#What it does
The /tdd skill follows strict test-driven development: write failing tests first, then implement the minimal code to make them pass, then refactor.
#How to use
bash
/tdd Implement email validation utility#Workflow
- Red β Write failing tests that describe the expected behavior
- Green β Implement the minimal code to pass all tests
- Refactor β Clean up the implementation without changing behavior
- Verify β Run the full test suite to ensure nothing broke
#What you get
- Tests that document behavior, not implementation details
- Minimal, focused implementations
- High confidence that the code works as specified
- Natural documentation through test names
#Example
bash
> /tdd Create a function that validates email addresses
# Step 1: Writing tests...
β should accept valid emails ([email protected])
β should reject missing @ symbol
β should reject missing domain
β should accept subdomains ([email protected])
β All 4 tests failing (expected)
# Step 2: Implementing...
β All 4 tests passing
# Step 3: Refactoring...
β Extracted regex to constant, added JSDoc
β All tests still passing