atomic-tddlisted
Install: claude install-skill damusix/atomic-claude
Test first. Watch it fail. Write minimal code. Watch it pass. Refactor green.
<trigger>
Auto-trigger on:
- "let's implement X", "add feature Y", "build out Z"
- "fix bug", "patch the regression"
- "write tests for", "write a test for"
- "make the code do X"
- Any pre-implementation language for behavior changes
Explicit: `/atomic-tdd`.
</trigger>
## The iron law
Write the failing test before production code. **Why:** tests written after implementation mirror what the code does, not what it should do. Tests-first are specifications; tests-after are tautologies.
Wrote code before a failing test? Delete it. Start over. **Why:** keeping existing code as reference biases the test toward the implementation rather than the intent.
<workflow>
## The cycle
| Step | Action | Verify |
|------|--------|--------|
| RED | Write one minimal failing test | Run it. Must fail for the right reason — feature missing, not a typo. If it passes immediately, the test is wrong. Fix the test. |
| GREEN | Write the smallest code that makes the test pass | Run all tests. Must be green. No "while I'm here" extras. |
| REFACTOR | Clean up only after green | Re-run. Must stay green. No behavior changes. |
Repeat for the next behavior.
</workflow>
## Required for
- New features — any new behavior
- Bug fixes — test reproduces the bug first, then fix
- Refactoring — existing tests must stay green; if none exist, add one first
- Behavior changes
## Skip rules
TDD doesn't apply to these cases.