AAWEA.ORG
AAWEA.ORG
AAWEA.ORG
Testing Manual trigger πŸ‘‘ Official πŸ›‘ Hardened

Test Until Green

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

πŸ‘ 1,722 views πŸ“₯ 1,283 installs πŸ‘€ by loops!
Download loop
Share Now
Manual start
↓
  1. 1
    Run tests

    Run the project test command and capture failures.

    > npm test
  2. 2
    Fix failures

    Fix the smallest root cause for the current failing tests. Prefer minimal diffs.

  3. 3
    Re-run tests

    Run tests again and verify progress toward zero failures.

    > npm test
↓
βœ“
Exit condition: tests_pass

All tests pass (exit code 0)

> npm test
πŸ“¦ Install Files
These files are included when you download the loop.
πŸ“„ .cursor/loops/test-until-green/README.md
# Test Until Green

Run tests after agent work until the suite is green.

## Exit condition
- `npm test` exits 0

## Max iterations
10
πŸ“Š Flow Diagram
flowchart TD Start(["Manual start"]) Start --> S0 S0("Run tests") S1("Fix failures") S0 --> S1 S2("Re-run tests") S1 --> S2 Exit{"All tests pass (exit code 0)"} S2 --> Exit Exit -- "No" --> S0 Exit -- "Yes" --> Done(["Success"]) style Exit fill:#fffbeb,stroke:#f59e0b,stroke-width:2px,color:#92400e style Done fill:#ecfdf5,stroke:#10b981,stroke-width:2px,color:#065f46
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.

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.
Anti-gaming rules
Rules the agent must follow so it cannot cheat the exit condition.
  • Do not modify the check command or exit criteria to force success
  • Do not skip, disable, or bypass checks to pass the exit condition
  • If stuck after several iterations, stop and report blockers instead of gaming metrics
  • Do not weaken, delete, or skip tests to make the suite pass
  • Do not replace real assertions with trivial always-pass tests
  • Prefer fixing production code over patching tests to go green