pan-wizard 3.32.0 → 3.34.0
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.
- package/README.md +23 -20
- package/agents/pan-conductor.md +18 -17
- package/agents/pan-counterfactual.md +2 -2
- package/agents/pan-debugger.md +27 -8
- package/agents/pan-design-checker.md +1 -1
- package/agents/pan-designer.md +2 -2
- package/agents/pan-distiller.md +3 -3
- package/agents/pan-document_code.md +16 -16
- package/agents/pan-executor.md +15 -11
- package/agents/pan-experiment-runner.md +15 -17
- package/agents/pan-hardener.md +15 -15
- package/agents/pan-integration-checker.md +2 -2
- package/agents/pan-knowledge.md +2 -2
- package/agents/pan-meta-reviewer.md +5 -5
- package/agents/pan-optimizer.md +40 -44
- package/agents/pan-phase-researcher.md +10 -10
- package/agents/pan-plan-checker.md +36 -30
- package/agents/pan-planner.md +77 -53
- package/agents/pan-previewer.md +1 -1
- package/agents/pan-project-researcher.md +21 -78
- package/agents/pan-release.md +1 -1
- package/agents/pan-research-synthesizer.md +2 -2
- package/agents/pan-reviewer.md +24 -2
- package/agents/pan-roadmapper.md +20 -62
- package/agents/pan-verifier.md +53 -30
- package/bin/install-lib.cjs +228 -38
- package/bin/install.js +86 -15
- package/commands/pan/army.md +16 -12
- package/commands/pan/assumptions.md +2 -2
- package/commands/pan/audit-deployment.md +11 -12
- package/commands/pan/cost.md +8 -4
- package/commands/pan/debug.md +10 -7
- package/commands/pan/design-phase.md +3 -3
- package/commands/pan/discuss-phase.md +2 -0
- package/commands/pan/exec-phase.md +21 -37
- package/commands/pan/experiment.md +11 -10
- package/commands/pan/focus-auto.md +33 -27
- package/commands/pan/focus-design.md +9 -6
- package/commands/pan/focus-doc-audit.md +4 -3
- package/commands/pan/focus-drift-walking.md +4 -3
- package/commands/pan/focus-exec.md +7 -7
- package/commands/pan/focus-plan.md +12 -11
- package/commands/pan/focus-scan.md +7 -10
- package/commands/pan/focus-sync.md +3 -2
- package/commands/pan/git.md +8 -8
- package/commands/pan/health.md +2 -2
- package/commands/pan/hud.md +3 -2
- package/commands/pan/hygiene.md +14 -7
- package/commands/pan/knowledge.md +9 -9
- package/commands/pan/learn.md +10 -7
- package/commands/pan/links.md +4 -1
- package/commands/pan/map-codebase.md +5 -5
- package/commands/pan/mcp-bridge.md +18 -18
- package/commands/pan/milestone-done.md +7 -5
- package/commands/pan/milestone-new.md +1 -1
- package/commands/pan/new-project.md +10 -10
- package/commands/pan/optimize.md +16 -14
- package/commands/pan/patches.md +2 -6
- package/commands/pan/pause.md +1 -1
- package/commands/pan/phase-tests.md +4 -3
- package/commands/pan/plan-phase.md +9 -19
- package/commands/pan/preview.md +1 -1
- package/commands/pan/profile.md +4 -4
- package/commands/pan/quick.md +1 -1
- package/commands/pan/remove-phase.md +1 -1
- package/commands/pan/report.md +2 -2
- package/commands/pan/research-phase.md +14 -15
- package/commands/pan/resume.md +9 -11
- package/commands/pan/retro.md +5 -3
- package/commands/pan/review-deep.md +10 -10
- package/commands/pan/settings.md +1 -1
- package/commands/pan/todo-add.md +2 -2
- package/commands/pan/todo-check.md +2 -2
- package/commands/pan/verify-phase.md +0 -11
- package/commands/pan/what-if.md +2 -2
- package/hooks/dist/pan-context-monitor.js +343 -44
- package/hooks/dist/pan-cost-logger.js +30 -0
- package/hooks/dist/pan-state-reinject.js +140 -15
- package/hooks/dist/pan-statusline.js +68 -22
- package/hooks/dist/pan-stop-guard.js +7 -2
- package/package.json +1 -1
- package/pan-wizard-core/bin/lib/agents-md.cjs +48 -7
- package/pan-wizard-core/bin/lib/bridge.cjs +6 -5
- package/pan-wizard-core/bin/lib/campaign.cjs +4 -2
- package/pan-wizard-core/bin/lib/commands-learnings.cjs +19 -2
- package/pan-wizard-core/bin/lib/commands.cjs +126 -5
- package/pan-wizard-core/bin/lib/config.cjs +112 -1
- package/pan-wizard-core/bin/lib/constants.cjs +29 -15
- package/pan-wizard-core/bin/lib/context-budget.cjs +12 -9
- package/pan-wizard-core/bin/lib/core.cjs +77 -23
- package/pan-wizard-core/bin/lib/cost-rebuild.cjs +13 -1
- package/pan-wizard-core/bin/lib/cost.cjs +149 -10
- package/pan-wizard-core/bin/lib/distill.cjs +6 -3
- package/pan-wizard-core/bin/lib/doc-lint.cjs +30 -11
- package/pan-wizard-core/bin/lib/findings.cjs +15 -4
- package/pan-wizard-core/bin/lib/focus.cjs +13 -4
- package/pan-wizard-core/bin/lib/frontmatter.cjs +105 -26
- package/pan-wizard-core/bin/lib/hygiene.cjs +178 -17
- package/pan-wizard-core/bin/lib/init.cjs +12 -5
- package/pan-wizard-core/bin/lib/knowledge.cjs +17 -1
- package/pan-wizard-core/bin/lib/learn-index.cjs +111 -10
- package/pan-wizard-core/bin/lib/learn-lint.cjs +30 -3
- package/pan-wizard-core/bin/lib/memory-optimize.cjs +8 -4
- package/pan-wizard-core/bin/lib/memory.cjs +508 -54
- package/pan-wizard-core/bin/lib/milestone.cjs +8 -3
- package/pan-wizard-core/bin/lib/optimize.cjs +84 -16
- package/pan-wizard-core/bin/lib/phase-remove.cjs +85 -21
- package/pan-wizard-core/bin/lib/phase-report.cjs +8 -2
- package/pan-wizard-core/bin/lib/phase.cjs +67 -15
- package/pan-wizard-core/bin/lib/preview.cjs +3 -1
- package/pan-wizard-core/bin/lib/review-deep.cjs +2 -2
- package/pan-wizard-core/bin/lib/roadmap-compact.cjs +267 -0
- package/pan-wizard-core/bin/lib/roadmap.cjs +243 -9
- package/pan-wizard-core/bin/lib/runner.cjs +2 -1
- package/pan-wizard-core/bin/lib/state-compact.cjs +11 -6
- package/pan-wizard-core/bin/lib/state.cjs +47 -31
- package/pan-wizard-core/bin/lib/template.cjs +11 -4
- package/pan-wizard-core/bin/lib/verdict.cjs +54 -4
- package/pan-wizard-core/bin/lib/verify-drift.cjs +14 -5
- package/pan-wizard-core/bin/lib/verify-preflight.cjs +4 -13
- package/pan-wizard-core/bin/lib/verify-retro.cjs +5 -3
- package/pan-wizard-core/bin/lib/verify-scope.cjs +74 -4
- package/pan-wizard-core/bin/lib/verify.cjs +117 -35
- package/pan-wizard-core/bin/lib/whatif.cjs +5 -3
- package/pan-wizard-core/bin/pan-tools.cjs +111 -17
- package/pan-wizard-core/learnings/index.json +5 -5
- package/pan-wizard-core/mcp/server.cjs +18 -9
- package/pan-wizard-core/opencode/pan-wizard.js +111 -0
- package/pan-wizard-core/references/checkpoints.md +7 -5
- package/pan-wizard-core/references/continuation-format.md +3 -3
- package/pan-wizard-core/references/decimal-phase-calculation.md +2 -3
- package/pan-wizard-core/references/design-methodology.md +1 -1
- package/pan-wizard-core/references/git-integration.md +4 -6
- package/pan-wizard-core/references/git-planning-commit.md +2 -2
- package/pan-wizard-core/references/guardrails.md +2 -2
- package/pan-wizard-core/references/handoff-decisions.md +3 -3
- package/pan-wizard-core/references/model-profile-resolution.md +5 -5
- package/pan-wizard-core/references/model-profiles.md +14 -9
- package/pan-wizard-core/references/phase-argument-parsing.md +7 -7
- package/pan-wizard-core/references/planning-config.md +4 -4
- package/pan-wizard-core/references/tdd.md +10 -1
- package/pan-wizard-core/references/verdict-contract.md +2 -1
- package/pan-wizard-core/references/verification-patterns.md +5 -5
- package/pan-wizard-core/templates/codebase/architecture.md +2 -2
- package/pan-wizard-core/templates/codebase/best-practices.md +2 -2
- package/pan-wizard-core/templates/codebase/concerns.md +3 -3
- package/pan-wizard-core/templates/codebase/integrations.md +6 -6
- package/pan-wizard-core/templates/codebase/relationships.md +2 -2
- package/pan-wizard-core/templates/codebase/stack.md +2 -2
- package/pan-wizard-core/templates/codebase/structure.md +4 -4
- package/pan-wizard-core/templates/codebase/testing.md +4 -4
- package/pan-wizard-core/templates/continue-here.md +1 -1
- package/pan-wizard-core/templates/debug-subagent-prompt.md +3 -2
- package/pan-wizard-core/templates/debug.md +15 -1
- package/pan-wizard-core/templates/discovery.md +1 -1
- package/pan-wizard-core/templates/milestone-archive.md +6 -6
- package/pan-wizard-core/templates/milestone.md +1 -1
- package/pan-wizard-core/templates/phase-prompt.md +31 -18
- package/pan-wizard-core/templates/planner-subagent-prompt.md +3 -5
- package/pan-wizard-core/templates/research-project/architecture.md +3 -3
- package/pan-wizard-core/templates/research-project/features.md +1 -1
- package/pan-wizard-core/templates/research-project/pitfalls.md +1 -1
- package/pan-wizard-core/templates/research-project/stack.md +3 -3
- package/pan-wizard-core/templates/research.md +5 -5
- package/pan-wizard-core/templates/retrospective.md +1 -1
- package/pan-wizard-core/templates/roadmap.md +15 -15
- package/pan-wizard-core/templates/summary-complex.md +1 -0
- package/pan-wizard-core/templates/summary-minimal.md +1 -0
- package/pan-wizard-core/templates/summary-standard.md +2 -1
- package/pan-wizard-core/templates/summary.md +18 -2
- package/pan-wizard-core/templates/uat.md +3 -3
- package/pan-wizard-core/templates/user-setup.md +8 -8
- package/pan-wizard-core/templates/verification-report.md +54 -4
- package/pan-wizard-core/workflows/add-phase.md +1 -1
- package/pan-wizard-core/workflows/assumptions.md +1 -1
- package/pan-wizard-core/workflows/discuss-phase.md +9 -8
- package/pan-wizard-core/workflows/exec-phase.md +34 -60
- package/pan-wizard-core/workflows/execute-plan.md +8 -7
- package/pan-wizard-core/workflows/health.md +13 -11
- package/pan-wizard-core/workflows/help.md +8 -9
- package/pan-wizard-core/workflows/learn.md +13 -11
- package/pan-wizard-core/workflows/map-codebase.md +10 -10
- package/pan-wizard-core/workflows/milestone-audit.md +10 -10
- package/pan-wizard-core/workflows/milestone-gaps.md +17 -24
- package/pan-wizard-core/workflows/milestone-new.md +7 -6
- package/pan-wizard-core/workflows/new-project.md +10 -10
- package/pan-wizard-core/workflows/optimize.md +11 -9
- package/pan-wizard-core/workflows/pause.md +6 -1
- package/pan-wizard-core/workflows/phase-tests.md +4 -4
- package/pan-wizard-core/workflows/plan-phase.md +31 -34
- package/pan-wizard-core/workflows/profile.md +2 -2
- package/pan-wizard-core/workflows/progress.md +5 -7
- package/pan-wizard-core/workflows/quick.md +10 -8
- package/pan-wizard-core/workflows/remove-phase.md +1 -1
- package/pan-wizard-core/workflows/research-phase.md +9 -5
- package/pan-wizard-core/workflows/resume-project.md +4 -6
- package/pan-wizard-core/workflows/retro.md +3 -1
- package/pan-wizard-core/workflows/settings.md +16 -24
- package/pan-wizard-core/workflows/todo-check.md +1 -1
- package/pan-wizard-core/workflows/transition.md +12 -12
- package/pan-wizard-core/workflows/update.md +25 -17
- package/pan-wizard-core/workflows/verify-phase.md +24 -17
- package/pan-zcode/KNOWN-BETA-RISKS.md +2 -2
- package/pan-zcode/README.md +7 -7
- package/pan-zcode/bin/install-zcode.js +1 -1
- package/scripts/build-agent-plugin.js +19 -5
- package/scripts/build-plugin.js +3 -1
- package/scripts/generate-skills-docs.py +13 -4
- package/scripts/test-surface.cjs +4 -0
|
@@ -8,7 +8,7 @@ Template for `.planning/phases/XX-name/{phase_num}-uat.md` — persistent UAT se
|
|
|
8
8
|
|
|
9
9
|
```markdown
|
|
10
10
|
---
|
|
11
|
-
status: testing | complete | diagnosed
|
|
11
|
+
status: testing | complete | diagnosed | resolved
|
|
12
12
|
phase: XX-name
|
|
13
13
|
source: [list of summary.md files tested]
|
|
14
14
|
started: [ISO timestamp]
|
|
@@ -74,7 +74,7 @@ skipped: [N]
|
|
|
74
74
|
<section_rules>
|
|
75
75
|
|
|
76
76
|
**Frontmatter:**
|
|
77
|
-
- `status`: OVERWRITE - "testing" or "
|
|
77
|
+
- `status`: OVERWRITE - "testing", "complete", "diagnosed" (after diagnosis) or "resolved" (exec-phase closes the gaps)
|
|
78
78
|
- `phase`: IMMUTABLE - set on creation
|
|
79
79
|
- `source`: IMMUTABLE - SUMMARY files being tested
|
|
80
80
|
- `started`: IMMUTABLE - set on creation
|
|
@@ -106,7 +106,7 @@ skipped: [N]
|
|
|
106
106
|
|
|
107
107
|
**After testing complete (status: complete), if gaps exist:**
|
|
108
108
|
|
|
109
|
-
1. User runs diagnosis (
|
|
109
|
+
1. User runs diagnosis (on Claude Code, the native `/pan-diagnose-issues <phase>`; no `/pan:` command or verify-phase step runs it)
|
|
110
110
|
2. diagnose-issues workflow spawns parallel debug agents
|
|
111
111
|
3. Each agent investigates one gap, returns root cause
|
|
112
112
|
4. uat.md Gaps section updated with diagnosis:
|
|
@@ -8,7 +8,7 @@ Template for `.planning/phases/XX-name/{phase}-USER-SETUP.md` - human-required c
|
|
|
8
8
|
|
|
9
9
|
## File Template
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
~~~markdown
|
|
12
12
|
# Phase {X}: User Setup Required
|
|
13
13
|
|
|
14
14
|
**Generated:** [YYYY-MM-DD]
|
|
@@ -55,7 +55,7 @@ Expected results:
|
|
|
55
55
|
---
|
|
56
56
|
|
|
57
57
|
**Once all items complete:** Mark status as "Complete" at top of file.
|
|
58
|
-
|
|
58
|
+
~~~
|
|
59
59
|
|
|
60
60
|
---
|
|
61
61
|
|
|
@@ -117,7 +117,7 @@ user_setup:
|
|
|
117
117
|
## Service-Specific Examples
|
|
118
118
|
|
|
119
119
|
<stripe_example>
|
|
120
|
-
|
|
120
|
+
~~~markdown
|
|
121
121
|
# Phase 10: User Setup Required
|
|
122
122
|
|
|
123
123
|
**Generated:** 2025-01-14
|
|
@@ -188,11 +188,11 @@ Expected: Build passes, webhook returns 400 (signature validation working).
|
|
|
188
188
|
---
|
|
189
189
|
|
|
190
190
|
**Once all items complete:** Mark status as "Complete" at top of file.
|
|
191
|
-
|
|
191
|
+
~~~
|
|
192
192
|
</stripe_example>
|
|
193
193
|
|
|
194
194
|
<supabase_example>
|
|
195
|
-
|
|
195
|
+
~~~markdown
|
|
196
196
|
# Phase 2: User Setup Required
|
|
197
197
|
|
|
198
198
|
**Generated:** 2025-01-14
|
|
@@ -242,11 +242,11 @@ npx supabase status
|
|
|
242
242
|
---
|
|
243
243
|
|
|
244
244
|
**Once all items complete:** Mark status as "Complete" at top of file.
|
|
245
|
-
|
|
245
|
+
~~~
|
|
246
246
|
</supabase_example>
|
|
247
247
|
|
|
248
248
|
<sendgrid_example>
|
|
249
|
-
|
|
249
|
+
~~~markdown
|
|
250
250
|
# Phase 5: User Setup Required
|
|
251
251
|
|
|
252
252
|
**Generated:** 2025-01-14
|
|
@@ -297,7 +297,7 @@ curl -X POST http://localhost:3000/api/test-email \
|
|
|
297
297
|
---
|
|
298
298
|
|
|
299
299
|
**Once all items complete:** Mark status as "Complete" at top of file.
|
|
300
|
-
|
|
300
|
+
~~~
|
|
301
301
|
</sendgrid_example>
|
|
302
302
|
|
|
303
303
|
---
|
|
@@ -10,11 +10,34 @@ Template for `.planning/phases/XX-name/{phase_num}-verification.md` — phase go
|
|
|
10
10
|
---
|
|
11
11
|
phase: XX-name
|
|
12
12
|
verified: YYYY-MM-DDTHH:MM:SSZ
|
|
13
|
+
# verified_commit: git rev-parse HEAD before writing this file; `pan-tools verify stale` compares against it
|
|
14
|
+
verified_commit: <sha>
|
|
13
15
|
status: passed | gaps_found | human_needed
|
|
14
16
|
score: N/M must-haves verified
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
test_gate: passed | failed | skipped
|
|
18
|
+
# Only for checks that could not run, with why (a skipped test gate is one): write not_checked uncommented
|
|
19
|
+
# not_checked:
|
|
20
|
+
# - check: "tests"
|
|
21
|
+
# reason: "no test script in package.json"
|
|
22
|
+
# Only if status: gaps_found; read by `findings record` and /pan:plan-phase --gaps: write gaps uncommented
|
|
23
|
+
# gaps:
|
|
24
|
+
# - truth: "Observable truth that failed"
|
|
25
|
+
# status: failed
|
|
26
|
+
# reason: "Why it failed"
|
|
27
|
+
# artifacts:
|
|
28
|
+
# - path: "src/path/to/file.tsx"
|
|
29
|
+
# issue: "What's wrong"
|
|
30
|
+
# missing:
|
|
31
|
+
# - "Specific thing to add/fix"
|
|
32
|
+
# Only if status: human_needed: write human_verification uncommented
|
|
33
|
+
# human_verification:
|
|
34
|
+
# - test: "What to do"
|
|
35
|
+
# expected: "What should happen"
|
|
36
|
+
# why_human: "Why it cannot be verified programmatically"
|
|
37
|
+
# Only when the scope check (`pan-tools verify scope <phase>`) found work no plan asked for: write unrequested uncommented
|
|
38
|
+
# unrequested:
|
|
39
|
+
# - path: "src/admin/panel.tsx"
|
|
40
|
+
# what: "An admin panel no plan or requirement asked for"
|
|
18
41
|
---
|
|
19
42
|
|
|
20
43
|
# Phase {X}: {Name} Verification Report
|
|
@@ -207,8 +230,35 @@ Unrequested work is recorded, not blocking: the status does not change because o
|
|
|
207
230
|
---
|
|
208
231
|
phase: 03-chat
|
|
209
232
|
verified: 2025-01-15T14:30:00Z
|
|
233
|
+
verified_commit: 4f2a9c1
|
|
210
234
|
status: gaps_found
|
|
211
|
-
score:
|
|
235
|
+
score: 1/5 must-haves verified
|
|
236
|
+
test_gate: passed
|
|
237
|
+
gaps:
|
|
238
|
+
- truth: "User can see existing messages"
|
|
239
|
+
status: failed
|
|
240
|
+
reason: "Chat.tsx renders a placeholder, not message data"
|
|
241
|
+
artifacts:
|
|
242
|
+
- path: "src/components/Chat.tsx"
|
|
243
|
+
issue: "Returns a placeholder div and fetches nothing"
|
|
244
|
+
missing:
|
|
245
|
+
- "Fetch from /api/chat and render the messages"
|
|
246
|
+
- truth: "User can send a message"
|
|
247
|
+
status: failed
|
|
248
|
+
reason: "The onSubmit handler only logs"
|
|
249
|
+
artifacts:
|
|
250
|
+
- path: "src/components/ChatInput.tsx"
|
|
251
|
+
issue: "onSubmit calls console.log, no fetch"
|
|
252
|
+
missing:
|
|
253
|
+
- "POST to /api/chat on submit"
|
|
254
|
+
- truth: "Sent message appears in list"
|
|
255
|
+
status: failed
|
|
256
|
+
reason: "No state update after send, and the API routes return hardcoded values"
|
|
257
|
+
artifacts:
|
|
258
|
+
- path: "src/app/api/chat/route.ts"
|
|
259
|
+
issue: "GET returns [], POST returns { ok: true }, no database call"
|
|
260
|
+
missing:
|
|
261
|
+
- "prisma.message.findMany and create in the route handlers, and a list refresh after send"
|
|
212
262
|
---
|
|
213
263
|
|
|
214
264
|
# Phase 3: Chat Interface Verification Report
|
|
@@ -52,7 +52,7 @@ The CLI handles:
|
|
|
52
52
|
- Calculating next phase number (max + 1)
|
|
53
53
|
- Generating slug from description
|
|
54
54
|
- Creating the phase directory (`.planning/phases/{NN}-{slug}/`)
|
|
55
|
-
- Inserting the phase
|
|
55
|
+
- Inserting the phase into roadmap.md: its checklist line, and a section with Goal, Requirements, Depends on and Plans lines
|
|
56
56
|
|
|
57
57
|
Extract from result: `phase_number`, `padded`, `name`, `slug`, `directory`.
|
|
58
58
|
</step>
|
|
@@ -24,7 +24,7 @@ Exit workflow.
|
|
|
24
24
|
Validate phase exists in roadmap:
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
|
|
27
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "${PHASE}" # found, phase_name, goal, success_criteria, section
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
**If phase not found:**
|
|
@@ -130,7 +130,7 @@ Exit workflow.
|
|
|
130
130
|
</step>
|
|
131
131
|
|
|
132
132
|
<step name="auto_mode_bypass">
|
|
133
|
-
**P-1803 fix (v3.7.8):** When `--auto` is set or `workflow.auto_advance: true`, **skip the entire question-driven discussion** and synthesize a minimal `context.md` directly from upstream artifacts. The
|
|
133
|
+
**P-1803 fix (v3.7.8):** When `--auto` is set or `workflow.auto_advance: true`, **skip the entire question-driven discussion** and synthesize a minimal `context.md` directly from upstream artifacts. The unguarded `AskUserQuestion` calls in `check_existing`, `present_gray_areas` and `discuss_areas` all stall headless `claude -p` sessions immediately. Surfaced by the wookie autonomous build (v3.7.7): retry attempts via `/pan:discuss-phase 3 --auto` exited in 75s with $0.42 cost and zero commits before plan-phase auto-mode was patched to bypass discuss-phase entirely. This step makes discuss-phase itself auto-mode-safe, so it can be re-introduced into the auto pipeline cleanly.
|
|
134
134
|
|
|
135
135
|
Detect auto mode:
|
|
136
136
|
|
|
@@ -152,7 +152,7 @@ Skip the interactive flow. Generate `context.md` from the roadmap goal + idea.md
|
|
|
152
152
|
|
|
153
153
|
2. Read inputs:
|
|
154
154
|
```bash
|
|
155
|
-
|
|
155
|
+
PHASE_JSON=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "${PHASE}") # JSON: goal, success_criteria, section
|
|
156
156
|
IDEA_PATH=".planning/idea.md"
|
|
157
157
|
PROJECT_PATH=".planning/project.md"
|
|
158
158
|
REQ_PATH=".planning/requirements.md"
|
|
@@ -170,7 +170,7 @@ REQ_PATH=".planning/requirements.md"
|
|
|
170
170
|
<domain>
|
|
171
171
|
## Phase Boundary
|
|
172
172
|
|
|
173
|
-
[
|
|
173
|
+
[The `goal` from PHASE_JSON, verbatim]
|
|
174
174
|
|
|
175
175
|
</domain>
|
|
176
176
|
|
|
@@ -181,7 +181,7 @@ REQ_PATH=".planning/requirements.md"
|
|
|
181
181
|
[For each item in idea.md "Constraints" / "Scope" / "Notes for the planner" sections that mentions Phase ${PHASE} or its domain keywords (e.g., "image pipeline" for Phase 3) — extract as a locked decision, prefixed with the domain name]
|
|
182
182
|
|
|
183
183
|
### From requirements.md
|
|
184
|
-
[For each requirement
|
|
184
|
+
[For each requirement the phase's slice lists under "Its requirements" (`pan-tools roadmap slice ${PHASE} --raw`) — list as a locked decision]
|
|
185
185
|
|
|
186
186
|
### Claude's Discretion
|
|
187
187
|
- Implementation patterns within the constraints above (the planner decides specific libraries / file layouts / function shapes)
|
|
@@ -213,7 +213,8 @@ None — auto-mode synthesis honors the original idea.md scope.
|
|
|
213
213
|
|
|
214
214
|
Write the file:
|
|
215
215
|
```bash
|
|
216
|
-
|
|
216
|
+
# phase_dir is null when the phase has no directory yet: create it (the printed path is phase_dir)
|
|
217
|
+
case "{phase_dir}" in ""|null) node ~/.claude/pan-wizard-core/bin/pan-tools.cjs scaffold phase-dir --phase "${PHASE}" --name "{phase_name}" --raw ;; esac
|
|
217
218
|
# Use Write tool (NOT heredoc) to create ${phase_dir}/${PADDED_PHASE}-context.md
|
|
218
219
|
```
|
|
219
220
|
|
|
@@ -278,7 +279,7 @@ If "Cancel": Exit workflow.
|
|
|
278
279
|
<step name="analyze_phase">
|
|
279
280
|
Analyze the phase to identify gray areas worth discussing.
|
|
280
281
|
|
|
281
|
-
**Read the phase
|
|
282
|
+
**Read the phase's section (`roadmap get-phase "${PHASE}"`: `goal`, `success_criteria`, `section`) and determine:**
|
|
282
283
|
|
|
283
284
|
1. **Domain boundary** — What capability is this phase delivering? State it clearly.
|
|
284
285
|
|
|
@@ -416,9 +417,9 @@ Create context.md capturing decisions made.
|
|
|
416
417
|
|
|
417
418
|
Use values from init: `phase_dir`, `phase_slug`, `padded_phase`.
|
|
418
419
|
|
|
419
|
-
If `phase_dir` is null (phase exists in roadmap but no directory)
|
|
420
|
+
If `phase_dir` is null (phase exists in roadmap but no directory), create it and use the printed path as `phase_dir`:
|
|
420
421
|
```bash
|
|
421
|
-
|
|
422
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs scaffold phase-dir --phase "${PHASE}" --name "{phase_name}" --raw
|
|
422
423
|
```
|
|
423
424
|
|
|
424
425
|
**File location:** `${phase_dir}/${padded_phase}-context.md`
|
|
@@ -11,7 +11,7 @@ Read state.md before any operation to load project context.
|
|
|
11
11
|
|
|
12
12
|
@~/.claude/pan-wizard-core/references/guardrails.md
|
|
13
13
|
|
|
14
|
-
> **Also see:** `~/.claude/pan-wizard-core/learnings/universal/` — AI-derived patterns from prior experiments. **Don't skim the whole folder.** Run `pan-tools learn topics-for --agent executor --token-budget 5000 --raw` to load
|
|
14
|
+
> **Also see:** `~/.claude/pan-wizard-core/learnings/universal/` — AI-derived patterns from prior experiments. **Don't skim the whole folder.** Run `pan-tools learn topics-for --agent executor --cue "<phase goal; the files it touches>" --token-budget 5000 --raw` to load the topics that match this task, within the budget; if none matches, it falls back to the topics tagged relevant for execution. Per P-RES-002 (distractor-density research), reading every topic degrades reasoning even at modest token counts. Files appear here over time as `pan-tools learn promote` adds findings.
|
|
15
15
|
</required_reading>
|
|
16
16
|
|
|
17
17
|
## Re-Read Checkpoints
|
|
@@ -20,7 +20,7 @@ Context compaction may have dropped earlier sections. Re-read the relevant secti
|
|
|
20
20
|
|
|
21
21
|
| Before this step | Re-read | Why |
|
|
22
22
|
|------------------|---------|-----|
|
|
23
|
-
| Spawning a subagent | This workflow's `<step name="
|
|
23
|
+
| Spawning a subagent | This workflow's `<step name="execute_waves">` block | Wave/segment routing is easy to misremember after compaction |
|
|
24
24
|
| Writing code in a plan | `references/tdd.md` + plan file | Conventions and the plan's tasks drift across long sessions |
|
|
25
25
|
| Committing | `references/guardrails.md` | Pre-commit shortcuts (silent model swaps, scope creep) are tempting under pressure |
|
|
26
26
|
| Marking phase complete | `workflows/verify-phase.md` | Completion criteria are easy to misremember |
|
|
@@ -34,7 +34,7 @@ Load all context in one call:
|
|
|
34
34
|
INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init execute-phase "${PHASE_ARG}")
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
Parse JSON for: `executor_model`, `verifier_model`, `reviewer_model`, `commit_docs`, `parallelization`, `branching_strategy`, `branch_name`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `plans`, `incomplete_plans`, `plan_count`, `incomplete_count`, `state_exists`, `roadmap_exists`, `phase_req_ids`.
|
|
37
|
+
Parse JSON for: `executor_model`, `verifier_model`, `reviewer_model`, `commit_docs`, `parallelization`, `branching_strategy`, `branch_name`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `plans`, `incomplete_plans`, `plan_count`, `incomplete_count`, `state_exists`, `roadmap_exists`, `phase_req_ids`, `verifier_enabled`.
|
|
38
38
|
|
|
39
39
|
**If `phase_found` is false:** Error — phase directory not found.
|
|
40
40
|
**If `plan_count` is 0:** Error — no plans found in phase.
|
|
@@ -49,6 +49,11 @@ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize trace init \
|
|
|
49
49
|
--command "exec-phase" \
|
|
50
50
|
--phase "${PHASE_ARG}" 2>/dev/null || true
|
|
51
51
|
```
|
|
52
|
+
|
|
53
|
+
**The phase's roadmap slice** — what executing this phase needs from roadmap.md and requirements.md (a line per phase, this phase's section, its dependencies' goals, its requirement lines). Plans name it in their `<context>`; this writes it for plans made before it existed:
|
|
54
|
+
```bash
|
|
55
|
+
SLICE_PATH=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap slice "${phase_number}" --write --raw)
|
|
56
|
+
```
|
|
52
57
|
</step>
|
|
53
58
|
|
|
54
59
|
<step name="handle_branching">
|
|
@@ -70,42 +75,6 @@ From init JSON: `phase_dir`, `plan_count`, `incomplete_count`.
|
|
|
70
75
|
Report: "Found {plan_count} plans in {phase_dir} ({incomplete_count} incomplete)"
|
|
71
76
|
</step>
|
|
72
77
|
|
|
73
|
-
<step name="load_phase_memory">
|
|
74
|
-
**Load project memory before dispatching executors — prevents re-learning patterns already solved.**
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
ls .planning/memory/*.md 2>/dev/null
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
If `.planning/memory/` exists and contains `.md` files:
|
|
81
|
-
1. **Check the memory-load budget first** (ADR-0036 — keeps per-agent injection bounded as logs grow):
|
|
82
|
-
```bash
|
|
83
|
-
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs memory budget --raw
|
|
84
|
-
```
|
|
85
|
-
2. **Load, size-gated — whole-file is the default:**
|
|
86
|
-
- If `status` is `ok`: **read every file whole** (Read tool) and condense each entry to its rule(s) — 1–3 lines per file. This preserves the "apply every rule" contract for normal-sized logs.
|
|
87
|
-
- If `status` is `warning` or `critical` (a log has grown large): load a **cue-scoped** slice per agent instead of the whole log, using the phase objective + the files this phase touches as the cue:
|
|
88
|
-
```bash
|
|
89
|
-
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs memory select <agent> --cue "<phase objective; changed files>" --raw
|
|
90
|
-
```
|
|
91
|
-
Run once per agent that has a memory file. The returned `selected` entries are already recency-floored and token-budgeted (the newest lessons are always included). If `selected` is empty for an agent, **fall back to reading that file whole** — never silently drop an agent's memory.
|
|
92
|
-
3. Store the condensed rules as a `MEMORY_RULES` block for injection into executor prompts in execute_waves.
|
|
93
|
-
4. **Log memory priming to trace:**
|
|
94
|
-
```bash
|
|
95
|
-
MEMORY_COUNT=$(ls .planning/memory/*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
96
|
-
if [ "$MEMORY_COUNT" -gt "0" ]; then
|
|
97
|
-
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize trace log \
|
|
98
|
-
--type decision --category memory_primed \
|
|
99
|
-
--description "Loaded ${MEMORY_COUNT} memory entries before Wave 1 dispatch" \
|
|
100
|
-
--agent orchestrator --impact minor \
|
|
101
|
-
--context "{\"memory_count\":${MEMORY_COUNT}}" \
|
|
102
|
-
2>/dev/null || true
|
|
103
|
-
fi
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
If no memory files exist: skip (no trace event needed).
|
|
107
|
-
</step>
|
|
108
|
-
|
|
109
78
|
<step name="discover_and_group_plans">
|
|
110
79
|
Load plan inventory with wave grouping in one call:
|
|
111
80
|
|
|
@@ -115,7 +84,7 @@ PLAN_INDEX=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs phase-plan-index "
|
|
|
115
84
|
|
|
116
85
|
Parse JSON for: `phase`, `plans[]` (each with `id`, `wave`, `autonomous`, `objective`, `files_modified`, `task_count`, `has_summary`), `waves` (map of wave number → plan IDs), `incomplete`, `has_checkpoints`.
|
|
117
86
|
|
|
118
|
-
**Filtering:** Skip plans where `has_summary: true`. If `--gaps-only`: also skip
|
|
87
|
+
**Filtering:** Skip plans where `has_summary: true`. If `--gaps-only`: also skip plans whose frontmatter lacks `gap_closure: true` (`phase-plan-index` does not report it; `frontmatter get <plan> --field gap_closure` exits 1 when it is absent). If all filtered: "No matching incomplete plans" → exit.
|
|
119
88
|
|
|
120
89
|
**If `--gaps-only`:** this run is the fix round after a verification found gaps — a second attempt at work that failed once. Resolve the executor for that attempt and use it in place of `executor_model` for every spawn in this run:
|
|
121
90
|
|
|
@@ -197,10 +166,7 @@ Execute each wave in sequence. Within a wave: parallel if `PARALLELIZATION=true`
|
|
|
197
166
|
- .agents/skills/ (Project skills, if exists — list skills, read SKILL.md for each, follow relevant rules during implementation)
|
|
198
167
|
</files_to_read>
|
|
199
168
|
|
|
200
|
-
|
|
201
|
-
{MEMORY_RULES — insert condensed content of all .planning/memory/*.md files read in load_phase_memory step. If no memory files exist, omit this block entirely.}
|
|
202
|
-
Apply every rule in this block without exception. These are lessons from previous phases that the reviewer has already verified.
|
|
203
|
-
</project_memory>
|
|
169
|
+
If the plan's `<context>` names `@.planning/roadmap.md`, read `{slice_path}` in its place: it carries this phase's section, its dependencies' goals and its requirements, and the whole roadmap is the largest file in `.planning/` on a long project. Open the whole file only for something the slice leaves out.
|
|
204
170
|
|
|
205
171
|
<success_criteria>
|
|
206
172
|
- [ ] All tasks executed
|
|
@@ -256,7 +222,11 @@ Execute each wave in sequence. Within a wave: parallel if `PARALLELIZATION=true`
|
|
|
256
222
|
|
|
257
223
|
**Known Claude Code bug (classifyHandoffIfNeeded):** If an agent reports "failed" with error containing `classifyHandoffIfNeeded is not defined`, this is a Claude Code runtime bug — not a PAN or agent issue. The error fires in the completion handler AFTER all tool calls finish. In this case: run the same spot-checks as step 4 (summary.md exists, git commits present, no Self-Check: FAILED). If spot-checks PASS → treat as **successful**. If spot-checks FAIL → treat as real failure below.
|
|
258
224
|
|
|
259
|
-
For real failures: report which plan failed → ask "Continue?" or "Stop?"
|
|
225
|
+
For real failures: report which plan failed → ask "Continue?" or "Stop?". If stop, partial completion report. If continue, never run a plan that depends on a failed one; ask the engine which plans are blocked:
|
|
226
|
+
```bash
|
|
227
|
+
BLOCKED=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs phase-plan-index "${PHASE_NUMBER}" --failed "${FAILED_PLAN_IDS}")
|
|
228
|
+
```
|
|
229
|
+
`${FAILED_PLAN_IDS}` is the comma-separated ids of every plan that failed so far. `blocked` lists each unfinished plan whose `depends_on` reaches a failed plan, directly or through another blocked plan, with the failed plans behind it. Do not spawn those plans in this or any later wave. Name them in the wave report and the final summary ("Skipped 03-03 and 03-04: they depend on 03-01, which failed"), and run every other plan as planned. The same applies after "Continue with remaining waves?" in step 4.
|
|
260
230
|
|
|
261
231
|
6. **Execute checkpoint plans between waves** — see `<checkpoint_handling>`.
|
|
262
232
|
|
|
@@ -275,7 +245,7 @@ AUTO_CFG=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs config-get workflow.
|
|
|
275
245
|
|
|
276
246
|
When executor returns a checkpoint AND `AUTO_CFG` is `"true"`:
|
|
277
247
|
- **human-verify** → Auto-spawn continuation agent with `{user_response}` = `"approved"`. Log `⚡ Auto-approved checkpoint`.
|
|
278
|
-
- **decision** →
|
|
248
|
+
- **decision** → The executor already took the plan's `auto_select` option when the task had one, so a decision that comes back has none: present it to the user (standard flow below). If a returned decision's task does carry `auto_select` in the plan file, auto-spawn the continuation agent with `{user_response}` = that option id and log `⚡ Auto-selected: [option] (auto_select)`. Never answer with an option because it is listed first.
|
|
279
249
|
- **human-action** → Present to user (existing behavior below). Auth gates cannot be automated.
|
|
280
250
|
|
|
281
251
|
**Standard flow (not auto-mode, or human-action type):**
|
|
@@ -521,8 +491,8 @@ fi
|
|
|
521
491
|
|
|
522
492
|
**2. Find parent UAT file:**
|
|
523
493
|
```bash
|
|
524
|
-
|
|
525
|
-
#
|
|
494
|
+
PARENT_DIR=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs find-phase "${PARENT_PHASE}" --raw)
|
|
495
|
+
# --raw prints the phase directory itself (empty when not found); find the UAT file in it
|
|
526
496
|
```
|
|
527
497
|
|
|
528
498
|
**If no parent UAT found:** Skip this step (gap-closure may have been triggered by verification.md instead).
|
|
@@ -552,21 +522,25 @@ mv .planning/debug/{slug}.md .planning/debug/resolved/
|
|
|
552
522
|
|
|
553
523
|
**6. Commit updated artifacts:**
|
|
554
524
|
```bash
|
|
555
|
-
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs commit "docs(phase-${PARENT_PHASE}): resolve UAT gaps and debug sessions after ${PHASE_NUMBER} gap closure" --files .planning/phases/*${PARENT_PHASE}*/*-uat.md .planning/debug/
|
|
525
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs commit "docs(phase-${PARENT_PHASE}): resolve UAT gaps and debug sessions after ${PHASE_NUMBER} gap closure" --files .planning/phases/*${PARENT_PHASE}*/*-uat.md .planning/debug/
|
|
556
526
|
```
|
|
557
527
|
</step>
|
|
558
528
|
|
|
559
529
|
<step name="verify_phase_goal">
|
|
560
530
|
Verify phase achieved its GOAL, not just completed tasks.
|
|
561
531
|
|
|
532
|
+
**If `verifier_enabled` is false** (`workflow.verifier: false`, set by `/pan:settings` or at project setup): skip this step. Say "verification skipped (workflow.verifier is off)" when you report the phase, and go to update_roadmap. `/pan:verify-phase {X}` still verifies on demand.
|
|
533
|
+
|
|
562
534
|
```
|
|
563
535
|
Task(
|
|
564
536
|
prompt="Verify phase {phase_number} goal achievement.
|
|
565
537
|
Phase directory: {phase_dir}
|
|
566
538
|
Phase goal: {goal from roadmap.md}
|
|
567
539
|
Phase requirement IDs: {phase_req_ids}
|
|
540
|
+
Roadmap slice: {slice_path} — this phase's section, its dependencies' goals and its requirement lines. Read it instead of roadmap.md and requirements.md.
|
|
568
541
|
Check must_haves against actual codebase.
|
|
569
|
-
Cross-reference requirement IDs from PLAN frontmatter against
|
|
542
|
+
Cross-reference requirement IDs from PLAN frontmatter against the slice's requirement lines — every ID MUST be accounted for.
|
|
543
|
+
Run the project's test suite as the test gate (the run_test_suite step of @~/.claude/pan-wizard-core/workflows/verify-phase.md) and record test_gate in the frontmatter.
|
|
570
544
|
Create verification.md.",
|
|
571
545
|
subagent_type="pan-verifier",
|
|
572
546
|
model="{verifier_model}"
|
|
@@ -585,7 +559,7 @@ VERIF_STATUS=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs findings record
|
|
|
585
559
|
|
|
586
560
|
| Status | Action |
|
|
587
561
|
|--------|--------|
|
|
588
|
-
| `passed` | → update_roadmap |
|
|
562
|
+
| `passed` | → update_roadmap. If the verification frontmatter has `test_gate: skipped` or a `not_checked` list, say so when you report the phase: "passed — not checked: tests (no test script)". A pass never hides what it did not check |
|
|
589
563
|
| `human_needed` | Present items for human testing, get approval or feedback |
|
|
590
564
|
| `gaps_found` | Present gap summary, offer `/pan:plan-phase {phase} --gaps` |
|
|
591
565
|
|
|
@@ -660,18 +634,18 @@ The report files are appended to the completion commit's `--files` list (`$REPOR
|
|
|
660
634
|
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs commit "docs(phase-{X}): complete phase execution" --files .planning/roadmap.md .planning/state.md .planning/requirements.md {phase_dir}/*-verification.md $REPORT_FILES
|
|
661
635
|
```
|
|
662
636
|
|
|
663
|
-
|
|
664
|
-
```bash
|
|
665
|
-
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize trace end 2>/dev/null || true
|
|
666
|
-
```
|
|
667
|
-
|
|
668
|
-
Log phase completion event:
|
|
637
|
+
Log phase completion event (before the session ends: `trace end` clears the active-session pointer, and a `trace log` after it lands in a separate day-scoped `sess_auto_*` session):
|
|
669
638
|
```bash
|
|
670
639
|
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize trace log \
|
|
671
640
|
--type decision --category phase_complete \
|
|
672
|
-
--description "Phase ${PHASE_NUMBER} execution complete (${
|
|
641
|
+
--description "Phase ${PHASE_NUMBER} execution complete (${VERIF_STATUS:-verified})" \
|
|
673
642
|
--agent orchestrator --impact minor 2>/dev/null || true
|
|
674
643
|
```
|
|
644
|
+
|
|
645
|
+
**Circular optimization — finalize trace session:**
|
|
646
|
+
```bash
|
|
647
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize trace end 2>/dev/null || true
|
|
648
|
+
```
|
|
675
649
|
</step>
|
|
676
650
|
|
|
677
651
|
<step name="offer_next">
|
|
@@ -685,14 +659,14 @@ Parse `--no-transition` flag from $ARGUMENTS.
|
|
|
685
659
|
**If `--no-transition` flag present:**
|
|
686
660
|
|
|
687
661
|
Execute-phase was spawned by plan-phase's auto-advance. Do NOT run transition.md.
|
|
688
|
-
After verification passes and roadmap is updated, return completion status to parent:
|
|
662
|
+
If verification found gaps, return `## GAPS FOUND` with the phase, score and gap summaries (plan-phase and discuss-phase stop the chain on it). After verification passes and roadmap is updated, return completion status to parent:
|
|
689
663
|
|
|
690
664
|
```
|
|
691
665
|
## PHASE COMPLETE
|
|
692
666
|
|
|
693
667
|
Phase: ${PHASE_NUMBER} - ${PHASE_NAME}
|
|
694
668
|
Plans: ${completed_count}/${total_count}
|
|
695
|
-
Verification: {Passed |
|
|
669
|
+
Verification: {Passed | Skipped (workflow.verifier is off)}
|
|
696
670
|
|
|
697
671
|
[Include aggregate_results output]
|
|
698
672
|
```
|
|
@@ -9,7 +9,7 @@ Read config.json for planning behavior settings.
|
|
|
9
9
|
@~/.claude/pan-wizard-core/references/git-integration.md
|
|
10
10
|
@~/.claude/pan-wizard-core/references/guardrails.md
|
|
11
11
|
|
|
12
|
-
> **Also see:** `~/.claude/pan-wizard-core/learnings/universal/` — AI-derived patterns from prior experiments. **Don't skim the whole folder.** Run `pan-tools learn topics-for --agent executor --token-budget 5000 --raw` to load
|
|
12
|
+
> **Also see:** `~/.claude/pan-wizard-core/learnings/universal/` — AI-derived patterns from prior experiments. **Don't skim the whole folder.** Run `pan-tools learn topics-for --agent executor --cue "<plan objective; the files it modifies>" --token-budget 5000 --raw` to load the topics that match this task, within the budget; if none matches, it falls back to the topics tagged relevant for execution. Per P-RES-002 (distractor-density research), reading every topic degrades reasoning even at modest token counts.
|
|
13
13
|
</required_reading>
|
|
14
14
|
|
|
15
15
|
## Re-Read Checkpoints
|
|
@@ -47,7 +47,8 @@ ls .planning/phases/XX-name/*-summary.md 2>/dev/null | sort
|
|
|
47
47
|
Find first PLAN without matching SUMMARY. Decimal phases supported (`01.1-hotfix/`):
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
|
-
PHASE=$(
|
|
50
|
+
PHASE=$(basename "$PLAN_PATH" | grep -oE '^[0-9]+(\.[0-9]+)?')
|
|
51
|
+
PLAN=$(basename "$PLAN_PATH" | grep -oE '^[0-9]+(\.[0-9]+)?-[0-9]+' | cut -d- -f2)
|
|
51
52
|
# config settings can be fetched via pan-tools config-get if needed
|
|
52
53
|
```
|
|
53
54
|
|
|
@@ -137,8 +138,8 @@ This IS the execution instructions. Follow exactly. If plan references context.m
|
|
|
137
138
|
|
|
138
139
|
<step name="previous_phase_check">
|
|
139
140
|
```bash
|
|
140
|
-
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs phases list --type summaries
|
|
141
|
-
# Extract the second-to-last summary from the JSON result
|
|
141
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs phases list --type summaries
|
|
142
|
+
# Extract the second-to-last summary from the JSON result's files[] (file names only, in phase order)
|
|
142
143
|
```
|
|
143
144
|
If previous SUMMARY has unresolved "Issues Encountered" or "Next Phase Readiness" blockers: AskUserQuestion(header="Previous Issues", options: "Proceed anyway" | "Address first" | "Review previous").
|
|
144
145
|
</step>
|
|
@@ -277,7 +278,7 @@ TASK_COMMITS+=("Task ${TASK_NUM}: ${TASK_COMMIT}")
|
|
|
277
278
|
<step name="checkpoint_protocol">
|
|
278
279
|
On `type="checkpoint:*"`: automate everything possible first. Checkpoints are for verification/decisions only.
|
|
279
280
|
|
|
280
|
-
Display: `CHECKPOINT: [Type]` box → Progress {X}/{Y} → Task name → type-specific content →
|
|
281
|
+
Display: `CHECKPOINT: [Type]` box → Progress {X}/{Y} → Task name → type-specific content → the action prompt line `→ [signal]`
|
|
281
282
|
|
|
282
283
|
| Type | Content | Resume signal |
|
|
283
284
|
|------|---------|---------------|
|
|
@@ -333,7 +334,7 @@ Create `{phase}-{plan}-summary.md` at `.planning/phases/XX-name/`. Use `~/.claud
|
|
|
333
334
|
|
|
334
335
|
**Frontmatter:** phase, plan, subsystem, tags | requires/provides/affects | tech-stack.added/patterns | key-files.created/modified | key-decisions | requirements-completed (**MUST** copy `requirements` array from plan.md frontmatter verbatim) | duration ($DURATION), completed ($PLAN_END_TIME date).
|
|
335
336
|
|
|
336
|
-
Title: `# Phase [X]
|
|
337
|
+
Title: `# Phase [X]: [Name] Summary` (the summary template's)
|
|
337
338
|
|
|
338
339
|
One-liner SUBSTANTIVE: "JWT auth with refresh rotation using jose library" not "Authentication implemented"
|
|
339
340
|
|
|
@@ -382,7 +383,7 @@ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs state record-session \
|
|
|
382
383
|
--resume-file "None"
|
|
383
384
|
```
|
|
384
385
|
|
|
385
|
-
Keep state.md under
|
|
386
|
+
Keep state.md under 100 lines (the state template's size constraint).
|
|
386
387
|
</step>
|
|
387
388
|
|
|
388
389
|
<step name="issues_review_gate">
|
|
@@ -11,13 +11,13 @@ Read all files referenced by the invoking prompt's execution_context before star
|
|
|
11
11
|
<step name="parse_args">
|
|
12
12
|
**Parse arguments:**
|
|
13
13
|
|
|
14
|
-
Check
|
|
14
|
+
Check which of `--repair`, `--standards`, `--full`, `--drift` and `--links` are present in the command arguments; `validate health` reads all five.
|
|
15
15
|
|
|
16
16
|
```
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
HEALTH_FLAGS=""
|
|
18
|
+
for flag in --repair --standards --full --drift --links; do
|
|
19
|
+
if arguments contain "$flag"; then HEALTH_FLAGS="$HEALTH_FLAGS $flag"; fi
|
|
20
|
+
done
|
|
21
21
|
```
|
|
22
22
|
</step>
|
|
23
23
|
|
|
@@ -25,7 +25,7 @@ fi
|
|
|
25
25
|
**Run health validation:**
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs validate health $
|
|
28
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs validate health $HEALTH_FLAGS
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
Parse JSON output:
|
|
@@ -84,7 +84,7 @@ Errors: N | Warnings: N | Info: N
|
|
|
84
84
|
```
|
|
85
85
|
## Errors
|
|
86
86
|
|
|
87
|
-
- [
|
|
87
|
+
- [E005] config.json: JSON parse error - <parser message>
|
|
88
88
|
Fix: Run /pan:health --repair to reset to defaults
|
|
89
89
|
|
|
90
90
|
- [E002] project.md not found
|
|
@@ -95,7 +95,7 @@ Errors: N | Warnings: N | Info: N
|
|
|
95
95
|
```
|
|
96
96
|
## Warnings
|
|
97
97
|
|
|
98
|
-
- [
|
|
98
|
+
- [W002] state.md references phase 5, but only phases 01, 02, 03 exist
|
|
99
99
|
Fix: Run /pan:health --repair to regenerate
|
|
100
100
|
|
|
101
101
|
- [W005] Phase directory "1-setup" doesn't follow NN-name format
|
|
@@ -165,7 +165,8 @@ Report final status.
|
|
|
165
165
|
| I003 | info | Focus-model or campaign tree — the phase-model checks do not apply | No |
|
|
166
166
|
| I004 | info | planning-with-files shares the tree — PAN leaves its files alone | No |
|
|
167
167
|
| I005 | info | The planning tree is gitignored while commit_docs is true — planning commits commit nothing | No |
|
|
168
|
-
|
|
|
168
|
+
| I006 | info | config.json holds keys PAN's code does not read (usually a typo); the fix names the nearest known key. It also lists `gates` and `safety` from templates/config.json: the `custom`-mode conditions in transition.md and execute-plan.md read `gates`; nothing reads `safety` (transition.md asks before skipping plans in every mode) | No |
|
|
169
|
+
| STATE_REQ_DRIFT | warning | state.md complete but requirements.md has unchecked boxes | Yes |
|
|
169
170
|
| STATE_ROADMAP_DRIFT | warning | state.md complete but roadmap.md has unchecked plan boxes | Yes |
|
|
170
171
|
| VERIFICATION_GATE_MISSING | warning | Phase has completed plans but no verification record | No |
|
|
171
172
|
|
|
@@ -175,7 +176,6 @@ Flag-gated codes:
|
|
|
175
176
|
|------|----------|------|-------------|------------|
|
|
176
177
|
| TESTS_FAIL | error | --full | Test run exited non-zero | No |
|
|
177
178
|
| BUILD_FAIL | error | --full | Build exited non-zero | No |
|
|
178
|
-
| MEM_BUDGET | warning / info | --full | Memory injection over budget | No |
|
|
179
179
|
| DRIFT_HIGH | warning | --drift | Drift verdict is high | No |
|
|
180
180
|
| DRIFT_MEDIUM | info | --drift | Drift verdict is medium | No |
|
|
181
181
|
| LINKS_ERR | warning | --links | Link graph has errors | No |
|
|
@@ -196,7 +196,9 @@ or behind the current position warns.
|
|
|
196
196
|
|--------|--------|------|
|
|
197
197
|
| createConfig | Create config.json with defaults | None |
|
|
198
198
|
| resetConfig | Delete + recreate config.json | Loses custom settings |
|
|
199
|
-
| regenerateState |
|
|
199
|
+
| regenerateState | Back up state.md to `state.md.bak-<timestamp>`, then create state.md from ROADMAP structure | Session history only in the backup |
|
|
200
|
+
| syncRequirements | Tick requirements.md boxes when state.md says every plan is done (STATE_REQ_DRIFT) | Edits requirements.md checkboxes |
|
|
201
|
+
| syncRoadmap | Tick roadmap.md plan boxes when state.md says every plan is done (STATE_ROADMAP_DRIFT) | Edits roadmap.md checkboxes |
|
|
200
202
|
|
|
201
203
|
**Not repairable (too risky):**
|
|
202
204
|
- project.md, roadmap.md content
|