Test Until Green
Coding
by loops! by elorm
Run your test suite, fix the smallest root cause on failure, and repeat until every test passes.
Prompt
Step 1 — Run tests Run the project test command and capture failures. Check: `npm test` Step 2 — Fix failures Fix the smallest root cause for the current failing tests. Prefer minimal diffs. Step 3 — Re-run tests Run tests again and verify progress toward zero failures. Check: `npm test` Step 4 — Repeat until done Repeat the steps above until: All tests pass (exit code 0) Check with: `npm test` Stop after 10 iterations and report what is blocking. Guardrails: - 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
Platforms
CLAUDE
CLAUDE
Use this prompt in AIniverse
Tap to copy, run it on ChatGPT / Claude / Gemini, save to your stack, or remix.
Open in AppMore Coding prompts
Independent Verifier Pass
When implementation claims done, a separate verifier pass runs build, lint, and tests with no access to the implement...
API Contract Until Match
Loop until API responses match the OpenAPI or JSON Schema contract — catch drift between docs and implementation.
De-Sloppify Pass
After implementation, run a cleanup pass: remove debug code, tighten naming, delete dead branches, and align with pro...
Merge Conflict Resolver
Rebase or merge target branch, resolve conflicts file by file, and loop until the branch is current and tests pass.