Testing loops

Loops that run your test suite, fix what fails, and exit only when everything is green.

32 graded loops in this category.

Kill flaky tests

Loop/loop

Run your test suite repeatedly, collect every intermittent failure, and fix or quarantine flaky tests until you get five consecutive green runs.

prompt
→ Claude
/loop run my test suite 20 times, collect every intermittent failure, fix or quarantine the flaky ones, and don't stop until you get 5 consecutive fully-green runs
testinghigh riskclaude-codecursor

Stabilize flaky tests for good

Measure the flakiness, fix one root cause at a time, and stop after a defined streak of stable full-suite runs.

prompt
→ Claude
Run [test suite] [N] times under the same conditions and list tests whose result changes. Fix the most frequent flake at its root cause—shared state, timing, ordering, or an external dependency—never with a blind sleep or retry. Run that test [N] times, then rerun the full suite. Repeat until [N] consecutive full-suite runs pass, progress stalls, or approval is required. Return each flake, root cause, fix, evidence, and justified quarantine.
testingmedium riskclaude-codecodex

Build a todo CLI app with tests

Loop/ralphnew

Ralph autonomously builds a todo CLI application with comprehensive test coverage over multiple iterations until complete.

prompt
→ Claude
/ralph-loop "Build a todo CLI app with tests" --max-iterations 30
testinglow riskclaude-code

Ralph a test backlog

Iterate over a prioritized list of untested modules with fresh context each pass, writing real behavioral tests for one module at a time and banking lessons in a guardrails file.

prompt
→ Claude
/loop each iteration with fresh context: read .ralph/test-backlog.json and .ralph/guardrails.md, pick the top unfinished module, write behavioral tests for its public API (no snapshot-only tests), run the suite, and mark the module done only when its tests pass and coverage for it exceeds 80%; append any discovered testing gotcha (fixtures, mocking rules, async traps) to .ralph/guardrails.md; stop when the backlog is empty or after 25 turns
testinghigh riskclaude-codecodex

# AGENTS.md - Codex Ralph Vault Loop ##…

Loop/ralph

Community ralph loop for testing, sourced from github. Verified exit condition, evaluator-gated.

prompt
→ Claude
# AGENTS.md - Codex Ralph Vault Loop ## Mission codex-ralph-vault-loop is a Codex App/CLI native orchestration overlay for multi-agent engineering work. It keeps Codex main as the decision maker, uses external models only through MCP tools, verifies work through gates, and stores durable memory in the vault layer. ## Core Rules - Codex main decides. The primary Codex session owns final decisions, edits, synthesis, safety, and verification. - External models advise. Z.ai, MiniMax, and other non-OpenAI systems provide analysis or worker output only through MCP tools. - Gates verify. Tests, lint, security checks, scorecards, and migration checkpoints decide whether a phase can pass. - Vault remembers. Durable memory belongs in the approved Ralph/Codex memory paths, not in ad hoc repo files. - Do not bypass critical hooks. If prettier , gitleaks , semgrep , or pre-commit are missing from PATH , use the local machine binaries when present, install only with approval, or stop and report the blocker; do not use --no-verify to skip security or formatting gates unless the user explicitly orders that exact bypass. - Do not merge or close a PR until review feedback and automated Cap the run at 25 iterations; leave remaining work for the next session.
testinghigh riskcodex

Test all endpoints

Loop/goalnew

Run tests against every API endpoint until coverage is complete or you hit 30 iterations.

prompt
→ Claude
/goal all endpoints tested or stop after 30 turns
testingmedium riskclaude-code

Verification-gated self-running loop skill

Loop/ralph

A drop-in Claude Code skill that keeps looping until an external verifier passes — not the model's own self-report — making it a strong anti-reward-hacking pattern for autonomous coding.

