The tdd skill is a reference for the red-green loop. It defines what a good test is, where tests go, which anti-patterns to avoid and the rules each cycle follows. It fires when you want to build features or fix bugs test-first, mention red-green-refactor, or ask for integration tests.
It links to companion files on writing tests and on mocking.
What You Get
- A shared definition of a good test that reads like a specification
- A confirmed list of seams to test, each with a note on what it catches and misses
- Named anti-patterns to watch for
- A loop with clear rules: red before green, one slice at a time
Common Use Cases
- Build a new feature test-first with an agent
- Fix a bug by writing a failing test that reproduces it
- Add integration tests at the public interface of a module
What Makes It Unique
It asks for agreement on test seams before the first test, which focuses effort on critical paths and complex logic. It names tautological tests, where the assertion recomputes the code’s own answer, next to implementation-coupled tests and horizontal slicing, and it keeps refactoring out of the loop and in the review stage.
Under The Hood
A SKILL.md with two linked reference files, tests.md and mocking.md. It reads GLOSSARY.md and ADRs when they exist so test names use the project’s vocabulary, and it can call the codebase-design skill when the shape of an interface is in question. It runs no scripts of its own.