PromptTop pickTesting and qualityClaude Code, Codex, Cursor and other coding agents

Test-first red-green loop

Writes failing tests first, then implements without touching the tests until they pass.

How each pass goes
  1. Write tests for the behaviour; confirm they fail.
  2. Implement the smallest change.
  3. Run tests; repeat without editing them.
Stops when
All the new tests pass and none were weakened.
Starter prompt
Write tests for this behaviour first and show that they fail. Then implement in small steps, running the tests after each, without editing the tests. Stop when they all pass; refactor only while they stay green.
Paste into Claude Code, Codex or Cursor. To keep it running unattended, wrap it in /goal or the Ralph loop.