Prerequisites
- TaskMaster initialized project (
tm init
) - Tasks with subtasks created (
tm parse-prd
ortm expand
) - Git repository with clean working tree
- Test framework installed (vitest, jest, mocha, etc.)
1. Start a Workflow
2. The TDD Cycle
RED Phase: Write Failing Test
GREEN Phase: Implement Feature
Write minimal code to pass:COMMIT Phase: Save Progress
3. Continue for All Subtasks
Repeat the RED-GREEN-COMMIT cycle for each subtask until complete.4. Complete the Workflow
When all subtasks are done:task-7
is ready for review/merge!
Common Patterns
Parse Test Output
Your test runner outputs human-readable format - convert to JSON: Vitest:{"total":10,"passed":8,"failed":2,"skipped":0}
Jest:
{"total":10,"passed":8,"failed":2,"skipped":0}
Handle Errors
Problem: RED phase won’t complete - “no test failures” Solution: Your test isn’t testing new behavior. Make sure it fails:Resume Interrupted Work
JSON Output Mode
All commands support--json
for programmatic use:
- CI/CD integration
- Custom tooling
- Automated workflows
- Progress monitoring
MCP Integration
For AI agents (Claude Code, etc.), use MCP tools:Cheat Sheet
Next Steps
- Read AI Agent Integration Guide for complete documentation
- Check Command Reference for all options
Tips
- Always let tests fail first - That’s the RED phase
- Write minimal code - Just enough to pass
- Commit frequently - After each subtask
- Use —json - Better for programmatic use
- Check status often - Know where you are
- Trust the workflow - It enforces TDD rules
Ready to start? Run
tm autopilot start <taskId>
and begin your TDD journey!