Loop/goalTestingmedium riskadvancedsafety C · 55Forward Futurepre-dates current gate · under review

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.
claude-code · codex

Use this when

Use this for a deliberate architectural refactor where the destination can be stated in concrete terms and the current system can be tested after each meaningful change.

How it runs

  1. Write down the architectural target, constraints, and current risks before editing code.
  2. Make one significant, reviewable change at a time.
  3. Live-test the affected behavior and run an independent review after each significant step.
  4. Commit each verified checkpoint and update the temporary progress file with decisions, blockers, and the next action.

Done when

The architecture is satisfactory and checks pass. Live-test, autoreview, and commit each significant step.

Why it works

Small verified checkpoints reduce refactor risk and preserve rollback points. The progress file keeps the goal and decisions available across long sessions or handoffs.

Implementation note

Define what satisfactory means before starting, such as module boundaries, dependency direction, passing tests, and acceptable performance. A subjective stop condition can otherwise run indefinitely.

Source: Forward Future

More testing loops

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

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