pan-wizard 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +772 -0
  3. package/agents/pan-debugger.md +1246 -0
  4. package/agents/pan-document_code.md +965 -0
  5. package/agents/pan-executor.md +469 -0
  6. package/agents/pan-integration-checker.md +443 -0
  7. package/agents/pan-phase-researcher.md +572 -0
  8. package/agents/pan-plan-checker.md +763 -0
  9. package/agents/pan-planner.md +1297 -0
  10. package/agents/pan-project-researcher.md +647 -0
  11. package/agents/pan-research-synthesizer.md +239 -0
  12. package/agents/pan-reviewer.md +112 -0
  13. package/agents/pan-roadmapper.md +642 -0
  14. package/agents/pan-verifier.md +672 -0
  15. package/assets/pan-logo-2000-transparent.svg +30 -0
  16. package/assets/pan-logo-2000.svg +43 -0
  17. package/assets/terminal.svg +119 -0
  18. package/bin/install-lib.cjs +616 -0
  19. package/bin/install.js +1936 -0
  20. package/commands/pan/add-phase.md +44 -0
  21. package/commands/pan/assumptions.md +47 -0
  22. package/commands/pan/audit-deployment.md +378 -0
  23. package/commands/pan/debug.md +168 -0
  24. package/commands/pan/discord.md +19 -0
  25. package/commands/pan/discuss-phase.md +84 -0
  26. package/commands/pan/exec-phase.md +45 -0
  27. package/commands/pan/focus-auto.md +323 -0
  28. package/commands/pan/focus-design.md +816 -0
  29. package/commands/pan/focus-exec.md +316 -0
  30. package/commands/pan/focus-plan.md +101 -0
  31. package/commands/pan/focus-scan.md +272 -0
  32. package/commands/pan/focus-sync.md +104 -0
  33. package/commands/pan/health.md +23 -0
  34. package/commands/pan/help.md +23 -0
  35. package/commands/pan/insert-phase.md +33 -0
  36. package/commands/pan/map-codebase.md +72 -0
  37. package/commands/pan/milestone-audit.md +37 -0
  38. package/commands/pan/milestone-cleanup.md +19 -0
  39. package/commands/pan/milestone-done.md +137 -0
  40. package/commands/pan/milestone-gaps.md +35 -0
  41. package/commands/pan/milestone-new.md +45 -0
  42. package/commands/pan/new-project.md +43 -0
  43. package/commands/pan/patches.md +110 -0
  44. package/commands/pan/pause.md +39 -0
  45. package/commands/pan/phase-budget.md +23 -0
  46. package/commands/pan/phase-tests.md +42 -0
  47. package/commands/pan/plan-phase.md +46 -0
  48. package/commands/pan/profile.md +36 -0
  49. package/commands/pan/progress.md +25 -0
  50. package/commands/pan/quick.md +42 -0
  51. package/commands/pan/remove-phase.md +32 -0
  52. package/commands/pan/research-phase.md +190 -0
  53. package/commands/pan/resume.md +41 -0
  54. package/commands/pan/retro.md +33 -0
  55. package/commands/pan/settings.md +37 -0
  56. package/commands/pan/todo-add.md +48 -0
  57. package/commands/pan/todo-check.md +46 -0
  58. package/commands/pan/update.md +38 -0
  59. package/commands/pan/verify-phase.md +39 -0
  60. package/hooks/dist/pan-check-update.js +62 -0
  61. package/hooks/dist/pan-context-monitor.js +122 -0
  62. package/hooks/dist/pan-statusline.js +108 -0
  63. package/package.json +66 -0
  64. package/pan-wizard-core/bin/lib/codebase.cjs +746 -0
  65. package/pan-wizard-core/bin/lib/commands.cjs +1435 -0
  66. package/pan-wizard-core/bin/lib/config.cjs +611 -0
  67. package/pan-wizard-core/bin/lib/constants.cjs +696 -0
  68. package/pan-wizard-core/bin/lib/context-budget.cjs +150 -0
  69. package/pan-wizard-core/bin/lib/core.cjs +650 -0
  70. package/pan-wizard-core/bin/lib/focus.cjs +900 -0
  71. package/pan-wizard-core/bin/lib/frontmatter.cjs +442 -0
  72. package/pan-wizard-core/bin/lib/init.cjs +881 -0
  73. package/pan-wizard-core/bin/lib/milestone.cjs +276 -0
  74. package/pan-wizard-core/bin/lib/phase.cjs +1212 -0
  75. package/pan-wizard-core/bin/lib/roadmap.cjs +470 -0
  76. package/pan-wizard-core/bin/lib/state.cjs +1029 -0
  77. package/pan-wizard-core/bin/lib/template.cjs +314 -0
  78. package/pan-wizard-core/bin/lib/utils.cjs +171 -0
  79. package/pan-wizard-core/bin/lib/verify.cjs +1808 -0
  80. package/pan-wizard-core/bin/pan-tools.cjs +773 -0
  81. package/pan-wizard-core/references/checkpoints.md +776 -0
  82. package/pan-wizard-core/references/continuation-format.md +249 -0
  83. package/pan-wizard-core/references/decimal-phase-calculation.md +65 -0
  84. package/pan-wizard-core/references/git-integration.md +248 -0
  85. package/pan-wizard-core/references/git-planning-commit.md +38 -0
  86. package/pan-wizard-core/references/model-profile-resolution.md +34 -0
  87. package/pan-wizard-core/references/model-profiles.md +111 -0
  88. package/pan-wizard-core/references/phase-argument-parsing.md +61 -0
  89. package/pan-wizard-core/references/planning-config.md +196 -0
  90. package/pan-wizard-core/references/questioning.md +145 -0
  91. package/pan-wizard-core/references/tdd.md +263 -0
  92. package/pan-wizard-core/references/ui-brand.md +160 -0
  93. package/pan-wizard-core/references/verification-patterns.md +612 -0
  94. package/pan-wizard-core/templates/codebase/architecture.md +283 -0
  95. package/pan-wizard-core/templates/codebase/best-practices.md +133 -0
  96. package/pan-wizard-core/templates/codebase/concerns.md +325 -0
  97. package/pan-wizard-core/templates/codebase/conventions.md +307 -0
  98. package/pan-wizard-core/templates/codebase/integrations.md +305 -0
  99. package/pan-wizard-core/templates/codebase/relationships.md +124 -0
  100. package/pan-wizard-core/templates/codebase/stack.md +199 -0
  101. package/pan-wizard-core/templates/codebase/structure.md +298 -0
  102. package/pan-wizard-core/templates/codebase/testing.md +480 -0
  103. package/pan-wizard-core/templates/config.json +37 -0
  104. package/pan-wizard-core/templates/context.md +283 -0
  105. package/pan-wizard-core/templates/continue-here.md +78 -0
  106. package/pan-wizard-core/templates/debug-subagent-prompt.md +91 -0
  107. package/pan-wizard-core/templates/debug.md +164 -0
  108. package/pan-wizard-core/templates/discovery.md +146 -0
  109. package/pan-wizard-core/templates/milestone-archive.md +123 -0
  110. package/pan-wizard-core/templates/milestone.md +115 -0
  111. package/pan-wizard-core/templates/phase-prompt.md +593 -0
  112. package/pan-wizard-core/templates/planner-subagent-prompt.md +117 -0
  113. package/pan-wizard-core/templates/project.md +184 -0
  114. package/pan-wizard-core/templates/requirements.md +231 -0
  115. package/pan-wizard-core/templates/research-project/architecture.md +204 -0
  116. package/pan-wizard-core/templates/research-project/features.md +147 -0
  117. package/pan-wizard-core/templates/research-project/pitfalls.md +200 -0
  118. package/pan-wizard-core/templates/research-project/stack.md +120 -0
  119. package/pan-wizard-core/templates/research-project/summary.md +170 -0
  120. package/pan-wizard-core/templates/research.md +552 -0
  121. package/pan-wizard-core/templates/retrospective.md +54 -0
  122. package/pan-wizard-core/templates/roadmap.md +202 -0
  123. package/pan-wizard-core/templates/standards.md +24 -0
  124. package/pan-wizard-core/templates/state.md +176 -0
  125. package/pan-wizard-core/templates/summary-complex.md +59 -0
  126. package/pan-wizard-core/templates/summary-minimal.md +41 -0
  127. package/pan-wizard-core/templates/summary-standard.md +49 -0
  128. package/pan-wizard-core/templates/summary.md +249 -0
  129. package/pan-wizard-core/templates/uat.md +247 -0
  130. package/pan-wizard-core/templates/user-setup.md +311 -0
  131. package/pan-wizard-core/templates/validation.md +76 -0
  132. package/pan-wizard-core/templates/verification-report.md +322 -0
  133. package/pan-wizard-core/workflows/add-phase.md +111 -0
  134. package/pan-wizard-core/workflows/assumptions.md +178 -0
  135. package/pan-wizard-core/workflows/diagnose-issues.md +219 -0
  136. package/pan-wizard-core/workflows/discuss-phase.md +542 -0
  137. package/pan-wizard-core/workflows/exec-phase.md +572 -0
  138. package/pan-wizard-core/workflows/execute-plan.md +448 -0
  139. package/pan-wizard-core/workflows/health.md +156 -0
  140. package/pan-wizard-core/workflows/help.md +431 -0
  141. package/pan-wizard-core/workflows/insert-phase.md +129 -0
  142. package/pan-wizard-core/workflows/map-codebase.md +401 -0
  143. package/pan-wizard-core/workflows/milestone-audit.md +297 -0
  144. package/pan-wizard-core/workflows/milestone-cleanup.md +152 -0
  145. package/pan-wizard-core/workflows/milestone-gaps.md +274 -0
  146. package/pan-wizard-core/workflows/milestone-new.md +382 -0
  147. package/pan-wizard-core/workflows/new-project.md +1178 -0
  148. package/pan-wizard-core/workflows/pause.md +122 -0
  149. package/pan-wizard-core/workflows/phase-tests.md +388 -0
  150. package/pan-wizard-core/workflows/plan-phase.md +569 -0
  151. package/pan-wizard-core/workflows/profile.md +115 -0
  152. package/pan-wizard-core/workflows/progress.md +381 -0
  153. package/pan-wizard-core/workflows/quick.md +453 -0
  154. package/pan-wizard-core/workflows/remove-phase.md +154 -0
  155. package/pan-wizard-core/workflows/research-phase.md +73 -0
  156. package/pan-wizard-core/workflows/resume-project.md +306 -0
  157. package/pan-wizard-core/workflows/retro.md +121 -0
  158. package/pan-wizard-core/workflows/settings.md +213 -0
  159. package/pan-wizard-core/workflows/todo-add.md +157 -0
  160. package/pan-wizard-core/workflows/todo-check.md +176 -0
  161. package/pan-wizard-core/workflows/transition.md +544 -0
  162. package/pan-wizard-core/workflows/update.md +219 -0
  163. package/pan-wizard-core/workflows/verify-phase.md +301 -0
  164. package/scripts/build-hooks.js +43 -0
