/plan
This skill is self-contained — follow the steps below instead of delegating to external planning skills (superpowers, etc.).
Research the codebase and create a spec + phased implementation plan. Zero interactive questions — explores the code instead.
When to use
Creates a track for any feature, bug fix, or refactor with a concrete, file-level implementation plan. Works with or without /setup.
MCP Tools (use if available)
session_search(query) — find similar past work in Claude Code chat history
project_code_search(query, project) — find reusable code across projects
codegraph_query(query) — check dependencies of affected files
codegraph_explain(project) — architecture overview: stack, languages, directory layers, key patterns, top dependencies, hub files
kb_search(query) — search knowledge base for relevant methodology
If MCP tools are not available, fall back to Glob + Grep + Read.
Steps
Parse task description from $ARGUMENTS.
- If empty, ask via AskUserQuestion: "What feature, bug, or refactor do you want to plan?"
- This is the ONE question maximum.
Detect context — determine where plan files should be stored:
Project context (normal project with code):
- Detected by:
package.json, pyproject.toml, Cargo.toml, *.xcodeproj, or build.gradle.kts exists in working directory
- Plan path:
docs/plan/{trackId}/
Knowledge base context (documentation-centric project):
- Detected by: NO package manifest found, BUT directories like
docs/, notes/, or structured numbered directories exist
- Plan path:
docs/plan/{shortname}/
- Note: the shortname is derived from the task (kebab-case, no date suffix for the directory)
Set $PLAN_ROOT based on detected context. All subsequent file paths use $PLAN_ROOT.
Load project context (parallel reads):
CLAUDE.md — architecture, constraints, Do/Don't
docs/prd.md — what the product does (if exists)
docs/workflow.md — TDD policy, commit strategy (if exists)
package.json or pyproject.toml — stack, versions, deps
Auto-classify track type from keywords in task description:
- Contains "fix", "bug", "broken", "error", "crash" →
bug
- Contains "refactor", "cleanup", "reorganize", "migrate" →
refactor
- Contains "update", "upgrade", "bump" →
chore
- Default →
feature
Research phase — explore the codebase to understand what needs to change:
a. Get architecture overview (if MCP available — do this FIRST):
codegraph_explain(project="{project name from CLAUDE.md or directory name}")
Gives you: stack, languages, directory layers, key patterns, top dependencies, hub files.
b. Find relevant files — Glob + Grep for patterns related to the task:
- Search for keywords from the task description
- Look at directory structure to understand architecture
- Identify files that will need modification
c. Precedent retrieval (context graph pattern — search past solutions BEFORE planning):
d. Search code across projects (if MCP available):
project_code_search(query="{relevant pattern}")
e. Check dependencies of affected files (if MCP available):
codegraph_query(query="MATCH (f:File {path: '{file}'})-[:IMPORTS]->(dep) RETURN dep.path")
f. Read existing tests in the affected area — understand testing patterns used.
g. Read CLAUDE.md architecture constraints — understand boundaries and conventions.
- Check for harness section: module boundaries, data validation rules, lint configs.
- Read
docs/ARCHITECTURE.md and docs/QUALITY_SCORE.md if they exist.
h. Detect deploy infrastructure — search for deploy scripts/configs to include deploy phase in plan:
find . -maxdepth 3 \( -name 'deploy.sh' -o -name 'Dockerfile' -o -name 'docker-compose.yml' -o -name 'fly.toml' -o -name 'wrangler.toml' \) -type f 2>/dev/null
If found, read them to understand deploy targets. Include a deploy phase in the plan with concrete commands.
Generate track ID:
- Extract a short name (2-3 words, kebab-case) from task description.
- Format:
{shortname}_{YYYYMMDD} (e.g., user-auth_20260209).
Create track directory:
mkdir -p $PLAN_ROOT
- Project context:
docs/plan/{trackId}/
- KB context:
docs/plan/{shortname}/
Generate $PLAN_ROOT/spec.md:
Based on research findings, NOT generic questions.
# Specification: {Title}
**Track ID:** {trackId}
**Type:** {Feature|Bug|Refactor|Chore}
**Created:** {YYYY-MM-DD}
**Status:** Draft
## Summary
{1-2 paragraph description based on research}
## Acceptance Criteria
- [ ] {concrete, testable criterion}
- [ ] {concrete, testable criterion}
{3-8 criteria based on research findings}
## Dependencies
- {external deps, packages, other tracks}
## Out of Scope
- {what this track does NOT cover}
## Technical Notes
- {architecture decisions from research}
- {relevant patterns found in codebase}
- {reusable code from other projects}
Generate $PLAN_ROOT/plan.md:
Concrete, file-level plan from research. Keep it tight: 2-4 phases, 5-15 tasks total.
Critical format rules (parsed by /build):
- Phase headers:
## Phase N: Name
- Tasks:
- [ ] Task N.Y: Description (with period or detailed text)
- Subtasks: indented
- [ ] Subtask description
- All tasks use
[ ] (unchecked), [~] (in progress), [x] (done)
# Implementation Plan: {Title}
**Track ID:** {trackId}
**Spec:** [spec.md](./spec.md)
**Created:** {YYYY-MM-DD}
**Status:** [ ] Not Started
## Overview
{1-2 sentences on approach}
## Phase 1: {Name}
{brief description of phase goal}
### Tasks
- [ ] Task 1.1: {description with concrete file paths}
- [ ] Task 1.2: {description}
### Verification
- [ ] {what to check after this phase}
## Phase 2: {Name}
### Tasks
- [ ] Task 2.1: {description}
- [ ] Task 2.2: {description}
### Verification
- [ ] {verification steps}
{2-4 phases total}
## Phase {N-1}: Deploy (if deploy infrastructure exists)
_Include this phase ONLY if the project has deploy scripts/configs (deploy.sh, Dockerfile, docker-compose.yml, fly.toml, wrangler.toml, vercel.json). Skip if no deploy infra found._
### Tasks
- [ ] Task {N-1}.1: {concrete deploy step — e.g. "Run python/deploy.sh to push Docker image to VPS", "wrangler deploy", etc.}
- [ ] Task {N-1}.2: Verify deployment — health check, logs, HTTP status
### Verification
- [ ] Service is live and healthy
- [ ] No runtime errors in production logs
## Phase {N}: Docs & Cleanup
### Tasks
- [ ] Task {N}.1: Update CLAUDE.md with any new commands, architecture changes, or key files
- [ ] Task {N}.2: Update README.md if public API or setup steps changed
- [ ] Task {N}.3: Remove dead code — unused imports, orphaned files, stale exports
### Verification
- [ ] CLAUDE.md reflects current project state
- [ ] Linter clean, tests pass
## Final Verification
- [ ] All acceptance criteria from spec met
- [ ] Tests pass
- [ ] Linter clean
- [ ] Build succeeds
- [ ] Documentation up to date
---
_Generated by /plan. Tasks marked [~] in progress and [x] complete by /build._
Plan quality rules:
- Every task mentions specific file paths (from research).
- Tasks are atomic — one commit each.
- Phases are independently verifiable.
- Total: 5-15 tasks (not 70).
- Last phase is always "Docs & Cleanup".
- Harness-aware: if the task introduces new patterns, include a task to update lint rules or CLAUDE.md constraints. If it touches module boundaries, include verification of dependency direction. Think: "what harness change prevents future agents from breaking this?"
Create progress task list for pipeline visibility:
After writing plan.md, create TaskCreate entries so progress is trackable:
- One task per phase: "Phase 1: {name}" with task list as description.
- This gives the user and pipeline real-time visibility into what's planned.
/build will update these tasks as it works through them.
If superpowers:writing-plans skill is available, follow its granularity format: bite-sized tasks (2-5 minutes each), complete code in task descriptions, exact file paths, verification steps per task. This enhances the built-in format above.
Show plan for approval via AskUserQuestion:
Present the spec summary + plan overview. Options:
- "Approve and start" — ready for
/build
- "Edit plan" — user wants to modify before implementing
- "Cancel" — discard the track
If "Edit plan": tell user to edit $PLAN_ROOT/plan.md manually, then run /build.
Output
Track created: {trackId}
Type: {Feature|Bug|Refactor|Chore}
Phases: {N}
Tasks: {N}
Spec: $PLAN_ROOT/spec.md
Plan: $PLAN_ROOT/plan.md
Research findings:
- {key finding 1}
- {key finding 2}
- {reusable code found, if any}
Next: /build {trackId}
Rationalizations Catalog
These thoughts mean STOP — you're skipping research:
| Thought |
Reality |
| "I know this codebase" |
You know what you've seen. Search for what you haven't. |
| "The plan is obvious" |
Obvious plans miss edge cases. Research first. |
| "Let me just start coding" |
10 minutes of research prevents 2 hours of rework. |
| "This is a small feature" |
Small features touch many files. Map the blast radius. |
| "I'll figure it out as I go" |
That's not a plan. Write the file paths first. |
| "70 tasks should cover it" |
5-15 tasks. If you need more, split into tracks. |
Compatibility Notes
- Plan format must match what
/build parses: ## Phase N:, - [ ] Task N.Y:.
/build reads docs/workflow.md for TDD policy and commit strategy (if exists).
- If
docs/workflow.md missing, /build uses sensible defaults (moderate TDD, conventional commits).
Common Issues
Plan has too many tasks
Cause: Feature scope too broad or tasks not atomic enough.
Fix: Target 5-15 tasks across 2-4 phases. Split large features into multiple tracks.
Context detection wrong (project vs KB)
Cause: Directory has both code manifests and KB-style directories.
Fix: Project context takes priority if package.json/pyproject.toml exists.
Research phase finds no relevant code
Cause: New project with minimal codebase or MCP tools unavailable.
Fix: Skill falls back to Glob + Grep. For new projects, the plan will rely more on CLAUDE.md architecture and stack conventions.
1---
2name: solo-plan
3description: Explore codebase and create spec + phased implementation plan with file-level task breakdown. Use when user says "plan this feature", "create implementation plan", "write a spec", "battle plan", or describes a feature/bug/refactor. Zero questions — researches code instead. Do NOT use for idea validation (use /validate) or execution (use /build).
4license: MIT
5metadata:
6 source: https://skillmd.com/skills/modbender/solo-plan
7 author: fortunto2
8 version: "2.2.1"
9 openclaw:
10 emoji: "📋"
11allowed-tools: Read, Grep, Bash, Glob, Write, Edit, AskUserQuestion, mcp__solograph__session_search, mcp__solograph__project_code_search, mcp__solograph__codegraph_query, mcp__solograph__codegraph_explain, mcp__solograph__kb_search, mcp__solograph__web_search, mcp__context7__resolve-library-id, mcp__context7__query-docs
12argument-hint: "<task description>"
13---
14
15# /plan
16
17This skill is self-contained — follow the steps below instead of delegating to external planning skills (superpowers, etc.).
18
19Research the codebase and create a spec + phased implementation plan. Zero interactive questions — explores the code instead.
20
21## When to use
22
23Creates a track for any feature, bug fix, or refactor with a concrete, file-level implementation plan. Works with or without `/setup`.
24
25## MCP Tools (use if available)
26
27- `session_search(query)` — find similar past work in Claude Code chat history
28- `project_code_search(query, project)` — find reusable code across projects
29- `codegraph_query(query)` — check dependencies of affected files
30- `codegraph_explain(project)` — architecture overview: stack, languages, directory layers, key patterns, top dependencies, hub files
31- `kb_search(query)` — search knowledge base for relevant methodology
32
33If MCP tools are not available, fall back to Glob + Grep + Read.
34
35## Steps
36
371. **Parse task description** from `$ARGUMENTS`.
38 - If empty, ask via AskUserQuestion: "What feature, bug, or refactor do you want to plan?"
39 - This is the ONE question maximum.
40
412. **Detect context** — determine where plan files should be stored:
42
43 **Project context** (normal project with code):
44 - Detected by: `package.json`, `pyproject.toml`, `Cargo.toml`, `*.xcodeproj`, or `build.gradle.kts` exists in working directory
45 - Plan path: `docs/plan/{trackId}/`
46
47 **Knowledge base context** (documentation-centric project):
48 - Detected by: NO package manifest found, BUT directories like `docs/`, `notes/`, or structured numbered directories exist
49 - Plan path: `docs/plan/{shortname}/`
50 - Note: the shortname is derived from the task (kebab-case, no date suffix for the directory)
51
52 Set `$PLAN_ROOT` based on detected context. All subsequent file paths use `$PLAN_ROOT`.
53
543. **Load project context** (parallel reads):
55 - `CLAUDE.md` — architecture, constraints, Do/Don't
56 - `docs/prd.md` — what the product does (if exists)
57 - `docs/workflow.md` — TDD policy, commit strategy (if exists)
58 - `package.json` or `pyproject.toml` — stack, versions, deps
59
603. **Auto-classify track type** from keywords in task description:
61 - Contains "fix", "bug", "broken", "error", "crash" → `bug`
62 - Contains "refactor", "cleanup", "reorganize", "migrate" → `refactor`
63 - Contains "update", "upgrade", "bump" → `chore`
64 - Default → `feature`
65
664. **Research phase** — explore the codebase to understand what needs to change:
67
68 a. **Get architecture overview** (if MCP available — do this FIRST):
69 ```
70 codegraph_explain(project="{project name from CLAUDE.md or directory name}")
71 ```
72 Gives you: stack, languages, directory layers, key patterns, top dependencies, hub files.
73
74 b. **Find relevant files** — Glob + Grep for patterns related to the task:
75 - Search for keywords from the task description
76 - Look at directory structure to understand architecture
77 - Identify files that will need modification
78
79 c. **Precedent retrieval** (context graph pattern — search past solutions BEFORE planning):
80 - Search past sessions (if MCP available):
81 ```
82 session_search(query="{task description keywords}")
83 ```
84 Look for: how similar tasks were solved, what went wrong, what patterns worked.
85 - Search KB for relevant methodology:
86 ```
87 kb_search(query="{task type}: {keywords}")
88 ```
89 Check for: harness patterns, architectural constraints, quality scores.
90
91 d. **Search code across projects** (if MCP available):
92 ```
93 project_code_search(query="{relevant pattern}")
94 ```
95
96 e. **Check dependencies** of affected files (if MCP available):
97 ```
98 codegraph_query(query="MATCH (f:File {path: '{file}'})-[:IMPORTS]->(dep) RETURN dep.path")
99 ```
100
101 f. **Read existing tests** in the affected area — understand testing patterns used.
102
103 g. **Read CLAUDE.md** architecture constraints — understand boundaries and conventions.
104 - Check for harness section: module boundaries, data validation rules, lint configs.
105 - Read `docs/ARCHITECTURE.md` and `docs/QUALITY_SCORE.md` if they exist.
106
107 h. **Detect deploy infrastructure** — search for deploy scripts/configs to include deploy phase in plan:
108 ```bash
109 find . -maxdepth 3 \( -name 'deploy.sh' -o -name 'Dockerfile' -o -name 'docker-compose.yml' -o -name 'fly.toml' -o -name 'wrangler.toml' \) -type f 2>/dev/null
110 ```
111 If found, read them to understand deploy targets. Include a deploy phase in the plan with concrete commands.
112
1135. **Generate track ID:**
114 - Extract a short name (2-3 words, kebab-case) from task description.
115 - Format: `{shortname}_{YYYYMMDD}` (e.g., `user-auth_20260209`).
116
1176. **Create track directory:**
118 ```bash
119 mkdir -p $PLAN_ROOT
120 ```
121 - Project context: `docs/plan/{trackId}/`
122 - KB context: `docs/plan/{shortname}/`
123
1247. **Generate `$PLAN_ROOT/spec.md`:**
125 Based on research findings, NOT generic questions.
126 ```markdown
127 # Specification: {Title}
128
129 **Track ID:** {trackId}
130 **Type:** {Feature|Bug|Refactor|Chore}
131 **Created:** {YYYY-MM-DD}
132 **Status:** Draft
133
134 ## Summary
135 {1-2 paragraph description based on research}
136
137 ## Acceptance Criteria
138 - [ ] {concrete, testable criterion}
139 - [ ] {concrete, testable criterion}
140 {3-8 criteria based on research findings}
141
142 ## Dependencies
143 - {external deps, packages, other tracks}
144
145 ## Out of Scope
146 - {what this track does NOT cover}
147
148 ## Technical Notes
149 - {architecture decisions from research}
150 - {relevant patterns found in codebase}
151 - {reusable code from other projects}
152 ```
153
1548. **Generate `$PLAN_ROOT/plan.md`:**
155 Concrete, file-level plan from research. Keep it tight: 2-4 phases, 5-15 tasks total.
156
157 **Critical format rules** (parsed by `/build`):
158 - Phase headers: `## Phase N: Name`
159 - Tasks: `- [ ] Task N.Y: Description` (with period or detailed text)
160 - Subtasks: indented ` - [ ] Subtask description`
161 - All tasks use `[ ]` (unchecked), `[~]` (in progress), `[x]` (done)
162
163 ```markdown
164 # Implementation Plan: {Title}
165
166 **Track ID:** {trackId}
167 **Spec:** [spec.md](./spec.md)
168 **Created:** {YYYY-MM-DD}
169 **Status:** [ ] Not Started
170
171 ## Overview
172 {1-2 sentences on approach}
173
174 ## Phase 1: {Name}
175 {brief description of phase goal}
176
177 ### Tasks
178 - [ ] Task 1.1: {description with concrete file paths}
179 - [ ] Task 1.2: {description}
180
181 ### Verification
182 - [ ] {what to check after this phase}
183
184 ## Phase 2: {Name}
185 ### Tasks
186 - [ ] Task 2.1: {description}
187 - [ ] Task 2.2: {description}
188
189 ### Verification
190 - [ ] {verification steps}
191
192 {2-4 phases total}
193
194 ## Phase {N-1}: Deploy (if deploy infrastructure exists)
195 _Include this phase ONLY if the project has deploy scripts/configs (deploy.sh, Dockerfile, docker-compose.yml, fly.toml, wrangler.toml, vercel.json). Skip if no deploy infra found._
196
197 ### Tasks
198 - [ ] Task {N-1}.1: {concrete deploy step — e.g. "Run python/deploy.sh to push Docker image to VPS", "wrangler deploy", etc.}
199 - [ ] Task {N-1}.2: Verify deployment — health check, logs, HTTP status
200
201 ### Verification
202 - [ ] Service is live and healthy
203 - [ ] No runtime errors in production logs
204
205 ## Phase {N}: Docs & Cleanup
206 ### Tasks
207 - [ ] Task {N}.1: Update CLAUDE.md with any new commands, architecture changes, or key files
208 - [ ] Task {N}.2: Update README.md if public API or setup steps changed
209 - [ ] Task {N}.3: Remove dead code — unused imports, orphaned files, stale exports
210
211 ### Verification
212 - [ ] CLAUDE.md reflects current project state
213 - [ ] Linter clean, tests pass
214
215 ## Final Verification
216 - [ ] All acceptance criteria from spec met
217 - [ ] Tests pass
218 - [ ] Linter clean
219 - [ ] Build succeeds
220 - [ ] Documentation up to date
221
222 ---
223 _Generated by /plan. Tasks marked [~] in progress and [x] complete by /build._
224 ```
225
226 **Plan quality rules:**
227 - Every task mentions specific file paths (from research).
228 - Tasks are atomic — one commit each.
229 - Phases are independently verifiable.
230 - Total: 5-15 tasks (not 70).
231 - **Last phase is always "Docs & Cleanup"**.
232 - **Harness-aware:** if the task introduces new patterns, include a task to update lint rules or CLAUDE.md constraints. If it touches module boundaries, include verification of dependency direction. Think: "what harness change prevents future agents from breaking this?"
233
2349. **Create progress task list** for pipeline visibility:
235
236 After writing plan.md, create TaskCreate entries so progress is trackable:
237 - One task per phase: "Phase 1: {name}" with task list as description.
238 - This gives the user and pipeline real-time visibility into what's planned.
239 - `/build` will update these tasks as it works through them.
240
241 If `superpowers:writing-plans` skill is available, follow its granularity format: bite-sized tasks (2-5 minutes each), complete code in task descriptions, exact file paths, verification steps per task. This enhances the built-in format above.
242
24310. **Show plan for approval** via AskUserQuestion:
244 Present the spec summary + plan overview. Options:
245 - "Approve and start" — ready for `/build`
246 - "Edit plan" — user wants to modify before implementing
247 - "Cancel" — discard the track
248
249 If "Edit plan": tell user to edit `$PLAN_ROOT/plan.md` manually, then run `/build`.
250
251## Output
252
253```
254Track created: {trackId}
255
256 Type: {Feature|Bug|Refactor|Chore}
257 Phases: {N}
258 Tasks: {N}
259 Spec: $PLAN_ROOT/spec.md
260 Plan: $PLAN_ROOT/plan.md
261
262Research findings:
263 - {key finding 1}
264 - {key finding 2}
265 - {reusable code found, if any}
266
267Next: /build {trackId}
268```
269
270## Rationalizations Catalog
271
272These thoughts mean STOP — you're skipping research:
273
274| Thought | Reality |
275|---------|---------|
276| "I know this codebase" | You know what you've seen. Search for what you haven't. |
277| "The plan is obvious" | Obvious plans miss edge cases. Research first. |
278| "Let me just start coding" | 10 minutes of research prevents 2 hours of rework. |
279| "This is a small feature" | Small features touch many files. Map the blast radius. |
280| "I'll figure it out as I go" | That's not a plan. Write the file paths first. |
281| "70 tasks should cover it" | 5-15 tasks. If you need more, split into tracks. |
282
283## Compatibility Notes
284
285- Plan format must match what `/build` parses: `## Phase N:`, `- [ ] Task N.Y:`.
286- `/build` reads `docs/workflow.md` for TDD policy and commit strategy (if exists).
287- If `docs/workflow.md` missing, `/build` uses sensible defaults (moderate TDD, conventional commits).
288
289## Common Issues
290
291### Plan has too many tasks
292**Cause:** Feature scope too broad or tasks not atomic enough.
293**Fix:** Target 5-15 tasks across 2-4 phases. Split large features into multiple tracks.
294
295### Context detection wrong (project vs KB)
296**Cause:** Directory has both code manifests and KB-style directories.
297**Fix:** Project context takes priority if `package.json`/`pyproject.toml` exists.
298
299### Research phase finds no relevant code
300**Cause:** New project with minimal codebase or MCP tools unavailable.
301**Fix:** Skill falls back to Glob + Grep. For new projects, the plan will rely more on CLAUDE.md architecture and stack conventions.