/tdd
Orchestrator for TDD workflow with parallel execution.
Progress Checklist
code
- [ ] Step 1: Parse args and set variables - [ ] Step 2: Invoke ticket-reader agent - [ ] Step 3: Validate design exists - [ ] Step 4: Invoke knowledge-reader agent - [ ] Step 5: Execute TDD with parallel orchestration - [ ] Step 6: Invoke /refine-loop (if no errors) - [ ] Step 7: Generate report
Steps
- •
Parse args and set variables:
- •
ticket→ TICKET_ID (required, error if not provided) - •
iterations→ MAX_ITERATIONS (default: 10)
- •
- •
Invoke ticket-reader agent:
- •Task prompt:
OPERATION=get TICKET_ID=$TICKET_ID - •If error → END
- •Parse output → TICKET_PATH
- •Task prompt:
- •
Validate design exists:
- •Check if <TICKET_PATH>/design.md exists
- •If not → Error: "design.md not found. Run /design first.", END
- •
Invoke knowledge-reader agent:
- •Task prompt:
OPERATION=resolve TICKET_PATH=$TICKET_PATH WORKFLOW=/tdd - •Parse output → KNOWLEDGE (empty array if error)
- •Task prompt:
- •
Execute TDD with parallel orchestration:
a. Get ready tasks:
- •Run
node ~/.claude/scripts/resolve-task-dependencies.js --ticket=$TICKET_ID --filter="Implement:" - •If no tasks → Error: "No implementation tasks found", END
b. For each ready task:
- •TaskGet(task_id) to get task details
- •TaskUpdate(task_id, status="in_progress")
- •Launch tdd-runner with Task tool:
- •subagent_type: tdd-runner
- •run_in_background: true
- •prompt includes: TASK_SUBJECT, TASK_DESCRIPTION, KNOWLEDGE, CWD
c. Monitor and iterate:
- •Use TaskOutput to check completion
- •On completion: TaskUpdate(task_id, status="completed")
- •Refresh dependencies, launch newly ready tasks
- •Repeat until all complete
d. Collect results: TDD_FILES, TDD_TEST_COUNT, TDD_PASSED_COUNT
- •Run
- •
Invoke /refine-loop (if no TDD errors):
- •Args: "type=code-tests ticket={TICKET_PATH} scope=uncommitted iterations={MAX_ITERATIONS}"
- •
Generate report:
- •Write to <TICKET_PATH>/tdd-report.md