Executing Plans
Core principle: Group related tasks to share agent context. One agent per subsystem, groups run in parallel.
Why Grouping Matters
Without grouping:
code
Task 1 (auth/login) → Agent 1 [explores codebase, reads auth/] Task 2 (auth/logout) → Agent 2 [explores codebase, reads auth/ again]
With grouping:
code
Tasks 1-2 (auth/*) → Agent 1 [explores once, executes both]
Execution Flow
code
- [ ] Load plan file - [ ] Group tasks by subsystem - [ ] Dispatch agents for independent groups in parallel - [ ] Update plan file (mark IN_PROGRESS) - [ ] Wait, dispatch dependent groups - [ ] Run verification (tests, build, lint) - [ ] Dispatch code-reviewer agent - [ ] Mark plan COMPLETED
Grouping Rules
| Signal | Group together |
|---|---|
| Same directory prefix | src/auth/* tasks |
| Same domain/feature | Auth tasks, billing tasks |
| Plan sections | Tasks under same ## heading |
Limits: 3-4 tasks max per group. Split if larger.
Parallel vs Sequential
Parallel: Groups touch different subsystems
code
Group A: src/auth/* ─┬─ parallel Group B: src/billing/* ─┘
Sequential: Groups have dependencies
code
Group A: Create shared types → Group B: Use those types
Group Dispatch
code
Task tool (general-purpose):
description: "Auth tasks: login, logout"
prompt: |
Execute these tasks from [plan-file] IN ORDER:
- Task 1: Add login endpoint
- Task 2: Add logout endpoint
Use skills: <relevant skills>
Commit after each task. Report: files changed, test results
Progress Tracking
- •Set plan status to IN_PROGRESS when starting
- •Check off
[x]each task as completed - •Set status to COMPLETED when all pass verification
Auto-Recovery
- •Agent attempts to fix failures (has context)
- •If can't fix, report failure
- •Dispatch fix agent with error output
- •Same error twice → stop and ask user
Final Verification
- •Run full test suite
- •Run build
- •Dispatch
ce:code-reviewer - •Fix issues found
- •Mark COMPLETED