| name | tdd |
| description | Implement a feature using strict test-driven development |
Implement the following feature using Test-Driven Development: the task/scope the user described when invoking this skill (if none given, ask or infer from context)
Follow the RED → GREEN → REFACTOR cycle strictly.
Cycle
- RED: Write a failing test that describes the desired behavior.
- GREEN: Write the minimum code to make the test pass.
- REFACTOR: Clean up while keeping tests green.
Process
- Understand the requirement.
- Identify the test framework already in use (jest, vitest, pytest, go test, etc.).
- Write test cases covering: happy path, edge cases, error cases.
- Run tests → confirm they fail.
- Implement the minimum code to pass.
- Run tests → confirm they pass.
- Refactor if needed, keeping tests green.
- Report test coverage for the new code.
Rules
- Never write implementation before tests.
- Each test checks ONE behavior.
- Descriptive test names:
should [expected behavior] when [condition].
- Mock external dependencies, not internal logic.
- Aim for meaningful coverage, not 100% line coverage.