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,306 @@
1
+ <trigger>
2
+ Use this workflow when:
3
+ - Starting a new session on an existing project
4
+ - User says "continue", "what's next", "where were we", "resume"
5
+ - Any planning operation when .planning/ already exists
6
+ - User returns after time away from project
7
+ </trigger>
8
+
9
+ <purpose>
10
+ Instantly restore full project context so "Where were we?" has an immediate, complete answer.
11
+ </purpose>
12
+
13
+ <required_reading>
14
+ @~/.claude/pan-wizard-core/references/continuation-format.md
15
+ </required_reading>
16
+
17
+ <process>
18
+
19
+ <step name="initialize">
20
+ Load all context in one call:
21
+
22
+ ```bash
23
+ INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init resume)
24
+ ```
25
+
26
+ Parse JSON for: `state_exists`, `roadmap_exists`, `project_exists`, `planning_exists`, `has_interrupted_agent`, `interrupted_agent_id`, `commit_docs`.
27
+
28
+ **If `state_exists` is true:** Proceed to load_state
29
+ **If `state_exists` is false but `roadmap_exists` or `project_exists` is true:** Offer to reconstruct state.md
30
+ **If `planning_exists` is false:** This is a new project - route to /pan:new-project
31
+ </step>
32
+
33
+ <step name="load_state">
34
+
35
+ Read and parse state.md, then project.md:
36
+
37
+ ```bash
38
+ cat .planning/state.md
39
+ cat .planning/project.md
40
+ ```
41
+
42
+ **From state.md extract:**
43
+
44
+ - **Project Reference**: Core value and current focus
45
+ - **Current Position**: Phase X of Y, Plan A of B, Status
46
+ - **Progress**: Visual progress bar
47
+ - **Recent Decisions**: Key decisions affecting current work
48
+ - **Pending Todos**: Ideas captured during sessions
49
+ - **Blockers/Concerns**: Issues carried forward
50
+ - **Session Continuity**: Where we left off, any resume files
51
+
52
+ **From project.md extract:**
53
+
54
+ - **What This Is**: Current accurate description
55
+ - **Requirements**: Validated, Active, Out of Scope
56
+ - **Key Decisions**: Full decision log with outcomes
57
+ - **Constraints**: Hard limits on implementation
58
+
59
+ </step>
60
+
61
+ <step name="check_incomplete_work">
62
+ Look for incomplete work that needs attention:
63
+
64
+ ```bash
65
+ # Check for continue-here files (mid-plan resumption)
66
+ ls .planning/phases/*/.continue-here*.md 2>/dev/null
67
+
68
+ # Check for plans without summaries (incomplete execution)
69
+ for plan in .planning/phases/*/*-plan.md; do
70
+ summary="${plan/PLAN/SUMMARY}"
71
+ [ ! -f "$summary" ] && echo "Incomplete: $plan"
72
+ done 2>/dev/null
73
+
74
+ # Check for interrupted agents (use has_interrupted_agent and interrupted_agent_id from init)
75
+ if [ "$has_interrupted_agent" = "true" ]; then
76
+ echo "Interrupted agent: $interrupted_agent_id"
77
+ fi
78
+ ```
79
+
80
+ **If .continue-here file exists:**
81
+
82
+ - This is a mid-plan resumption point
83
+ - Read the file for specific resumption context
84
+ - Flag: "Found mid-plan checkpoint"
85
+
86
+ **If PLAN without SUMMARY exists:**
87
+
88
+ - Execution was started but not completed
89
+ - Flag: "Found incomplete plan execution"
90
+
91
+ **If interrupted agent found:**
92
+
93
+ - Subagent was spawned but session ended before completion
94
+ - Read agent-history.json for task details
95
+ - Flag: "Found interrupted agent"
96
+ </step>
97
+
98
+ <step name="present_status">
99
+ Present complete project status to user:
100
+
101
+ ```
102
+ ╔══════════════════════════════════════════════════════════════╗
103
+ ║ PROJECT STATUS ║
104
+ ╠══════════════════════════════════════════════════════════════╣
105
+ ║ Building: [one-liner from project.md "What This Is"] ║
106
+ ║ ║
107
+ ║ Phase: [X] of [Y] - [Phase name] ║
108
+ ║ Plan: [A] of [B] - [Status] ║
109
+ ║ Progress: [██████░░░░] XX% ║
110
+ ║ ║
111
+ ║ Last activity: [date] - [what happened] ║
112
+ ╚══════════════════════════════════════════════════════════════╝
113
+
114
+ [If incomplete work found:]
115
+ ⚠️ Incomplete work detected:
116
+ - [.continue-here file or incomplete plan]
117
+
118
+ [If interrupted agent found:]
119
+ ⚠️ Interrupted agent detected:
120
+ Agent ID: [id]
121
+ Task: [task description from agent-history.json]
122
+ Interrupted: [timestamp]
123
+
124
+ Resume with: Task tool (resume parameter with agent ID)
125
+
126
+ [If pending todos exist:]
127
+ 📋 [N] pending todos — /pan:todo-check to review
128
+
129
+ [If blockers exist:]
130
+ ⚠️ Carried concerns:
131
+ - [blocker 1]
132
+ - [blocker 2]
133
+
134
+ [If alignment is not ✓:]
135
+ ⚠️ Brief alignment: [status] - [assessment]
136
+ ```
137
+
138
+ </step>
139
+
140
+ <step name="determine_next_action">
141
+ Based on project state, determine the most logical next action:
142
+
143
+ **If interrupted agent exists:**
144
+ → Primary: Resume interrupted agent (Task tool with resume parameter)
145
+ → Option: Start fresh (abandon agent work)
146
+
147
+ **If .continue-here file exists:**
148
+ → Primary: Resume from checkpoint
149
+ → Option: Start fresh on current plan
150
+
151
+ **If incomplete plan (PLAN without SUMMARY):**
152
+ → Primary: Complete the incomplete plan
153
+ → Option: Abandon and move on
154
+
155
+ **If phase in progress, all plans complete:**
156
+ → Primary: Transition to next phase
157
+ → Option: Review completed work
158
+
159
+ **If phase ready to plan:**
160
+ → Check if context.md exists for this phase:
161
+
162
+ - If context.md missing:
163
+ → Primary: Discuss phase vision (how user imagines it working)
164
+ → Secondary: Plan directly (skip context gathering)
165
+ - If context.md exists:
166
+ → Primary: Plan the phase
167
+ → Option: Review roadmap
168
+
169
+ **If phase ready to execute:**
170
+ → Primary: Execute next plan
171
+ → Option: Review the plan first
172
+ </step>
173
+
174
+ <step name="offer_options">
175
+ Present contextual options based on project state:
176
+
177
+ ```
178
+ What would you like to do?
179
+
180
+ [Primary action based on state - e.g.:]
181
+ 1. Resume interrupted agent [if interrupted agent found]
182
+ OR
183
+ 1. Execute phase (/pan:exec-phase {phase})
184
+ OR
185
+ 1. Discuss Phase 3 context (/pan:discuss-phase 3) [if context.md missing]
186
+ OR
187
+ 1. Plan Phase 3 (/pan:plan-phase 3) [if context.md exists or discuss option declined]
188
+
189
+ [Secondary options:]
190
+ 2. Review current phase status
191
+ 3. Check pending todos ([N] pending)
192
+ 4. Review brief alignment
193
+ 5. Something else
194
+ ```
195
+
196
+ **Note:** When offering phase planning, check for context.md existence first:
197
+
198
+ ```bash
199
+ ls .planning/phases/XX-name/*-context.md 2>/dev/null
200
+ ```
201
+
202
+ If missing, suggest discuss-phase before plan. If exists, offer plan directly.
203
+
204
+ Wait for user selection.
205
+ </step>
206
+
207
+ <step name="route_to_workflow">
208
+ Based on user selection, route to appropriate workflow:
209
+
210
+ - **Execute plan** → Show command for user to run after clearing:
211
+ ```
212
+ ---
213
+
214
+ ## ▶ Next Up
215
+
216
+ **{phase}-{plan}: [Plan Name]** — [objective from plan.md]
217
+
218
+ `/pan:exec-phase {phase}`
219
+
220
+ <sub>`/clear` first → fresh context window</sub>
221
+
222
+ ---
223
+ ```
224
+ - **Plan phase** → Show command for user to run after clearing:
225
+ ```
226
+ ---
227
+
228
+ ## ▶ Next Up
229
+
230
+ **Phase [N]: [Name]** — [Goal from roadmap.md]
231
+
232
+ `/pan:plan-phase [phase-number]`
233
+
234
+ <sub>`/clear` first → fresh context window</sub>
235
+
236
+ ---
237
+
238
+ **Also available:**
239
+ - `/pan:discuss-phase [N]` — gather context first
240
+ - `/pan:research-phase [N]` — investigate unknowns
241
+
242
+ ---
243
+ ```
244
+ - **Transition** → ./transition.md
245
+ - **Check todos** → Read .planning/todos/pending/, present summary
246
+ - **Review alignment** → Read project.md, compare to current state
247
+ - **Something else** → Ask what they need
248
+ </step>
249
+
250
+ <step name="update_session">
251
+ Before proceeding to routed workflow, update session continuity:
252
+
253
+ Update state.md:
254
+
255
+ ```markdown
256
+ ## Session Continuity
257
+
258
+ Last session: [now]
259
+ Stopped at: Session resumed, proceeding to [action]
260
+ Resume file: [updated if applicable]
261
+ ```
262
+
263
+ This ensures if session ends unexpectedly, next resume knows the state.
264
+ </step>
265
+
266
+ </process>
267
+
268
+ <reconstruction>
269
+ If state.md is missing but other artifacts exist:
270
+
271
+ "state.md missing. Reconstructing from artifacts..."
272
+
273
+ 1. Read project.md → Extract "What This Is" and Core Value
274
+ 2. Read roadmap.md → Determine phases, find current position
275
+ 3. Scan \*-summary.md files → Extract decisions, concerns
276
+ 4. Count pending todos in .planning/todos/pending/
277
+ 5. Check for .continue-here files → Session continuity
278
+
279
+ Reconstruct and write state.md, then proceed normally.
280
+
281
+ This handles cases where:
282
+
283
+ - Project predates state.md introduction
284
+ - File was accidentally deleted
285
+ - Cloning repo without full .planning/ state
286
+ </reconstruction>
287
+
288
+ <quick_resume>
289
+ If user says "continue" or "go":
290
+ - Load state silently
291
+ - Determine primary action
292
+ - Execute immediately without presenting options
293
+
294
+ "Continuing from [state]... [action]"
295
+ </quick_resume>
296
+
297
+ <success_criteria>
298
+ Resume is complete when:
299
+
300
+ - [ ] state.md loaded (or reconstructed)
301
+ - [ ] Incomplete work detected and flagged
302
+ - [ ] Clear status presented to user
303
+ - [ ] Contextual next actions offered
304
+ - [ ] User knows exactly where project stands
305
+ - [ ] Session continuity updated
306
+ </success_criteria>
@@ -0,0 +1,121 @@
1
+ <purpose>
2
+ Milestone retrospective — analyze historical .planning/ data for process improvement insights.
3
+
4
+ Run after milestone completion to reflect on estimation accuracy, verification patterns, and common gaps.
5
+ </purpose>
6
+
7
+ <core_principle>
8
+ **Process learning through quantitative analysis**
9
+
10
+ Retrospectives are not blame sessions. They identify systemic patterns that improve future planning:
11
+ - Were estimates accurate? (planned phases vs actual including gap closures)
12
+ - Did verification catch issues? (first-try pass rate)
13
+ - What gaps recur? (common patterns across phases)
14
+ </core_principle>
15
+
16
+ <process>
17
+
18
+ <step name="gather_data" priority="first">
19
+ Call pan-tools retro to gather all metrics:
20
+
21
+ ```bash
22
+ RETRO=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs retro)
23
+ ```
24
+
25
+ Parse JSON for: `phases_planned`, `phases_completed`, `phases_decimal`, `estimation_accuracy_pct`, `verifications_total`, `verifications_passed_first_try`, `verifications_gaps_found`, `verifications_human_needed`, `first_try_rate_pct`, `common_gap_patterns`.
26
+
27
+ **If error:** Report "No roadmap found — run /pan:new-project first."
28
+ </step>
29
+
30
+ <step name="analyze_estimation">
31
+ **Estimation Accuracy Analysis**
32
+
33
+ ```
34
+ Planned phases: {phases_planned}
35
+ Completed: {phases_completed}
36
+ Gap closure phases: {phases_decimal}
37
+ Estimation accuracy: {estimation_accuracy_pct}%
38
+ ```
39
+
40
+ | Accuracy | Assessment | Recommendation |
41
+ |----------|-----------|----------------|
42
+ | ≥ 90% | Excellent estimation | Keep current approach |
43
+ | 70-89% | Good, some gaps expected | Minor calibration needed |
44
+ | 50-69% | Under-estimated scope | Add buffer phases or break work smaller |
45
+ | < 50% | Significant under-estimation | Review requirements gathering process |
46
+ </step>
47
+
48
+ <step name="analyze_verification">
49
+ **Verification Pattern Analysis**
50
+
51
+ ```
52
+ Verifications: {verifications_total}
53
+ Passed first try: {verifications_passed_first_try} ({first_try_rate_pct}%)
54
+ Gaps found: {verifications_gaps_found}
55
+ Human needed: {verifications_human_needed}
56
+ ```
57
+
58
+ | First-try rate | Assessment | Recommendation |
59
+ |---------------|-----------|----------------|
60
+ | ≥ 80% | Strong execution quality | Current workflow is effective |
61
+ | 60-79% | Moderate gap rate | Improve plan detail or must_haves quality |
62
+ | < 60% | High gap rate | Review plan-checker effectiveness, add more explicit must_haves |
63
+ </step>
64
+
65
+ <step name="analyze_patterns">
66
+ **Common Gap Patterns**
67
+
68
+ If `common_gap_patterns` is non-empty:
69
+
70
+ ```
71
+ Top recurring gap types:
72
+ 1. {pattern} — appeared {count} times
73
+ 2. {pattern} — appeared {count} times
74
+ ...
75
+ ```
76
+
77
+ For each top pattern, suggest a preventive action:
78
+ - Missing wiring → "Add explicit key_links to must_haves"
79
+ - Stub detection → "Strengthen plan-checker substance checks"
80
+ - Test failures → "Add test gate earlier in verification"
81
+ - Missing files → "Require artifact existence in plan verify steps"
82
+ </step>
83
+
84
+ <step name="present_report">
85
+ **Retrospective Report**
86
+
87
+ ```markdown
88
+ ## Milestone Retrospective
89
+
90
+ ### Estimation
91
+ - Phases: {completed}/{planned} ({decimal} gap closures)
92
+ - Accuracy: {accuracy}% — {assessment}
93
+ - Recommendation: {recommendation}
94
+
95
+ ### Verification Quality
96
+ - First-try pass rate: {rate}% — {assessment}
97
+ - Gap phases needed: {gaps_found}
98
+ - Human verification: {human_needed}
99
+ - Recommendation: {recommendation}
100
+
101
+ ### Common Gap Patterns
102
+ {pattern_list_with_recommendations}
103
+
104
+ ### Key Takeaways
105
+ 1. {takeaway based on data}
106
+ 2. {takeaway based on data}
107
+ 3. {takeaway based on data}
108
+
109
+ ### Next Milestone Adjustments
110
+ - {specific adjustment for next milestone planning}
111
+ ```
112
+ </step>
113
+
114
+ </process>
115
+
116
+ <constraints>
117
+ - Read-only: this workflow does not modify any files
118
+ - Data-driven: all assessments backed by quantitative metrics
119
+ - Actionable: every finding includes a concrete recommendation
120
+ - Non-judgmental: focus on systemic patterns, not individual decisions
121
+ </constraints>
@@ -0,0 +1,213 @@
1
+ <purpose>
2
+ Interactive configuration of PAN workflow agents (research, plan_check, verifier) and model profile selection via multi-question prompt. Updates .planning/config.json with user preferences. Optionally saves settings as global defaults (~/.pan-wizard-core/defaults.json) for future projects.
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="ensure_and_load_config">
12
+ Ensure config exists and load current state:
13
+
14
+ ```bash
15
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs config-ensure-section
16
+ INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs state load)
17
+ ```
18
+
19
+ Creates `.planning/config.json` with defaults if missing and loads current config values.
20
+ </step>
21
+
22
+ <step name="read_current">
23
+ ```bash
24
+ cat .planning/config.json
25
+ ```
26
+
27
+ Parse current values (default to `true` if not present):
28
+ - `workflow.research` — spawn researcher during plan-phase
29
+ - `workflow.plan_check` — spawn plan checker during plan-phase
30
+ - `workflow.verifier` — spawn verifier during execute-phase
31
+ - `workflow.nyquist_validation` — validation architecture research during plan-phase
32
+ - `model_profile` — which model each agent uses (default: `balanced`)
33
+ - `git.branching_strategy` — branching approach (default: `"none"`)
34
+ </step>
35
+
36
+ <step name="present_settings">
37
+ Use AskUserQuestion with current values pre-selected:
38
+
39
+ ```
40
+ AskUserQuestion([
41
+ {
42
+ question: "Which model profile for agents?",
43
+ header: "Model",
44
+ multiSelect: false,
45
+ options: [
46
+ { label: "Quality", description: "Opus everywhere except verification (highest cost)" },
47
+ { label: "Balanced (Recommended)", description: "Opus for planning, Sonnet for execution/verification" },
48
+ { label: "Budget", description: "Sonnet for writing, Haiku for research/verification (lowest cost)" }
49
+ ]
50
+ },
51
+ {
52
+ question: "Spawn Plan Researcher? (researches domain before planning)",
53
+ header: "Research",
54
+ multiSelect: false,
55
+ options: [
56
+ { label: "Yes", description: "Research phase goals before planning" },
57
+ { label: "No", description: "Skip research, plan directly" }
58
+ ]
59
+ },
60
+ {
61
+ question: "Spawn Plan Checker? (verifies plans before execution)",
62
+ header: "Plan Check",
63
+ multiSelect: false,
64
+ options: [
65
+ { label: "Yes", description: "Verify plans meet phase goals" },
66
+ { label: "No", description: "Skip plan verification" }
67
+ ]
68
+ },
69
+ {
70
+ question: "Spawn Execution Verifier? (verifies phase completion)",
71
+ header: "Verifier",
72
+ multiSelect: false,
73
+ options: [
74
+ { label: "Yes", description: "Verify must-haves after execution" },
75
+ { label: "No", description: "Skip post-execution verification" }
76
+ ]
77
+ },
78
+ {
79
+ question: "Auto-advance pipeline? (discuss → plan → execute automatically)",
80
+ header: "Auto",
81
+ multiSelect: false,
82
+ options: [
83
+ { label: "No (Recommended)", description: "Manual /clear + paste between stages" },
84
+ { label: "Yes", description: "Chain stages via Task() subagents (same isolation)" }
85
+ ]
86
+ },
87
+ {
88
+ question: "Enable Nyquist Validation? (researches test coverage during planning)",
89
+ header: "Nyquist",
90
+ multiSelect: false,
91
+ options: [
92
+ { label: "Yes (Recommended)", description: "Research automated test coverage during plan-phase. Adds validation requirements to plans. Blocks approval if tasks lack automated verify." },
93
+ { label: "No", description: "Skip validation research. Good for rapid prototyping or no-test phases." }
94
+ ]
95
+ },
96
+ {
97
+ question: "Git branching strategy?",
98
+ header: "Branching",
99
+ multiSelect: false,
100
+ options: [
101
+ { label: "None (Recommended)", description: "Commit directly to current branch" },
102
+ { label: "Per Phase", description: "Create branch for each phase (pan/phase-{N}-{name})" },
103
+ { label: "Per Milestone", description: "Create branch for entire milestone (pan/{version}-{name})" }
104
+ ]
105
+ }
106
+ ])
107
+ ```
108
+ </step>
109
+
110
+ <step name="update_config">
111
+ Merge new settings into existing config.json:
112
+
113
+ ```json
114
+ {
115
+ ...existing_config,
116
+ "model_profile": "quality" | "balanced" | "budget",
117
+ "workflow": {
118
+ "research": true/false,
119
+ "plan_check": true/false,
120
+ "verifier": true/false,
121
+ "auto_advance": true/false,
122
+ "nyquist_validation": true/false
123
+ },
124
+ "git": {
125
+ "branching_strategy": "none" | "phase" | "milestone"
126
+ }
127
+ }
128
+ ```
129
+
130
+ Write updated config to `.planning/config.json`.
131
+ </step>
132
+
133
+ <step name="save_as_defaults">
134
+ Ask whether to save these settings as global defaults for future projects:
135
+
136
+ ```
137
+ AskUserQuestion([
138
+ {
139
+ question: "Save these as default settings for all new projects?",
140
+ header: "Defaults",
141
+ multiSelect: false,
142
+ options: [
143
+ { label: "Yes", description: "New projects start with these settings (saved to ~/.pan-wizard-core/defaults.json)" },
144
+ { label: "No", description: "Only apply to this project" }
145
+ ]
146
+ }
147
+ ])
148
+ ```
149
+
150
+ If "Yes": write the same config object (minus project-specific fields like `brave_search`) to `~/.pan-wizard-core/defaults.json`:
151
+
152
+ ```bash
153
+ mkdir -p ~/.gsd
154
+ ```
155
+
156
+ Write `~/.pan-wizard-core/defaults.json` with:
157
+ ```json
158
+ {
159
+ "mode": <current>,
160
+ "depth": <current>,
161
+ "model_profile": <current>,
162
+ "commit_docs": <current>,
163
+ "parallelization": <current>,
164
+ "branching_strategy": <current>,
165
+ "workflow": {
166
+ "research": <current>,
167
+ "plan_check": <current>,
168
+ "verifier": <current>,
169
+ "auto_advance": <current>,
170
+ "nyquist_validation": <current>
171
+ }
172
+ }
173
+ ```
174
+ </step>
175
+
176
+ <step name="confirm">
177
+ Display:
178
+
179
+ ```
180
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
181
+ PAN ► SETTINGS UPDATED
182
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
183
+
184
+ | Setting | Value |
185
+ |----------------------|-------|
186
+ | Model Profile | {quality/balanced/budget} |
187
+ | Plan Researcher | {On/Off} |
188
+ | Plan Checker | {On/Off} |
189
+ | Execution Verifier | {On/Off} |
190
+ | Auto-Advance | {On/Off} |
191
+ | Nyquist Validation | {On/Off} |
192
+ | Git Branching | {None/Per Phase/Per Milestone} |
193
+ | Saved as Defaults | {Yes/No} |
194
+
195
+ These settings apply to future /pan:plan-phase and /pan:exec-phase runs.
196
+
197
+ Quick commands:
198
+ - /pan:profile <profile> — switch model profile
199
+ - /pan:plan-phase --research — force research
200
+ - /pan:plan-phase --skip-research — skip research
201
+ - /pan:plan-phase --skip-verify — skip plan check
202
+ ```
203
+ </step>
204
+
205
+ </process>
206
+
207
+ <success_criteria>
208
+ - [ ] Current config read
209
+ - [ ] User presented with 7 settings (profile + 5 workflow toggles + git branching)
210
+ - [ ] Config updated with model_profile, workflow, and git sections
211
+ - [ ] User offered to save as global defaults (~/.pan-wizard-core/defaults.json)
212
+ - [ ] Changes confirmed to user
213
+ </success_criteria>