@@ -0,0 +1,431 @@
1
+ <purpose>
2
+ Display the complete PAN command reference. Output ONLY the reference content. Do NOT add project-specific analysis, git status, next-step suggestions, or any commentary beyond the reference.
3
+ </purpose>
4
+
5
+ <reference>
6
+ # PAN Command Reference
7
+
8
+ **PAN** (Project Automation Navigator) — workflow automation for solo agentic development with Claude Code, Copilot CLI, Gemini CLI, Codex, and OpenCode.
9
+
10
+ ---
11
+
12
+ ## Two Workflows — Pick One
13
+
14
+ PAN has two distinct workflows. Pick the one that fits your situation.
15
+
16
+ ### Workflow A: Phase Lifecycle (Greenfield / Milestone-Driven)
17
+
18
+ Best for: new projects, structured milestones, large multi-phase builds.
19
+
20
+ ```
21
+ /pan:new-project # 1. Research, requirements, roadmap
22
+ /clear
23
+ /pan:plan-phase 1 # 2. Create detailed plan for phase 1
24
+ /clear
25
+ /pan:exec-phase 1 # 3. Execute the plan
26
+ /clear
27
+ /pan:verify-phase 1 # 4. Validate the work (optional)
28
+ /clear
29
+ /pan:progress # 5. See status, route to next phase
30
+ ... repeat plan → exec → verify for each phase ...
31
+ /pan:milestone-done 1.0.0 # 6. Archive milestone when complete
32
+ ```
33
+
34
+ ### Workflow B: Focus Commands (Iterative / Brownfield)
35
+
36
+ Best for: existing projects, ongoing maintenance, iterative improvement, batch work sessions.
37
+
38
+ ```
39
+ /pan:focus-scan # 1. SCAN — find all work items, prioritize, score
40
+ /clear
41
+ /pan:focus-plan # 2. PLAN — budget items into a sized batch
42
+ /clear
43
+ /pan:focus-exec # 3. EXEC — implement, test, verify, commit
44
+ /clear
45
+ /pan:focus-sync # 4. SYNC — update docs to match changes
46
+ ```
47
+
48
+ **focus-design** is a standalone command for deep feature investigation:
49
+ ```
50
+ /pan:focus-design "Add webhook support" # Research, design, spec, ADR
51
+ /clear
52
+ /pan:focus-scan # Re-scan to pick up new tasks
53
+ ```
54
+
55
+ ---
56
+
57
+ ## Brownfield Quick-Start (Adding Features to an Existing Project)
58
+
59
+ Already have a codebase? Here's how to get started:
60
+
61
+ | Situation | Command |
62
+ |-----------|---------|
63
+ | Quick one-off fix or small feature | `/pan:quick "add logout button"` |
64
+ | Need to design a feature first | `/pan:focus-design "Add webhook support"` |
65
+ | Find and fix bugs, tech debt, gaps | `/pan:focus-scan` → `plan` → `exec` |
66
+ | Large feature needing multiple phases | `/pan:milestone-new` |
67
+ | Continuous automated improvement | `/pan:focus-auto` |
68
+
69
+ **Most common path — iterative improvement:**
70
+ ```
71
+ /pan:focus-scan # 1. Find work items (bugs, TODOs, gaps, features)
72
+ /clear
73
+ /pan:focus-plan # 2. Budget a batch (--mode features for feature work)
74
+ /clear
75
+ /pan:focus-exec # 3. Implement, test, commit
76
+ /clear
77
+ /pan:focus-sync # 4. Update docs to match
78
+ ```
79
+
80
+ **Design-first path — new feature on existing codebase:**
81
+ ```
82
+ /pan:focus-design "Add webhook support" # Research → spec → ADR
83
+ /clear
84
+ /pan:focus-scan # Picks up tasks from spec
85
+ /clear
86
+ /pan:focus-plan --mode features # Budget toward feature work
87
+ /clear
88
+ /pan:focus-exec # Build it
89
+ ```
90
+
91
+ **Large feature path — structured milestone on existing codebase:**
92
+ ```
93
+ /pan:map-codebase # Optional: help PAN understand your code
94
+ /clear
95
+ /pan:milestone-new # Create requirements + roadmap phases
96
+ /clear
97
+ /pan:plan-phase 1 → /clear → /pan:exec-phase 1 → repeat
98
+ ...
99
+ /pan:milestone-done 1.0.0
100
+ ```
101
+
102
+ ---
103
+
104
+ ## Focus Commands — In Detail
105
+
106
+ The Focus workflow is a **scan → plan → exec → sync** pipeline. Each step feeds the next.
107
+
108
+ ### Step 1: `/pan:focus-scan`
109
+
110
+ **What it does:** Deep-dives into your entire codebase — reads every module, greps for TODOs/FIXMEs, runs tests, checks coverage gaps, reads your roadmap — then produces a prioritized work list.
111
+
112
+ **Priority tiers:** P0 (crashes) → P1 (wrong results) → P2 (test gaps) → P3 (incomplete features) → P4 (new features) → P5 (tooling) → P6 (docs)
113
+
114
+ **Reality Score:** Every P3-P6 item gets scored: `RS = (User Value + Time Criticality + Risk Reduction) / Job Size`. Items below RS 3.0 get deferred, below 1.5 get dropped.
115
+
116
+ **Output:** `.planning/superplan_<date>.md` — the prioritized work list that `/pan:focus-plan` reads.
117
+
118
+ **Flags:**
119
+ - `--quick` — skip strategic analysis and validation phases
120
+ - `--lean` — aggressive RS filtering (drop < 1.5, defer < 3.0)
121
+ - `--focus <area>` — weight items toward a specific area
122
+ - `--refresh` — force re-read all files
123
+
124
+ ### Step 2: `/pan:focus-plan`
125
+
126
+ **What it does:** Reads the scan output and selects a right-sized batch of work items that fits within a point budget. Orders items for maximum impact with minimum risk.
127
+
128
+ **Requires:** A scan from step 1 (runs one automatically if missing).
129
+
130
+ **Modes:**
131
+ | Mode | Budget | Strategy |
132
+ |------|--------|----------|
133
+ | `bugfix` | 40 pts | P0→P1→smallest-first, no features |
134
+ | `balanced` | 50 pts | 60% stability / 40% features (default) |
135
+ | `features` | 50 pts | 80% features, P0 crashes still mandatory |
136
+ | `full` | 60 pts | All priorities equally weighted |
137
+
138
+ **Point system:** XS=1, S=2, M=4, L=10, XL=20 points.
139
+
140
+ **Output:** `.planning/focus/batch-<date>.json` — the execution batch that `/pan:focus-exec` reads.
141
+
142
+ **Flags:**
143
+ - `--mode <mode>` — select execution mode (default: balanced)
144
+ - `--budget N` — override point budget (5-100)
145
+ - `--dry-run` — show what would be selected without writing
146
+ - `--lean` — exclude items with RS < 1.5
147
+
148
+ ### Step 3: `/pan:focus-exec`
149
+
150
+ **What it does:** One-command pipeline that implements every item in the batch. Runs 6 stages automatically:
151
+
152
+ 1. **Session Start** — baseline tests, rollback snapshot
153
+ 2. **Batch Loading** — read and validate the batch file
154
+ 3. **Execution** — implement items tier by tier (MICRO → STANDARD → FULL)
155
+ 4. **Verification** — full test suite, compare against baseline
156
+ 5. **Doc Sync** — update README, CHANGELOG, etc.
157
+ 6. **Session End** — commit, record session summary
158
+
159
+ **Execution tiers:**
160
+ | Tier | Sizes | Test cadence |
161
+ |------|-------|-------------|
162
+ | MICRO | XS, S | Specific test after each item |
163
+ | STANDARD | M | Full test suite after each item |
164
+ | FULL | L, XL | Build + full test suite after each item |
165
+
166
+ **Requires:** A batch from step 2.
167
+
168
+ **Flags:**
169
+ - `--no-commit` — skip the commit step
170
+ - `--continue` — resume a previously interrupted run
171
+ - `--dry-run` — show stages 1-2 only
172
+
173
+ ### Step 4: `/pan:focus-sync`
174
+
175
+ **What it does:** Checks all documentation for staleness and fixes it. Compares actual command counts, module counts, test counts against what docs claim.
176
+
177
+ **Checks:** README, USER-GUIDE, ARCHITECTURE, CLI-REFERENCE, CHANGELOG, command files, agent files.
178
+
179
+ **Flags:**
180
+ - `--readme` — check README only
181
+ - `--commands` — verify command files match implementations
182
+ - `--agents` — verify agent files
183
+ - `--all` — full sync + auto-fix
184
+
185
+ ### Standalone: `/pan:focus-design <description>`
186
+
187
+ **What it does:** Full 10-phase feature investigation pipeline. Not part of the scan→plan→exec flow — use this when you need to design a new feature from scratch.
188
+
189
+ **10 phases:** Problem framing → Internal recon → Competitive intel → Strategic analysis → Architecture → Design synthesis → ADR → Error handling → Security → Implementation roadmap
190
+
191
+ **Modes:**
192
+ | Mode | Phases | Use when |
193
+ |------|--------|----------|
194
+ | `--full` | All 10 (default) | New user-facing features |
195
+ | `--internal` | Skip competitive | Internal tooling, refactors |
196
+ | `--outward` | Skip hardening | Market research, strategic decisions |
197
+ | `--spike` | 4 phases only | Quick proof-of-concept |
198
+
199
+ **Modifiers:** `--gate` (pause after strategy), `--audit` (verify existing impl), `--mvp` (stop at MVP tasks)
200
+
201
+ **Output:** Spec in `docs/specs/`, ADR in `docs/decisions/`
202
+
203
+ ---
204
+
205
+ ## All Commands (37)
206
+
207
+ ### Getting Started
208
+ | Command | Description |
209
+ |---------|-------------|
210
+ | `/pan:new-project` | Initialize new project — research, requirements, roadmap |
211
+ | `/pan:map-codebase` | Analyze existing codebase with parallel agents |
212
+
213
+ ### Phase Lifecycle
214
+ | Command | Description |
215
+ |---------|-------------|
216
+ | `/pan:discuss-phase <N>` | Shape implementation through targeted questions |
217
+ | `/pan:plan-phase <N>` | Research + plan a phase with verification |
218
+ | `/pan:exec-phase <N>` | Execute plans with wave-based parallelization |
219
+ | `/pan:research-phase <N>` | Deep ecosystem research for specialized domains |
220
+ | `/pan:verify-phase <N>` | Validate built features through UAT |
221
+
222
+ ### Phase Management
223
+ | Command | Description |
224
+ |---------|-------------|
225
+ | `/pan:add-phase <desc>` | Append new phase to roadmap |
226
+ | `/pan:insert-phase <N> <desc>` | Insert urgent work between phases |
227
+ | `/pan:remove-phase <N>` | Remove phase and renumber |
228
+ | `/pan:assumptions <N>` | Surface approach assumptions before planning |
229
+ | `/pan:phase-tests <N>` | Generate tests for completed phase |
230
+ | `/pan:phase-budget` | Estimate context utilization for current phase |
231
+
232
+ ### Session & Progress
233
+ | Command | Description |
234
+ |---------|-------------|
235
+ | `/pan:progress` | Check status and route to next action |
236
+ | `/pan:quick <desc>` | Fast-path execution (skip optional agents) |
237
+ | `/pan:pause` | Save context for later resumption |
238
+ | `/pan:resume` | Restore previous session context |
239
+ | `/pan:profile <name>` | Switch model profile (quality/balanced/budget) |
240
+
241
+ ### Milestone
242
+ | Command | Description |
243
+ |---------|-------------|
244
+ | `/pan:milestone-new` | Start a new milestone cycle |
245
+ | `/pan:milestone-done <v>` | Archive completed milestone |
246
+ | `/pan:milestone-audit` | Audit completion against intent |
247
+ | `/pan:milestone-gaps` | Create phases to close audit gaps |
248
+ | `/pan:milestone-cleanup` | Archive accumulated phase directories |
249
+ | `/pan:retro` | Milestone retrospective — estimation & verification analysis |
250
+
251
+ ### Focus (Strategic Project Management)
252
+ | Command | Description |
253
+ |---------|-------------|
254
+ | `/pan:focus-scan` | Step 1: Find and prioritize all work items |
255
+ | `/pan:focus-plan` | Step 2: Budget items into an execution batch |
256
+ | `/pan:focus-exec` | Step 3: Implement, test, verify, commit |
257
+ | `/pan:focus-sync` | Step 4: Synchronize documentation after changes |
258
+ | `/pan:focus-design <desc>` | Standalone: Deep feature investigation and spec |
259
+
260
+ ### System
261
+ | Command | Description |
262
+ |---------|-------------|
263
+ | `/pan:help` | Show this reference |
264
+ | `/pan:health` | Diagnose planning directory integrity |
265
+ | `/pan:settings` | Configure workflow toggles |
266
+ | `/pan:update` | Update PAN to latest version |
267
+ | `/pan:debug` | Systematic debugging with persistent state |
268
+ | `/pan:todo-add` | Capture idea as todo |
269
+ | `/pan:todo-check` | List and select pending todos |
270
+
271
+ ### Community
272
+ | Command | Description |
273
+ |---------|-------------|
274
+ | `/pan:discord` | Join the PAN Discord community |
275
+ | `/pan:patches` | Reapply local modifications after update |
276
+
277
+ ---
278
+
279
+ ## Common Patterns
280
+
281
+ **New project from scratch:**
282
+ ```
283
+ /pan:new-project → /clear → /pan:plan-phase 1 → /clear → /pan:exec-phase 1 → repeat
284
+ ```
285
+
286
+ **Existing project, iterative work:**
287
+ ```
288
+ /pan:focus-scan → /clear → /pan:focus-plan → /clear → /pan:focus-exec → /clear → /pan:focus-sync
289
+ ```
290
+
291
+ **Design a feature, then build it:**
292
+ ```
293
+ /pan:focus-design "feature" → /clear → /pan:focus-scan → /clear → /pan:focus-plan → /clear → /pan:focus-exec
294
+ ```
295
+
296
+ **Resume after a break:**
297
+ ```
298
+ /pan:progress # See where you left off
299
+ /pan:resume # Full context restoration
300
+ ```
301
+
302
+ **Quick ad-hoc task:**
303
+ ```
304
+ /pan:quick "fix the login button"
305
+ ```
306
+
307
+ **Insert urgent work mid-milestone:**
308
+ ```
309
+ /pan:insert-phase 5 "Critical security fix" → /pan:plan-phase 5.1 → /pan:exec-phase 5.1
310
+ ```
311
+
312
+ **Complete a milestone:**
313
+ ```
314
+ /pan:milestone-audit → /pan:milestone-gaps → ... fix gaps ... → /pan:milestone-done 1.0.0
315
+ ```
316
+
317
+ **Debug an issue (survives /clear):**
318
+ ```
319
+ /pan:debug "form submission fails" → ... investigate ... → /clear → /pan:debug
320
+ ```
321
+
322
+ ---
323
+
324
+ ## Phase Lifecycle — Detail
325
+
326
+ **`/pan:new-project`** — One command: deep questioning → optional domain research (4 parallel agents) → requirements → roadmap. Creates `.planning/` with project.md, roadmap.md, state.md, config.json, requirements.md.
327
+
328
+ **`/pan:map-codebase`** — Analyze existing codebase before `/pan:new-project`. Creates `.planning/codebase/` with 7 documents (stack, architecture, structure, conventions, testing, integrations, concerns).
329
+
330
+ **`/pan:discuss-phase <N>`** — Capture your vision for a phase before planning. Creates context.md.
331
+
332
+ **`/pan:research-phase <N>`** — Deep ecosystem research for specialized domains (3D, ML, audio, etc.). Creates research.md.
333
+
334
+ **`/pan:assumptions <N>`** — See Claude's intended approach before it starts. Conversational only, no files created.
335
+
336
+ **`/pan:plan-phase <N>`** — Create execution plan. Generates `XX-YY-plan.md` with concrete tasks. Pass `--prd path/to/requirements.md` to skip discuss-phase.
337
+
338
+ **`/pan:exec-phase <N>`** — Execute all plans in a phase. Groups by wave, runs waves sequentially, plans within each wave in parallel.
339
+
340
+ **`/pan:verify-phase <N>`** — Conversational UAT. Presents tests one at a time, diagnoses failures, creates fix plans.
341
+
342
+ **`/pan:quick <desc>`** — Small tasks with PAN guarantees but shorter path. Skips researcher, checker, verifier. Lives in `.planning/quick/`.
343
+
344
+ ---
345
+
346
+ ## Milestone Management — Detail
347
+
348
+ **`/pan:milestone-new`** — Start new milestone. Mirrors `/pan:new-project` flow for brownfield projects.
349
+
350
+ **`/pan:milestone-done <version>`** — Archive completed milestone. Creates milestones.md entry, git tag, archives to `milestones/` directory.
351
+
352
+ **`/pan:milestone-audit`** — Reads verification.md files, checks requirements coverage, spawns integration checker. Creates milestone-audit.md.
353
+
354
+ **`/pan:milestone-gaps`** — Reads audit, groups gaps into phases, adds to roadmap.md.
355
+
356
+ **`/pan:milestone-cleanup`** — Moves completed phase directories to `milestones/v{X.Y}-phases/`.
357
+
358
+ **`/pan:retro`** — Milestone retrospective. Analyzes estimation accuracy, verification patterns, and common gap types. Run after `/pan:milestone-done` to reflect before the next milestone.
359
+
360
+ ---
361
+
362
+ ## Session & Debugging — Detail
363
+
364
+ **`/pan:progress`** — Visual progress bar, completion %, recent work summary, next action routing. Detects 100% milestone completion.
365
+
366
+ **`/pan:resume`** — Reads state.md, shows current position, offers next actions.
367
+
368
+ **`/pan:pause`** — Creates `.continue-here` file, updates state.md session continuity.
369
+
370
+ **`/pan:debug [description]`** — Scientific method debugging with persistent state in `.planning/debug/`. Survives `/clear` — run `/pan:debug` with no args to resume.
371
+
372
+ **`/pan:todo-add [desc]`** — Capture from conversation or explicit description. Creates structured todo in `.planning/todos/pending/`.
373
+
374
+ **`/pan:todo-check [area]`** — List pending todos, select one, route to action (work now, add to phase, brainstorm).
375
+
376
+ ---
377
+
378
+ ## Configuration
379
+
380
+ **`/pan:settings`** — Toggle researcher, plan checker, verifier agents. Select model profile.
381
+
382
+ **`/pan:profile <name>`** — Quick profile switch: `quality` (Opus everywhere), `balanced` (Opus plan + Sonnet exec, default), `budget` (Sonnet + Haiku).
383
+
384
+ **Planning config** (`.planning/config.json`):
385
+ - `commit_docs: true` — commit planning artifacts to git (set `false` + add `.planning/` to `.gitignore` for private planning)
386
+ - `search_gitignored: false` — add `--no-ignore` to ripgrep when `.planning/` is gitignored
387
+
388
+ ---
389
+
390
+ ## Files & Structure
391
+
392
+ ```
393
+ .planning/
394
+ ├── project.md # Project vision
395
+ ├── roadmap.md # Current phase breakdown
396
+ ├── state.md # Project memory & context
397
+ ├── requirements.md # Scoped requirements with REQ-IDs
398
+ ├── config.json # Workflow & gate configuration
399
+ ├── focus/ # Focus batch files
400
+ │ └── batch-YYYY-MM-DD.json
401
+ ├── superplan_*.md # Focus scan output
402
+ ├── todos/
403
+ │ ├── pending/ # Todos waiting
404
+ │ └── done/ # Completed todos
405
+ ├── debug/ # Active debug sessions
406
+ │ └── resolved/ # Archived resolved issues
407
+ ├── milestones/ # Archived milestones
408
+ ├── codebase/ # Codebase map (brownfield)
409
+ └── phases/ # Phase plans and summaries
410
+ └── NN-phase-name/
411
+ ├── NN-YY-plan.md
412
+ └── NN-YY-summary.md
413
+ ```
414
+
415
+ ---
416
+
417
+ ## Staying Updated
418
+
419
+ ```bash
420
+ npx pan-wizard@latest
421
+ ```
422
+
423
+ Run `/pan:update` for version comparison and changelog preview before updating.
424
+
425
+ ## Getting Help
426
+
427
+ - `/pan:progress` — see where you're at
428
+ - `.planning/state.md` — current project context
429
+ - `.planning/roadmap.md` — phase status
430
+ - `/pan:discord` — community support
431
+ </reference>
@@ -0,0 +1,129 @@
1
+ <purpose>
2
+ Insert a decimal phase for urgent work discovered mid-milestone between existing integer phases. Uses decimal numbering (72.1, 72.2, etc.) to preserve the logical sequence of planned phases while accommodating urgent insertions without renumbering the entire roadmap.
3
+ </purpose>
4
+
5
+ <required_reading>
6
+ Read all files referenced by the invoking prompt's execution_context before starting.
7
+ </required_reading>
8
+
9
+ <process>
10
+
11
+ <step name="parse_arguments">
12
+ Parse the command arguments:
13
+ - First argument: integer phase number to insert after
14
+ - Remaining arguments: phase description
15
+
16
+ Example: `/pan:insert-phase 72 Fix critical auth bug`
17
+ -> after = 72
18
+ -> description = "Fix critical auth bug"
19
+
20
+ If arguments missing:
21
+
22
+ ```
23
+ ERROR: Both phase number and description required
24
+ Usage: /pan:insert-phase <after> <description>
25
+ Example: /pan:insert-phase 72 Fix critical auth bug
26
+ ```
27
+
28
+ Exit.
29
+
30
+ Validate first argument is an integer.
31
+ </step>
32
+
33
+ <step name="init_context">
34
+ Load phase operation context:
35
+
36
+ ```bash
37
+ INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init phase-op "${after_phase}")
38
+ ```
39
+
40
+ Check `roadmap_exists` from init JSON. If false:
41
+ ```
42
+ ERROR: No roadmap found (.planning/roadmap.md)
43
+ ```
44
+ Exit.
45
+ </step>
46
+
47
+ <step name="insert_phase">
48
+ **Delegate the phase insertion to pan-tools:**
49
+
50
+ ```bash
51
+ RESULT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs phase insert "${after_phase}" "${description}")
52
+ ```
53
+
54
+ The CLI handles:
55
+ - Verifying target phase exists in roadmap.md
56
+ - Calculating next decimal phase number (checking existing decimals on disk)
57
+ - Generating slug from description
58
+ - Creating the phase directory (`.planning/phases/{N.M}-{slug}/`)
59
+ - Inserting the phase entry into roadmap.md after the target phase with (INSERTED) marker
60
+
61
+ Extract from result: `phase_number`, `after_phase`, `name`, `slug`, `directory`.
62
+ </step>
63
+
64
+ <step name="update_project_state">
65
+ Update state.md to reflect the inserted phase:
66
+
67
+ 1. Read `.planning/state.md`
68
+ 2. Under "## Accumulated Context" → "### Roadmap Evolution" add entry:
69
+ ```
70
+ - Phase {decimal_phase} inserted after Phase {after_phase}: {description} (URGENT)
71
+ ```
72
+
73
+ If "Roadmap Evolution" section doesn't exist, create it.
74
+ </step>
75
+
76
+ <step name="completion">
77
+ Present completion summary:
78
+
79
+ ```
80
+ Phase {decimal_phase} inserted after Phase {after_phase}:
81
+ - Description: {description}
82
+ - Directory: .planning/phases/{decimal-phase}-{slug}/
83
+ - Status: Not planned yet
84
+ - Marker: (INSERTED) - indicates urgent work
85
+
86
+ Roadmap updated: .planning/roadmap.md
87
+ Project state updated: .planning/state.md
88
+
89
+ ---
90
+
91
+ ## Next Up
92
+
93
+ **Phase {decimal_phase}: {description}** -- urgent insertion
94
+
95
+ `/pan:plan-phase {decimal_phase}`
96
+
97
+ <sub>`/clear` first -> fresh context window</sub>
98
+
99
+ ---
100
+
101
+ **Also available:**
102
+ - Review insertion impact: Check if Phase {next_integer} dependencies still make sense
103
+ - Review roadmap
104
+
105
+ ---
106
+ ```
107
+ </step>
108
+
109
+ </process>
110
+
111
+ <anti_patterns>
112
+
113
+ - Don't use this for planned work at end of milestone (use /pan:add-phase)
114
+ - Don't insert before Phase 1 (decimal 0.1 makes no sense)
115
+ - Don't renumber existing phases
116
+ - Don't modify the target phase content
117
+ - Don't create plans yet (that's /pan:plan-phase)
118
+ - Don't commit changes (user decides when to commit)
119
+ </anti_patterns>
120
+
121
+ <success_criteria>
122
+ Phase insertion is complete when:
123
+
124
+ - [ ] `pan-tools phase insert` executed successfully
125
+ - [ ] Phase directory created
126
+ - [ ] Roadmap updated with new phase entry (includes "(INSERTED)" marker)
127
+ - [ ] state.md updated with roadmap evolution note
128
+ - [ ] User informed of next steps and dependency implications
129
+ </success_criteria>