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,593 @@
1
+ # Phase Prompt Template
2
+
3
+ > **Note:** Planning methodology is in `agents/pan-planner.md`.
4
+ > This template defines the plan.md output format that the agent produces.
5
+
6
+ Template for `.planning/phases/XX-name/{phase}-{plan}-plan.md` - executable phase plans optimized for parallel execution.
7
+
8
+ **Naming:** Use `{phase}-{plan}-plan.md` format (e.g., `01-02-plan.md` for Phase 1, Plan 2)
9
+
10
+ ---
11
+
12
+ ## File Template
13
+
14
+ ```markdown
15
+ ---
16
+ phase: XX-name
17
+ plan: NN
18
+ type: execute
19
+ wave: N # Execution wave (1, 2, 3...). Pre-computed at plan time.
20
+ depends_on: [] # Plan IDs this plan requires (e.g., ["01-01"]).
21
+ files_modified: [] # Files this plan modifies.
22
+ autonomous: true # false if plan has checkpoints requiring user interaction
23
+ requirements: [] # REQUIRED — Requirement IDs from ROADMAP this plan addresses. MUST NOT be empty.
24
+ user_setup: [] # Human-required setup Claude cannot automate (see below)
25
+
26
+ # Goal-backward verification (derived during planning, verified after execution)
27
+ must_haves:
28
+ truths: [] # Observable behaviors that must be true for goal achievement
29
+ artifacts: [] # Files that must exist with real implementation
30
+ key_links: [] # Critical connections between artifacts
31
+ ---
32
+
33
+ <objective>
34
+ [What this plan accomplishes]
35
+
36
+ Purpose: [Why this matters for the project]
37
+ Output: [What artifacts will be created]
38
+ </objective>
39
+
40
+ <execution_context>
41
+ @~/.claude/pan-wizard-core/workflows/execute-plan.md
42
+ @~/.claude/pan-wizard-core/templates/summary.md
43
+ [If plan contains checkpoint tasks (type="checkpoint:*"), add:]
44
+ @~/.claude/pan-wizard-core/references/checkpoints.md
45
+ </execution_context>
46
+
47
+ <context>
48
+ @.planning/project.md
49
+ @.planning/roadmap.md
50
+ @.planning/state.md
51
+
52
+ # Only reference prior plan SUMMARYs if genuinely needed:
53
+ # - This plan uses types/exports from prior plan
54
+ # - Prior plan made decision that affects this plan
55
+ # Do NOT reflexively chain: Plan 02 refs 01, Plan 03 refs 02...
56
+
57
+ [Relevant source files:]
58
+ @src/path/to/relevant.ts
59
+ </context>
60
+
61
+ <tasks>
62
+
63
+ <task type="auto">
64
+ <name>Task 1: [Action-oriented name]</name>
65
+ <files>path/to/file.ext, another/file.ext</files>
66
+ <action>[Specific implementation - what to do, how to do it, what to avoid and WHY]</action>
67
+ <verify>[Command or check to prove it worked]</verify>
68
+ <done>[Measurable acceptance criteria]</done>
69
+ </task>
70
+
71
+ <task type="auto">
72
+ <name>Task 2: [Action-oriented name]</name>
73
+ <files>path/to/file.ext</files>
74
+ <action>[Specific implementation]</action>
75
+ <verify>[Command or check]</verify>
76
+ <done>[Acceptance criteria]</done>
77
+ </task>
78
+
79
+ <!-- For checkpoint task examples and patterns, see @~/.claude/pan-wizard-core/references/checkpoints.md -->
80
+ <!-- Key rule: Claude starts dev server BEFORE human-verify checkpoints. User only visits URLs. -->
81
+
82
+ <task type="checkpoint:decision" gate="blocking">
83
+ <decision>[What needs deciding]</decision>
84
+ <context>[Why this decision matters]</context>
85
+ <options>
86
+ <option id="option-a"><name>[Name]</name><pros>[Benefits]</pros><cons>[Tradeoffs]</cons></option>
87
+ <option id="option-b"><name>[Name]</name><pros>[Benefits]</pros><cons>[Tradeoffs]</cons></option>
88
+ </options>
89
+ <resume-signal>Select: option-a or option-b</resume-signal>
90
+ </task>
91
+
92
+ <task type="checkpoint:human-verify" gate="blocking">
93
+ <what-built>[What Claude built] - server running at [URL]</what-built>
94
+ <how-to-verify>Visit [URL] and verify: [visual checks only, NO CLI commands]</how-to-verify>
95
+ <resume-signal>Type "approved" or describe issues</resume-signal>
96
+ </task>
97
+
98
+ </tasks>
99
+
100
+ <verification>
101
+ Before declaring plan complete:
102
+ - [ ] [Specific test command]
103
+ - [ ] [Build/type check passes]
104
+ - [ ] [Behavior verification]
105
+ </verification>
106
+
107
+ <success_criteria>
108
+
109
+ - All tasks completed
110
+ - All verification checks pass
111
+ - No errors or warnings introduced
112
+ - [Plan-specific criteria]
113
+ </success_criteria>
114
+
115
+ <output>
116
+ After completion, create `.planning/phases/XX-name/{phase}-{plan}-summary.md`
117
+ </output>
118
+ ```
119
+
120
+ ---
121
+
122
+ ## Frontmatter Fields
123
+
124
+ | Field | Required | Purpose |
125
+ |-------|----------|---------|
126
+ | `phase` | Yes | Phase identifier (e.g., `01-foundation`) |
127
+ | `plan` | Yes | Plan number within phase (e.g., `01`, `02`) |
128
+ | `type` | Yes | Always `execute` for standard plans, `tdd` for TDD plans |
129
+ | `wave` | Yes | Execution wave number (1, 2, 3...). Pre-computed at plan time. |
130
+ | `depends_on` | Yes | Array of plan IDs this plan requires. |
131
+ | `files_modified` | Yes | Files this plan touches. |
132
+ | `autonomous` | Yes | `true` if no checkpoints, `false` if has checkpoints |
133
+ | `requirements` | Yes | **MUST** list requirement IDs from ROADMAP. Every roadmap requirement MUST appear in at least one plan. |
134
+ | `user_setup` | No | Array of human-required setup items (external services) |
135
+ | `must_haves` | Yes | Goal-backward verification criteria (see below) |
136
+
137
+ **Wave is pre-computed:** Wave numbers are assigned during `/pan:plan-phase`. Execute-phase reads `wave` directly from frontmatter and groups plans by wave number. No runtime dependency analysis needed.
138
+
139
+ **Must-haves enable verification:** The `must_haves` field carries goal-backward requirements from planning to execution. After all plans complete, execute-phase spawns a verification subagent that checks these criteria against the actual codebase.
140
+
141
+ ---
142
+
143
+ ## Parallel vs Sequential
144
+
145
+ <parallel_examples>
146
+
147
+ **Wave 1 candidates (parallel):**
148
+
149
+ ```yaml
150
+ # Plan 01 - User feature
151
+ wave: 1
152
+ depends_on: []
153
+ files_modified: [src/models/user.ts, src/api/users.ts]
154
+ autonomous: true
155
+
156
+ # Plan 02 - Product feature (no overlap with Plan 01)
157
+ wave: 1
158
+ depends_on: []
159
+ files_modified: [src/models/product.ts, src/api/products.ts]
160
+ autonomous: true
161
+
162
+ # Plan 03 - Order feature (no overlap)
163
+ wave: 1
164
+ depends_on: []
165
+ files_modified: [src/models/order.ts, src/api/orders.ts]
166
+ autonomous: true
167
+ ```
168
+
169
+ All three run in parallel (Wave 1) - no dependencies, no file conflicts.
170
+
171
+ **Sequential (genuine dependency):**
172
+
173
+ ```yaml
174
+ # Plan 01 - Auth foundation
175
+ wave: 1
176
+ depends_on: []
177
+ files_modified: [src/lib/auth.ts, src/middleware/auth.ts]
178
+ autonomous: true
179
+
180
+ # Plan 02 - Protected features (needs auth)
181
+ wave: 2
182
+ depends_on: ["01"]
183
+ files_modified: [src/features/dashboard.ts]
184
+ autonomous: true
185
+ ```
186
+
187
+ Plan 02 in Wave 2 waits for Plan 01 in Wave 1 - genuine dependency on auth types/middleware.
188
+
189
+ **Checkpoint plan:**
190
+
191
+ ```yaml
192
+ # Plan 03 - UI with verification
193
+ wave: 3
194
+ depends_on: ["01", "02"]
195
+ files_modified: [src/components/Dashboard.tsx]
196
+ autonomous: false # Has checkpoint:human-verify
197
+ ```
198
+
199
+ Wave 3 runs after Waves 1 and 2. Pauses at checkpoint, orchestrator presents to user, resumes on approval.
200
+
201
+ </parallel_examples>
202
+
203
+ ---
204
+
205
+ ## Context Section
206
+
207
+ **Parallel-aware context:**
208
+
209
+ ```markdown
210
+ <context>
211
+ @.planning/project.md
212
+ @.planning/roadmap.md
213
+ @.planning/state.md
214
+
215
+ # Only include SUMMARY refs if genuinely needed:
216
+ # - This plan imports types from prior plan
217
+ # - Prior plan made decision affecting this plan
218
+ # - Prior plan's output is input to this plan
219
+ #
220
+ # Independent plans need NO prior SUMMARY references.
221
+ # Do NOT reflexively chain: 02 refs 01, 03 refs 02...
222
+
223
+ @src/relevant/source.ts
224
+ </context>
225
+ ```
226
+
227
+ **Bad pattern (creates false dependencies):**
228
+ ```markdown
229
+ <context>
230
+ @.planning/phases/03-features/03-01-summary.md # Just because it's earlier
231
+ @.planning/phases/03-features/03-02-summary.md # Reflexive chaining
232
+ </context>
233
+ ```
234
+
235
+ ---
236
+
237
+ ## Scope Guidance
238
+
239
+ **Plan sizing:**
240
+
241
+ - 2-3 tasks per plan
242
+ - ~50% context usage maximum
243
+ - Complex phases: Multiple focused plans, not one large plan
244
+
245
+ **When to split:**
246
+
247
+ - Different subsystems (auth vs API vs UI)
248
+ - >3 tasks
249
+ - Risk of context overflow
250
+ - TDD candidates - separate plans
251
+
252
+ **Vertical slices preferred:**
253
+
254
+ ```
255
+ PREFER: Plan 01 = User (model + API + UI)
256
+ Plan 02 = Product (model + API + UI)
257
+
258
+ AVOID: Plan 01 = All models
259
+ Plan 02 = All APIs
260
+ Plan 03 = All UIs
261
+ ```
262
+
263
+ ---
264
+
265
+ ## TDD Plans
266
+
267
+ TDD features get dedicated plans with `type: tdd`.
268
+
269
+ **Heuristic:** Can you write `expect(fn(input)).toBe(output)` before writing `fn`?
270
+ → Yes: Create a TDD plan
271
+ → No: Standard task in standard plan
272
+
273
+ See `~/.claude/pan-wizard-core/references/tdd.md` for TDD plan structure.
274
+
275
+ ---
276
+
277
+ ## Task Types
278
+
279
+ | Type | Use For | Autonomy |
280
+ |------|---------|----------|
281
+ | `auto` | Everything Claude can do independently | Fully autonomous |
282
+ | `checkpoint:human-verify` | Visual/functional verification | Pauses, returns to orchestrator |
283
+ | `checkpoint:decision` | Implementation choices | Pauses, returns to orchestrator |
284
+ | `checkpoint:human-action` | Truly unavoidable manual steps (rare) | Pauses, returns to orchestrator |
285
+
286
+ **Checkpoint behavior in parallel execution:**
287
+ - Plan runs until checkpoint
288
+ - Agent returns with checkpoint details + agent_id
289
+ - Orchestrator presents to user
290
+ - User responds
291
+ - Orchestrator resumes agent with `resume: agent_id`
292
+
293
+ ---
294
+
295
+ ## Examples
296
+
297
+ **Autonomous parallel plan:**
298
+
299
+ ```markdown
300
+ ---
301
+ phase: 03-features
302
+ plan: 01
303
+ type: execute
304
+ wave: 1
305
+ depends_on: []
306
+ files_modified: [src/features/user/model.ts, src/features/user/api.ts, src/features/user/UserList.tsx]
307
+ autonomous: true
308
+ ---
309
+
310
+ <objective>
311
+ Implement complete User feature as vertical slice.
312
+
313
+ Purpose: Self-contained user management that can run parallel to other features.
314
+ Output: User model, API endpoints, and UI components.
315
+ </objective>
316
+
317
+ <context>
318
+ @.planning/project.md
319
+ @.planning/roadmap.md
320
+ @.planning/state.md
321
+ </context>
322
+
323
+ <tasks>
324
+ <task type="auto">
325
+ <name>Task 1: Create User model</name>
326
+ <files>src/features/user/model.ts</files>
327
+ <action>Define User type with id, email, name, createdAt. Export TypeScript interface.</action>
328
+ <verify>tsc --noEmit passes</verify>
329
+ <done>User type exported and usable</done>
330
+ </task>
331
+
332
+ <task type="auto">
333
+ <name>Task 2: Create User API endpoints</name>
334
+ <files>src/features/user/api.ts</files>
335
+ <action>GET /users (list), GET /users/:id (single), POST /users (create). Use User type from model.</action>
336
+ <verify>curl tests pass for all endpoints</verify>
337
+ <done>All CRUD operations work</done>
338
+ </task>
339
+ </tasks>
340
+
341
+ <verification>
342
+ - [ ] npm run build succeeds
343
+ - [ ] API endpoints respond correctly
344
+ </verification>
345
+
346
+ <success_criteria>
347
+ - All tasks completed
348
+ - User feature works end-to-end
349
+ </success_criteria>
350
+
351
+ <output>
352
+ After completion, create `.planning/phases/03-features/03-01-summary.md`
353
+ </output>
354
+ ```
355
+
356
+ **Plan with checkpoint (non-autonomous):**
357
+
358
+ ```markdown
359
+ ---
360
+ phase: 03-features
361
+ plan: 03
362
+ type: execute
363
+ wave: 2
364
+ depends_on: ["03-01", "03-02"]
365
+ files_modified: [src/components/Dashboard.tsx]
366
+ autonomous: false
367
+ ---
368
+
369
+ <objective>
370
+ Build dashboard with visual verification.
371
+
372
+ Purpose: Integrate user and product features into unified view.
373
+ Output: Working dashboard component.
374
+ </objective>
375
+
376
+ <execution_context>
377
+ @~/.claude/pan-wizard-core/workflows/execute-plan.md
378
+ @~/.claude/pan-wizard-core/templates/summary.md
379
+ @~/.claude/pan-wizard-core/references/checkpoints.md
380
+ </execution_context>
381
+
382
+ <context>
383
+ @.planning/project.md
384
+ @.planning/roadmap.md
385
+ @.planning/phases/03-features/03-01-summary.md
386
+ @.planning/phases/03-features/03-02-summary.md
387
+ </context>
388
+
389
+ <tasks>
390
+ <task type="auto">
391
+ <name>Task 1: Build Dashboard layout</name>
392
+ <files>src/components/Dashboard.tsx</files>
393
+ <action>Create responsive grid with UserList and ProductList components. Use Tailwind for styling.</action>
394
+ <verify>npm run build succeeds</verify>
395
+ <done>Dashboard renders without errors</done>
396
+ </task>
397
+
398
+ <!-- Checkpoint pattern: Claude starts server, user visits URL. See checkpoints.md for full patterns. -->
399
+ <task type="auto">
400
+ <name>Start dev server</name>
401
+ <action>Run `npm run dev` in background, wait for ready</action>
402
+ <verify>curl localhost:3000 returns 200</verify>
403
+ </task>
404
+
405
+ <task type="checkpoint:human-verify" gate="blocking">
406
+ <what-built>Dashboard - server at http://localhost:3000</what-built>
407
+ <how-to-verify>Visit localhost:3000/dashboard. Check: desktop grid, mobile stack, no scroll issues.</how-to-verify>
408
+ <resume-signal>Type "approved" or describe issues</resume-signal>
409
+ </task>
410
+ </tasks>
411
+
412
+ <verification>
413
+ - [ ] npm run build succeeds
414
+ - [ ] Visual verification passed
415
+ </verification>
416
+
417
+ <success_criteria>
418
+ - All tasks completed
419
+ - User approved visual layout
420
+ </success_criteria>
421
+
422
+ <output>
423
+ After completion, create `.planning/phases/03-features/03-03-summary.md`
424
+ </output>
425
+ ```
426
+
427
+ ---
428
+
429
+ ## Anti-Patterns
430
+
431
+ **Bad: Reflexive dependency chaining**
432
+ ```yaml
433
+ depends_on: ["03-01"] # Just because 01 comes before 02
434
+ ```
435
+
436
+ **Bad: Horizontal layer grouping**
437
+ ```
438
+ Plan 01: All models
439
+ Plan 02: All APIs (depends on 01)
440
+ Plan 03: All UIs (depends on 02)
441
+ ```
442
+
443
+ **Bad: Missing autonomy flag**
444
+ ```yaml
445
+ # Has checkpoint but no autonomous: false
446
+ depends_on: []
447
+ files_modified: [...]
448
+ # autonomous: ??? <- Missing!
449
+ ```
450
+
451
+ **Bad: Vague tasks**
452
+ ```xml
453
+ <task type="auto">
454
+ <name>Set up authentication</name>
455
+ <action>Add auth to the app</action>
456
+ </task>
457
+ ```
458
+
459
+ ---
460
+
461
+ ## Guidelines
462
+
463
+ - Always use XML structure for Claude parsing
464
+ - Include `wave`, `depends_on`, `files_modified`, `autonomous` in every plan
465
+ - Prefer vertical slices over horizontal layers
466
+ - Only reference prior SUMMARYs when genuinely needed
467
+ - Group checkpoints with related auto tasks in same plan
468
+ - 2-3 tasks per plan, ~50% context max
469
+
470
+ ---
471
+
472
+ ## User Setup (External Services)
473
+
474
+ When a plan introduces external services requiring human configuration, declare in frontmatter:
475
+
476
+ ```yaml
477
+ user_setup:
478
+ - service: stripe
479
+ why: "Payment processing requires API keys"
480
+ env_vars:
481
+ - name: STRIPE_SECRET_KEY
482
+ source: "Stripe Dashboard → Developers → API keys → Secret key"
483
+ - name: STRIPE_WEBHOOK_SECRET
484
+ source: "Stripe Dashboard → Developers → Webhooks → Signing secret"
485
+ dashboard_config:
486
+ - task: "Create webhook endpoint"
487
+ location: "Stripe Dashboard → Developers → Webhooks → Add endpoint"
488
+ details: "URL: https://[your-domain]/api/webhooks/stripe"
489
+ local_dev:
490
+ - "stripe listen --forward-to localhost:3000/api/webhooks/stripe"
491
+ ```
492
+
493
+ **The automation-first rule:** `user_setup` contains ONLY what Claude literally cannot do:
494
+ - Account creation (requires human signup)
495
+ - Secret retrieval (requires dashboard access)
496
+ - Dashboard configuration (requires human in browser)
497
+
498
+ **NOT included:** Package installs, code changes, file creation, CLI commands Claude can run.
499
+
500
+ **Result:** Execute-plan generates `{phase}-USER-SETUP.md` with checklist for the user.
501
+
502
+ See `~/.claude/pan-wizard-core/templates/user-setup.md` for full schema and examples
503
+
504
+ ---
505
+
506
+ ## Must-Haves (Goal-Backward Verification)
507
+
508
+ The `must_haves` field defines what must be TRUE for the phase goal to be achieved. Derived during planning, verified after execution.
509
+
510
+ **Structure:**
511
+
512
+ ```yaml
513
+ must_haves:
514
+ truths:
515
+ - "User can see existing messages"
516
+ - "User can send a message"
517
+ - "Messages persist across refresh"
518
+ artifacts:
519
+ - path: "src/components/Chat.tsx"
520
+ provides: "Message list rendering"
521
+ min_lines: 30
522
+ - path: "src/app/api/chat/route.ts"
523
+ provides: "Message CRUD operations"
524
+ exports: ["GET", "POST"]
525
+ - path: "prisma/schema.prisma"
526
+ provides: "Message model"
527
+ contains: "model Message"
528
+ key_links:
529
+ - from: "src/components/Chat.tsx"
530
+ to: "/api/chat"
531
+ via: "fetch in useEffect"
532
+ pattern: "fetch.*api/chat"
533
+ - from: "src/app/api/chat/route.ts"
534
+ to: "prisma.message"
535
+ via: "database query"
536
+ pattern: "prisma\\.message\\.(find|create)"
537
+ ```
538
+
539
+ **Field descriptions:**
540
+
541
+ | Field | Purpose |
542
+ |-------|---------|
543
+ | `truths` | Observable behaviors from user perspective. Each must be testable. |
544
+ | `artifacts` | Files that must exist with real implementation. |
545
+ | `artifacts[].path` | File path relative to project root. |
546
+ | `artifacts[].provides` | What this artifact delivers. |
547
+ | `artifacts[].min_lines` | Optional. Minimum lines to be considered substantive. |
548
+ | `artifacts[].exports` | Optional. Expected exports to verify. |
549
+ | `artifacts[].contains` | Optional. Pattern that must exist in file. |
550
+ | `key_links` | Critical connections between artifacts. |
551
+ | `key_links[].from` | Source artifact. |
552
+ | `key_links[].to` | Target artifact or endpoint. |
553
+ | `key_links[].via` | How they connect (description). |
554
+ | `key_links[].pattern` | Optional. Regex to verify connection exists. |
555
+
556
+ ### Test Tier Strategy
557
+
558
+ Every plan MUST include a Test Tier Strategy table classifying each truth by minimum test tier:
559
+
560
+ ```markdown
561
+ | Truth / Criterion | Minimum Tier | Infrastructure | Rationale |
562
+ |---|---|---|---|
563
+ | User can connect to SQL Server | T2: Integration | Docker: mssql:2022 | Requires real TCP connection |
564
+ | CLI outputs JSON format | T3: E2E | Docker + built binary | Observable behavior |
565
+ | csv_field escapes commas | T1: Unit | None | Pure function |
566
+ ```
567
+
568
+ **Tier Key:**
569
+ - T1: Unit — pure functions, data structures (no infrastructure)
570
+ - T2: Integration — code + external service (Docker container required)
571
+ - T3: E2E — full CLI/UI end-to-end (Docker + built binary/server)
572
+ - T4: Visual — browser-rendered UI flows (Playwright, headed locally)
573
+
574
+ **Rules:**
575
+ 1. If ANY truth requires T2+, infrastructure setup MUST appear as a Wave 0 or Wave 1 task
576
+ 2. Docker Compose should be proposed in research.md — reference it, don't recreate
577
+ 3. T3/T4 tests run AFTER T1/T2 in the verification sequence
578
+ 4. Each `<verify>` block should specify tier when T2+: `<automated tier="T2">docker compose up -d && cargo test --test integration</automated>`
579
+
580
+ **Why this matters:**
581
+
582
+ Task completion ≠ Goal achievement. A task "create chat component" can complete by creating a placeholder. The `must_haves` field captures what must actually work, enabling verification to catch gaps before they compound.
583
+
584
+ **Verification flow:**
585
+
586
+ 1. Plan-phase derives must_haves from phase goal (goal-backward)
587
+ 2. Must_haves written to plan.md frontmatter
588
+ 3. Execute-phase runs all plans
589
+ 4. Verification subagent checks must_haves against codebase
590
+ 5. Gaps found → fix plans created → execute → re-verify
591
+ 6. All must_haves pass → phase complete
592
+
593
+ See `~/.claude/pan-wizard-core/workflows/verify-phase.md` for verification logic.
@@ -0,0 +1,117 @@
1
+ # Planner Subagent Prompt Template
2
+
3
+ Template for spawning pan-planner agent. The agent contains all planning expertise - this template provides planning context only.
4
+
5
+ ---
6
+
7
+ ## Template
8
+
9
+ ```markdown
10
+ <planning_context>
11
+
12
+ **Phase:** {phase_number}
13
+ **Mode:** {standard | gap_closure}
14
+
15
+ **Project State:**
16
+ @.planning/state.md
17
+
18
+ **Roadmap:**
19
+ @.planning/roadmap.md
20
+
21
+ **Requirements (if exists):**
22
+ @.planning/requirements.md
23
+
24
+ **Phase Context (if exists):**
25
+ @.planning/phases/{phase_dir}/{phase_num}-context.md
26
+
27
+ **Research (if exists):**
28
+ @.planning/phases/{phase_dir}/{phase_num}-research.md
29
+
30
+ **Gap Closure (if --gaps mode):**
31
+ @.planning/phases/{phase_dir}/{phase_num}-verification.md
32
+ @.planning/phases/{phase_dir}/{phase_num}-uat.md
33
+
34
+ </planning_context>
35
+
36
+ <downstream_consumer>
37
+ Output consumed by /pan:exec-phase
38
+ Plans must be executable prompts with:
39
+ - Frontmatter (wave, depends_on, files_modified, autonomous)
40
+ - Tasks in XML format
41
+ - Verification criteria
42
+ - must_haves for goal-backward verification
43
+ </downstream_consumer>
44
+
45
+ <quality_gate>
46
+ Before returning PLANNING COMPLETE:
47
+ - [ ] plan.md files created in phase directory
48
+ - [ ] Each plan has valid frontmatter
49
+ - [ ] Tasks are specific and actionable
50
+ - [ ] Dependencies correctly identified
51
+ - [ ] Waves assigned for parallel execution
52
+ - [ ] must_haves derived from phase goal
53
+ </quality_gate>
54
+ ```
55
+
56
+ ---
57
+
58
+ ## Placeholders
59
+
60
+ | Placeholder | Source | Example |
61
+ |-------------|--------|---------|
62
+ | `{phase_number}` | From roadmap/arguments | `5` or `2.1` |
63
+ | `{phase_dir}` | Phase directory name | `05-user-profiles` |
64
+ | `{phase}` | Phase prefix | `05` |
65
+ | `{standard \| gap_closure}` | Mode flag | `standard` |
66
+
67
+ ---
68
+
69
+ ## Usage
70
+
71
+ **From /pan:plan-phase (standard mode):**
72
+ ```python
73
+ Task(
74
+ prompt=filled_template,
75
+ subagent_type="pan-planner",
76
+ description="Plan Phase {phase}"
77
+ )
78
+ ```
79
+
80
+ **From /pan:plan-phase --gaps (gap closure mode):**
81
+ ```python
82
+ Task(
83
+ prompt=filled_template, # with mode: gap_closure
84
+ subagent_type="pan-planner",
85
+ description="Plan gaps for Phase {phase}"
86
+ )
87
+ ```
88
+
89
+ ---
90
+
91
+ ## Continuation
92
+
93
+ For checkpoints, spawn fresh agent with:
94
+
95
+ ```markdown
96
+ <objective>
97
+ Continue planning for Phase {phase_number}: {phase_name}
98
+ </objective>
99
+
100
+ <prior_state>
101
+ Phase directory: @.planning/phases/{phase_dir}/
102
+ Existing plans: @.planning/phases/{phase_dir}/*-plan.md
103
+ </prior_state>
104
+
105
+ <checkpoint_response>
106
+ **Type:** {checkpoint_type}
107
+ **Response:** {user_response}
108
+ </checkpoint_response>
109
+
110
+ <mode>
111
+ Continue: {standard | gap_closure}
112
+ </mode>
113
+ ```
114
+
115
+ ---
116
+
117
+ **Note:** Planning methodology, task breakdown, dependency analysis, wave assignment, TDD detection, and goal-backward derivation are baked into the pan-planner agent. This template only passes context.