Loop Tester
Treat testing as a resumable campaign, not a finite checklist. Repeatedly choose the
highest-information risk, perform real operations, verify outcomes through independent
observations, preserve evidence, checkpoint state, and continue until a valid stop condition
occurs.
Honor the continuation contract
- Continue after a batch or round completes. Immediately select and execute the next useful batch.
- Do not stop because all planned cases ran, no new defect appeared, coverage reads 100%, or one
path is blocked.
- Increase depth between rounds by changing inputs, ordering, roles, state, scale, environment,
concurrency, or module combinations. Repeat an identical case only for reproduction,
regression, stability, or change verification.
- Use the host's persistent goal, continuation, wakeup, or monitoring mechanism when one is
available and the user's request authorizes long-running execution. Keep the goal active while
safe work remains.
- Never simulate persistence with an uncontrolled shell loop, and never claim to be running in
the background when the host cannot continue execution. Before any unavoidable execution
boundary, write a complete checkpoint that allows the next invocation to resume exactly.
- Keep one bounded batch in progress at a time. A batch should produce observable evidence and a
checkpoint before more work is queued.
Establish scope and safety
- Read repository instructions, the current worktree state, start commands, existing tests,
configuration, known issues, and recent changes.
- Resolve the target, authorization boundary, environment type, accounts or roles, permitted test
data, external dependencies, and destructive-action limits from available context.
- Default to a local, development, staging, or disposable environment. Obtain explicit authority
before touching production, real user data, paid services, destructive flows, load generation,
fault injection, or third-party systems.
- Preserve unrelated user changes. Test and record by default; do not modify product code unless
the user separately asks for a fix.
- Prefer isolated test accounts, temporary data, dedicated worktrees, and reversible operations.
Define cleanup before executing a case with side effects.
Do not abandon the whole campaign when one prerequisite is unknown. Record the narrow blockage and
continue any safe, independent work. Ask the user only when the missing decision would materially
change scope, authorization, or risk.
Initialize or resume the campaign
Determine this skill's directory, then run:
python3 <skill-dir>/scripts/init_testing_loop.py <project-root>
python3 <skill-dir>/scripts/validate_testing_loop.py <project-root>
The initializer only creates missing state and never overwrites history. Read
state-contract.md before repairing state or writing the first
checkpoint.
Use .testing-loop/CURRENT_STATE.md as the authoritative recovery pointer. On every invocation:
- Read
CURRENT_STATE.md, PROGRESS.md, REGRESSION_QUEUE.md, and BLOCKED_ITEMS.md.
- Read the relevant portions of
TEST_PLAN.md, COVERAGE.md, FINDINGS.md, and recent
TEST_HISTORY.md entries.
- Compare the recorded code version and environment with the current ones. Treat changes as new
regression signals.
- Resume the recorded next action unless new evidence makes a different action higher priority.
- Build or update the test map: start paths, routes, modules, roles, forms, APIs, persistence,
integrations, complex interactions, and observability surfaces.
- Start only the services needed for the current batch. Record commands, ports, process ownership,
accounts, version, and environment differences.
If UI automation is unavailable, continue with safe API, CLI, log, or static test-map work and
record UI-only cases as blocked. Do not mark them covered.
Execute the closed loop
Repeat this sequence without waiting for another user prompt:
- Read state — inspect recent history, code changes, low-confidence coverage, due regressions,
open findings, recovered blockages, and the last confirmed state.
- Select risk — choose the candidate expected to add the most information. Use the scoring and
novelty rules in test-catalog.md when the next target is not
obvious.
- Design a batch — define preconditions, role, data, steps, observations, oracle, cleanup,
resource budget, and the condition for ending this case.
- Perform real operations — interact through the same UI, API, CLI, or service boundary a user
would use. Avoid replacing manual interaction with source inspection alone.
- Observe broadly — capture visible behavior, requests and responses, console output, service
logs, persisted state, timing, and resource behavior as applicable.
- Verify independently — do not trust a toast or status code alone. Cross-check at least one
independent surface, such as refresh, list versus detail, API versus UI, database versus API,
relogin, or a second role.
- Triage anomalies immediately — distinguish product defects from environment, fixture,
automation, and expectation failures. Follow
evidence-and-triage.md.
- Persist results — save evidence first, update or create the finding, then update the index,
coverage, history, queues, progress, and finally
CURRENT_STATE.md.
- Clean up — remove only disposable data and stop only resources started by this campaign that
are no longer needed. Preserve the state required for reproduction.
- Generate and start the next batch — use the new evidence to reprioritize; do not merely
rerun the previous steps.
Rotate through progressive strategies
Start with broad baseline coverage, then deepen through input boundaries, abnormal recovery,
cross-module and concurrency combinations, authorization and isolation, stability and resource
behavior, and finding-directed exploration. From the eighth round onward, choose dynamically from
coverage gaps, recent changes, defect clusters, long-unchecked regressions, recovered blockages,
complex areas, and missing evidence.
Treat these as strategy families rather than a rigid eight-round script. When a critical flow is
untested or a fresh change lands, return to the relevant earlier strategy with new state and
evidence. Read test-catalog.md before generating a new strategy or
when two consecutive batches add no new information.
Record findings and evidence
Create one file per independent issue under
.testing-loop/findings/FINDING-NNNN.md. To allocate an ID and scaffold the record safely, run:
python3 <skill-dir>/scripts/create_finding.py <project-root> \
--title "<title>" --module "<module>" --severity "<severity>" --kind "<type>"
Record observed facts immediately; add missing detail later. Label hypotheses as hypotheses and
never invent unavailable fields.
Reproduce with the smallest reliable sequence, record frequency and impact, and test adjacent
paths that may share the cause.
Link every screenshot, request trace, log excerpt, data snapshot, and recording to a case or
finding ID. Redact tokens, cookies, credentials, personal data, and unrelated customer content.
Preserve closed findings and prior regression results. Change their lifecycle state; do not
erase history.
A visual success message is not proof of persistence, and a client failure is not proof that the
server performed no side effect.
Handle blockage and recovery
For a localized blockage:
- Save the last confirmed state and the attempted action.
- Gather enough evidence to classify the blockage.
- Try a small number of reversible recovery actions, such as one retry, restarting a service
started by this campaign, recreating disposable data, or switching entry points.
- Record the blockage, attempts, unlock condition, owner if known, and next review time in
BLOCKED_ITEMS.md.
- Move to another testable risk and revisit the item when its condition changes or its review is
due.
After a crash, service exit, or browser disconnect, checkpoint evidence before restarting. Resume
from the last verified state and avoid replaying a possibly committed operation until its
side-effect status is known.
If the same campaign-wide blocking condition persists and no safe work remains, follow the host's
exact persistent-goal blocking contract. When that contract counts goal turns, require three
consecutive goal turns with the same blocker; multiple checks or batches inside one turn do not
satisfy it. Without a host-defined threshold, require three separate resume attempts before
writing a final blocked checkpoint. Do not use this condition for ordinary local failures.
Communicate and checkpoint
During active work, send a concise progress update at least every 60 seconds: current module,
risk under test, latest evidence or finding, and next action.
When asked for status, report verifiable counts and artifacts first, then continue unless the
user asks to pause or stop.
Update CURRENT_STATE.md after every batch, module switch, crash, environment change, and
execution boundary.
End each round by recording scope, new coverage, findings, reproduction state, weak areas, and
the next-round plan; then begin that plan.
Run the validator after initialization, state repair, and major checkpoints:
python3 <skill-dir>/scripts/validate_testing_loop.py <project-root>
Repair validation errors without deleting history.
Stop and hand off
Stop only when:
- the user explicitly asks to stop, pause, exit, or terminate;
- the host externally terminates execution; or
- all available environments remain unrecoverable after the campaign-wide blocked audit.
Before stopping, update all state files, validate them, close resources started by the campaign,
and hand off the current conclusion, open findings, unfinished batch, blocked work, exact resume
action, and environment restoration steps.
1---2name: loop-tester3description: Run a persistent, multi-round, resumable, evidence-driven manual and exploratory testing campaign across user interfaces, APIs, CLIs, and services. Use only when the user explicitly asks for an indefinite or repeatedly continuing autonomous campaign, such as loop testing, long-running QA, "keep testing until I stop you", "持续测试", "无限循环测试", "长期自主测试", or resumption of an existing `.testing-loop` campaign. Do not use for a single bounded test pass, ordinary regression run, one-off debugging, CI test watching, or a finite checklist.4---56# Loop Tester78Treat testing as a resumable campaign, not a finite checklist. Repeatedly choose the9highest-information risk, perform real operations, verify outcomes through independent10observations, preserve evidence, checkpoint state, and continue until a valid stop condition11occurs.1213## Honor the continuation contract1415- Continue after a batch or round completes. Immediately select and execute the next useful batch.16- Do not stop because all planned cases ran, no new defect appeared, coverage reads 100%, or one17 path is blocked.18- Increase depth between rounds by changing inputs, ordering, roles, state, scale, environment,19 concurrency, or module combinations. Repeat an identical case only for reproduction,20 regression, stability, or change verification.21- Use the host's persistent goal, continuation, wakeup, or monitoring mechanism when one is22 available and the user's request authorizes long-running execution. Keep the goal active while23 safe work remains.24- Never simulate persistence with an uncontrolled shell loop, and never claim to be running in25 the background when the host cannot continue execution. Before any unavoidable execution26 boundary, write a complete checkpoint that allows the next invocation to resume exactly.27- Keep one bounded batch in progress at a time. A batch should produce observable evidence and a28 checkpoint before more work is queued.2930## Establish scope and safety31321. Read repository instructions, the current worktree state, start commands, existing tests,33 configuration, known issues, and recent changes.342. Resolve the target, authorization boundary, environment type, accounts or roles, permitted test35 data, external dependencies, and destructive-action limits from available context.363. Default to a local, development, staging, or disposable environment. Obtain explicit authority37 before touching production, real user data, paid services, destructive flows, load generation,38 fault injection, or third-party systems.394. Preserve unrelated user changes. Test and record by default; do not modify product code unless40 the user separately asks for a fix.415. Prefer isolated test accounts, temporary data, dedicated worktrees, and reversible operations.42 Define cleanup before executing a case with side effects.4344Do not abandon the whole campaign when one prerequisite is unknown. Record the narrow blockage and45continue any safe, independent work. Ask the user only when the missing decision would materially46change scope, authorization, or risk.4748## Initialize or resume the campaign4950Determine this skill's directory, then run:5152```bash53python3 <skill-dir>/scripts/init_testing_loop.py <project-root>54python3 <skill-dir>/scripts/validate_testing_loop.py <project-root>55```5657The initializer only creates missing state and never overwrites history. Read58[state-contract.md](references/state-contract.md) before repairing state or writing the first59checkpoint.6061Use `.testing-loop/CURRENT_STATE.md` as the authoritative recovery pointer. On every invocation:62631. Read `CURRENT_STATE.md`, `PROGRESS.md`, `REGRESSION_QUEUE.md`, and `BLOCKED_ITEMS.md`.642. Read the relevant portions of `TEST_PLAN.md`, `COVERAGE.md`, `FINDINGS.md`, and recent65 `TEST_HISTORY.md` entries.663. Compare the recorded code version and environment with the current ones. Treat changes as new67 regression signals.684. Resume the recorded next action unless new evidence makes a different action higher priority.695. Build or update the test map: start paths, routes, modules, roles, forms, APIs, persistence,70 integrations, complex interactions, and observability surfaces.716. Start only the services needed for the current batch. Record commands, ports, process ownership,72 accounts, version, and environment differences.7374If UI automation is unavailable, continue with safe API, CLI, log, or static test-map work and75record UI-only cases as blocked. Do not mark them covered.7677## Execute the closed loop7879Repeat this sequence without waiting for another user prompt:80811. **Read state** — inspect recent history, code changes, low-confidence coverage, due regressions,82 open findings, recovered blockages, and the last confirmed state.832. **Select risk** — choose the candidate expected to add the most information. Use the scoring and84 novelty rules in [test-catalog.md](references/test-catalog.md) when the next target is not85 obvious.863. **Design a batch** — define preconditions, role, data, steps, observations, oracle, cleanup,87 resource budget, and the condition for ending this case.884. **Perform real operations** — interact through the same UI, API, CLI, or service boundary a user89 would use. Avoid replacing manual interaction with source inspection alone.905. **Observe broadly** — capture visible behavior, requests and responses, console output, service91 logs, persisted state, timing, and resource behavior as applicable.926. **Verify independently** — do not trust a toast or status code alone. Cross-check at least one93 independent surface, such as refresh, list versus detail, API versus UI, database versus API,94 relogin, or a second role.957. **Triage anomalies immediately** — distinguish product defects from environment, fixture,96 automation, and expectation failures. Follow97 [evidence-and-triage.md](references/evidence-and-triage.md).988. **Persist results** — save evidence first, update or create the finding, then update the index,99 coverage, history, queues, progress, and finally `CURRENT_STATE.md`.1009. **Clean up** — remove only disposable data and stop only resources started by this campaign that101 are no longer needed. Preserve the state required for reproduction.10210. **Generate and start the next batch** — use the new evidence to reprioritize; do not merely103 rerun the previous steps.104105## Rotate through progressive strategies106107Start with broad baseline coverage, then deepen through input boundaries, abnormal recovery,108cross-module and concurrency combinations, authorization and isolation, stability and resource109behavior, and finding-directed exploration. From the eighth round onward, choose dynamically from110coverage gaps, recent changes, defect clusters, long-unchecked regressions, recovered blockages,111complex areas, and missing evidence.112113Treat these as strategy families rather than a rigid eight-round script. When a critical flow is114untested or a fresh change lands, return to the relevant earlier strategy with new state and115evidence. Read [test-catalog.md](references/test-catalog.md) before generating a new strategy or116when two consecutive batches add no new information.117118## Record findings and evidence119120- Create one file per independent issue under121 `.testing-loop/findings/FINDING-NNNN.md`. To allocate an ID and scaffold the record safely, run:122123 ```bash124 python3 <skill-dir>/scripts/create_finding.py <project-root> \125 --title "<title>" --module "<module>" --severity "<severity>" --kind "<type>"126 ```127128- Record observed facts immediately; add missing detail later. Label hypotheses as hypotheses and129 never invent unavailable fields.130- Reproduce with the smallest reliable sequence, record frequency and impact, and test adjacent131 paths that may share the cause.132- Link every screenshot, request trace, log excerpt, data snapshot, and recording to a case or133 finding ID. Redact tokens, cookies, credentials, personal data, and unrelated customer content.134- Preserve closed findings and prior regression results. Change their lifecycle state; do not135 erase history.136- A visual success message is not proof of persistence, and a client failure is not proof that the137 server performed no side effect.138139## Handle blockage and recovery140141For a localized blockage:1421431. Save the last confirmed state and the attempted action.1442. Gather enough evidence to classify the blockage.1453. Try a small number of reversible recovery actions, such as one retry, restarting a service146 started by this campaign, recreating disposable data, or switching entry points.1474. Record the blockage, attempts, unlock condition, owner if known, and next review time in148 `BLOCKED_ITEMS.md`.1495. Move to another testable risk and revisit the item when its condition changes or its review is150 due.151152After a crash, service exit, or browser disconnect, checkpoint evidence before restarting. Resume153from the last verified state and avoid replaying a possibly committed operation until its154side-effect status is known.155156If the same campaign-wide blocking condition persists and no safe work remains, follow the host's157exact persistent-goal blocking contract. When that contract counts goal turns, require three158consecutive goal turns with the same blocker; multiple checks or batches inside one turn do not159satisfy it. Without a host-defined threshold, require three separate resume attempts before160writing a final blocked checkpoint. Do not use this condition for ordinary local failures.161162## Communicate and checkpoint163164- During active work, send a concise progress update at least every 60 seconds: current module,165 risk under test, latest evidence or finding, and next action.166- When asked for status, report verifiable counts and artifacts first, then continue unless the167 user asks to pause or stop.168- Update `CURRENT_STATE.md` after every batch, module switch, crash, environment change, and169 execution boundary.170- End each round by recording scope, new coverage, findings, reproduction state, weak areas, and171 the next-round plan; then begin that plan.172- Run the validator after initialization, state repair, and major checkpoints:173174 ```bash175 python3 <skill-dir>/scripts/validate_testing_loop.py <project-root>176 ```177178Repair validation errors without deleting history.179180## Stop and hand off181182Stop only when:183184- the user explicitly asks to stop, pause, exit, or terminate;185- the host externally terminates execution; or186- all available environments remain unrecoverable after the campaign-wide blocked audit.187188Before stopping, update all state files, validate them, close resources started by the campaign,189and hand off the current conclusion, open findings, unfinished batch, blocked work, exact resume190action, and environment restoration steps.