tddlisted
Install: claude install-skill DROOdotFOO/agent-skills
# TDD Skill
## What You Get
- Failing test (RED) -> minimal implementation (GREEN) -> refactored code, committed at each green step
- Full test suite passing with no mocks of internal modules
## Philosophy
Tests verify **behavior through public interfaces**, not implementation details. Never test private methods directly. Never mock your own modules.
Use **vertical slices**, not horizontal slices. Write one test, make it pass, repeat. Do not write all tests first then implement -- that is waterfall disguised as TDD.
## Workflow: 4 Phases
### Phase 1: Planning
Before writing any code, confirm:
- What is the public interface (function signatures, module API)?
- What behaviors does the caller expect?
- What are the edge cases and error conditions?
Do NOT write code yet. Agree on the interface first.
### Phase 2: Tracer Bullet
Write exactly ONE test for the simplest happy-path behavior. Run it. Watch it fail (RED). Implement the minimum code to make it pass (GREEN). This proves the test infrastructure works end-to-end.
### Phase 3: Incremental Loop
For each remaining behavior:
1. Write ONE failing test (RED)
2. Implement minimum code to pass (GREEN)
3. If the code is messy, refactor NOW while green
4. Run the full suite -- all tests must pass
5. Repeat
Never skip ahead. Never write two tests before making the first green.
### Phase 4: Refactor
Only refactor when GREEN. Look for: duplication, shallow modules, long methods, feature envy, primitive obsession. Run the