tdd
Original:🇺🇸 English
Translated
Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants test-first development, or requests TDD workflow.
1installs
Sourcehelderberto/skills
Added on
NPX Install
npx skill4agent add helderberto/skills tddTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Test-Driven Development
Philosophy
Tests verify behavior through public interfaces, not implementation. Good tests survive refactors.
See for testing philosophy and anti-patterns.
principles.mdWorkflow
1. Planning
- Confirm interface design with user
- List behaviors to test (prioritize critical paths)
- Get approval before writing code
2. Tracer Bullet
RED: Write first test → fails
GREEN: Minimal code to pass → passes3. Incremental Loop
For each remaining behavior:
RED: Write next test → fails
GREEN: Minimal code to pass → passesRules:
- One test at a time
- Minimal code to pass
- No refactoring while RED
4. Refactor
Once all tests GREEN:
- Remove duplication
- Improve structure
- Tests must stay GREEN
Anti-Pattern: Horizontal Slices
DO NOT write all tests first, then all implementation.
DO use vertical slices: one test → one implementation → repeat.
See for workflow demonstrations.
examples.md