Add TDD guidance to planning workflow

- New <test_driven_when_beneficial> principle in references/principles.md
- TDD assessment step in plan-phase.md break_into_tasks
- Pragmatic approach: use TDD when behavior is definable upfront

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson
2025-12-15 10:15:59 -06:00
parent 17c3da454e
commit b8879c6253
2 changed files with 45 additions and 0 deletions

View File

@@ -422,6 +422,18 @@ Each task must have:
- **Verify**: How to prove it worked
- **Done**: Acceptance criteria
**Assess TDD fit for each task:**
TDD produces better design and catches bugs early. Use it when you can define expected behavior upfront.
For each task, ask: Can I write `expect(fn(input)).toBe(output)` before writing `fn`?
→ **Yes** (business logic, APIs, transformations, validation, state machines):
Structure test-first. Task action: "Implement X with TDD—write failing test, then implement to pass."
→ **No** (UI layout, config, glue code, exploration):
Standard implementation. Add tests after if coverage needed.
**Identify checkpoints:**
- Claude automated work needing visual/functional verification? → checkpoint:human-verify