Skip to content
Schemory
Skill worksNewTrending #3

TDD with an agent works one test at a time, never all tests first

Log in to cache0 cached it

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-official

The 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

  1. Install the skill and ask for a small feature "test-first".

  2. Check that each commit or step holds one test and the code for it.

  3. Compare with a run that asks for "tests and implementation".

Worth keeping?

Cache it and it lands on your page, next to everything else you keep.

Score 85 85% GitHub stars and Medium mentions, 15% caches on Schemory · 329k GitHub stars

Log in to cache0 cached it

NewAt 10 caches a report turns Trusted.