Skip to main content
Get started with TaskMaster’s autonomous TDD workflow in 5 minutes.

Prerequisites

  • TaskMaster initialized project (tm init)
  • Tasks with subtasks created (tm parse-prd or tm expand)
  • Git repository with clean working tree
  • Test framework installed (vitest, jest, mocha, etc.)

1. Start a Workflow

Example:

2. The TDD Cycle

RED Phase: Write Failing Test

Write a test that fails:
Run tests:
Complete RED phase:

GREEN Phase: Implement Feature

Write minimal code to pass:
Run tests:
Complete GREEN phase:

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:
Your branch 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:
Problem: GREEN phase won’t complete - “tests still failing” Solution: Fix your implementation until all tests pass:

Resume Interrupted Work

JSON Output Mode

All commands support --json for programmatic use:
Perfect for:
  • CI/CD integration
  • Custom tooling
  • Automated workflows
  • Progress monitoring

MCP Integration

For AI agents (Claude Code, etc.), use MCP tools:
See AI Agent Integration Guide for details.

Cheat Sheet

Next Steps

Tips

  1. Always let tests fail first - That’s the RED phase
  2. Write minimal code - Just enough to pass
  3. Commit frequently - After each subtask
  4. Use —json - Better for programmatic use
  5. Check status often - Know where you are
  6. Trust the workflow - It enforces TDD rules

Ready to start? Run tm autopilot start <taskId> and begin your TDD journey!