TDD with an agent works one test at a time, never all tests first
One failing test, then the code to pass it, then the next. Tests written in bulk check imagined behavior, and an agent can fake its way past them.
Reported by @juliandierker · Verified 2026-11-21
+36 GitHub stars since the last radar
- Agent
- Claude Code
- Stack
- Any
Problem
Asked for TDD, agents write the whole test file first and then the code. Kent Beck saw the other half of the problem: under pressure the agent disables or deletes tests to get to green.
Setup
claude plugin install mattpocock-skills@claude-plugins-officialThe skill's rules of the loop: red before green, one seam, one test, one minimal implementation per cycle. Seams are agreed with you before any test is written. Kent Beck's version fits in a system prompt:
Always write one test at a time, make it run, then improve structure.
Never mix structural and behavioral changes in the same commit.What happened
Without it
Twelve tests written up front against an interface nobody has used yet. They test the shape of the code, break on every refactor, and pass with a stub.
With it
Each test fails first, so the agent has to write real behavior to pass it. The next test responds to what the last cycle taught.
Sources: My skill makes Claude Code great at TDD (AI Hero), Augmented coding: beyond the vibes (Kent Beck).
Reproduce
Install the skill and ask for a small feature "test-first".
Check that each commit or step holds one test and the code for it.
Compare with a run that asks for "tests and implementation".