tdd-best-practices
Installation
SKILL.md
TDD Best Practices
Use this skill when the main question is how to drive implementation from tests, how to structure a test suite, or how to recover discipline in a codebase where tests were written after the fact.
Working Style
- Write one failing test, then make it pass with the minimum code needed.
- Refactor only when all tests are green.
- Test behaviors, not implementations — the public API, not private methods.
- Keep tests as simple as the production code they verify.
- A test suite that is hard to change is as expensive as production code that is hard to change.
The Red-Green-Refactor Cycle
RED → Write a failing test that describes the next behavior.
GREEN → Write the minimum code to make it pass.
REFACTOR → Clean up both the code and the test — no new behavior.