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,44 @@
1
+ ---
2
+ name: pan:add-phase
3
+ group: Phase Management
4
+ description: Add phase to end of current milestone in roadmap
5
+ argument-hint: <description>
6
+ allowed-tools:
7
+ - Read
8
+ - Write
9
+ - Bash
10
+ ---
11
+
12
+ <objective>
13
+ Add a new integer phase to the end of the current milestone in the roadmap.
14
+
15
+ Routes to the add-phase workflow which handles:
16
+ - Phase number calculation (next sequential integer)
17
+ - Directory creation with slug generation
18
+ - Roadmap structure updates
19
+ - state.md roadmap evolution tracking
20
+ </objective>
21
+
22
+ <execution_context>
23
+ @~/.claude/pan-wizard-core/workflows/add-phase.md
24
+ </execution_context>
25
+
26
+ <context>
27
+ Arguments: $ARGUMENTS (phase description)
28
+
29
+ Roadmap and state are resolved in-workflow via `init phase-op` and targeted tool calls.
30
+ </context>
31
+
32
+ <process>
33
+ **Follow the add-phase workflow** from `@~/.claude/pan-wizard-core/workflows/add-phase.md`.
34
+
35
+ The workflow handles all logic including:
36
+ 1. Argument parsing and validation
37
+ 2. Roadmap existence checking
38
+ 3. Current milestone identification
39
+ 4. Next phase number calculation (ignoring decimals)
40
+ 5. Slug generation from description
41
+ 6. Phase directory creation
42
+ 7. Roadmap entry insertion
43
+ 8. state.md updates
44
+ </process>
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: pan:assumptions
3
+ group: Phase Management
4
+ description: Surface Claude's assumptions about a phase approach before planning
5
+ argument-hint: "[phase]"
6
+ allowed-tools:
7
+ - Read
8
+ - Bash
9
+ - Grep
10
+ - Glob
11
+ ---
12
+
13
+ <objective>
14
+ Analyze a phase and present Claude's assumptions about technical approach, implementation order, scope boundaries, risk areas, and dependencies.
15
+
16
+ Purpose: Help users see what Claude thinks BEFORE planning begins - enabling course correction early when assumptions are wrong.
17
+ Output: Conversational output only (no file creation) - ends with "What do you think?" prompt
18
+ </objective>
19
+
20
+ <execution_context>
21
+ @~/.claude/pan-wizard-core/workflows/assumptions.md
22
+ </execution_context>
23
+
24
+ <context>
25
+ Phase number: $ARGUMENTS (required)
26
+
27
+ Project state and roadmap are loaded in-workflow using targeted reads.
28
+ </context>
29
+
30
+ <process>
31
+ 1. Validate phase number argument (error if missing or invalid)
32
+ 2. Check if phase exists in roadmap
33
+ 3. Follow assumptions.md workflow:
34
+ - Analyze roadmap description
35
+ - Surface assumptions about: technical approach, implementation order, scope, risks, dependencies
36
+ - Present assumptions clearly
37
+ - Prompt "What do you think?"
38
+ 4. Gather feedback and offer next steps
39
+ </process>
40
+
41
+ <success_criteria>
42
+
43
+ - Phase validated against roadmap
44
+ - Assumptions surfaced across five areas
45
+ - User prompted for feedback
46
+ - User knows next steps (discuss context, plan phase, or correct assumptions)
47
+ </success_criteria>
@@ -0,0 +1,378 @@
1
+ ---
2
+ name: pan:audit-deployment
3
+ group: System
4
+ description: Audit a PAN Wizard deployment — verify installation integrity, project health, and draft enhancement specs
5
+ argument-hint: <target-directory> [--enhancements] [--repair]
6
+ allowed-tools:
7
+ - Read
8
+ - Bash
9
+ - Write
10
+ - Glob
11
+ - Grep
12
+ - AskUserQuestion
13
+ ---
14
+ <objective>
15
+ Audit a directory where PAN Wizard was installed and a project was run. Verify installation integrity, validate project artifacts, assess workflow execution quality, and optionally produce a featureAI-format enhancement spec that superplan.md can consume for development planning.
16
+ </objective>
17
+
18
+ <execution_context>
19
+ This command operates on a TARGET directory (not the PAN source repo). The target must be provided as the first argument.
20
+ </execution_context>
21
+
22
+ <process>
23
+
24
+ <step name="parse_args">
25
+ **Parse arguments:**
26
+
27
+ Extract target directory path from the first argument. It is REQUIRED.
28
+
29
+ ```
30
+ TARGET_DIR = first positional argument
31
+ ENHANCEMENTS_FLAG = "--enhancements" present?
32
+ REPAIR_FLAG = "--repair" present?
33
+ ```
34
+
35
+ If no target directory is provided, ask the user:
36
+ > Which directory should I audit? Provide the full path to the folder where PAN Wizard was installed and a project was run.
37
+
38
+ Validate the directory exists before proceeding.
39
+ </step>
40
+
41
+ <step name="installation_audit">
42
+ **Phase 1 — Installation Integrity Audit**
43
+
44
+ Check the PAN Wizard installation artifacts in the target directory. Determine which runtime was used (Claude, Gemini, OpenCode, Codex, Copilot) by checking for config directories:
45
+
46
+ ```
47
+ Claude: <target>/.claude/
48
+ Gemini: <target>/.gemini/
49
+ OpenCode: <target>/.opencode/
50
+ Codex: <target>/.codex/
51
+ Copilot: <target>/.copilot/ (or ~/.copilot/)
52
+ GitHub: <target>/.github/
53
+ ```
54
+
55
+ For the detected runtime config directory (CONFIG_DIR), audit ALL of the following:
56
+
57
+ **1.1 Core Files (CRITICAL)**
58
+ - [ ] `CONFIG_DIR/pan-wizard-core/VERSION` exists — read and record version
59
+ - [ ] `CONFIG_DIR/pan-wizard-core/CHANGELOG.md` exists
60
+ - [ ] `CONFIG_DIR/pan-file-manifest.json` exists — parse and validate JSON
61
+ - [ ] `CONFIG_DIR/package.json` exists — should contain `{"type":"commonjs"}`
62
+
63
+ **1.2 Core Modules**
64
+ - [ ] `CONFIG_DIR/pan-wizard-core/bin/pan-tools.cjs` exists (CLI dispatcher)
65
+ - [ ] `CONFIG_DIR/pan-wizard-core/bin/lib/` directory exists
66
+ - Count all `.cjs` files in `bin/lib/` — expect 14-16 modules
67
+
68
+ **1.3 Workflows, Templates, References**
69
+ - [ ] `CONFIG_DIR/pan-wizard-core/workflows/` — count files, expect 25+
70
+ - [ ] `CONFIG_DIR/pan-wizard-core/templates/` — count files, expect 20+
71
+ - [ ] `CONFIG_DIR/pan-wizard-core/references/` — count files, expect 10+
72
+
73
+ **1.4 Commands**
74
+ - For Claude/Gemini: `CONFIG_DIR/commands/pan/` — count `.md` files, expect 35+
75
+ - For OpenCode: `CONFIG_DIR/command/` — count `pan-*.md` files
76
+ - For Codex/Copilot: `CONFIG_DIR/skills/pan-*/SKILL.md` — count skill directories
77
+
78
+ **1.5 Agents**
79
+ - [ ] `CONFIG_DIR/agents/` — count agent files, expect 12
80
+ - Verify key agents exist: pan-planner, pan-executor, pan-verifier, pan-debugger
81
+
82
+ **1.6 Hooks**
83
+ - [ ] `CONFIG_DIR/hooks/pan-statusline.js` exists
84
+ - [ ] `CONFIG_DIR/hooks/pan-check-update.js` exists
85
+ - [ ] `CONFIG_DIR/hooks/pan-context-monitor.js` exists
86
+
87
+ **1.7 Settings/Config**
88
+ - [ ] Settings file exists (settings.json / opencode.json / config.json)
89
+ - [ ] Hooks are registered in settings (SessionStart, PostToolUse, statusLine)
90
+ - [ ] Hook commands point to existing files
91
+
92
+ **1.8 Manifest Integrity**
93
+ - Read `pan-file-manifest.json`
94
+ - For each file in the manifest, verify it exists on disk
95
+ - Flag any MISSING files (manifest says exists, disk says no)
96
+ - Flag any MODIFIED files (hash mismatch) — these are user customizations, not errors
97
+ - Flag any ORPHANED files (on disk but not in manifest)
98
+
99
+ Record all findings with severity: CRITICAL (missing core), WARNING (missing optional), INFO (modifications).
100
+ </step>
101
+
102
+ <step name="project_audit">
103
+ **Phase 2 — Project Artifacts Audit**
104
+
105
+ Check `.planning/` directory in the target:
106
+
107
+ **2.1 Core Planning Files**
108
+ - [ ] `.planning/config.json` — exists, valid JSON, has required keys (mode, depth, model_profile, workflow)
109
+ - [ ] `.planning/project.md` — exists, has "What This Is", "Core Value", "Requirements" sections
110
+ - [ ] `.planning/state.md` — exists, has "Current Position", "Performance Metrics" sections
111
+ - [ ] `.planning/roadmap.md` — exists, has phase table
112
+ - [ ] `.planning/requirements.md` — exists if project used requirements tracking
113
+
114
+ **2.2 Phase Directories**
115
+ - Scan for `phase_*` or `*-*` numbered directories
116
+ - For each phase directory:
117
+ - [ ] PLAN.md exists (phase summary)
118
+ - [ ] At least one plan_*.md file exists
119
+ - [ ] verification.md exists (phase was verified)
120
+ - Count: total phases, phases with plans, phases verified, phases with gaps
121
+
122
+ **2.3 Research Artifacts** (if brownfield/research was enabled)
123
+ - [ ] `.planning/research/` directory exists
124
+ - Check for stack.md, features.md, architecture.md, pitfalls.md
125
+ - [ ] `.planning/codebase/` directory exists (brownfield)
126
+
127
+ **2.4 State Consistency**
128
+ - Parse state.md "Current Position" — extract phase number
129
+ - Count actual phase directories — do they match?
130
+ - Check roadmap.md phase count vs actual directories
131
+ - Verify no orphaned .continue-here-*.md files (paused but not resumed)
132
+
133
+ **2.5 Config Sanity**
134
+ - Validate config.json values are within expected ranges
135
+ - mode: "yolo" | "interactive"
136
+ - depth: "quick" | "standard" | "comprehensive"
137
+ - model_profile: "quality" | "balanced" | "budget"
138
+ - workflow agents: all boolean
139
+ </step>
140
+
141
+ <step name="workflow_quality_audit">
142
+ **Phase 3 — Workflow Execution Quality**
143
+
144
+ Assess how well the project workflow was followed:
145
+
146
+ **3.1 Planning Quality**
147
+ For each phase with a PLAN.md:
148
+ - Does it have clear objectives?
149
+ - Does it reference requirements?
150
+ - Are plans sequential with dependencies noted?
151
+ - Grade: Complete / Partial / Stub
152
+
153
+ **3.2 Verification Coverage**
154
+ - Count phases with verification.md vs total phases
155
+ - Check if verifications have pass/fail outcomes
156
+ - Flag phases that were executed but never verified
157
+
158
+ **3.3 Commit History** (if git repo)
159
+ - Check if `.planning/` is tracked in git (config.json commit_docs)
160
+ - Look for atomic commit patterns (one commit per plan)
161
+ - Check for PAN-style commit messages
162
+
163
+ **3.4 Session Continuity**
164
+ - Check for .continue-here-*.md files (indicates paused sessions)
165
+ - Check state.md session logs for gaps
166
+ - Look for evidence of context loss (repeated work, contradictory decisions)
167
+
168
+ **3.5 Todo Management**
169
+ - Check `.planning/todos/` directory
170
+ - Count pending vs completed
171
+ - Flag stale todos (captured but never addressed)
172
+ </step>
173
+
174
+ <step name="report">
175
+ **Phase 4 — Generate Audit Report**
176
+
177
+ Format findings as a structured report:
178
+
179
+ ```
180
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
181
+ PAN Deployment Audit
182
+ Target: <target-directory>
183
+ Date: <YYYY-MM-DD>
184
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
185
+
186
+ ## Summary
187
+
188
+ | Category | Status | Score |
189
+ |------------------------|----------|-------|
190
+ | Installation Integrity | ✓/⚠/✗ | N/N |
191
+ | Project Artifacts | ✓/⚠/✗ | N/N |
192
+ | Workflow Quality | ✓/⚠/✗ | N/N |
193
+ | Overall | HEALTHY / DEGRADED / BROKEN | N% |
194
+
195
+ Runtime: <detected runtime>
196
+ PAN Version: <version from VERSION file>
197
+ Phases: <completed>/<total>
198
+ Verification Coverage: <N>%
199
+
200
+ ## Installation Integrity
201
+
202
+ ### Critical Issues
203
+ - [I-C01] <description> — <fix>
204
+
205
+ ### Warnings
206
+ - [I-W01] <description> — <suggestion>
207
+
208
+ ### Info
209
+ - [I-I01] <description>
210
+
211
+ ### Modified Files (User Customizations)
212
+ - <file> — hash mismatch (expected: abc..., actual: def...)
213
+
214
+ ## Project Artifacts
215
+
216
+ ### Critical Issues
217
+ - [P-C01] <description> — <fix>
218
+
219
+ ### Warnings
220
+ - [P-W01] <description> — <suggestion>
221
+
222
+ ### Phase Health
223
+ | Phase | PLAN.md | Plans | Verified | Status |
224
+ |-------|---------|-------|----------|--------|
225
+ | 01 | ✓ | 3 | ✓ | Complete |
226
+ | 02 | ✓ | 5 | ✗ | Unverified |
227
+
228
+ ## Workflow Quality
229
+
230
+ ### Observations
231
+ - Planning quality: <grade>
232
+ - Verification coverage: <N>%
233
+ - Commit discipline: <grade>
234
+ - Session continuity: <grade>
235
+
236
+ ### Recommendations
237
+ 1. <actionable recommendation>
238
+ 2. <actionable recommendation>
239
+ ```
240
+
241
+ If `--repair` flag was provided, attempt auto-fixes for repairable issues:
242
+ - Regenerate missing settings.json with default hook config
243
+ - Create missing .planning/config.json with defaults
244
+ - Remove orphaned .continue-here-*.md files
245
+
246
+ Report repairs performed.
247
+ </step>
248
+
249
+ <step name="enhancements">
250
+ **Phase 5 — Enhancement Spec Generation** (only if `--enhancements` flag)
251
+
252
+ Based on audit findings, generate a featureAI-format enhancement spec at `docs/specs/deployment_audit_findings_featureai.md` in the PAN SOURCE repository (NOT the target directory).
253
+
254
+ The spec MUST follow this exact format to be consumable by superplan.md:
255
+
256
+ ```markdown
257
+ # [Enhancement Title] — Feature Specification
258
+
259
+ **Generated:** <YYYY-MM-DD>
260
+ **Version:** 1.0
261
+ **Status:** Proposed
262
+ **Source:** Deployment audit of <target-directory>
263
+
264
+ ---
265
+
266
+ ## Problem Statement
267
+
268
+ [Describe the problems discovered during the audit. What is broken, missing, or suboptimal in PAN Wizard based on real-world deployment evidence?]
269
+
270
+ ## Demand Evidence
271
+
272
+ | Evidence Type | Source | Finding |
273
+ |---|---|---|
274
+ | Deployment audit | <target-dir> | <specific finding> |
275
+ | ... | ... | ... |
276
+
277
+ ## Success Criteria
278
+
279
+ ```
280
+ SC-1: <measurable criterion>
281
+ SC-2: <measurable criterion>
282
+ ```
283
+
284
+ ## Design
285
+
286
+ [Proposed changes to PAN Wizard to address the findings]
287
+
288
+ ### Architecture
289
+
290
+ [How the fix/enhancement integrates with existing PAN architecture]
291
+
292
+ ## Feature Ladder
293
+
294
+ | Version | Scope | Value | Effort |
295
+ |---|---|---|---|
296
+ | **v0 (MVP)** | <scope> | <value> | <effort> |
297
+ | **v1** | <scope> | <value> | <effort> |
298
+
299
+ ## Implementation Tasks
300
+
301
+ | # | ID | Title | Files | Effort | Pts | Priority |
302
+ |---|---|---|---|---|---|---|
303
+ | 1 | A.1 | <task> | <files> | S/M/L | N | P1-P4 |
304
+
305
+ ### Dependency Graph
306
+
307
+ ```
308
+ A.1 ──> A.2 ──> A.3
309
+ ```
310
+
311
+ ## Test Plan
312
+
313
+ | Level | Count | What It Catches |
314
+ |---|---|---|
315
+ | Unit | N+ | <description> |
316
+ | Integration | N+ | <description> |
317
+
318
+ ## Risk Register
319
+
320
+ | Risk | Probability | Impact | Mitigation |
321
+ |---|---|---|---|
322
+ | <risk> | Low/Med/High | Low/Med/High | <mitigation> |
323
+
324
+ ---
325
+
326
+ *Generated by /pan:audit-deployment — <YYYY-MM-DD>*
327
+ ```
328
+
329
+ Group findings into logical enhancement categories:
330
+ 1. **Installer gaps** — Missing files, broken hooks, manifest issues
331
+ 2. **Workflow gaps** — Missing verification, planning quality
332
+ 3. **Template gaps** — Templates that don't match real-world needs
333
+ 4. **Documentation gaps** — Unclear processes discovered during audit
334
+ 5. **Tooling gaps** — Features PAN should have but doesn't
335
+
336
+ For each category with findings, generate a separate featureAI spec OR consolidate into one spec if findings are cohesive.
337
+
338
+ Ask the user before writing specs:
339
+ > The audit found N enhancement opportunities across M categories. Should I generate featureAI specs for superplan.md to plan development? [Yes/No]
340
+ </step>
341
+
342
+ <step name="final_summary">
343
+ **Final Summary**
344
+
345
+ Display a concise summary:
346
+
347
+ ```
348
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
349
+ Audit Complete
350
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
351
+
352
+ Score: N% (HEALTHY / DEGRADED / BROKEN)
353
+ Critical: N | Warnings: N | Info: N
354
+
355
+ Installation: <status>
356
+ Project: <status>
357
+ Workflow: <status>
358
+
359
+ Enhancements drafted: N specs → docs/specs/
360
+ ```
361
+
362
+ If enhancements were generated:
363
+ > Enhancement specs written. Run superplan.md or /pan:milestone-new to plan development work.
364
+
365
+ If repairs were performed:
366
+ > N issues auto-repaired. Re-run /pan:audit-deployment to verify.
367
+ </step>
368
+
369
+ </process>
370
+
371
+ <constraints>
372
+ - NEVER modify the target directory's .planning/ content unless --repair is explicitly passed
373
+ - NEVER modify the target directory's PAN installation files (read-only audit)
374
+ - Enhancement specs are written to the PAN SOURCE repo docs/specs/, NOT the target directory
375
+ - If the target directory IS the PAN source repo, refuse with: "Cannot audit the PAN source repository. Use a separate deployment directory."
376
+ - All file reads are defensive — missing files are findings, not crashes
377
+ - Do not expose file hashes, absolute paths, or credentials in the report
378
+ </constraints>
@@ -0,0 +1,168 @@
1
+ ---
2
+ name: pan:debug
3
+ group: System
4
+ description: Systematic debugging with persistent state across context resets
5
+ argument-hint: [issue description]
6
+ allowed-tools:
7
+ - Read
8
+ - Bash
9
+ - Task
10
+ - AskUserQuestion
11
+ ---
12
+
13
+ <objective>
14
+ Debug issues using scientific method with subagent isolation.
15
+
16
+ **Orchestrator role:** Gather symptoms, spawn pan-debugger agent, handle checkpoints, spawn continuations.
17
+
18
+ **Why subagent:** Investigation burns context fast (reading files, forming hypotheses, testing). Fresh 200k context per investigation. Main context stays lean for user interaction.
19
+ </objective>
20
+
21
+ <context>
22
+ User's issue: $ARGUMENTS
23
+
24
+ Check for active sessions:
25
+ ```bash
26
+ ls .planning/debug/*.md 2>/dev/null | grep -v resolved | head -5
27
+ ```
28
+ </context>
29
+
30
+ <process>
31
+
32
+ ## 0. Initialize Context
33
+
34
+ ```bash
35
+ INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs state load)
36
+ ```
37
+
38
+ Extract `commit_docs` from init JSON. Resolve debugger model:
39
+ ```bash
40
+ DEBUGGER_MODEL=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs resolve-model pan-debugger --raw)
41
+ ```
42
+
43
+ ## 1. Check Active Sessions
44
+
45
+ If active sessions exist AND no $ARGUMENTS:
46
+ - List sessions with status, hypothesis, next action
47
+ - User picks number to resume OR describes new issue
48
+
49
+ If $ARGUMENTS provided OR user describes new issue:
50
+ - Continue to symptom gathering
51
+
52
+ ## 2. Gather Symptoms (if new issue)
53
+
54
+ Use AskUserQuestion for each:
55
+
56
+ 1. **Expected behavior** - What should happen?
57
+ 2. **Actual behavior** - What happens instead?
58
+ 3. **Error messages** - Any errors? (paste or describe)
59
+ 4. **Timeline** - When did this start? Ever worked?
60
+ 5. **Reproduction** - How do you trigger it?
61
+
62
+ After all gathered, confirm ready to investigate.
63
+
64
+ ## 3. Spawn pan-debugger Agent
65
+
66
+ Fill prompt and spawn:
67
+
68
+ ```markdown
69
+ <objective>
70
+ Investigate issue: {slug}
71
+
72
+ **Summary:** {trigger}
73
+ </objective>
74
+
75
+ <symptoms>
76
+ expected: {expected}
77
+ actual: {actual}
78
+ errors: {errors}
79
+ reproduction: {reproduction}
80
+ timeline: {timeline}
81
+ </symptoms>
82
+
83
+ <mode>
84
+ symptoms_prefilled: true
85
+ goal: find_and_fix
86
+ </mode>
87
+
88
+ <debug_file>
89
+ Create: .planning/debug/{slug}.md
90
+ </debug_file>
91
+ ```
92
+
93
+ ```
94
+ Task(
95
+ prompt=filled_prompt,
96
+ subagent_type="pan-debugger",
97
+ model="{debugger_model}",
98
+ description="Debug {slug}"
99
+ )
100
+ ```
101
+
102
+ ## 4. Handle Agent Return
103
+
104
+ **If `## ROOT CAUSE FOUND`:**
105
+ - Display root cause and evidence summary
106
+ - Offer options:
107
+ - "Fix now" - spawn fix subagent
108
+ - "Plan fix" - suggest /pan:plan-phase --gaps
109
+ - "Manual fix" - done
110
+
111
+ **If `## CHECKPOINT REACHED`:**
112
+ - Present checkpoint details to user
113
+ - Get user response
114
+ - If checkpoint type is `human-verify`:
115
+ - If user confirms fixed: continue so agent can finalize/resolve/archive
116
+ - If user reports issues: continue so agent returns to investigation/fixing
117
+ - Spawn continuation agent (see step 5)
118
+
119
+ **If `## INVESTIGATION INCONCLUSIVE`:**
120
+ - Show what was checked and eliminated
121
+ - Offer options:
122
+ - "Continue investigating" - spawn new agent with additional context
123
+ - "Manual investigation" - done
124
+ - "Add more context" - gather more symptoms, spawn again
125
+
126
+ ## 5. Spawn Continuation Agent (After Checkpoint)
127
+
128
+ When user responds to checkpoint, spawn fresh agent:
129
+
130
+ ```markdown
131
+ <objective>
132
+ Continue debugging {slug}. Evidence is in the debug file.
133
+ </objective>
134
+
135
+ <prior_state>
136
+ <files_to_read>
137
+ - .planning/debug/{slug}.md (Debug session state)
138
+ </files_to_read>
139
+ </prior_state>
140
+
141
+ <checkpoint_response>
142
+ **Type:** {checkpoint_type}
143
+ **Response:** {user_response}
144
+ </checkpoint_response>
145
+
146
+ <mode>
147
+ goal: find_and_fix
148
+ </mode>
149
+ ```
150
+
151
+ ```
152
+ Task(
153
+ prompt=continuation_prompt,
154
+ subagent_type="pan-debugger",
155
+ model="{debugger_model}",
156
+ description="Continue debug {slug}"
157
+ )
158
+ ```
159
+
160
+ </process>
161
+
162
+ <success_criteria>
163
+ - [ ] Active sessions checked
164
+ - [ ] Symptoms gathered (if new)
165
+ - [ ] pan-debugger spawned with context
166
+ - [ ] Checkpoints handled correctly
167
+ - [ ] Root cause confirmed before fixing
168
+ </success_criteria>
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: pan:discord
3
+ group: Community
4
+ description: Join the PAN Discord community
5
+ ---
6
+
7
+ <objective>
8
+ Display the Discord invite link for the PAN community server.
9
+ </objective>
10
+
11
+ <output>
12
+ # Join the PAN Discord
13
+
14
+ Connect with other PAN users, get help, share what you're building, and stay updated.
15
+
16
+ **Invite link:** https://discord.gg/pan-wizard
17
+
18
+ Click the link or paste it into your browser to join.
19
+ </output>