pan-wizard 3.33.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 +17 -16
- 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 +14 -14
- package/agents/pan-executor.md +12 -8
- package/agents/pan-experiment-runner.md +8 -7
- package/agents/pan-integration-checker.md +2 -2
- package/agents/pan-knowledge.md +1 -1
- package/agents/pan-meta-reviewer.md +3 -3
- package/agents/pan-optimizer.md +39 -43
- package/agents/pan-phase-researcher.md +8 -8
- package/agents/pan-plan-checker.md +30 -28
- package/agents/pan-planner.md +54 -43
- package/agents/pan-previewer.md +1 -1
- package/agents/pan-project-researcher.md +11 -11
- 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 +15 -14
- package/agents/pan-verifier.md +32 -24
- package/bin/install-lib.cjs +58 -23
- package/bin/install.js +47 -1
- package/commands/pan/army.md +15 -11
- 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 +9 -8
- package/commands/pan/focus-auto.md +22 -20
- package/commands/pan/focus-design.md +7 -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 +6 -6
- package/commands/pan/focus-plan.md +12 -11
- package/commands/pan/focus-scan.md +5 -3
- 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 +1 -1
- package/commands/pan/mcp-bridge.md +18 -18
- package/commands/pan/milestone-done.md +6 -3
- 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 +2 -1
- package/commands/pan/plan-phase.md +9 -19
- package/commands/pan/preview.md +1 -1
- package/commands/pan/profile.md +2 -2
- 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 +12 -11
- package/commands/pan/resume.md +9 -11
- package/commands/pan/retro.md +5 -3
- package/commands/pan/review-deep.md +7 -7
- package/commands/pan/settings.md +1 -1
- 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-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 +44 -6
- 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 +33 -4
- package/pan-wizard-core/bin/lib/config.cjs +2 -1
- package/pan-wizard-core/bin/lib/constants.cjs +18 -6
- package/pan-wizard-core/bin/lib/context-budget.cjs +12 -9
- package/pan-wizard-core/bin/lib/core.cjs +53 -19
- package/pan-wizard-core/bin/lib/cost-rebuild.cjs +13 -1
- package/pan-wizard-core/bin/lib/cost.cjs +142 -13
- 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 +9 -2
- 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 +7 -4
- 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 +15 -13
- package/pan-wizard-core/bin/lib/preview.cjs +3 -1
- 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 +43 -28
- package/pan-wizard-core/bin/lib/template.cjs +11 -4
- 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 +5 -2
- package/pan-wizard-core/bin/lib/verify.cjs +30 -28
- package/pan-wizard-core/bin/lib/whatif.cjs +5 -3
- package/pan-wizard-core/bin/pan-tools.cjs +101 -15
- package/pan-wizard-core/learnings/index.json +5 -5
- package/pan-wizard-core/opencode/pan-wizard.js +111 -0
- package/pan-wizard-core/references/checkpoints.md +3 -3
- 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/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/milestone-archive.md +6 -6
- package/pan-wizard-core/templates/milestone.md +1 -1
- package/pan-wizard-core/templates/phase-prompt.md +29 -17
- 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 +53 -8
- 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 +26 -57
- package/pan-wizard-core/workflows/execute-plan.md +8 -7
- package/pan-wizard-core/workflows/health.md +13 -12
- 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 +9 -9
- 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 +5 -3
- 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 +17 -15
- 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-plugin.js +3 -1
- package/scripts/generate-skills-docs.py +13 -4
|
@@ -10,16 +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:
|
|
13
|
+
# verified_commit: git rev-parse HEAD before writing this file; `pan-tools verify stale` compares against it
|
|
14
|
+
verified_commit: <sha>
|
|
14
15
|
status: passed | gaps_found | human_needed
|
|
15
16
|
score: N/M must-haves verified
|
|
16
17
|
test_gate: passed | failed | skipped
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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"
|
|
23
41
|
---
|
|
24
42
|
|
|
25
43
|
# Phase {X}: {Name} Verification Report
|
|
@@ -212,8 +230,35 @@ Unrequested work is recorded, not blocking: the status does not change because o
|
|
|
212
230
|
---
|
|
213
231
|
phase: 03-chat
|
|
214
232
|
verified: 2025-01-15T14:30:00Z
|
|
233
|
+
verified_commit: 4f2a9c1
|
|
215
234
|
status: gaps_found
|
|
216
|
-
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"
|
|
217
262
|
---
|
|
218
263
|
|
|
219
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
|
|
@@ -525,8 +491,8 @@ fi
|
|
|
525
491
|
|
|
526
492
|
**2. Find parent UAT file:**
|
|
527
493
|
```bash
|
|
528
|
-
|
|
529
|
-
#
|
|
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
|
|
530
496
|
```
|
|
531
497
|
|
|
532
498
|
**If no parent UAT found:** Skip this step (gap-closure may have been triggered by verification.md instead).
|
|
@@ -556,21 +522,24 @@ mv .planning/debug/{slug}.md .planning/debug/resolved/
|
|
|
556
522
|
|
|
557
523
|
**6. Commit updated artifacts:**
|
|
558
524
|
```bash
|
|
559
|
-
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/
|
|
560
526
|
```
|
|
561
527
|
</step>
|
|
562
528
|
|
|
563
529
|
<step name="verify_phase_goal">
|
|
564
530
|
Verify phase achieved its GOAL, not just completed tasks.
|
|
565
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
|
+
|
|
566
534
|
```
|
|
567
535
|
Task(
|
|
568
536
|
prompt="Verify phase {phase_number} goal achievement.
|
|
569
537
|
Phase directory: {phase_dir}
|
|
570
538
|
Phase goal: {goal from roadmap.md}
|
|
571
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.
|
|
572
541
|
Check must_haves against actual codebase.
|
|
573
|
-
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.
|
|
574
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.
|
|
575
544
|
Create verification.md.",
|
|
576
545
|
subagent_type="pan-verifier",
|
|
@@ -665,18 +634,18 @@ The report files are appended to the completion commit's `--files` list (`$REPOR
|
|
|
665
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
|
|
666
635
|
```
|
|
667
636
|
|
|
668
|
-
|
|
669
|
-
```bash
|
|
670
|
-
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize trace end 2>/dev/null || true
|
|
671
|
-
```
|
|
672
|
-
|
|
673
|
-
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):
|
|
674
638
|
```bash
|
|
675
639
|
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize trace log \
|
|
676
640
|
--type decision --category phase_complete \
|
|
677
|
-
--description "Phase ${PHASE_NUMBER} execution complete (${
|
|
641
|
+
--description "Phase ${PHASE_NUMBER} execution complete (${VERIF_STATUS:-verified})" \
|
|
678
642
|
--agent orchestrator --impact minor 2>/dev/null || true
|
|
679
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
|
+
```
|
|
680
649
|
</step>
|
|
681
650
|
|
|
682
651
|
<step name="offer_next">
|
|
@@ -690,14 +659,14 @@ Parse `--no-transition` flag from $ARGUMENTS.
|
|
|
690
659
|
**If `--no-transition` flag present:**
|
|
691
660
|
|
|
692
661
|
Execute-phase was spawned by plan-phase's auto-advance. Do NOT run transition.md.
|
|
693
|
-
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:
|
|
694
663
|
|
|
695
664
|
```
|
|
696
665
|
## PHASE COMPLETE
|
|
697
666
|
|
|
698
667
|
Phase: ${PHASE_NUMBER} - ${PHASE_NAME}
|
|
699
668
|
Plans: ${completed_count}/${total_count}
|
|
700
|
-
Verification: {Passed |
|
|
669
|
+
Verification: {Passed | Skipped (workflow.verifier is off)}
|
|
701
670
|
|
|
702
671
|
[Include aggregate_results output]
|
|
703
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,8 +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
|
-
| I006 | info | config.json holds keys PAN does not read (usually a typo); the fix names the nearest known key | No |
|
|
169
|
-
| STATE_REQ_DRIFT | warning | state.md complete but
|
|
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 |
|
|
170
170
|
| STATE_ROADMAP_DRIFT | warning | state.md complete but roadmap.md has unchecked plan boxes | Yes |
|
|
171
171
|
| VERIFICATION_GATE_MISSING | warning | Phase has completed plans but no verification record | No |
|
|
172
172
|
|
|
@@ -176,7 +176,6 @@ Flag-gated codes:
|
|
|
176
176
|
|------|----------|------|-------------|------------|
|
|
177
177
|
| TESTS_FAIL | error | --full | Test run exited non-zero | No |
|
|
178
178
|
| BUILD_FAIL | error | --full | Build exited non-zero | No |
|
|
179
|
-
| MEM_BUDGET | warning / info | --full | Memory injection over budget | No |
|
|
180
179
|
| DRIFT_HIGH | warning | --drift | Drift verdict is high | No |
|
|
181
180
|
| DRIFT_MEDIUM | info | --drift | Drift verdict is medium | No |
|
|
182
181
|
| LINKS_ERR | warning | --links | Link graph has errors | No |
|
|
@@ -197,7 +196,9 @@ or behind the current position warns.
|
|
|
197
196
|
|--------|--------|------|
|
|
198
197
|
| createConfig | Create config.json with defaults | None |
|
|
199
198
|
| resetConfig | Delete + recreate config.json | Loses custom settings |
|
|
200
|
-
| 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 |
|
|
201
202
|
|
|
202
203
|
**Not repairable (too risky):**
|
|
203
204
|
- project.md, roadmap.md content
|
|
@@ -119,7 +119,7 @@ The Focus workflow is a **scan → plan → exec → sync** pipeline. Each step
|
|
|
119
119
|
|
|
120
120
|
**Reality Score:** Every P3-P6 item gets scored: `RS = (User Value + Time Criticality + Risk Reduction) / Job Size`. Items below RS 3.0 get deferred, below 1.5 get dropped.
|
|
121
121
|
|
|
122
|
-
**Output:**
|
|
122
|
+
**Output:** the prioritized work list, returned by `pan-tools focus scan` as JSON (`/pan:focus-plan` collects the items again itself).
|
|
123
123
|
|
|
124
124
|
**Flags:**
|
|
125
125
|
- `--quick` — skip strategic analysis and validation phases
|
|
@@ -136,10 +136,10 @@ The Focus workflow is a **scan → plan → exec → sync** pipeline. Each step
|
|
|
136
136
|
**Modes:**
|
|
137
137
|
| Mode | Budget | Strategy |
|
|
138
138
|
|------|--------|----------|
|
|
139
|
-
| `bugfix` | 40 pts | P0→
|
|
139
|
+
| `bugfix` | 40 pts | One pass over P0→P4 in priority order, smallest first within a priority (P5–P6 excluded; no item-type filter) |
|
|
140
140
|
| `balanced` | 50 pts | 60% stability / 40% features (default) |
|
|
141
141
|
| `features` | 50 pts | 80% features, P0 crashes still mandatory |
|
|
142
|
-
| `full` | 60 pts |
|
|
142
|
+
| `full` | 60 pts | One pass over every priority in priority order (P0 first, smallest first within a priority) |
|
|
143
143
|
|
|
144
144
|
**Point system:** XS=1, S=2, M=4, L=10, XL=20 points.
|
|
145
145
|
|
|
@@ -183,8 +183,8 @@ The Focus workflow is a **scan → plan → exec → sync** pipeline. Each step
|
|
|
183
183
|
|
|
184
184
|
**Flags:**
|
|
185
185
|
- `--readme` — check README only
|
|
186
|
-
- `--
|
|
187
|
-
- `--
|
|
186
|
+
- `--docs` — verify documentation matches implementations
|
|
187
|
+
- `--arch` — verify architecture docs match actual structure
|
|
188
188
|
- `--all` — full sync + auto-fix
|
|
189
189
|
|
|
190
190
|
### Standalone: `/pan:focus-design <description>`
|
|
@@ -336,7 +336,7 @@ The Focus workflow is a **scan → plan → exec → sync** pipeline. Each step
|
|
|
336
336
|
|
|
337
337
|
**`/pan:new-project`** — One command: deep questioning → optional domain research (4 parallel agents) → requirements → roadmap. Creates `.planning/` with project.md, roadmap.md, state.md, config.json, requirements.md.
|
|
338
338
|
|
|
339
|
-
**`/pan:map-codebase`** — Analyze existing codebase before `/pan:new-project`. Creates `.planning/codebase/` with
|
|
339
|
+
**`/pan:map-codebase`** — Analyze existing codebase before `/pan:new-project`. Creates `.planning/codebase/` with its codebase documents (stack, architecture, structure, conventions, testing, integrations, concerns, relationships, best-practices).
|
|
340
340
|
|
|
341
341
|
**`/pan:discuss-phase <N>`** — Capture your vision for a phase before planning. Creates context.md.
|
|
342
342
|
|
|
@@ -394,7 +394,7 @@ The Focus workflow is a **scan → plan → exec → sync** pipeline. Each step
|
|
|
394
394
|
|
|
395
395
|
**Planning config** (`.planning/config.json`):
|
|
396
396
|
- `commit_docs: true` — commit planning artifacts to git (set `false` + add `.planning/` to `.gitignore` for private planning)
|
|
397
|
-
- `search_gitignored: false` — add `--no-ignore` to
|
|
397
|
+
- `search_gitignored: false` — reserved: read by `loadConfig` and reported by `init map-codebase`, but no workflow or agent acts on it (to search a gitignored `.planning/`, add `--no-ignore` to `rg` yourself)
|
|
398
398
|
|
|
399
399
|
---
|
|
400
400
|
|
|
@@ -409,10 +409,9 @@ The Focus workflow is a **scan → plan → exec → sync** pipeline. Each step
|
|
|
409
409
|
├── config.json # Workflow & gate configuration
|
|
410
410
|
├── focus/ # Focus batch files
|
|
411
411
|
│ └── batch-YYYY-MM-DD.json
|
|
412
|
-
├── superplan_*.md # Focus scan output
|
|
413
412
|
├── todos/
|
|
414
413
|
│ ├── pending/ # Todos waiting
|
|
415
|
-
│ └──
|
|
414
|
+
│ └── completed/ # Completed todos
|
|
416
415
|
├── debug/ # Active debug sessions
|
|
417
416
|
│ └── resolved/ # Archived resolved issues
|
|
418
417
|
├── milestones/ # Archived milestones
|
|
@@ -27,11 +27,13 @@ Use the most recent session unless `--session <id>` was specified.
|
|
|
27
27
|
|
|
28
28
|
If `--session <id>` was specified, use that session ID.
|
|
29
29
|
|
|
30
|
+
If `--experiment <slug>` was specified, set `EXP` to the harvest folder (the `harvest_path` `/pan:experiment harvest <slug>` printed, `<source-repo>/experiments/<slug>/` by default), add `--cwd "$EXP"` to every `pan-tools` call in this workflow, and read and write every `.planning/optimization/` path below under `$EXP/`.
|
|
31
|
+
|
|
30
32
|
## Step 2 — Generate local analysis
|
|
31
33
|
|
|
32
34
|
Run:
|
|
33
35
|
```
|
|
34
|
-
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize learn [--session <id> | --sessions <n>]
|
|
36
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize learn [--session <id> | --sessions <n>] # with no active session, pass --session <id> for the session Step 1 chose: a bare call errors "No trace session active"
|
|
35
37
|
```
|
|
36
38
|
|
|
37
39
|
This produces `.planning/optimization/reports/{session}-analysis.json`. With `--sessions <n>` it pools the last n sessions into `pooled-<n>-{session}-analysis.json`: a recommendation should explain failures that recur across runs, not one run's accident.
|
|
@@ -39,18 +41,18 @@ This produces `.planning/optimization/reports/{session}-analysis.json`. With `--
|
|
|
39
41
|
Read the output and note:
|
|
40
42
|
- `summary.errors` — how many error events
|
|
41
43
|
- `summary.gaps` — how many gap events
|
|
42
|
-
- `summary.memory_misses` — how many
|
|
44
|
+
- `summary.memory_misses` — how many times an agent logged missing knowledge (`memory_miss` events)
|
|
43
45
|
- `summary.wasted_tokens` — tokens wasted on redundancies
|
|
44
46
|
- `top_error_patterns` — most frequent error categories
|
|
45
47
|
- `top_tool_error_patterns` — failed tool calls captured from the subagents' own transcripts, ranked by how many spawns hit them
|
|
46
48
|
- `verdict_stats` — each judge's pass/fail counts, retries, and the retries that resolved a failure
|
|
47
|
-
- `top_memory_misses` — most
|
|
49
|
+
- `top_memory_misses` — the topics most often logged as missing
|
|
48
50
|
|
|
49
51
|
## Step 3 — Invoke pan-optimizer agent
|
|
50
52
|
|
|
51
53
|
Spawn the `pan-optimizer` agent with this instruction:
|
|
52
54
|
|
|
53
|
-
> Read the analysis at
|
|
55
|
+
> Read the analysis at `{analysis_path}` (the path `optimize learn` printed: `{session}-analysis.json`, or `pooled-<n>-{session}-analysis.json` with `--sessions`) and the raw trace at `.planning/optimization/traces/{session}/trace.jsonl`. Produce a full optimization report at `.planning/optimization/reports/{session}-opt-report.md` following the format in your agent definition.
|
|
54
56
|
|
|
55
57
|
Wait for the agent to complete. It will write the report to `.planning/optimization/reports/`.
|
|
56
58
|
|
|
@@ -61,9 +63,9 @@ Read `.planning/optimization/reports/{session}-opt-report.md`.
|
|
|
61
63
|
Present to the user:
|
|
62
64
|
1. **Score** — the circular optimization score (0–100)
|
|
63
65
|
2. **Top 3 findings** — the most impactful recommendations
|
|
64
|
-
3. **
|
|
65
|
-
4. **
|
|
66
|
-
5. **Next step** —
|
|
66
|
+
3. **Lessons** — how many, and where each belongs: the project's instructions (CLAUDE.md or AGENTS.md, outside PAN's section), a test, or a comment at the cited code
|
|
67
|
+
4. **Prompt and workflow changes** — how many, for human review
|
|
68
|
+
5. **Next step** — `/pan:optimize apply` records the suggestions in `.planning/optimization/suggestions.md`; a person makes the changes, because nothing in the report reaches an agent until it is written where the agents read
|
|
67
69
|
|
|
68
70
|
## Step 5 — Auto-apply (if --apply flag)
|
|
69
71
|
|
|
@@ -72,14 +74,14 @@ If the `--apply` flag was passed, immediately run:
|
|
|
72
74
|
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize apply
|
|
73
75
|
```
|
|
74
76
|
|
|
75
|
-
Show what was
|
|
77
|
+
Show what was recorded and where each suggestion belongs.
|
|
76
78
|
|
|
77
79
|
## Step 6 — Update the circular score baseline
|
|
78
80
|
|
|
79
81
|
After applying, tell the user what to watch in the next run:
|
|
80
|
-
- Which
|
|
81
|
-
- Which error patterns
|
|
82
|
-
- Prompt/workflow changes to consider
|
|
82
|
+
- Which lessons they wrote into the project's instructions, tests or code (the next trace should show fewer of those gaps and `memory_miss` events)
|
|
83
|
+
- Which error patterns a prompt or workflow change addressed
|
|
84
|
+
- Prompt/workflow changes still to consider
|
|
83
85
|
|
|
84
86
|
## Edge cases
|
|
85
87
|
|