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,104 @@
1
+ ---
2
+ name: focus-sync
3
+ group: Focus
4
+ description: Synchronize documentation after changes — check staleness and update counts
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Grep
9
+ - Glob
10
+ - Edit
11
+ - Write
12
+ ---
13
+
14
+ # /pan:focus-sync — Documentation Synchronization
15
+
16
+ Synchronize project documentation across all files. $ARGUMENTS
17
+
18
+ **Goal:** Detect stale documentation (wrong counts, missing commands, outdated references) and optionally fix it. Documentation should reflect the actual codebase at all times.
19
+
20
+ ---
21
+
22
+ ## CRITICAL: Project Scope Boundary
23
+
24
+ This command synchronizes the **host project's documentation** — NOT PAN Wizard's own infrastructure files.
25
+
26
+ **NEVER sync, modify, or report staleness in these PAN directories:**
27
+ - `.claude/`, `.github/copilot-instructions.md`, `.opencode/`, `.gemini/`, `.codex/` — PAN runtime directories
28
+ - Any `pan-wizard-core/`, `pan-tools`, agent `.md`, or command `.md` files within PAN runtime directories
29
+
30
+ **These directories are PAN's own tooling.** Documentation sync applies to the project's README, docs, guides, and code comments — not to PAN's installed agents or command definitions.
31
+
32
+ ---
33
+
34
+ ## Usage
35
+
36
+ ```
37
+ /pan:focus-sync # Full sync check: report staleness
38
+ /pan:focus-sync --readme # Check README.md only
39
+ /pan:focus-sync --docs # Verify documentation matches implementations
40
+ /pan:focus-sync --arch # Verify architecture docs match actual structure
41
+ /pan:focus-sync --all # Full sync of everything + auto-fix
42
+ ```
43
+
44
+ ---
45
+
46
+ ## Sync Operations
47
+
48
+ ### README Sync
49
+ 1. Read `README.md`
50
+ 2. Cross-reference with `package.json` (or equivalent) for version, description
51
+ 3. Verify counts mentioned in README match actual project artifacts (e.g., source modules, API endpoints, components, commands)
52
+ 4. Update any stale counts or descriptions
53
+
54
+ ### Documentation Sync
55
+ 1. Read the project's primary documentation files (e.g., docs/, wiki, guides)
56
+ 2. Verify all public features/APIs are documented
57
+ 3. Verify descriptions match actual implementations
58
+ 4. Flag any missing or outdated entries
59
+
60
+ ### Source-to-Docs Cross-Reference
61
+ 1. List the project's main source modules/components
62
+ 2. Cross-reference with documentation references
63
+ 3. Verify each documented feature has a corresponding implementation
64
+ 4. Report orphaned documentation or undocumented features
65
+
66
+ ### Architecture Sync
67
+ 1. Read architecture documentation (if it exists)
68
+ 2. Verify component/module/service counts match actual
69
+ 3. Verify described patterns match implemented patterns
70
+ 4. Flag structural drift
71
+
72
+ ### CHANGELOG Sync
73
+ 1. Verify latest version entry matches `package.json` (or equivalent) version
74
+ 2. Check all recent features are documented
75
+
76
+ ---
77
+
78
+ ## Source of Truth Hierarchy
79
+
80
+ ```
81
+ package.json <- Version, description, entry points
82
+ |
83
+ README.md <- Public documentation
84
+ |
85
+ docs/USER-GUIDE.md <- Detailed user guide
86
+ |
87
+ CHANGELOG.md <- Version history
88
+ ```
89
+
90
+ ---
91
+
92
+ ## Report
93
+
94
+ Output via `pan-tools focus sync`:
95
+
96
+ ```
97
+ | Area | Status | Finding |
98
+ |------|--------|---------|
99
+ | README | stale | Components: documented 12, actual 15 |
100
+ | Docs | stale | Missing 3 recently added features |
101
+ | Architecture | stale | Modules: documented 8, actual 10 |
102
+ | CHANGELOG | current | Version matches |
103
+ | Source-Docs | current | All features documented |
104
+ ```
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: pan:health
3
+ group: System
4
+ description: Diagnose planning directory health and optionally repair issues
5
+ argument-hint: [--repair]
6
+ allowed-tools:
7
+ - Read
8
+ - Bash
9
+ - Write
10
+ - AskUserQuestion
11
+ ---
12
+ <objective>
13
+ Validate `.planning/` directory integrity and report actionable issues. Checks for missing files, invalid configurations, inconsistent state, and orphaned plans.
14
+ </objective>
15
+
16
+ <execution_context>
17
+ @~/.claude/pan-wizard-core/workflows/health.md
18
+ </execution_context>
19
+
20
+ <process>
21
+ Execute the health workflow from @~/.claude/pan-wizard-core/workflows/health.md end-to-end.
22
+ Parse --repair flag from arguments and pass to workflow.
23
+ </process>
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: pan:help
3
+ group: System
4
+ description: Show available PAN commands and usage guide
5
+ ---
6
+ <objective>
7
+ Display the complete PAN command reference.
8
+
9
+ Output ONLY the reference content below. Do NOT add:
10
+ - Project-specific analysis
11
+ - Git status or file context
12
+ - Next-step suggestions
13
+ - Any commentary beyond the reference
14
+ </objective>
15
+
16
+ <execution_context>
17
+ @~/.claude/pan-wizard-core/workflows/help.md
18
+ </execution_context>
19
+
20
+ <process>
21
+ Output the complete PAN command reference from @~/.claude/pan-wizard-core/workflows/help.md.
22
+ Display the reference content directly — no additions or modifications.
23
+ </process>
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: pan:insert-phase
3
+ group: Phase Management
4
+ description: Insert urgent work as decimal phase (e.g., 72.1) between existing phases
5
+ argument-hint: <after> <description>
6
+ allowed-tools:
7
+ - Read
8
+ - Write
9
+ - Bash
10
+ ---
11
+
12
+ <objective>
13
+ Insert a decimal phase for urgent work discovered mid-milestone that must be completed between existing integer phases.
14
+
15
+ Uses decimal numbering (72.1, 72.2, etc.) to preserve the logical sequence of planned phases while accommodating urgent insertions.
16
+
17
+ Purpose: Handle urgent work discovered during execution without renumbering entire roadmap.
18
+ </objective>
19
+
20
+ <execution_context>
21
+ @~/.claude/pan-wizard-core/workflows/insert-phase.md
22
+ </execution_context>
23
+
24
+ <context>
25
+ Arguments: $ARGUMENTS (format: <after-phase-number> <description>)
26
+
27
+ Roadmap and state are resolved in-workflow via `init phase-op` and targeted tool calls.
28
+ </context>
29
+
30
+ <process>
31
+ Execute the insert-phase workflow from @~/.claude/pan-wizard-core/workflows/insert-phase.md end-to-end.
32
+ Preserve all validation gates (argument parsing, phase verification, decimal calculation, roadmap updates).
33
+ </process>
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: pan:map-codebase
3
+ group: Getting Started
4
+ description: Analyze codebase with parallel mapper agents to produce .planning/codebase/ documents
5
+ argument-hint: "[optional: specific area to map, e.g., 'api' or 'auth']"
6
+ allowed-tools:
7
+ - Read
8
+ - Bash
9
+ - Glob
10
+ - Grep
11
+ - Write
12
+ - Task
13
+ ---
14
+
15
+ <objective>
16
+ Analyze existing codebase using parallel pan-document_code agents to produce structured codebase documents.
17
+
18
+ Each mapper agent explores a focus area and **writes documents directly** to `.planning/codebase/`. The orchestrator only receives confirmations, keeping context usage minimal.
19
+
20
+ Output: .planning/codebase/ folder with 7 structured documents about the codebase state.
21
+ </objective>
22
+
23
+ <execution_context>
24
+ @~/.claude/pan-wizard-core/workflows/map-codebase.md
25
+ </execution_context>
26
+
27
+ <context>
28
+ Focus area: $ARGUMENTS (optional - if provided, tells agents to focus on specific subsystem)
29
+
30
+ **Load project state if exists:**
31
+ Check for .planning/state.md - loads context if project already initialized
32
+
33
+ **This command can run:**
34
+ - Before /pan:new-project (brownfield codebases) - creates codebase map first
35
+ - After /pan:new-project (greenfield codebases) - updates codebase map as code evolves
36
+ - Anytime to refresh codebase understanding
37
+ </context>
38
+
39
+ <when_to_use>
40
+ **Use map-codebase for:**
41
+ - Brownfield projects before initialization (understand existing code first)
42
+ - Refreshing codebase map after significant changes
43
+ - Onboarding to an unfamiliar codebase
44
+ - Before major refactoring (understand current state)
45
+ - When state.md references outdated codebase info
46
+
47
+ **Skip map-codebase for:**
48
+ - Greenfield projects with no code yet (nothing to map)
49
+ - Trivial codebases (<5 files)
50
+ </when_to_use>
51
+
52
+ <process>
53
+ 1. Check if .planning/codebase/ already exists (offer to refresh or skip)
54
+ 2. Create .planning/codebase/ directory structure
55
+ 3. Spawn 4 parallel pan-document_code agents:
56
+ - Agent 1: tech focus → writes STACK.md, INTEGRATIONS.md
57
+ - Agent 2: arch focus → writes ARCHITECTURE.md, STRUCTURE.md
58
+ - Agent 3: quality focus → writes CONVENTIONS.md, TESTING.md
59
+ - Agent 4: concerns focus → writes CONCERNS.md
60
+ 4. Wait for agents to complete, collect confirmations (NOT document contents)
61
+ 5. Verify all 7 documents exist with line counts
62
+ 6. Commit codebase map
63
+ 7. Offer next steps (typically: /pan:new-project or /pan:plan-phase)
64
+ </process>
65
+
66
+ <success_criteria>
67
+ - [ ] .planning/codebase/ directory created
68
+ - [ ] All 7 codebase documents written by mapper agents
69
+ - [ ] Documents follow template structure
70
+ - [ ] Parallel agents completed without errors
71
+ - [ ] User knows next steps
72
+ </success_criteria>
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: pan:milestone-audit
3
+ group: Milestone
4
+ description: Audit milestone completion against original intent before archiving
5
+ argument-hint: "[version]"
6
+ allowed-tools:
7
+ - Read
8
+ - Glob
9
+ - Grep
10
+ - Bash
11
+ - Task
12
+ - Write
13
+ ---
14
+ <objective>
15
+ Verify milestone achieved its definition of done. Check requirements coverage, cross-phase integration, and end-to-end flows.
16
+
17
+ **This command IS the orchestrator.** Reads existing verification.md files (phases already verified during execute-phase), aggregates tech debt and deferred gaps, then spawns integration checker for cross-phase wiring.
18
+ </objective>
19
+
20
+ <execution_context>
21
+ @~/.claude/pan-wizard-core/workflows/milestone-audit.md
22
+ </execution_context>
23
+
24
+ <context>
25
+ Version: $ARGUMENTS (optional — defaults to current milestone)
26
+
27
+ Core planning files are resolved in-workflow (`init milestone-op`) and loaded only as needed.
28
+
29
+ **Completed Work:**
30
+ Glob: .planning/phases/*/*-summary.md
31
+ Glob: .planning/phases/*/*-verification.md
32
+ </context>
33
+
34
+ <process>
35
+ Execute the audit-milestone workflow from @~/.claude/pan-wizard-core/workflows/milestone-audit.md end-to-end.
36
+ Preserve all workflow gates (scope determination, verification reading, integration check, requirements coverage, routing).
37
+ </process>
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: pan:milestone-cleanup
3
+ group: Milestone
4
+ description: Archive accumulated phase directories from completed milestones
5
+ ---
6
+ <objective>
7
+ Archive phase directories from completed milestones into `.planning/milestones/v{X.Y}-phases/`.
8
+
9
+ Use when `.planning/phases/` has accumulated directories from past milestones.
10
+ </objective>
11
+
12
+ <execution_context>
13
+ @~/.claude/pan-wizard-core/workflows/milestone-cleanup.md
14
+ </execution_context>
15
+
16
+ <process>
17
+ Follow the cleanup workflow at @~/.claude/pan-wizard-core/workflows/milestone-cleanup.md.
18
+ Identify completed milestones, show a dry-run summary, and archive on confirmation.
19
+ </process>
@@ -0,0 +1,137 @@
1
+ ---
2
+ type: prompt
3
+ name: pan:milestone-done
4
+ group: Milestone
5
+ description: Archive completed milestone and prepare for next version
6
+ argument-hint: <version>
7
+ allowed-tools:
8
+ - Read
9
+ - Write
10
+ - Bash
11
+ ---
12
+
13
+ <objective>
14
+ Mark milestone {{version}} complete, archive to milestones/, and update roadmap.md and requirements.md.
15
+
16
+ Purpose: Create historical record of shipped version, archive milestone artifacts (roadmap + requirements), and prepare for next milestone.
17
+ Output: Milestone archived (roadmap + requirements), project.md evolved, git tagged.
18
+ </objective>
19
+
20
+ <execution_context>
21
+ **Load these files NOW (before proceeding):**
22
+
23
+ - @~/.claude/pan-wizard-core/workflows/milestone-done.md (main workflow)
24
+ - @~/.claude/pan-wizard-core/templates/milestone-archive.md (archive template)
25
+ </execution_context>
26
+
27
+ <context>
28
+ **Project files:**
29
+ - `.planning/roadmap.md`
30
+ - `.planning/requirements.md`
31
+ - `.planning/state.md`
32
+ - `.planning/project.md`
33
+
34
+ **User input:**
35
+
36
+ - Version: {{version}} (e.g., "1.0", "1.1", "2.0")
37
+ </context>
38
+
39
+ <process>
40
+
41
+ **Follow milestone-done.md workflow:**
42
+
43
+ 0. **Check for audit:**
44
+
45
+ - Look for `.planning/v{{version}}-milestone-audit.md`
46
+ - If missing or stale: recommend `/pan:milestone-audit` first
47
+ - If audit status is `gaps_found`: recommend `/pan:milestone-gaps` first
48
+ - If audit status is `passed`: proceed to step 1
49
+
50
+ ```markdown
51
+ ## Pre-flight Check
52
+
53
+ {If no v{{version}}-milestone-audit.md:}
54
+ ⚠ No milestone audit found. Run `/pan:milestone-audit` first to verify
55
+ requirements coverage, cross-phase integration, and E2E flows.
56
+
57
+ {If audit has gaps:}
58
+ ⚠ Milestone audit found gaps. Run `/pan:milestone-gaps` to create
59
+ phases that close the gaps, or proceed anyway to accept as tech debt.
60
+
61
+ {If audit passed:}
62
+ ✓ Milestone audit passed. Proceeding with completion.
63
+ ```
64
+
65
+ 1. **Verify readiness:**
66
+
67
+ - Check all phases in milestone have completed plans (summary.md exists)
68
+ - Present milestone scope and stats
69
+ - Wait for confirmation
70
+
71
+ 2. **Gather stats:**
72
+
73
+ - Count phases, plans, tasks
74
+ - Calculate git range, file changes, LOC
75
+ - Extract timeline from git log
76
+ - Present summary, confirm
77
+
78
+ 3. **Extract accomplishments:**
79
+
80
+ - Read all phase summary.md files in milestone range
81
+ - Extract 4-6 key accomplishments
82
+ - Present for approval
83
+
84
+ 4. **Archive milestone:**
85
+
86
+ - Create `.planning/milestones/v{{version}}-roadmap.md`
87
+ - Extract full phase details from roadmap.md
88
+ - Fill milestone-archive.md template
89
+ - Update roadmap.md to one-line summary with link
90
+
91
+ 5. **Archive requirements:**
92
+
93
+ - Create `.planning/milestones/v{{version}}-requirements.md`
94
+ - Mark all v1 requirements as complete (checkboxes checked)
95
+ - Note requirement outcomes (validated, adjusted, dropped)
96
+ - Delete `.planning/requirements.md` (fresh one created for next milestone)
97
+
98
+ 6. **Update project.md:**
99
+
100
+ - Add "Current State" section with shipped version
101
+ - Add "Next Milestone Goals" section
102
+ - Archive previous content in `<details>` (if v1.1+)
103
+
104
+ 7. **Commit and tag:**
105
+
106
+ - Stage: milestones.md, project.md, roadmap.md, state.md, archive files
107
+ - Commit: `chore: archive v{{version}} milestone`
108
+ - Tag: `git tag -a v{{version}} -m "[milestone summary]"`
109
+ - Ask about pushing tag
110
+
111
+ 8. **Offer next steps:**
112
+ - `/pan:milestone-new` — start next milestone (questioning → research → requirements → roadmap)
113
+
114
+ </process>
115
+
116
+ <success_criteria>
117
+
118
+ - Milestone archived to `.planning/milestones/v{{version}}-roadmap.md`
119
+ - Requirements archived to `.planning/milestones/v{{version}}-requirements.md`
120
+ - `.planning/requirements.md` deleted (fresh for next milestone)
121
+ - roadmap.md collapsed to one-line entry
122
+ - project.md updated with current state
123
+ - Git tag v{{version}} created
124
+ - Commit successful
125
+ - User knows next steps (including need for fresh requirements)
126
+ </success_criteria>
127
+
128
+ <critical_rules>
129
+
130
+ - **Load workflow first:** Read milestone-done.md before executing
131
+ - **Verify completion:** All phases must have summary.md files
132
+ - **User confirmation:** Wait for approval at verification gates
133
+ - **Archive before deleting:** Always create archive files before updating/deleting originals
134
+ - **One-line summary:** Collapsed milestone in roadmap.md should be single line with link
135
+ - **Context efficiency:** Archive keeps roadmap.md and requirements.md constant size per milestone
136
+ - **Fresh requirements:** Next milestone starts with `/pan:milestone-new` which includes requirements definition
137
+ </critical_rules>
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: pan:milestone-gaps
3
+ group: Milestone
4
+ description: Create phases to close all gaps identified by milestone audit
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ - Glob
10
+ - Grep
11
+ - AskUserQuestion
12
+ ---
13
+ <objective>
14
+ Create all phases necessary to close gaps identified by `/pan:milestone-audit`.
15
+
16
+ Reads milestone-audit.md, groups gaps into logical phases, creates phase entries in roadmap.md, and offers to plan each phase.
17
+
18
+ One command creates all fix phases — no manual `/pan:add-phase` per gap.
19
+ </objective>
20
+
21
+ <execution_context>
22
+ @~/.claude/pan-wizard-core/workflows/milestone-gaps.md
23
+ </execution_context>
24
+
25
+ <context>
26
+ **Audit results:**
27
+ Glob: .planning/v*-milestone-audit.md (use most recent)
28
+
29
+ Original intent and current planning state are loaded on demand inside the workflow.
30
+ </context>
31
+
32
+ <process>
33
+ Execute the plan-milestone-gaps workflow from @~/.claude/pan-wizard-core/workflows/milestone-gaps.md end-to-end.
34
+ Preserve all workflow gates (audit loading, prioritization, phase grouping, user confirmation, roadmap updates).
35
+ </process>
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: pan:milestone-new
3
+ group: Milestone
4
+ description: Start a new milestone cycle — update project.md and route to requirements
5
+ argument-hint: "[milestone name, e.g., 'v1.1 Notifications']"
6
+ allowed-tools:
7
+ - Read
8
+ - Write
9
+ - Bash
10
+ - Task
11
+ - AskUserQuestion
12
+ ---
13
+ <objective>
14
+ Start a new milestone: questioning → research (optional) → requirements → roadmap.
15
+
16
+ Brownfield equivalent of new-project. Project exists, project.md has history. Gathers "what's next", updates project.md, then runs requirements → roadmap cycle.
17
+
18
+ **Creates/Updates:**
19
+ - `.planning/project.md` — updated with new milestone goals
20
+ - `.planning/research/` — domain research (optional, NEW features only)
21
+ - `.planning/requirements.md` — scoped requirements for this milestone
22
+ - `.planning/roadmap.md` — phase structure (continues numbering)
23
+ - `.planning/state.md` — reset for new milestone
24
+
25
+ **After:** `/pan:plan-phase [N]` to start execution.
26
+ </objective>
27
+
28
+ <execution_context>
29
+ @~/.claude/pan-wizard-core/workflows/milestone-new.md
30
+ @~/.claude/pan-wizard-core/references/questioning.md
31
+ @~/.claude/pan-wizard-core/references/ui-brand.md
32
+ @~/.claude/pan-wizard-core/templates/project.md
33
+ @~/.claude/pan-wizard-core/templates/requirements.md
34
+ </execution_context>
35
+
36
+ <context>
37
+ Milestone name: $ARGUMENTS (optional - will prompt if not provided)
38
+
39
+ Project and milestone context files are resolved inside the workflow (`init new-milestone`) and delegated via `<files_to_read>` blocks where subagents are used.
40
+ </context>
41
+
42
+ <process>
43
+ Execute the new-milestone workflow from @~/.claude/pan-wizard-core/workflows/milestone-new.md end-to-end.
44
+ Preserve all workflow gates (validation, questioning, research, requirements, roadmap approval, commits).
45
+ </process>
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: pan:new-project
3
+ group: Getting Started
4
+ description: Initialize a new project with deep context gathering and project.md
5
+ argument-hint: "[--auto]"
6
+ allowed-tools:
7
+ - Read
8
+ - Bash
9
+ - Write
10
+ - Task
11
+ - AskUserQuestion
12
+ ---
13
+ <context>
14
+ **Flags:**
15
+ - `--auto` — Automatic mode. After config questions, runs research → requirements → roadmap without further interaction. Expects idea document via @ reference.
16
+ </context>
17
+
18
+ <objective>
19
+ Initialize a new project through unified flow: questioning → research (optional) → requirements → roadmap.
20
+
21
+ **Creates:**
22
+ - `.planning/project.md` — project context
23
+ - `.planning/config.json` — workflow preferences
24
+ - `.planning/research/` — domain research (optional)
25
+ - `.planning/requirements.md` — scoped requirements
26
+ - `.planning/roadmap.md` — phase structure
27
+ - `.planning/state.md` — project memory
28
+
29
+ **After this command:** Run `/pan:plan-phase 1` to start execution.
30
+ </objective>
31
+
32
+ <execution_context>
33
+ @~/.claude/pan-wizard-core/workflows/new-project.md
34
+ @~/.claude/pan-wizard-core/references/questioning.md
35
+ @~/.claude/pan-wizard-core/references/ui-brand.md
36
+ @~/.claude/pan-wizard-core/templates/project.md
37
+ @~/.claude/pan-wizard-core/templates/requirements.md
38
+ </execution_context>
39
+
40
+ <process>
41
+ Execute the new-project workflow from @~/.claude/pan-wizard-core/workflows/new-project.md end-to-end.
42
+ Preserve all workflow gates (validation, approvals, commits, routing).
43
+ </process>
@@ -0,0 +1,110 @@
1
+ ---
2
+ description: Reapply local modifications after a PAN update
3
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
4
+ ---
5
+
6
+ <purpose>
7
+ After a PAN update wipes and reinstalls files, this command merges user's previously saved local modifications back into the new version. Uses intelligent comparison to handle cases where the upstream file also changed.
8
+ </purpose>
9
+
10
+ <process>
11
+
12
+ ## Step 1: Detect backed-up patches
13
+
14
+ Check for local patches directory:
15
+
16
+ ```bash
17
+ # Global install (path templated at install time)
18
+ PATCHES_DIR=~/.claude/pan-local-patches
19
+ # Local install fallback
20
+ if [ ! -d "$PATCHES_DIR" ]; then
21
+ PATCHES_DIR=./.claude/pan-local-patches
22
+ fi
23
+ ```
24
+
25
+ Read `backup-meta.json` from the patches directory.
26
+
27
+ **If no patches found:**
28
+ ```
29
+ No local patches found. Nothing to reapply.
30
+
31
+ Local patches are automatically saved when you run /pan:update
32
+ after modifying any PAN workflow, command, or agent files.
33
+ ```
34
+ Exit.
35
+
36
+ ## Step 2: Show patch summary
37
+
38
+ ```
39
+ ## Local Patches to Reapply
40
+
41
+ **Backed up from:** v{from_version}
42
+ **Current version:** {read VERSION file}
43
+ **Files modified:** {count}
44
+
45
+ | # | File | Status |
46
+ |---|------|--------|
47
+ | 1 | {file_path} | Pending |
48
+ | 2 | {file_path} | Pending |
49
+ ```
50
+
51
+ ## Step 3: Merge each file
52
+
53
+ For each file in `backup-meta.json`:
54
+
55
+ 1. **Read the backed-up version** (user's modified copy from `pan-local-patches/`)
56
+ 2. **Read the newly installed version** (current file after update)
57
+ 3. **Compare and merge:**
58
+
59
+ - If the new file is identical to the backed-up file: skip (modification was incorporated upstream)
60
+ - If the new file differs: identify the user's modifications and apply them to the new version
61
+
62
+ **Merge strategy:**
63
+ - Read both versions fully
64
+ - Identify sections the user added or modified (look for additions, not just differences from path replacement)
65
+ - Apply user's additions/modifications to the new version
66
+ - If a section the user modified was also changed upstream: flag as conflict, show both versions, ask user which to keep
67
+
68
+ 4. **Write merged result** to the installed location
69
+ 5. **Report status:**
70
+ - `Merged` — user modifications applied cleanly
71
+ - `Skipped` — modification already in upstream
72
+ - `Conflict` — user chose resolution
73
+
74
+ ## Step 4: Update manifest
75
+
76
+ After reapplying, regenerate the file manifest so future updates correctly detect these as user modifications:
77
+
78
+ ```bash
79
+ # The manifest will be regenerated on next /pan:update
80
+ # For now, just note which files were modified
81
+ ```
82
+
83
+ ## Step 5: Cleanup option
84
+
85
+ Ask user:
86
+ - "Keep patch backups for reference?" → preserve `pan-local-patches/`
87
+ - "Clean up patch backups?" → remove `pan-local-patches/` directory
88
+
89
+ ## Step 6: Report
90
+
91
+ ```
92
+ ## Patches Reapplied
93
+
94
+ | # | File | Status |
95
+ |---|------|--------|
96
+ | 1 | {file_path} | ✓ Merged |
97
+ | 2 | {file_path} | ○ Skipped (already upstream) |
98
+ | 3 | {file_path} | ⚠ Conflict resolved |
99
+
100
+ {count} file(s) updated. Your local modifications are active again.
101
+ ```
102
+
103
+ </process>
104
+
105
+ <success_criteria>
106
+ - [ ] All backed-up patches processed
107
+ - [ ] User modifications merged into new version
108
+ - [ ] Conflicts resolved with user input
109
+ - [ ] Status reported for each file
110
+ </success_criteria>