Read: docs/progress.json
Find phase by ID (e.g., "phase-1")
Extract all tasks with passed: false
Analyze dependencies (blockedBy)
Dependency Analysis
Build task groups for parallel execution:
Group 1: Tasks with NO dependencies (can run parallel)
Group 2: Tasks depending on Group 1 (run after Group 1)
Group 3: Tasks depending on Group 2 (run after Group 2)
...
[Single message with 3 Task tool calls - PARALLEL]
[Task Tool Call 1]
subagent_type: coder
description: "Execute task 2.1"
prompt: "Execute task 2.1 from docs/progress.json. Update passed: true when done."
[Task Tool Call 2]
subagent_type: coder
description: "Execute task 2.2"
prompt: "Execute task 2.2 from docs/progress.json. Update passed: true when done."
[Task Tool Call 3]
subagent_type: coder
description: "Execute tasks 2.3, 2.4"
prompt: "Execute tasks 2.3, 2.4 from docs/progress.json. Update each to passed: true when done."
Sequential Tasks (One Agent)
[Task Tool Call]
subagent_type: coder
description: "Execute phase 1 tasks"
prompt: "Execute these tasks in order: 1.1, 1.2, 1.3, 1.4 from docs/progress.json. Update each to passed: true when done."
Phase 1 Tasks:
- 1.1: Create migration (no deps)
- 1.2: Run migration (deps: 1.1)
- 1.3: Create RLS (deps: 1.2)
- 1.4: Test queries (deps: 1.3)
Analysis: All sequential → 1 agent per wave (or 1 agent for all)
Option A: 4 waves, 1 agent each
Option B: 1 agent handles all sequentially
Prefer Option B for fewer spawns
The Job: How to Execute This Skill
FOLLOW THESE STEPS EXACTLY:
Step A: Validate & Get Phase
1. Read docs/progress.json
2. If no phase arg → AskUserQuestion for phase
3. Extract pending tasks for that phase
Step B: Analyze Dependencies
1. Group tasks by dependencies
2. Wave 1 = no dependencies
3. Wave 2 = depends on Wave 1
4. etc.
Step C: Spawn Agents (THE CRITICAL PART)
FOR EACH WAVE, USE TASK TOOL TO SPAWN DEVELOPER AGENTS:
Wave with 1 task:
→ 1 Task tool call with subagent_type="developer"
Wave with 2 tasks:
→ 2 Task tool calls in SAME message (parallel)
Wave with 3+ tasks:
→ 3 Task tool calls in SAME message (parallel)
EXAMPLE - Wave with 2 parallel tasks:
You MUST send this as a single message with multiple tool calls:
<example_spawn>
I'll spawn 2 coder agents in parallel for Wave 2:
1. Wait for all agents in current wave
2. Proceed to next wave
3. Repeat Step C for next wave
Step E: Report
1. Show completed tasks
2. Show progress percentage
3. Suggest next phase
Agent Prompts
Single Task Prompt
coder agent:
"Phase {phase}: Execute task {id} - {name}.
Read docs/progress.json for details.
Follow docs/{source} for implementation.
Update progress.json when done."
Multiple Tasks Prompt (Sequential)
coder agent:
"Phase {phase}: Execute these tasks in order:
- {id1}: {name1}
- {id2}: {name2}
- {id3}: {name3}
Read docs/progress.json for details.
Update each task to passed: true when complete."
Error Handling
No Pending Tasks
All tasks in Phase X are already passed: true.
→ Report: "Phase X already complete. Run /developer Y for next phase."
Dependencies Not Met
Task depends on tasks from previous phase that aren't done.
→ Report: "Phase X has unmet dependencies. Complete Phase Y first."
→ Suggest: "Run /developer Y"
Agent Fails
Developer agent reports failure.
→ Report which task failed
→ Keep task as passed: false
→ Ask user how to proceed