What problem does it solve?
This skill enforces a strict Test-Driven Development (TDD) workflow, ensuring that all code is thoroughly tested before implementation. It eliminates common pitfalls like untested features, regressions, and brittle code, leading to higher quality software, fewer bugs, and faster development cycles.
Core Features & Use Cases
- Strict TDD Enforcement: Guides you through the RED-GREEN-REFACTOR cycle for every coding task.
- Comprehensive Test Coverage: Mandates unit, integration, and end-to-end tests for all projects.
- No Mocks Policy: Encourages testing with real data and APIs for more reliable results.
- Use Case: When implementing a new API endpoint, use this skill to ensure you write failing tests for all expected behaviors and edge cases first, then implement the code, and finally refactor, guaranteeing a robust and well-tested endpoint.
Quick Start
Announce at start:
"I'm using the test-driven-development skill to ensure test-first implementation."
Core TDD Cycle:
1. Write failing test defining desired functionality
2. Run test to confirm it fails as expected
3. Write ONLY enough code to make test pass
4. Run test to confirm success
5. Refactor while ensuring tests remain green
6. Repeat for next requirement
Python Test Standards:
Use pytest as test framework
Use uv run pytest to execute tests
NEVER use mocks - always use real data and APIs