testing loops

29 loops in this category.

Make all tests pass

/goalnew

Implement remaining code and run tests repeatedly until the full suite passes.

prompt
→ Claude
/goal finish the implementation and make all tests pass
testingmedium risk

Watch tests while you work

/loopnew

A passive watchdog loop that reruns your test suite every 15 minutes and surfaces failing tests with their error output.

prompt
→ Claude
/loop 15m run the test suite, and if anything fails, show me the failing tests and the error output
testinglow risk

Kill flaky tests

/loopnew

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 risk

Hit acceptance criteria

/goalnew

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 risk

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

/ralphnew

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 risk

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 risk

Nightly e2e run with morning report

/scheduleloopreponew

Run the full end-to-end suite every night at 2am and wake up to a digest of failures with screenshots, suspect commits, and a flakiness verdict per test.

prompt
→ Claude
/schedule every day at 2am, run the full e2e suite against the staging build; for each failure, attach the trace or screenshot, list the commits since the last green run, and say whether the failure looks flaky or real; post the digest to e2e-reports/ as a dated markdown file
testinghigh risk

Get auth tests green

/goalnew

Run auth tests and linter until all pass and the diff is clean.

prompt
→ Claude
/goal All tests in test/auth/ pass, lint is clean, and the diff touches only
testinglow risk

Get the failing tests green

/goalnew

Run failing tests, fix failures, and repeat until all tests pass.

prompt
→ Claude
/goal fix the failing tests and keep working until they pass
testinglow risk

API contract test backfill

/goalloopreponew

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 risk
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 →

Get auth tests and lint green

/goalnew

Run auth tests and lint checks until both pass, then stop and report success.

prompt
→ Claude
/goal all tests in test/auth pass and the lint step is clean
testinglow risk

Get tests green

/loopnew

Run tests, iterate code fixes until all pass, then stop.

prompt
→ Claude
/loop "Make tests pass" --completion-promise TESTS GREEN
testinglow risk

Get the test suite green

/goalnew

Run npm test repeatedly until all tests pass and the exit code is 0.

prompt
→ Claude
/goal all tests pass and npm test exits 0
testinglow risk

Reach a coverage target

/goalnew

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 risk

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 risk

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 risk

Make the test suite fast

Cut test runtime under repeatable conditions without weakening coverage, assertions, isolation, or behavior.

prompt
→ Claude
Optimize the test suite to run as quickly as possible without reducing coverage or changing behavior.
testingmedium risk

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 risk

Verification-gated self-running loop skill

/ralphnew

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 risk

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 risk
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 detect-fix-verify cycles

/loopnew

Run detect-fix-verify cycles up to 3 times until integration issues resolve.

prompt
→ Claude
/loop integration). Manages detect→fix→verify cycle with max 3 iterations
testingmedium risk

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 risk

Drive coverage to 100%

Find uncovered behavior, add tests that actually matter, and stop when the full suite passes at 100%.

prompt
→ Claude
Add tests until we have 100% test coverage.
testingmedium risk

Make tests pass, gate frozen

/goalnew

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 risk

Finish migration, keep tests green

/goalnew

Run tests after each migration step, fix failures immediately, stop when all tests pass and migration completes.

prompt
→ Claude
/goal Finish the migration and keep tests green # Set a goal
testinghigh risk

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 risk

Add the logs you're missing

Audit the important code paths, add useful structured logs, and prove success and failure events fire with tests.

prompt
→ Claude
Review the system's logging and add missing coverage until every important path produces useful, tested logs.
testingmedium risk

Implement spec until tests pass

/goalnew

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 risk

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 risk