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
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: focus-exec
|
|
3
3
|
group: Focus
|
|
4
|
-
description: Automated batch execution pipeline with 6 stages,
|
|
4
|
+
description: Automated batch execution pipeline with 6 stages, behavioral rules, 3 execution tiers
|
|
5
|
+
argument-hint: "[--budget N] [--mode bugfix|balanced|features|full] [--priority P0-P6] [--dry-run] [--no-commit] [--continue] [--deep-review]"
|
|
5
6
|
allowed-tools:
|
|
6
7
|
- Read
|
|
7
8
|
- Write
|
|
@@ -85,7 +86,7 @@ Each stage has a restricted set of appropriate actions. Using the wrong tool at
|
|
|
85
86
|
This command executes work on the **host project's source code** — not on PAN Wizard's own infrastructure.
|
|
86
87
|
|
|
87
88
|
**Do not read, modify, or fix files in these PAN directories:**
|
|
88
|
-
- `.claude/`, `.
|
|
89
|
+
- `.claude/`, `.codex/`, `.gemini/`, `.opencode/`, `.agents/`, and the Copilot runtime paths PAN installs into under `.github/` (`agents/`, `skills/`, `hooks/`, `copilot/`, `pan-wizard-core/`, `pan-local-patches/`, `mcp.json`, `package.json`, `pan-file-manifest.json`) — PAN runtime directories
|
|
89
90
|
- Any `pan-wizard-core/`, `pan-tools`, agent `.md`, or command `.md` files within PAN runtime directories
|
|
90
91
|
|
|
91
92
|
**These directories are PAN's own tooling installed into the project.** If a batch item targets a PAN infrastructure file, SKIP it with reason "PAN infrastructure — out of scope." Never modify PAN's agents, commands, core modules, or dispatcher as part of project work.
|
|
@@ -116,7 +117,7 @@ HARD STOP conditions (do not proceed to next stage):
|
|
|
116
117
|
- `--dry-run` — Run Stages 1-2 only (show what WOULD be executed)
|
|
117
118
|
- `--no-commit` — Skip the commit step in Stage 6
|
|
118
119
|
- `--continue` — Resume a previously interrupted execution
|
|
119
|
-
- `--deep-review` (v3.4+) — After each high-stakes item's execution, run
|
|
120
|
+
- `--deep-review` (v3.4+) — After each high-stakes item's execution, run the deep pass on that item's changed files: spawn pan-hardener (`<output_path>` `.planning/reviews/<item-id>/hardener.md`), then pan-meta-reviewer on its report (`.planning/reviews/<item-id>/meta.md`), and merge with `pan-tools review-deep merge <item-id> --hardener-file … --meta-file …` (no first-pass review, so no `--reviewer-file`; `/pan:review-deep` itself needs a phase). Slows the campaign by roughly 3× per item that triggers the deep pass; use for batches touching auth/payment/migrations.
|
|
120
121
|
|
|
121
122
|
---
|
|
122
123
|
|
|
@@ -161,7 +162,7 @@ Every code change must be tested before moving to the next item.
|
|
|
161
162
|
Test cadence by tier:
|
|
162
163
|
- **MICRO (XS/S):** Run specific test after implementing. Batch up to 3 independent items before smoke.
|
|
163
164
|
- **STANDARD (M):** Full test suite after each item.
|
|
164
|
-
- **FULL (L/XL):**
|
|
165
|
+
- **FULL (L/XL):** The project's build step (if it has one) + full test suite after each item.
|
|
165
166
|
|
|
166
167
|
### Rule 4: Don't Invent — Follow the Plan
|
|
167
168
|
Implement exactly what the batch says. Do not:
|
|
@@ -210,8 +211,7 @@ This catches emergent interactions: 5 "add try-catch" fixes might reveal the mod
|
|
|
210
211
|
1. **Check Project Status** — git status, recent commits
|
|
211
212
|
2. **Test Baseline** — run test suite, record current counts
|
|
212
213
|
3. **Create rollback snapshot** — git tag for safety
|
|
213
|
-
4. **
|
|
214
|
-
5. **Report** — Output session start summary
|
|
214
|
+
4. **Report** — Output session start summary
|
|
215
215
|
|
|
216
216
|
**Circular optimization — init trace:**
|
|
217
217
|
```bash
|
|
@@ -286,7 +286,7 @@ Display the execution batch to user, then continue automatically.
|
|
|
286
286
|
3. DESIGN — outline approach before coding
|
|
287
287
|
4. STATE INTENT — "I will modify [files]. Risk: [what could break]"
|
|
288
288
|
5. IMPLEMENT in logical chunks
|
|
289
|
-
6. BUILD — build
|
|
289
|
+
6. BUILD — run the project's build step if the item changed what it builds
|
|
290
290
|
7. TEST — full test suite
|
|
291
291
|
8. CONFIRM — all pass -> DONE | fail -> investigate (15 min max) -> REVERT -> FAILED
|
|
292
292
|
```
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
name: focus-plan
|
|
3
3
|
group: Focus
|
|
4
4
|
description: Create capacity-budgeted work batch with spec coverage verification and 4 execution modes
|
|
5
|
+
argument-hint: "[--budget N] [--mode bugfix|balanced|features|full] [--priority P0-P6] [--lean] [--no-spec-check]"
|
|
5
6
|
allowed-tools:
|
|
6
7
|
- Read
|
|
7
8
|
- Write
|
|
@@ -24,7 +25,7 @@ Create a capacity-budgeted work batch from focus-scan results **with mandatory v
|
|
|
24
25
|
This command plans work batches for the **host project** — NOT for PAN Wizard's own infrastructure.
|
|
25
26
|
|
|
26
27
|
**NEVER include items targeting these PAN directories:**
|
|
27
|
-
- `.claude/`, `.
|
|
28
|
+
- `.claude/`, `.codex/`, `.gemini/`, `.opencode/`, `.agents/`, and the Copilot runtime paths PAN installs into under `.github/` (`agents/`, `skills/`, `hooks/`, `copilot/`, `pan-wizard-core/`, `pan-local-patches/`, `mcp.json`, `package.json`, `pan-file-manifest.json`) — PAN runtime directories
|
|
28
29
|
- Any `pan-wizard-core/`, `pan-tools`, agent `.md`, or command `.md` files within PAN runtime directories
|
|
29
30
|
|
|
30
31
|
If a scan item points to a PAN infrastructure file, DROP it from the batch. PAN's files are not the project's responsibility.
|
|
@@ -38,11 +39,11 @@ If no recent scan exists, run `/pan:focus-scan` automatically before proceeding.
|
|
|
38
39
|
**Flags:**
|
|
39
40
|
- `--budget N` — Override capacity budget in points (default: 50, min: 5, max: 100)
|
|
40
41
|
- `--mode MODE` — Execution mode. Default: `balanced`
|
|
41
|
-
- `bugfix` — P0
|
|
42
|
+
- `bugfix` — one pass over P0-P4 in priority order, smallest-first within each; P5-P6 left out (40 pts)
|
|
42
43
|
- `balanced` — **Default.** Mix of stability fixes + feature development, 60/40 split (50 pts)
|
|
43
|
-
- `features` — Feature-focused: 80%
|
|
44
|
-
- `full` — Full-spectrum:
|
|
45
|
-
- `--priority
|
|
44
|
+
- `features` — Feature-focused: P0 crashes mandatory, then 80% of what that leaves on P3-P5 (50 pts)
|
|
45
|
+
- `full` — Full-spectrum: one pass over every priority, P0 first and smallest-first within each; budget raised to at least 60 (60 pts)
|
|
46
|
+
- `--priority PN` — Only pick items at priority PN or higher (P0 through PN), e.g. `--priority P2`
|
|
46
47
|
- `--lean` — Apply RS filtering: exclude items with RS < 1.5
|
|
47
48
|
- `--no-spec-check` — Skip spec coverage verification (NOT recommended — use only for pure bugfix batches)
|
|
48
49
|
|
|
@@ -133,13 +134,13 @@ This becomes the **spec gap backlog** — items that specs/ADRs promised but the
|
|
|
133
134
|
### `features` — Feature-Focused Sprint
|
|
134
135
|
- **Budget:** 50 pts
|
|
135
136
|
- **Mandatory pass:** All P0 items
|
|
136
|
-
- **Feature pass (80%):**
|
|
137
|
-
- **Stability pass (20%):**
|
|
137
|
+
- **Feature pass (80%):** 80% of what the P0 pass left, for P3-P5 (40 pts when there are no P0 items)
|
|
138
|
+
- **Stability pass (20%):** the rest of it, for P1-P2 quick wins (10 pts when there are no P0 items)
|
|
138
139
|
- **Spec coverage:** Feature items MUST map to spec requirements — reject unspecified feature work
|
|
139
140
|
|
|
140
141
|
### `full` — Full-Spectrum Marathon
|
|
141
142
|
- **Budget:** 60 pts
|
|
142
|
-
- **
|
|
143
|
+
- **One pass over every priority in priority order, smallest-first within each**
|
|
143
144
|
- **Spec coverage:** Full traceability — every item maps to a spec/ADR requirement or is flagged as unspecified
|
|
144
145
|
|
|
145
146
|
### Batch Selection Algorithm
|
|
@@ -220,7 +221,7 @@ This becomes the post-execution checklist for `/pan:focus-exec`.
|
|
|
220
221
|
|
|
221
222
|
## Phase 5: Output
|
|
222
223
|
|
|
223
|
-
|
|
224
|
+
Write the batch to `.planning/focus/batch-<YYYY-MM-DD>.json` yourself — `{date, mode, budget, allocated, items: [...]}`, each item `{id, title, priority, effort, points, tier, files}` with `tier` one of `MICRO`, `STANDARD`, `FULL` (`focus exec` and `focus classify-stages` group items by it, and an item without it lands in no wave); `focus exec`, `focus classify-stages` and `/pan:focus-exec` read an `items` or `batch` array. Do not hand this step to `pan-tools focus plan`: it ignores the scan and the spec mapping, batches only incomplete roadmap phases, pending todos and `.planning/patterns.md` entries, and overwrites the day's batch file:
|
|
224
225
|
|
|
225
226
|
```markdown
|
|
226
227
|
## Focus Batch — <date>
|
|
@@ -252,11 +253,11 @@ Produce a batch file at `.planning/focus/batch-<YYYY-MM-DD>.json` via `pan-tools
|
|
|
252
253
|
| NCA affordability | ADR-0018 SC-4 | Blocked by SC-1, SC-2 | After this batch |
|
|
253
254
|
|
|
254
255
|
### Dependency Order
|
|
255
|
-
|
|
256
|
+
~~~
|
|
256
257
|
#1 (P0 crash fix) → independent
|
|
257
258
|
#3 (categories) → #4 (keywords) → #5 (match types)
|
|
258
259
|
#2 (tests) → independent
|
|
259
|
-
|
|
260
|
+
~~~
|
|
260
261
|
|
|
261
262
|
### Post-Execution Verification Checklist
|
|
262
263
|
- [ ] SC-1: Category count >= 65 → `SELECT COUNT(*) FROM stx_category`
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
name: focus-scan
|
|
3
3
|
group: Focus
|
|
4
4
|
description: Deep-dive strategic work scan with prioritized items and Reality Score filtering
|
|
5
|
+
argument-hint: "[--focus <area>] [--quick] [--refresh] [--lean]"
|
|
5
6
|
allowed-tools:
|
|
6
7
|
- Read
|
|
8
|
+
- Write
|
|
7
9
|
- Bash
|
|
8
10
|
- Grep
|
|
9
11
|
- Glob
|
|
@@ -22,13 +24,13 @@ Survey the project for prioritized work items with evidence-based scoring. $ARGU
|
|
|
22
24
|
This command scans the **host project's source code** for work items — not PAN Wizard's own infrastructure.
|
|
23
25
|
|
|
24
26
|
**Exclude these directories from scanning:**
|
|
25
|
-
- `.claude/`, `.
|
|
27
|
+
- `.claude/`, `.codex/`, `.gemini/`, `.opencode/`, `.agents/`, and the Copilot runtime paths PAN installs into under `.github/` (`agents/`, `skills/`, `hooks/`, `copilot/`, `pan-wizard-core/`, `pan-local-patches/`, `mcp.json`, `package.json`, `pan-file-manifest.json`) — PAN runtime directories
|
|
26
28
|
- `.planning/` — PAN planning state (read for context, but never report PAN planning files as "issues")
|
|
27
29
|
- Any `pan-wizard-core/`, `pan-tools`, agent `.md`, or command `.md` files within PAN runtime directories
|
|
28
30
|
|
|
29
31
|
**These directories are PAN's own tooling installed into the project.** Do not report TODO/FIXME items found in PAN files. Do not flag PAN files as lacking test coverage. Do not suggest improvements to PAN's agents, commands, or core modules.
|
|
30
32
|
|
|
31
|
-
If a scan finding points to a file
|
|
33
|
+
If a scan finding points to a file in one of the PAN paths listed above — DROP IT. It is not the project's responsibility.
|
|
32
34
|
|
|
33
35
|
---
|
|
34
36
|
|
|
@@ -73,10 +75,7 @@ Read these files to establish baseline:
|
|
|
73
75
|
|
|
74
76
|
**Project Structure:**
|
|
75
77
|
- All core modules in the project's source directories
|
|
76
|
-
-
|
|
77
|
-
- All agent definitions
|
|
78
|
-
- All workflow definitions
|
|
79
|
-
- All hook source files
|
|
78
|
+
- The project's own command, agent, workflow and hook definitions, if it has any (never PAN's, which the Project Scope Boundary excludes)
|
|
80
79
|
|
|
81
80
|
**Planning State:**
|
|
82
81
|
- `.planning/state.md` — Current state
|
|
@@ -95,9 +94,7 @@ In: source directories, hooks, tests
|
|
|
95
94
|
Cross-reference found issues with documented items — flag any UNDOCUMENTED issues as new findings.
|
|
96
95
|
|
|
97
96
|
### 0.3 Check Test Results
|
|
98
|
-
|
|
99
|
-
npm test 2>&1
|
|
100
|
-
```
|
|
97
|
+
Run the project's test suite: the commands in `.planning/config.json → verification` when set, otherwise the test command discovered from `package.json` scripts, `Makefile`, or project docs.
|
|
101
98
|
Record: total tests, passing, failing, suites.
|
|
102
99
|
|
|
103
100
|
### 0.4 Baseline Snapshot Table
|
|
@@ -240,7 +237,7 @@ Gather items from:
|
|
|
240
237
|
## Phase 5: Scan Assembly
|
|
241
238
|
|
|
242
239
|
### 5.1 Output
|
|
243
|
-
|
|
240
|
+
Write the scan to `.planning/focus/scan-<YYYY-MM-DD>.md`, where `/pan:focus-plan` builds from it and `/pan:focus-exec` updates it (Stage 5.2). `pan-tools focus scan` does not take these items: it lists only incomplete roadmap phases that have a directory, pending todos and `.planning/patterns.md` entries.
|
|
244
241
|
|
|
245
242
|
### 5.2 Document Structure
|
|
246
243
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
name: focus-sync
|
|
3
3
|
group: Focus
|
|
4
4
|
description: Synchronize documentation after changes — check staleness and update counts
|
|
5
|
+
argument-hint: "[--readme | --docs | --arch | --all]"
|
|
5
6
|
allowed-tools:
|
|
6
7
|
- Read
|
|
7
8
|
- Bash
|
|
@@ -24,7 +25,7 @@ Synchronize project documentation across all files. $ARGUMENTS
|
|
|
24
25
|
This command synchronizes the **host project's documentation** — NOT PAN Wizard's own infrastructure files.
|
|
25
26
|
|
|
26
27
|
**NEVER sync, modify, or report staleness in these PAN directories:**
|
|
27
|
-
- `.claude/`, `.
|
|
28
|
+
- `.claude/`, `.codex/`, `.gemini/`, `.opencode/`, `.agents/`, and the Copilot runtime paths PAN installs into under `.github/` (`agents/`, `skills/`, `hooks/`, `copilot/`, `pan-wizard-core/`, `pan-local-patches/`, `mcp.json`, `package.json`, `pan-file-manifest.json`) — PAN runtime directories
|
|
28
29
|
- Any `pan-wizard-core/`, `pan-tools`, agent `.md`, or command `.md` files within PAN runtime directories
|
|
29
30
|
|
|
30
31
|
**These directories are PAN's own tooling.** Documentation sync applies to the project's README, docs, guides, and code comments — not to PAN's installed agents or command definitions.
|
|
@@ -91,7 +92,7 @@ CHANGELOG.md <- Version history
|
|
|
91
92
|
|
|
92
93
|
## Report
|
|
93
94
|
|
|
94
|
-
|
|
95
|
+
Report in this shape (`pan-tools focus sync` itself returns only JSON — `actuals` (counts of commands, agents and modules), `stale` / `current` entries for those counts, any `--tests` / `--suites` counts, renamed `/pan:` commands and the package.json-vs-CHANGELOG version, plus `stale_count` and `needs_sync`):
|
|
95
96
|
|
|
96
97
|
```
|
|
97
98
|
| Area | Status | Finding |
|
package/commands/pan/git.md
CHANGED
|
@@ -15,7 +15,7 @@ allowed-tools:
|
|
|
15
15
|
<objective>
|
|
16
16
|
Phase-aware git workflow with safety guardrails built in. Every subcommand that modifies history runs safety checks. Rollback uses PAN snapshot tags (`pan-rollback-*`), which `pan-tools rollback-snapshot <phase>` creates; no workflow creates them for you.
|
|
17
17
|
|
|
18
|
-
Works with any git repository — PAN
|
|
18
|
+
Works with any git repository — no PAN project (`.planning/`) needed, only the installed `pan-tools.cjs`.
|
|
19
19
|
</objective>
|
|
20
20
|
|
|
21
21
|
<subcommands>
|
|
@@ -59,19 +59,19 @@ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs git commit \
|
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
**Options:**
|
|
62
|
-
- `--type` — `feat | fix | docs | test | refactor | chore`
|
|
62
|
+
- `--type` — `feat | fix | docs | test | refactor | perf | chore`
|
|
63
63
|
- `--message` — Commit message body
|
|
64
64
|
- `--all` — Stage all changes before committing
|
|
65
65
|
- `--files f1 f2` — Stage specific files
|
|
66
66
|
- `--amend` — Amend last commit (no message needed)
|
|
67
|
-
- `--force` — Bypass deleted-file
|
|
67
|
+
- `--force` — Bypass the deleted-file block (not the sensitive-file block)
|
|
68
68
|
|
|
69
69
|
**Safety checks run automatically:**
|
|
70
70
|
|
|
71
71
|
| Check | Blocks on | Override |
|
|
72
72
|
|-------|-----------|---------|
|
|
73
|
-
| Deleted files |
|
|
74
|
-
| Sensitive files | `.env`, `.pem
|
|
73
|
+
| Deleted files | A deletion anywhere in the repository (`git status --porcelain`, staged or not) | `--force` |
|
|
74
|
+
| Sensitive files | A staged path ending `.env`, `.pem` or `.key`, or containing `credentials`, `secret`, `password` or `token` (PAN's own `.planning/metrics/tokens.jsonl` is exempt) | None: narrow `commit.sensitive_patterns` in `.planning/config.json`, or commit the file yourself |
|
|
75
75
|
|
|
76
76
|
**Output:** `{committed, hash, type, safety_checks}`
|
|
77
77
|
|
|
@@ -174,14 +174,14 @@ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs git diff --staged --file src/ap
|
|
|
174
174
|
### rollback — Revert to PAN Snapshot
|
|
175
175
|
|
|
176
176
|
```bash
|
|
177
|
-
# Rollback to
|
|
177
|
+
# Rollback to the last pan-rollback-* tag in name order — the newest only among one phase's snapshots (requires clean working tree)
|
|
178
178
|
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs git rollback
|
|
179
179
|
|
|
180
180
|
# Preview — does NOT reset, shows what would happen
|
|
181
181
|
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs git rollback --dry-run
|
|
182
182
|
|
|
183
183
|
# Rollback to specific tag
|
|
184
|
-
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs git rollback --tag pan-rollback-
|
|
184
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs git rollback --tag pan-rollback-3-20260415T101500
|
|
185
185
|
```
|
|
186
186
|
|
|
187
187
|
**Rollback workflow:**
|
|
@@ -219,5 +219,5 @@ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs git sync --remote upstream --br
|
|
|
219
219
|
</workflow>
|
|
220
220
|
|
|
221
221
|
<runtime_note>
|
|
222
|
-
All subcommands work with any git repository
|
|
222
|
+
All subcommands work with any git repository, whether or not it holds a PAN project (`.planning/`); they run the installed `pan-tools.cjs`. The only requirement is a valid git repo (`git init` or cloned).
|
|
223
223
|
</runtime_note>
|
package/commands/pan/health.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: pan:health
|
|
3
3
|
group: System
|
|
4
4
|
description: Diagnose planning directory health and optionally repair issues
|
|
5
|
-
argument-hint: "[--repair]"
|
|
5
|
+
argument-hint: "[--repair] [--standards] [--full] [--drift] [--links]"
|
|
6
6
|
allowed-tools:
|
|
7
7
|
- Read
|
|
8
8
|
- Bash
|
|
@@ -19,5 +19,5 @@ Validate `.planning/` directory integrity and report actionable issues. Checks f
|
|
|
19
19
|
|
|
20
20
|
<process>
|
|
21
21
|
Execute the health workflow from @~/.claude/pan-wizard-core/workflows/health.md end-to-end.
|
|
22
|
-
|
|
22
|
+
Pass the arguments to the workflow, which forwards `--repair`, `--standards`, `--full`, `--drift` and `--links` to `validate health`.
|
|
23
23
|
</process>
|
package/commands/pan/hud.md
CHANGED
|
@@ -34,10 +34,10 @@ pan-tools hud [--out <file>] [--open] [--stdout]
|
|
|
34
34
|
**JSON result shape** (default, when not `--stdout`):
|
|
35
35
|
```json
|
|
36
36
|
{
|
|
37
|
-
"path": "
|
|
37
|
+
"path": "/abs/path/to/project/.planning/hud.html",
|
|
38
38
|
"bytes": 18234,
|
|
39
39
|
"army_active": true,
|
|
40
|
-
"sections": ["mission", "command-stack", "campaign", "safety-harness", "worktrees", "roadmap", "telemetry", "requirements-quality", "activity"],
|
|
40
|
+
"sections": ["mission", "now-building", "command-stack", "campaign", "safety-harness", "worktrees", "roadmap", "telemetry", "requirements-quality", "activity"],
|
|
41
41
|
"opened": false
|
|
42
42
|
}
|
|
43
43
|
```
|
|
@@ -51,6 +51,7 @@ Panels render only when they have data — a plain (non-army) project still gets
|
|
|
51
51
|
| Panel | What it shows | Source |
|
|
52
52
|
|-------|---------------|--------|
|
|
53
53
|
| **Mission banner** | Project, core value, status, version/milestone + metric cards (progress, phase, requirements, spend) | `package.json`, `project.md`, `state.md`, phase scan, cost ledger |
|
|
54
|
+
| **Now building** | Current phase on a phase stepper, its pipeline stage (research → plan → execute → verify), and the army tasks in flight or the phase's plan/summary counts | phases on disk + army worktrees |
|
|
54
55
|
| **Command stack** *(army)* | Mission Control over the four squads with per-squad agent drill-down (active / idle, calls, tokens) | squad registry + cost ledger |
|
|
55
56
|
| **Campaign** *(army)* | Cadence, next-due, daily-budget bar, last run, run history | `schedule.json` |
|
|
56
57
|
| **Safety harness** *(army)* | Merge gate, abort switch (pause), active worktrees, daily budget, concurrency | config + pause file + worktrees + schedule |
|
package/commands/pan/hygiene.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pan:hygiene
|
|
3
3
|
group: System
|
|
4
|
-
description: Scan the project for PAN version drift and stale artifacts (legacy filenames, memory bloat, poisoned ledgers, trace debris) and apply safe cleanups
|
|
4
|
+
description: Scan the project for PAN version drift and stale artifacts (legacy filenames, memory bloat and stale entries, poisoned ledgers, trace debris, oversized planning files) and apply safe cleanups
|
|
5
5
|
argument-hint: "[--apply] [--trace-age-days N] [--all-tracks] [--track <name>]"
|
|
6
6
|
allowed-tools:
|
|
7
7
|
- Read
|
|
@@ -9,7 +9,14 @@ allowed-tools:
|
|
|
9
9
|
- AskUserQuestion
|
|
10
10
|
---
|
|
11
11
|
<objective>
|
|
12
|
-
Keep a PAN-managed project aligned with the latest PAN version and free of accumulated history debris. Detects:
|
|
12
|
+
Keep a PAN-managed project aligned with the latest PAN version and free of accumulated history debris. Detects:
|
|
13
|
+
- outdated runtime installs (per-runtime manifest version vs latest);
|
|
14
|
+
- legacy uppercase planning filenames and orphaned atomic-write .tmp files;
|
|
15
|
+
- per-agent memory logs past the compaction cap (`memory-bloat`), memory entries whose cited code is gone or that went unused past the expiry window (`memory-stale`), and files in `.planning/memory/` that are not read as memory (`memory-format`);
|
|
16
|
+
- planning files past their budget (`cache-context`): state.md, which every agent call re-reads, and roadmap.md and requirements.md, which only the roadmapper and milestone work read whole (phase agents read `roadmap slice`); state.md's settled history and roadmap.md's shipped phases can be archived;
|
|
17
|
+
- cost ledgers poisoned by pre-v3.12.4 telemetry, stale optimization trace sessions and reports, and stray fragment `.planning/` directories;
|
|
18
|
+
- a planning tree another tool writes into too (`shared-planning-tree`) or owns (`foreign-planning-tree`);
|
|
19
|
+
- Claude Code's own memory index past or near its load limit, or holding content where a one-line pointer belongs (`host-memory`). PAN only reports this one: it never writes the host's memory.
|
|
13
20
|
</objective>
|
|
14
21
|
|
|
15
22
|
<process>
|
|
@@ -28,7 +35,7 @@ Display the findings grouped by severity (critical → warn → info), labelling
|
|
|
28
35
|
|
|
29
36
|
**Always state which trees were scanned** — read `roots_scanned[]` and name them. If `summary.total` is 0, report "Project is clean and aligned" *together with* the list of trees that were read. A clean verdict without its scope is what let stale debris hide in an unscanned track; never report one without the other.
|
|
30
37
|
|
|
31
|
-
If
|
|
38
|
+
If the top-level `planning_root_exists` is `false`, or a `roots_scanned[]` entry has `planning_exists: false`, say so plainly — that is a mistyped `--track`, not a clean tree.
|
|
32
39
|
|
|
33
40
|
## 2. Version drift (manual remediation)
|
|
34
41
|
|
|
@@ -36,7 +43,7 @@ If any `version-alignment` findings exist, list the outdated runtimes and show t
|
|
|
36
43
|
|
|
37
44
|
```
|
|
38
45
|
Re-run the installer from the project root to align all runtimes:
|
|
39
|
-
|
|
46
|
+
npx pan-wizard@latest --claude --codex --gemini --opencode --copilot --local
|
|
40
47
|
(use the flags matching the runtimes reported in installs[])
|
|
41
48
|
```
|
|
42
49
|
|
|
@@ -58,11 +65,11 @@ Then ask the user (AskUserQuestion, header "Apply fixes", options: "Apply safe f
|
|
|
58
65
|
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs hygiene clean --all-tracks --apply
|
|
59
66
|
```
|
|
60
67
|
|
|
61
|
-
Safe fixes are: lowercase renames of legacy planning filenames, deletion of aged .tmp orphans, memory-log compaction, poisoned-ledger quarantine (
|
|
68
|
+
Safe fixes are: lowercase renames of legacy planning filenames, deletion of aged .tmp orphans, memory-log compaction, **memory pruning** (`prune-memory`: stale and expired entries move to `.planning/memory/archive/<agent>.md`), poisoned-ledger quarantine (renamed in place; only the newest quarantined copy is kept, older ones are deleted), pruning of trace sessions **and optimization reports** past retention (newest 5 of each always kept), **state.md compaction** (`compact-state`) — settled history is archived to `state-history.md` so it stops being re-read into every agent call — and **roadmap compaction** (`compact-roadmap`): shipped phases' sections move to `roadmap-history.md`, leaving a stub that `roadmap get-phase` reads back through. None of these deletes anything you wrote: the ledger is renamed, and each archive is written before the file it came from is rewritten. Each fix is applied inside its own tree's scope, so a track's debris is cleaned in that track. Pass through `--trace-age-days N` if provided. With `--track <name>`, use it **in place of** `--all-tracks` in both commands: given both, `--all-tracks` wins and every tree is cleaned.
|
|
62
69
|
|
|
63
70
|
## 4. Report
|
|
64
71
|
|
|
65
|
-
Summarize: the trees scanned, fixes executed / failed / left manual (attributed per track), plus the installer command if version drift remains. If a `cache-context` finding appeared, state the
|
|
72
|
+
Summarize: the trees scanned, fixes executed / failed / left manual (attributed per track), plus the installer command if version drift remains. If a `cache-context` finding appeared, state the token cost its detail names and who pays it: state.md is re-read on **every** agent call, the project's largest recurring expense, while roadmap.md and requirements.md cost only when the roadmapper or milestone work reads them whole. If a `host-memory` finding appeared, name the index and the lines it flags so the user can tidy them: Claude Code loads only the head of that index, and PAN never edits it. Recommend re-running `/pan:hygiene` after the installer to confirm alignment.
|
|
66
73
|
|
|
67
74
|
</process>
|
|
68
75
|
|
|
@@ -70,6 +77,6 @@ Summarize: the trees scanned, fixes executed / failed / left manual (attributed
|
|
|
70
77
|
- [ ] Scan run and findings presented by severity
|
|
71
78
|
- [ ] Version drift reported with the exact installer command (never auto-run)
|
|
72
79
|
- [ ] Safe fixes applied only with --apply or explicit user confirmation
|
|
73
|
-
- [ ] Nothing user-authored deleted — quarantine
|
|
80
|
+
- [ ] Nothing user-authored deleted — the ledger quarantine is a rename (older quarantined copies, PAN's own data, are removed), and memory compaction archives what it drops
|
|
74
81
|
- [ ] Final summary states executed/failed/manual counts
|
|
75
82
|
</success_criteria>
|
|
@@ -16,7 +16,7 @@ allowed-tools:
|
|
|
16
16
|
Retrieve, refine, or consolidate project knowledge. Three modes:
|
|
17
17
|
|
|
18
18
|
- **ask** — answer a natural-language question with inline citations grounded in `.planning/` + `docs/`.
|
|
19
|
-
- **discuss** — multi-turn refinement of a phase's context. Session state persists across invocations
|
|
19
|
+
- **discuss** — multi-turn refinement of a phase's context. Session state persists across invocations.
|
|
20
20
|
- **playbook** — aggregate all agents' memory (E-4 layer) into `.planning/playbook.md`, organized by category (Conventions / Gotchas / Decisions / Tool choices / Anti-patterns / Recurring gaps).
|
|
21
21
|
|
|
22
22
|
Consolidates Spec B v1's X-3 converse + X-6 teach + X-10 explain into one command.
|
|
@@ -54,10 +54,10 @@ Consolidates Spec B v1's X-3 converse + X-6 teach + X-10 explain into one comman
|
|
|
54
54
|
2. `pan-tools knowledge discuss <phase> --subcmd append --role user --content "<topic>"` persists the user turn.
|
|
55
55
|
3. Spawn `pan-knowledge` with `<mode>discuss</mode>`, session history, phase context, and the new turn.
|
|
56
56
|
4. Agent responds.
|
|
57
|
-
5. `pan-tools knowledge discuss <phase> --subcmd append --role agent --content "<response>" --cites "a.md,b.md"` persists the
|
|
58
|
-
6. If after ≥3 substantive turns the agent offered to emit `context.md`, user
|
|
57
|
+
5. Write the agent's response to a file, then `pan-tools knowledge discuss <phase> --subcmd append --role agent --content "$(cat <response-file>)" --cites "a.md,b.md"` persists it — a reply pasted between the quotes breaks the shell line at its first `"`, `$` or backtick.
|
|
58
|
+
6. If after ≥3 substantive turns the agent offered to emit `context.md`, the user accepts in another `/pan:knowledge discuss <phase>` turn and the agent writes it (there is no commit subcommand).
|
|
59
59
|
|
|
60
|
-
**Session persistence:** `.planning/conversations/<phase>/session.json` —
|
|
60
|
+
**Session persistence:** `.planning/conversations/<phase>/session.json` — `{phase, turns: [...], created, last_updated}`, each turn with ts/role/content/cites.
|
|
61
61
|
|
|
62
62
|
### `playbook`
|
|
63
63
|
|
|
@@ -66,12 +66,12 @@ Consolidates Spec B v1's X-3 converse + X-6 teach + X-10 explain into one comman
|
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
**Flow:**
|
|
69
|
-
1. `pan-tools knowledge playbook` reads
|
|
69
|
+
1. `pan-tools knowledge playbook` reads every agent log that `memory list` names in `.planning/memory/`, clusters entries by category, writes `.planning/playbook.md` directly.
|
|
70
70
|
2. Optionally spawn `pan-knowledge` with `<mode>playbook</mode>` to polish (dedupe contradictions, consolidate similar entries). Skip the polish step if the draft looks clean.
|
|
71
71
|
|
|
72
72
|
**Output:** `.planning/playbook.md` — team-readable summary of accumulated lessons.
|
|
73
73
|
|
|
74
|
-
**Auto-invocation:** `/pan:milestone-done`
|
|
74
|
+
**Auto-invocation:** none — no workflow runs it (`/pan:milestone-done` has no playbook step). Run it by hand any time.
|
|
75
75
|
|
|
76
76
|
</modes>
|
|
77
77
|
|
|
@@ -83,7 +83,7 @@ Consolidates Spec B v1's X-3 converse + X-6 teach + X-10 explain into one comman
|
|
|
83
83
|
|
|
84
84
|
**Bug investigation:** `/pan:knowledge ask "why did we add the retry in phase 4?"` — faster than grepping for historical context.
|
|
85
85
|
|
|
86
|
-
**Before milestone-done:** run `/pan:knowledge playbook` to
|
|
86
|
+
**Before milestone-done:** run `/pan:knowledge playbook` to collect the lessons the agent logs hold. PAN no longer writes those logs on its own (ADR-0036, amended `2026-10-04`): they hold what someone recorded with `memory append`, `memory record` or `/pan:retro` with `--write-memory`, or an older report applied, so on a project without such entries the playbook is empty.
|
|
87
87
|
|
|
88
88
|
</workflow>
|
|
89
89
|
|
|
@@ -106,8 +106,8 @@ The agent should NEVER fabricate citations. The retrieval layer's `sources` list
|
|
|
106
106
|
|
|
107
107
|
| Runtime | ask | discuss | playbook |
|
|
108
108
|
|---------|-----|---------|----------|
|
|
109
|
-
| Claude Code | Full, thinking enabled | Full
|
|
110
|
-
| OpenCode | Full | Full
|
|
109
|
+
| Claude Code | Full, thinking enabled | Full | Full |
|
|
110
|
+
| OpenCode | Full | Full | Full |
|
|
111
111
|
| Gemini | Full | Full | Full |
|
|
112
112
|
| Codex | Full | Full | Full |
|
|
113
113
|
| Copilot | Full | Full | Full |
|
package/commands/pan/learn.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
name: pan:learn
|
|
3
3
|
group: Self-Improvement
|
|
4
4
|
description: Analyze trace sessions or harvested experiments via pan-optimizer; generate ranked optimization reports
|
|
5
|
+
argument-hint: "[--session <id> | --sessions <n> | --experiment <slug>] [--apply]"
|
|
5
6
|
allowed-tools:
|
|
6
7
|
- Read
|
|
7
8
|
- Bash
|
|
@@ -26,8 +27,8 @@ Analyze the most recent trace session and generate an optimization report.
|
|
|
26
27
|
**Flags:**
|
|
27
28
|
- `--session <id>` — analyze a specific session instead of the most recent
|
|
28
29
|
- `--sessions <n>` — pool the last n sessions into one analysis, so recommendations rest on failures that recur across runs
|
|
29
|
-
- `--experiment <slug>` *(v3.7.0+, W3)* — analyze a harvested experiment instead of the current project's traces
|
|
30
|
-
- `--apply` —
|
|
30
|
+
- `--experiment <slug>` *(v3.7.0+, W3)* — analyze a harvested experiment instead of the current project's traces: the workflow runs its `pan-tools` steps with `--cwd` set to the harvest folder (the `harvest_path` `/pan:experiment harvest <slug>` printed, `<source-repo>/experiments/<slug>/` by default), so the analysis and the optimizer's report land in that folder's `.planning/optimization/reports/`. Used by the self-improvement loop. Run `/pan:experiment harvest <slug>` first.
|
|
31
|
+
- `--apply` — record the report's suggestions right after generating it (equivalent to running `/pan:optimize apply` immediately after)
|
|
31
32
|
|
|
32
33
|
**What it does:**
|
|
33
34
|
|
|
@@ -47,28 +48,30 @@ Analyze the most recent trace session and generate an optimization report.
|
|
|
47
48
|
- Tool failures and correction loops (error events)
|
|
48
49
|
- Topics the model had to infer without context (gap events)
|
|
49
50
|
- Repeated research on the same topic (redundancy events)
|
|
50
|
-
-
|
|
51
|
+
- Missing knowledge an agent logged (memory_miss events)
|
|
51
52
|
- Unexpected outcomes (surprise events)
|
|
52
53
|
|
|
53
54
|
**Output:**
|
|
54
55
|
|
|
55
56
|
The optimization report in `.planning/optimization/reports/` contains:
|
|
56
57
|
- Ranked error patterns with fix recommendations
|
|
57
|
-
-
|
|
58
|
+
- Lessons the agents lacked, each with where it belongs: the project's instructions (CLAUDE.md or AGENTS.md, outside PAN's section), a test, or a comment at the cited code
|
|
58
59
|
- Redundancy analysis with token waste estimates
|
|
59
60
|
- Prompt improvement suggestions (require human review before applying)
|
|
60
61
|
- Workflow gap suggestions (require human review)
|
|
61
|
-
- An `## Auto-Apply Actions` JSON block
|
|
62
|
+
- An `## Auto-Apply Actions` JSON block, which `/pan:optimize apply` records in `.planning/optimization/suggestions.md`
|
|
62
63
|
- A circular optimization score (0–100)
|
|
63
64
|
|
|
65
|
+
Nothing in the report reaches an agent until a person writes it where the agents read. PAN's workflows do not load `.planning/memory/` into agents.
|
|
66
|
+
|
|
64
67
|
**Example:**
|
|
65
68
|
```
|
|
66
69
|
/pan:learn
|
|
67
70
|
→ Session sess_20260421T180000: 47 events (8 errors, 12 gaps, 3 redundancies)
|
|
68
71
|
→ Report: .planning/optimization/reports/sess_20260421T180000-opt-report.md
|
|
69
72
|
→ Optimization score: 72/100
|
|
70
|
-
→ Top finding:
|
|
71
|
-
→
|
|
73
|
+
→ Top finding: L1 — Express middleware order inferred 5 times (belongs in CLAUDE.md)
|
|
74
|
+
→ Lessons: 3
|
|
72
75
|
→ Needs review: 2 prompt improvements, 1 workflow gap
|
|
73
76
|
```
|
|
74
77
|
|
package/commands/pan/links.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
name: pan:links
|
|
3
3
|
group: Validation
|
|
4
4
|
description: Validate the doc-code link graph — inline wiki-style refs, source-comment anchors, and require-code-mention contracts (ADR-0027, v3.8.0+)
|
|
5
|
+
argument-hint: "[--strict] [--doc-root <path>]... [--source-root <path>]... [--raw]"
|
|
5
6
|
allowed-tools:
|
|
6
7
|
- Bash
|
|
7
8
|
- Read
|
|
@@ -10,7 +11,7 @@ allowed-tools:
|
|
|
10
11
|
|
|
11
12
|
# /pan:links
|
|
12
13
|
|
|
13
|
-
Validate the doc-code link graph. Walks `docs/`, `pan-wizard-core
|
|
14
|
+
Validate the doc-code link graph. Walks `docs/`, `commands/`, `agents/` and `pan-wizard-core/`'s workflows, templates, references and learnings for inline `[[<id>]]` references, and `pan-wizard-core/`, `bin/`, `hooks/` and `scripts/` for `// @pan: <id>` source-comment anchors. Reports broken refs, stale anchors, and uncovered backlink contracts.
|
|
14
15
|
|
|
15
16
|
> **User projects:** the default roots (`docs/`, `pan-wizard-core/`, `commands/`, `agents/`) are the **PAN source-repo** layout. A typical user project has none of these, so a bare `/pan:links` scans almost nothing and reports a hollow `pass`. In a user project you **must** point it at your own layout with `--doc-root` / `--source-root` (both repeatable), e.g. `/pan:links --doc-root docs --source-root src`. Treat any run where `doc_files_scanned` (or `source_files_scanned`) is `0` as a **warning that the roots are misconfigured**, not a clean pass.
|
|
16
17
|
|
|
@@ -28,6 +29,8 @@ Validate the doc-code link graph. Walks `docs/`, `pan-wizard-core/`, `commands/`
|
|
|
28
29
|
- `--source-root <path>` — override default source roots. Repeatable.
|
|
29
30
|
- `--raw` — human-readable output instead of JSON.
|
|
30
31
|
|
|
32
|
+
**Run:** `node ~/.claude/pan-wizard-core/bin/pan-tools.cjs links validate [--strict] [--doc-root <path>]... [--source-root <path>]... [--raw]` (`validate` may be left out when a flag comes first).
|
|
33
|
+
|
|
31
34
|
**What it does:**
|
|
32
35
|
|
|
33
36
|
Three sequential passes share one walk pair:
|
|
@@ -17,7 +17,7 @@ Analyze existing codebase using parallel pan-document_code agents to produce str
|
|
|
17
17
|
|
|
18
18
|
Each mapper agent explores a focus area and **writes documents directly** to `.planning/codebase/`. The orchestrator only receives confirmations, keeping context usage minimal.
|
|
19
19
|
|
|
20
|
-
Output: .planning/codebase/ folder with
|
|
20
|
+
Output: .planning/codebase/ folder with structured documents about the codebase state.
|
|
21
21
|
</objective>
|
|
22
22
|
|
|
23
23
|
<execution_context>
|
|
@@ -59,9 +59,9 @@ The CLI returns `{mode, total_tokens, file_count, languages}`:
|
|
|
59
59
|
- **`mode: "single-shot"`** — repo is small enough (≤700K tokens) for one agent with a 1M-context window to ingest the whole thing. Spawn a single `pan-document_code` agent with the full repo in context. This avoids the 6-way stitching artifacts of sharded mode (contradictory version claims, duplicated mentions, missed cross-file references).
|
|
60
60
|
- **`mode: "sharded"`** — repo exceeds 700K tokens. Fall back to the default 6-way parallel sharding (tech, arch, quality, concerns, relationships, practices). Each shard is mapped by its own agent in its own context window, so no single agent has to hold the whole repo.
|
|
61
61
|
|
|
62
|
-
Record the chosen mode + telemetry in
|
|
62
|
+
Record the chosen mode + telemetry in a `.planning/codebase/overview.md` you write yourself. The map-codebase workflow has no single-shot branch — it always spawns the sharded mappers and writes no overview.md — so in `single-shot` mode spawn the one agent in place of its spawn step.
|
|
63
63
|
|
|
64
|
-
**The mode is decided by repo size alone** — `estimate-size` compares the token estimate to `--threshold` and applies no model check. So single-shot only pays off when the model you launched with actually has a 1M-context window
|
|
64
|
+
**The mode is decided by repo size alone** — `estimate-size` compares the token estimate to `--threshold` and applies no model check. So single-shot only pays off when the model you launched with actually has a 1M-context window. On a model with a smaller window, pass a threshold that matches your real window (e.g. `--threshold 150000`) so anything larger resolves to `sharded` instead of overflowing a single agent.
|
|
65
65
|
</stage_0_ingest_mode>
|
|
66
66
|
|
|
67
67
|
<tool_priority>
|
|
@@ -99,14 +99,14 @@ The orchestrator loads context in layers — NOT everything upfront. Mapper agen
|
|
|
99
99
|
- Agent 5: relationships focus → writes relationships.md
|
|
100
100
|
- Agent 6: practices focus → writes best-practices.md
|
|
101
101
|
4. Wait for agents to complete, collect confirmations (NOT document contents)
|
|
102
|
-
5. Verify all
|
|
102
|
+
5. Verify all documents exist with line counts
|
|
103
103
|
6. Commit codebase map
|
|
104
104
|
7. Offer next steps (typically: /pan:new-project or /pan:plan-phase)
|
|
105
105
|
</process>
|
|
106
106
|
|
|
107
107
|
<success_criteria>
|
|
108
108
|
- [ ] .planning/codebase/ directory created
|
|
109
|
-
- [ ] All
|
|
109
|
+
- [ ] All codebase documents written by mapper agents
|
|
110
110
|
- [ ] Documents follow template structure
|
|
111
111
|
- [ ] Parallel agents completed without errors
|
|
112
112
|
- [ ] User knows next steps
|