Plan
Purpose
Implementation planning skill. Takes an approved spec (from /ai-brainstorm or manual creation) and produces a phased execution plan with bite-sized tasks, agent assignments, and gate criteria. The plan is the contract that /ai-dispatch executes.
HARD GATE: user must approve the plan before /ai-dispatch can run.
When to Use
- After
/ai-brainstorm produces an approved spec
- When a spec exists but plan.md has placeholder content
- When re-planning is needed (plan failed, scope changed)
Process
- Read spec -- load
specs/spec.md
- Read context --
docs/solution-intent.md section 7 (roadmap), decision-store.json (constraints)
- Explore codebase -- understand current architecture, patterns, and affected files
- Classify pipeline -- select full/standard/hotfix/trivial based on change scope
- Decompose into tasks -- bite-sized (2-5 min each), single-agent, single-concern
- Assign agents -- capability-match each task to the right agent
- Order phases -- define phase boundaries and gate criteria
- Review plan -- self-review with spec-reviewer pattern (max 2 iterations)
- Write artifacts -- persist plan.md via Write tool to
specs/plan.md
- STOP -- present plan. User runs
/ai-dispatch to execute.
Pipeline Classification
| Pipeline |
Trigger |
Steps |
full |
New feature, refactor, >5 files |
discover, architecture, risk, test-plan, spec, dispatch |
standard |
Enhancement, 3-5 files |
discover, risk, spec, dispatch |
hotfix |
Bug fix, security patch, <3 files |
discover, risk, spec, dispatch |
trivial |
Typo, comment, single-line |
spec, dispatch |
Override: /ai-plan --pipeline=hotfix.
Task Decomposition Rules
Each task MUST be:
- Bite-sized: completable in 2-5 minutes by an agent
- Single-agent: assigned to exactly one agent (build, verify, guard)
- Single-concern: does one thing (not "implement feature AND write tests")
- Verifiable: has a clear done condition (test passes, lint clean, file exists)
- Ordered: dependencies are explicit (T-3 blocked by T-2)
TDD enforcement: for features needing tests, always produce paired tasks:
T-N: Write failing tests for [feature] (RED) -- assigned to build/test mode
T-N+1: Implement [feature] to pass tests (GREEN, blocked by T-N) -- assigned to build/code mode, constraint: "DO NOT modify test files from T-N"
Agent Assignment
| Agent |
Capabilities |
Assign when... |
build |
Code read-write, tests, debug |
Implementation, test writing, bug fixes |
verify |
Read-only scanning, 7 modes |
Quality checks, security scans, gap analysis |
guard |
Advisory, drift detection |
Pre-dispatch governance checks |
Plan Artifacts
plan.md
# Plan: spec-NNN [title]
## Pipeline: [full|standard|hotfix|trivial]
## Phases: N
## Tasks: N (build: N, verify: N, guard: N)
### Phase 1: [name]
**Gate**: [what must be true before Phase 2 starts]
- T-1.1: [task description] (agent: build)
- T-1.2: [task description] (agent: build)
### Phase 2: [name]
**Gate**: [what must be true before Phase 3 starts]
...
Common Mistakes
- Tasks too large (> 5 min). Split them.
- Missing dependencies between tasks.
- Assigning code-write tasks to verify (verify is read-only).
- Not pairing RED/GREEN tasks for TDD.
- Planning implementation details (plan says WHAT, code says HOW).
- Skipping the review step.
No-Execution Protocol
/ai-plan is planning-only. It MUST NOT:
- Invoke
ai-build agent or /ai-dispatch for task execution
- Modify source code
- Check off implementation tasks as completed
It MAY:
- Write plan.md via Write tool to
specs/plan.md
- Run codebase exploration (read-only)
Integration
- Called by: user directly, or after
/ai-brainstorm approval
- Calls:
/ai-explore (codebase context), Write tool (artifact creation)
- Transitions to:
/ai-dispatch (ONLY -- user must invoke explicitly)
$ARGUMENTS
1---2name: plan-343description: Use when an approved spec exists and needs to be broken into executable tasks with agent assignments. Creates the implementation plan that /ai-dispatch executes.4---5
6
7
8# Plan
9
10## Purpose
11
12Implementation planning skill. Takes an approved spec (from `/ai-brainstorm` or manual creation) and produces a phased execution plan with bite-sized tasks, agent assignments, and gate criteria. The plan is the contract that `/ai-dispatch` executes.
13
14HARD GATE: user must approve the plan before `/ai-dispatch` can run.
15
16## When to Use
17
18- After `/ai-brainstorm` produces an approved spec
19- When a spec exists but plan.md has placeholder content
20- When re-planning is needed (plan failed, scope changed)
21
22## Process
23
241. **Read spec** -- load `specs/spec.md`
252. **Read context** -- `docs/solution-intent.md` section 7 (roadmap), `decision-store.json` (constraints)
263. **Explore codebase** -- understand current architecture, patterns, and affected files
274. **Classify pipeline** -- select full/standard/hotfix/trivial based on change scope
285. **Decompose into tasks** -- bite-sized (2-5 min each), single-agent, single-concern
296. **Assign agents** -- capability-match each task to the right agent
307. **Order phases** -- define phase boundaries and gate criteria
318. **Review plan** -- self-review with spec-reviewer pattern (max 2 iterations)
329. **Write artifacts** -- persist plan.md via Write tool to `specs/plan.md`
3310. **STOP** -- present plan. User runs `/ai-dispatch` to execute.
34
35## Pipeline Classification
36
37| Pipeline | Trigger | Steps |
38|----------|---------|-------|
39| `full` | New feature, refactor, >5 files | discover, architecture, risk, test-plan, spec, dispatch |
40| `standard` | Enhancement, 3-5 files | discover, risk, spec, dispatch |
41| `hotfix` | Bug fix, security patch, <3 files | discover, risk, spec, dispatch |
42| `trivial` | Typo, comment, single-line | spec, dispatch |
43
44Override: `/ai-plan --pipeline=hotfix`.
45
46## Task Decomposition Rules
47
48Each task MUST be:
49
50- **Bite-sized**: completable in 2-5 minutes by an agent
51- **Single-agent**: assigned to exactly one agent (build, verify, guard)
52- **Single-concern**: does one thing (not "implement feature AND write tests")
53- **Verifiable**: has a clear done condition (test passes, lint clean, file exists)
54- **Ordered**: dependencies are explicit (T-3 blocked by T-2)
55
56**TDD enforcement**: for features needing tests, always produce paired tasks:
57- `T-N: Write failing tests for [feature]` (RED) -- assigned to build/test mode
58- `T-N+1: Implement [feature] to pass tests` (GREEN, blocked by T-N) -- assigned to build/code mode, constraint: "DO NOT modify test files from T-N"
59
60## Agent Assignment
61
62| Agent | Capabilities | Assign when... |
63|-------|-------------|----------------|
64| `build` | Code read-write, tests, debug | Implementation, test writing, bug fixes |
65| `verify` | Read-only scanning, 7 modes | Quality checks, security scans, gap analysis |
66| `guard` | Advisory, drift detection | Pre-dispatch governance checks |
67
68## Plan Artifacts
69
70### plan.md
71
72```markdown
73# Plan: spec-NNN [title]
74
75## Pipeline: [full|standard|hotfix|trivial]
76## Phases: N
77## Tasks: N (build: N, verify: N, guard: N)
78
79### Phase 1: [name]
80**Gate**: [what must be true before Phase 2 starts]
81- T-1.1: [task description] (agent: build)
82- T-1.2: [task description] (agent: build)
83
84### Phase 2: [name]
85**Gate**: [what must be true before Phase 3 starts]
86...
87```
88
89## Common Mistakes
90
91- Tasks too large (> 5 min). Split them.
92- Missing dependencies between tasks.
93- Assigning code-write tasks to verify (verify is read-only).
94- Not pairing RED/GREEN tasks for TDD.
95- Planning implementation details (plan says WHAT, code says HOW).
96- Skipping the review step.
97
98## No-Execution Protocol
99
100`/ai-plan` is planning-only. It MUST NOT:
101- Invoke `ai-build agent` or `/ai-dispatch` for task execution
102- Modify source code
103- Check off implementation tasks as completed
104
105It MAY:
106- Write plan.md via Write tool to `specs/plan.md`
107- Run codebase exploration (read-only)
108
109## Integration
110
111- **Called by**: user directly, or after `/ai-brainstorm` approval
112- **Calls**: `/ai-explore` (codebase context), Write tool (artifact creation)
113- **Transitions to**: `/ai-dispatch` (ONLY -- user must invoke explicitly)
114
115$ARGUMENTS