| name | tdd |
| description | Red→green→refactor discipline for new behavior — forces a failing test before implementation and a passing test before any claim of done. |
/tdd
Red→green→refactor for new behavior. This skill exists to fix one specific, observable agent failure mode: writing a lot of code, visually checking it, and claiming success without running the tests. Capturing a failing test before the implementation, then the same test passing after, makes that failure mode impossible to sustain.
Usage
/tdd <description of the new behavior>
When to Use
Invoke when the work adds new observable behavior with a testable contract:
- New function, method, or class with defined inputs and outputs
- New API endpoint, route, or handler
- New validation rule, business rule, or state transition
- New branch in existing logic (new condition, new error path)
- Bug fix where you can write a test that reproduces the bug
When NOT to Use
TDD hurts when no meaningful test can be written first. Skip it — with a documented reason — for:
- Exploratory spikes where the interface is undecided. Timebox the spike, then either discard or TDD the decided shape.
- UI/visual work where the verification is "does it look right." Use screenshot diffs or manual review instead.
- Brownfield refactors of untested code. Use
/refactor — it writes characterization tests first, then refactors.
- Pure scaffolding: new package, config file, dependency install.
- External integrations without stubs. If you can't mock or record the dependency, defer until you can.
For any of these, state explicitly: "Deferring TDD because . Will verify by ." Do not silently skip.