Autoloop TDD
Test-first loop: write a failing test, implement the minimum code to pass, refactor, and repeat.
起動プロンプト
Start the "Autoloop TDD" loop.
Goal: implement the target behavior test-first with a green suite
Max iterations: 12
Between iterations run: npm test
Exit when: target behavior is covered and all tests pass
Step 1: Write a failing test for the next behavior, implement the minimum code to pass, refactor, and repeat.
Self-pace this loop. After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when the exit condition passes or max iterations is reached. Give a short status update each pass.基本情報
カテゴリ
テスト
目標
implement the target behavior test-first with a green suite
最大反復回数
12
検査コマンド
npm test
退出条件
target behavior is covered and all tests pass
対応エージェント
Claude Code
手順
- 1
Write failing test
Write a focused test for the next behavior. Run it and confirm it fails for the right reason.
npm test -- --testPathPattern=<new-test> - 2
Implement minimum code
Write the smallest implementation that makes the new test pass. No extra features.
- 3
Verify green
Run the new test and full suite to confirm everything passes.
npm test - 4
Refactor
Clean up duplication and naming while keeping tests green. Run tests after each refactor.
npm test
他のテストのループ
Build Until Green
Run the production build, fix compile and bundling errors, and loop until the build succeeds.
Coverage Until Threshold
Add focused tests until coverage meets your threshold (e.g. 80%), without changing production behavior unnecessarily.
Pre-Commit Guard
Hook that runs tests before git commit commands to block commits when the suite is red.
Post-Edit Test Guard
Hook-based loop that runs related tests after file edits to catch regressions early.
Format Until Clean
Run the formatter, fix any remaining style issues, and loop until the codebase formats cleanly with no diffs.
Flaky Test Triage
Run failing tests repeatedly, classify each failure as flaky or real, and fix only confirmed regressions.