[01] LOOP
TestingmanualHardened

Test Until Green

Run your test suite, fix the smallest root cause on failure, and repeat until every test passes.

by Trooper

Kickoff prompt
Start the "Test Until Green" loop.

Goal: all tests pass
Max iterations: 10
Between iterations run: npm test
Exit when: tests exit 0

Step 1: Run tests. If there are failures, fix the smallest root cause, then repeat.

## Before you start

Connect plugins:
- GitHub (required) — Read branches, PRs, reviews, checks, workflow runs, and source diffs.

Attach skills:
- Loop runner (required) — Self-pace iterations, run the check between passes, and stop only on the exit condition.
- Code change + local verification (optional) — Edit code safely, run commands, and keep changes scoped.
- CI debugging (optional) — Read failing checks, logs, and the smallest actionable root cause.
- Test repair (optional) — Run tests, triage failures, and avoid weakening the suite.

Self-pace this loop. After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when the exit condition passes or max iterations is reached. Give a short status update each pass.

Paste the kickoff prompt into Cursor, Claude Code, or Codex. Deeplinks do not install hook files.

Steps

1. Run tests

Execute the full or scoped test suite.

2. Triage failures

Pick the smallest root cause from the failure output.

3. Fix and re-run

Patch, then run tests again.

Flow diagram

Guardrails

Rules the agent must follow so it cannot cheat the exit condition.

  • Do not weaken or delete tests to force green
  • Fix the smallest root cause per iteration

More Testing loops