prompt
→ Claude
Drop-in Claude Code skill: self-running agent loop with a "real, un-foolable verification gate" — loop continues until an external verifier (not the model's self-report) passes.
testingmedium riskclaude-code

Triage Dependabot PRs safely

Check the diff, release notes, exact-head CI, and tests before you repair, merge, or escalate a dependency update.

prompt
→ Claude
Review every Dependabot pull request currently open in [repository]. Take a fixed snapshot of that set and process each pull request once. Read its diff, release notes, advisories, dependency role, current base revision, and exact-head CI results. Run the repository’s relevant tests in an isolated worktree and classify the update by version change, breaking behavior, security exposure, and regression risk. For failing checks, identify the root cause and prepare the smallest verified repair. Process merges serially: before each merge, refetch the base and pull-request head and require passing exact-head checks. Merge only low-risk patch or minor updates when explicit merge authority has already been granted. Request approval for major, breaking, security-sensitive, uncertain, or externally visible actions. Never push changes, merge, comment, or send messages without the corresponding authority. Stop successfully when the original snapshot is fully processed; stop without changes when none are open; stop as blocked when verification is unavailable. Finish with reviewed, repaired, merged, deferred, and blocked pull requests plus supporting evidence.
testinghigh riskclaude-codecodex

Hit acceptance criteria

Loop/goal

Drive a feature to done against explicit acceptance criteria: a working paginated endpoint, passing tests, clean lint, and a hard turn cap.

prompt
→ Claude
/goal the /users endpoint returns 200 with a paginated JSON body, all tests pass, and lint is clean — stop after 20 turns
testingmedium riskclaude-codecodex

Work through TODO, turn tests green

Loop/loop

Implement each unchecked TODO item, run tests until they pass, then check it off; stop when the list is empty.

prompt
→ Claude
/loop implement the next unchecked item in TODO.md, run npm test until it passes, check it off; stop when the list is empty
testinglow riskclaude-code
Sponsored · ConnectMyEmail

Loops that read your inbox.

Email is the missing tool in your harness. ConnectMyEmail gives Claude Code and Codex a clean MCP into Gmail, Outlook, iCloud and IMAP — triage, drafts, follow-ups, on a loop.

connectmyemail.com →

Run all node tests; if any fail, fix…

Loop/loop

Community loop loop for testing, sourced from github. Verified exit condition, evaluator-gated.

prompt
→ Claude
/loop run all node tests; if any fail, fix and re-run | self-paced; stop when all green |
testingmedium riskclaude-code

Cursor "Iterate Until Tests Pass, Never Touch the Tests"

Loop/ralph

First-party Cursor guidance for the iterate-until-green loop, with the key anti-reward-hacking clause: the agent may never modify the tests it is trying to satisfy. Works in Cursor, Claude Code /goal, and Codex.

prompt
→ Claude
"Write code that makes these tests pass. Do NOT modify the tests. Keep iterating — run the suite, fix failures, run again — until all tests pass." (paraphrase of Cursor's official agent best-practices guidance)
testingmedium riskclaude-code

Complete PLAN.md until tests pass

Loop/goalnew

Work through every task in PLAN.md, pausing for credentials or destructive actions, until pnpm test and pnpm build both succeed.

prompt
→ Claude
/goal Implement every task in PLAN.md without stopping until pnpm test passes and pnpm build succeeds. Execution strategy: assess dependencies, shared context, write overlap, and independent verification before using subagents; keep final integration with the main agent. Surface each checkpoint with commands and exit codes. Pause for credentials, production data, or destructive actions
testinghigh riskclaude-code

API contract test backfill

Loop/goallooprepo

Generate a contract test for every documented endpoint in the OpenAPI spec so the spec and the implementation can never silently drift.

prompt
→ Claude
/goal every path in openapi.yaml has a contract test asserting its status codes and response schema — add tests for one untested endpoint per turn, run the suite, and fix either the spec or the handler when they disagree (tell me which you chose); stop when all paths are covered or after 15 turns
testingmedium riskclaude-codecodex

Fix interpreter matching test failures

Loop/loop

Run the test suite repeatedly, fixing InterpreterMatchingServiceTests failures until all pass.

prompt
→ Claude
/loop --max-turns 25 until tests pass: fix InterpreterMatchingServiceTests failures
testinglow riskclaude-code

Refactor in tested checkpoints

Reshape the architecture in small, independently reviewed steps — live-test, commit a checkpoint, and log progress each pass.

prompt
→ Claude
Refactor until you are happy with the architecture. After each significant step, live-test the system, run autoreview, and commit. Track progress in /tmp/refactor-{projectname}.md.
testingmedium riskclaude-codecodex

Build a REST API with tests

Loop/ralphnew

Run autonomous iterations to ship a complete REST API with full test coverage until completion is promised.

prompt
→ Claude
/ralph-loop "Build a REST API with tests" --max-iterations 30 --completion-promise "COMPLETE
testingmedium riskclaude-code

Backlog-clearing loop with a separate verifier

Loop/ralph

The four-settings loop template: a separate verifier model that never shares context with the writer, a hard stop rule, a state file re-read each cycle, and worktree isolation. Point it at a checkable backlog and let it run overnight.

prompt
→ Claude
GOAL: every test in [/tests/TARGET] passes, lint is clean, zero type errors. EACH CYCLE: 1. run the suite, read every failure 2. pick the single highest-impact failure 3. write the smallest change that fixes it 4. re-run tests + lint + type check VERIFY: a separate model instance checks the goal — never the writer. Verifier prompt: "You are a verifier. You did not write this code. GOAL: <the exact goal string>. Given the diff and the test output, answer ONLY: PASS — every condition in GOAL is objectively met, with evidence, or FAIL: <the specific condition not met, and the evidence>. Do not fix anything. If unsure, FAIL." STOP WHEN: verify passes, OR after 10 iterations, OR $5 spent, OR no progress in 2 attempts. ON BLOCKER: log it, skip to the next item, never halt the whole loop. STATE: append done / failed / next to a state file, re-read it at the top of every cycle. ISOLATION: one git worktree per subagent.
testinglow riskclaude-code

Make tests pass, gate frozen

Loop/goal

Run verify.sh repeatedly until it exits 0, all acceptance gates hold, and test quality gates are met, or report after 20 turns.

prompt
→ Claude
/goal ./scripts/verify.sh exits 0, .ai/spec-tdd/state.json phase is done, frozen tests and acceptance gates are unchanged, no tests are skipped/weakened, and no TODO/stub/hardcoded test-only implementation remains; or stop after 20 turns with a clear blocked report
testingmedium riskclaude-code

Node conformance/north-star.test.js

Loop/loop

Community loop loop for testing, sourced from github. Verified exit condition, evaluator-gated.

prompt
→ Claude
/loop 30m node conformance/north-star.test.js Cap the run at 15 passes.
testingmedium riskclaude-code
Sponsored · ConnectMyEmail

Loops that read your inbox.

Email is the missing tool in your harness. ConnectMyEmail gives Claude Code and Codex a clean MCP into Gmail, Outlook, iCloud and IMAP — triage, drafts, follow-ups, on a loop.

connectmyemail.com →

Reach a coverage target

Loop/goal

Add focused tests for the least-covered files and re-measure each turn until coverage hits 80 percent or the turn cap.

prompt
→ Claude
/goal test coverage is at least 80% with all tests passing — add focused tests for the least-covered files, re-run coverage each turn, stop at the threshold or after 12 turns
testingmedium riskclaude-codecodexcursor

Ground a feature before you build it

Anchor one small feature in the current code, APIs, data contracts, and tests before implementing and verifying the user path.

prompt
→ Claude
Implement one bounded feature slice in [repository]. Read project instructions, the current implementation, relevant services, types, UI, tests, and architecture notes before editing. Report the evidence, risks, affected files, persistence impact, and validation plan; stop for approval if inspection materially changes scope or reveals destructive, production, or silent-persistence behavior. Make the smallest change, preserve unknown data and unrelated work, run relevant checks, and manually verify user-facing states. Stop after this slice and return evidence, limitations, and the next recommended slice.
testinghigh riskclaude-codecodex

Run the test suite and report if anything…

Loop/loop

Community loop loop for testing, sourced from github. Verified exit condition, evaluator-gated.

prompt
→ Claude
/loop 30s run the test suite and report if anything is failing Cap the run at 15 passes.
testingmedium riskclaude-code

Trim what loads before first paint

Reduce the data downloaded before the first screen appears, with tests and screenshots guarding behavior and appearance.

prompt
→ Claude
Reduce the data [web app] downloads before its first screen appears. First record passing tests, mobile and desktop screenshots, and compressed transferred bytes—the data actually downloaded. Use the build report only to suggest candidates. Defer, compress, or remove one item, then rebuild and rerun every check. Keep it only if tests pass, screenshots are pixel-identical, and bytes decrease; otherwise revert. Stop when no safe candidate remains, progress stalls, or approval is needed. Return measurements, changes, and untested states.
testingmedium riskclaude-codecodex

Ship the release

Loop/goal

Run tests and update changelog until both pass without altering the public API.

prompt
→ Claude
/goal ship the release --success "tests pass and changelog updated" --constraints "do not touch the public API" --mode ordered
testingmedium riskclaude-code

Get tests green, docs clear

Loop/goal

Run tests and polish the README until npm test passes and documentation is complete.

prompt
→ Claude
/goal improve this repository until npm test passes and the README is clear
testinglow riskclaude-code

Fix critical issues from code review

Loop/ralph

Work through a prioritized backlog of 9 critical test and configuration fixes, stopping when all issues are resolved.

prompt
→ Claude
# Ralph Wiggum Loop: Fix Critical Issues from Issue #69 ## Task Address all 9 critical issues identified in the consensus code review for issue #15 improvements (see issue #69). ## Critical Fixes Required ### 1. Fix Payload Size Calculations File : internal/vectorstore/qdrant large payload test.go Create helper function for exact payload sizes: go func generateTestContent(targetBytes int) string { const baseText = "x" return strings.Repeat(baseText, targetBytes) } Update all large payload tests to use exact sizes (500KB, 5MB, 25MB). --- ### 2. Fix Test Race Conditions Files : internal/vectorstore/qdrant test.go , qdrant large payload test.go Replace all hardcoded collection names with unique names: go collectionName := fmt.Sprintf("test lifecycle %d", time.Now().UnixNano()) --- ### 3. Add API Key Configuration File : examples/qdrant-config/prod.yaml Add API key configuration: yaml qdrant: api key: ${QDRANT API KEY:} # Required for Qdrant Cloud Add troubleshooting entry to examples/qdrant-config/README.md for Unauthenticated errors. --- ### 4. Fix Documentation Line Counts Files : docs/QDRANT IMPLEMENTATION.md , d
testingmedium riskclaude-code

Builder vs. reviewer, proving each test

A builder and an adversarial reviewer pass a git baton between worktrees, proving every new test can catch its fix.

prompt
→ Claude
Use autonomy-loop for [repository task] after the test, build, and lint gates pass. Run /autonomy-loop:autonomy-init, then start builder and reviewer in separate worktrees. The builder reads LOOP-STATE.md, makes one bounded change, and adds a red-before, green-after test. The reviewer reruns the gates and proves the test by reverting or mutating the fix. Accept only on both passes; park protected or repeated-failure work for a human. Finish with the commit, gate evidence, test proof, trust tier, and risks.
testingmedium riskclaude-codecodex

Refactor without touching architecture

Improve a targeted area via dependency mapping, atomic refactors, and regression checks — no changes to architecture or public contracts.

prompt
→ Claude
Refactor [target] toward [measurable goal] in [repository]. If the target or goal is missing, ask and stop. Record current behavior and affected dependencies; select representative tests for boundaries and failure modes, then make one atomic change without altering public contracts unless authorized. Run the same tests, type and lint checks, and affected-consumer checks, keeping only regression-free improvements. Repeat for at most five rounds. Stop on success, blocked architecture, approval required, exhaustion, or no progress. Preserve unrelated work and finish with the diff, impact map, evidence, rejected attempts, and remaining debt.
testingmedium riskclaude-codecodex

Implement spec.md with TDD

Loop/ralph

Implement spec.md with test-driven development, loop until all tests pass and output COMPLETE.

prompt
→ Claude
/ralph-loop "Implement spec.md. TDD. Output <promise>COMPLETE</promise> when all tests pass." --max-iterations 30
testingmedium riskclaude-code
Sponsored · ConnectMyEmail

Loops that read your inbox.

Email is the missing tool in your harness. ConnectMyEmail gives Claude Code and Codex a clean MCP into Gmail, Outlook, iCloud and IMAP — triage, drafts, follow-ups, on a loop.

connectmyemail.com →

Every task in PLAN.md is marked [x], npm…

Loop/goal

Community goal loop for testing, sourced from github. Verified exit condition, evaluator-gated.

prompt
→ Claude
/goal every task in PLAN.md is marked [x], npm test exits 0 with output shown Cap the run at 20 turns.
testingmedium riskclaude-code

Implement spec until tests pass

Loop/goal

Build the feature from docs/spec.md and iterate until your test suite passes completely.

prompt
→ Claude
/goal Implement the feature described in docs/spec.md and keep going until tests pass
testingmedium riskclaude-code