TDD#
Red-green test-driven development loop at pre-agreed seams.
Description#
The tdd skill is the reference that makes the red → green loop produce tests worth keeping. It defines what a good test is (behaviour through public interfaces, one logical assertion, survives refactors), where tests go (only at seams pre-agreed with the user — in the slice loop, agreed in the spec), when to mock (system boundaries only: external APIs, time, randomness — never your own modules), and the anti-patterns to refuse: implementation-coupled tests, tautological assertions that recompute the expected value the way the code does, and horizontal slicing (all tests first, then all implementation).
Rules of the loop: red before green; one seam, one test, one minimal
implementation per cycle; refactoring belongs to review
(slice-review), not the loop.
Triggers#
/wf:tdd
Also: “red-green-refactor”, “test first”.
Output#
Failing tests written from acceptance criteria, then the minimal implementation that passes them.
Attribution#
Adapted from the tdd skill in
mattpocock/skills (MIT
license), with its tests.md and mocking.md references inlined.