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
|
@@ -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
|
|
|
@@ -3,7 +3,7 @@ Orchestrate parallel codebase mapper agents to analyze codebase and produce stru
|
|
|
3
3
|
|
|
4
4
|
Each agent has fresh context, explores a specific focus area, and **writes documents directly**. The orchestrator only receives confirmation + line counts, then writes a summary.
|
|
5
5
|
|
|
6
|
-
Output: .planning/codebase/ folder with
|
|
6
|
+
Output: .planning/codebase/ folder with structured documents about the codebase state.
|
|
7
7
|
</purpose>
|
|
8
8
|
|
|
9
9
|
<philosophy>
|
|
@@ -109,7 +109,7 @@ Use Task tool with `subagent_type="pan-document_code"`, `model="{mapper_model}"`
|
|
|
109
109
|
**CRITICAL:** Use the dedicated `pan-document_code` agent, NOT `Explore`. The mapper agent writes documents directly.
|
|
110
110
|
|
|
111
111
|
**CRITICAL: Project Scope Boundary — include this line in EVERY agent prompt:**
|
|
112
|
-
> SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure
|
|
112
|
+
> SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure paths: .claude/, .opencode/, .gemini/, .codex/, .agents/, .planning/, 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)
|
|
113
113
|
|
|
114
114
|
**Agent 1: Tech Focus**
|
|
115
115
|
|
|
@@ -120,7 +120,7 @@ Task(
|
|
|
120
120
|
run_in_background=true,
|
|
121
121
|
description="Map codebase tech stack",
|
|
122
122
|
prompt="Focus: tech
|
|
123
|
-
SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure
|
|
123
|
+
SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure paths: .claude/, .opencode/, .gemini/, .codex/, .agents/, .planning/, 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)
|
|
124
124
|
|
|
125
125
|
Analyze this codebase for technology stack and external integrations.
|
|
126
126
|
|
|
@@ -142,7 +142,7 @@ Task(
|
|
|
142
142
|
run_in_background=true,
|
|
143
143
|
description="Map codebase architecture",
|
|
144
144
|
prompt="Focus: arch
|
|
145
|
-
SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure
|
|
145
|
+
SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure paths: .claude/, .opencode/, .gemini/, .codex/, .agents/, .planning/, 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)
|
|
146
146
|
|
|
147
147
|
Analyze this codebase architecture and directory structure.
|
|
148
148
|
|
|
@@ -164,7 +164,7 @@ Task(
|
|
|
164
164
|
run_in_background=true,
|
|
165
165
|
description="Map codebase conventions",
|
|
166
166
|
prompt="Focus: quality
|
|
167
|
-
SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure
|
|
167
|
+
SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure paths: .claude/, .opencode/, .gemini/, .codex/, .agents/, .planning/, 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)
|
|
168
168
|
|
|
169
169
|
Analyze this codebase for coding conventions and testing patterns.
|
|
170
170
|
|
|
@@ -185,7 +185,7 @@ Task(
|
|
|
185
185
|
run_in_background=true,
|
|
186
186
|
description="Map codebase concerns",
|
|
187
187
|
prompt="Focus: concerns
|
|
188
|
-
SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure
|
|
188
|
+
SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure paths: .claude/, .opencode/, .gemini/, .codex/, .agents/, .planning/, 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)
|
|
189
189
|
|
|
190
190
|
Analyze this codebase for technical debt, known issues, and areas of concern.
|
|
191
191
|
|
|
@@ -206,7 +206,7 @@ Task(
|
|
|
206
206
|
run_in_background=true,
|
|
207
207
|
description="Map module relationships",
|
|
208
208
|
prompt="Focus: relationships
|
|
209
|
-
SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure
|
|
209
|
+
SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure paths: .claude/, .opencode/, .gemini/, .codex/, .agents/, .planning/, 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)
|
|
210
210
|
|
|
211
211
|
Analyze module dependencies using pre-computed import analysis.
|
|
212
212
|
|
|
@@ -230,7 +230,7 @@ Task(
|
|
|
230
230
|
run_in_background=true,
|
|
231
231
|
description="Map best practices",
|
|
232
232
|
prompt="Focus: practices
|
|
233
|
-
SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure
|
|
233
|
+
SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure paths: .claude/, .opencode/, .gemini/, .codex/, .agents/, .planning/, 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)
|
|
234
234
|
|
|
235
235
|
Assess codebase best practices using pre-computed analysis.
|
|
236
236
|
|
|
@@ -284,7 +284,7 @@ wc -l .planning/codebase/*.md
|
|
|
284
284
|
```
|
|
285
285
|
|
|
286
286
|
**Verification checklist:**
|
|
287
|
-
- All
|
|
287
|
+
- All codebase documents the mapper prompts list exist (lowercase filenames)
|
|
288
288
|
- No empty documents (each should have >20 lines)
|
|
289
289
|
|
|
290
290
|
If any documents missing or empty, note which agents may have failed.
|
|
@@ -395,7 +395,7 @@ End workflow.
|
|
|
395
395
|
- Relationships agent receives pre-computed import/dependency data
|
|
396
396
|
- Practices agent receives pre-computed language and best-practices data
|
|
397
397
|
- Read agent output files to collect confirmations
|
|
398
|
-
- All
|
|
398
|
+
- All codebase documents the mapper prompts list exist (lowercase filenames)
|
|
399
399
|
- Clear completion summary with line counts
|
|
400
400
|
- User offered clear next steps in PAN style
|
|
401
401
|
</success_criteria>
|
|
@@ -14,7 +14,7 @@ Read all files referenced by the invoking prompt's execution_context before star
|
|
|
14
14
|
INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init milestone-op)
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
Extract from init JSON: `milestone_version`, `milestone_name`, `phase_count`, `completed_phases`, `commit_docs`.
|
|
17
|
+
Extract from init JSON: `milestone_version`, `milestone_name`, `phase_count`, `completed_phases`, `commit_docs`. `{version}` below is the version without its leading `v` (the argument, else `milestone_version` with the `v` removed: `v1.0` → `1.0`), so `v{version}-milestone-audit.md` names the `v1.0-milestone-audit.md` that `/pan:milestone-done` looks for.
|
|
18
18
|
|
|
19
19
|
**Also extract `planning_root` and `track`, and use `$PLANNING_ROOT` for every planning path in this workflow** — the project may hold several planning trees, and auditing the wrong one produces a confident, plausible, wrong report:
|
|
20
20
|
|
|
@@ -26,7 +26,7 @@ PLANNING_ROOT=$(printf '%s' "$INIT" | node -e "let s='';process.stdin.on('data',
|
|
|
26
26
|
|
|
27
27
|
**Always state the resolved `planning_root` at the top of the audit report.** If `planning_root_exists` is `false`, STOP — that is a mistyped `--track`, not an empty milestone.
|
|
28
28
|
|
|
29
|
-
To audit a specific tree,
|
|
29
|
+
To audit a specific tree, add `--track <name>` to every `pan-tools` call in this workflow (each call resolves its own planning root). To see every tree's milestone state before choosing:
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
32
|
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init milestone-op --all-tracks
|
|
@@ -38,12 +38,12 @@ That returns `{track_count, ambiguous_tracks, tracks[]}`, one entry per planning
|
|
|
38
38
|
|
|
39
39
|
The init payload carries how the milestone was decided:
|
|
40
40
|
|
|
41
|
-
- `milestone_basis` — `marked-current` (a `(current)` / 🚧 marker), `first-unshipped`, `last-shipped`, or `default`
|
|
41
|
+
- `milestone_basis` — `marked-current` (a `(current)` / 🚧 marker), `first-unshipped`, `last-shipped`, `state` (state.md's `milestone:`), `no-milestone-heading`, or `default` (no roadmap.md)
|
|
42
42
|
- `milestone_ambiguous` — **`true` means the roadmap marks more than one milestone current**
|
|
43
43
|
|
|
44
44
|
**If `milestone_ambiguous` is `true`, STOP and report the planning-state error.** Do not audit. Two milestones marked current is a roadmap defect the owner must resolve; picking one silently is how an audit ends up describing a milestone that does not exist.
|
|
45
45
|
|
|
46
|
-
If `milestone_basis` is `
|
|
46
|
+
If `milestone_basis` is `no-milestone-heading` (no milestone heading, none recorded in state.md) or `default` (no roadmap.md), say so rather than auditing `v1.0 milestone`; `state` means the version came from state.md's `milestone:`.
|
|
47
47
|
|
|
48
48
|
Resolve integration checker model:
|
|
49
49
|
```bash
|
|
@@ -67,9 +67,9 @@ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs phases list
|
|
|
67
67
|
For each phase directory, read the verification.md:
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
|
-
# For each phase,
|
|
71
|
-
|
|
72
|
-
#
|
|
70
|
+
# For each phase, find-phase resolves its directory under phases/ (zero-padding handled; archived milestones are not searched)
|
|
71
|
+
PHASE_DIR=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs find-phase 01 --raw)
|
|
72
|
+
# --raw prints the directory itself (empty when not found); read verification.md from it
|
|
73
73
|
# Repeat for each phase number from roadmap.md
|
|
74
74
|
```
|
|
75
75
|
|
|
@@ -87,7 +87,7 @@ If a phase is missing verification.md, flag it as "unverified phase" — this is
|
|
|
87
87
|
What the judges found in this milestone, and what was decided about each finding, is on record. Read it rather than reconstructing it from prose:
|
|
88
88
|
|
|
89
89
|
```bash
|
|
90
|
-
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs findings debt --milestone "{version}"
|
|
90
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs findings debt --milestone "{version}" # with or without the leading v
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
- **`deferred`** findings were continued past on purpose, and each carries the reason recorded at the time. They are the milestone's tech debt: put every one in `tech_debt`, with its id and reason.
|
|
@@ -115,7 +115,7 @@ MUST map each integration finding to affected requirement IDs where applicable.
|
|
|
115
115
|
|
|
116
116
|
Verify cross-phase wiring and E2E user flows.",
|
|
117
117
|
subagent_type="pan-integration-checker",
|
|
118
|
-
model="{
|
|
118
|
+
model="{CHECKER_MODEL}"
|
|
119
119
|
)
|
|
120
120
|
```
|
|
121
121
|
|
|
@@ -145,7 +145,7 @@ For each phase's verification.md, extract the expanded requirements table:
|
|
|
145
145
|
For each phase's summary.md, extract `requirements-completed` from YAML frontmatter:
|
|
146
146
|
```bash
|
|
147
147
|
for summary in "$PLANNING_ROOT"/phases/*-*/*-summary.md; do
|
|
148
|
-
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs
|
|
148
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs frontmatter get "$summary" --field requirements-completed --raw
|
|
149
149
|
done
|
|
150
150
|
```
|
|
151
151
|
|
|
@@ -27,15 +27,15 @@ No audit gaps found. Run `/pan:milestone-audit` first.
|
|
|
27
27
|
|
|
28
28
|
## 2. Prioritize Gaps
|
|
29
29
|
|
|
30
|
-
Group gaps by
|
|
30
|
+
Group gaps by their audit status (requirements.md records no priority; each `gaps.requirements[]` entry carries `status`):
|
|
31
31
|
|
|
32
|
-
|
|
|
33
|
-
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
32
|
+
| Status | Action |
|
|
33
|
+
|--------|--------|
|
|
34
|
+
| `unsatisfied` | Create phase, blocks milestone |
|
|
35
|
+
| `partial` | Create phase, recommended (the audit's FAIL gate forces `gaps_found` only for `unsatisfied` and `orphaned`) |
|
|
36
|
+
| `orphaned` | Create phase, blocks milestone (the audit treats an orphaned requirement as unsatisfied) |
|
|
37
37
|
|
|
38
|
-
For integration/flow gaps,
|
|
38
|
+
For integration/flow gaps, take the status of the requirements they affect.
|
|
39
39
|
|
|
40
40
|
## 3. Group Gaps into Phases
|
|
41
41
|
|
|
@@ -65,8 +65,7 @@ Gap: Flow "View dashboard" broken at data fetch
|
|
|
65
65
|
Find highest existing phase:
|
|
66
66
|
```bash
|
|
67
67
|
# Get sorted phase list, extract last one
|
|
68
|
-
|
|
69
|
-
HIGHEST=$(echo "$PHASES" | jq -r '.directories[-1]')
|
|
68
|
+
HIGHEST=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs phases list --raw | tail -1)
|
|
70
69
|
```
|
|
71
70
|
|
|
72
71
|
New phases continue from there:
|
|
@@ -94,9 +93,9 @@ Closes:
|
|
|
94
93
|
- Flow: {flow name}
|
|
95
94
|
Tasks: {count}
|
|
96
95
|
|
|
97
|
-
{If
|
|
96
|
+
{If partial gaps exist:}
|
|
98
97
|
|
|
99
|
-
###
|
|
98
|
+
### Recommended (partial — not one of the gaps that force the audit's `gaps_found`)
|
|
100
99
|
|
|
101
100
|
These gaps are optional. Include them?
|
|
102
101
|
- {gap description}
|
|
@@ -111,18 +110,14 @@ Wait for user confirmation.
|
|
|
111
110
|
|
|
112
111
|
## 6. Update roadmap.md
|
|
113
112
|
|
|
114
|
-
Add new
|
|
113
|
+
Add each new phase with the CLI, which writes its checklist line (what `phase complete` ticks), its `### Phase N:` section and its directory:
|
|
115
114
|
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
**Goal:** {derived from gaps being closed}
|
|
119
|
-
**Requirements:** {REQ-IDs being satisfied}
|
|
120
|
-
**Gap Closure:** Closes gaps from audit
|
|
121
|
-
|
|
122
|
-
### Phase {N+1}: {Name}
|
|
123
|
-
...
|
|
115
|
+
```bash
|
|
116
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs phase add "{Name}"
|
|
124
117
|
```
|
|
125
118
|
|
|
119
|
+
Then edit the new section: set **Goal:** to {derived from gaps being closed}, **Requirements:** to {REQ-IDs being satisfied}, and add `**Gap Closure:** Closes gaps from audit`.
|
|
120
|
+
|
|
126
121
|
## 7. Update requirements.md Traceability Table (REQUIRED)
|
|
127
122
|
|
|
128
123
|
For each REQ-ID assigned to a gap closure phase:
|
|
@@ -140,9 +135,7 @@ grep -c "Pending" .planning/requirements.md
|
|
|
140
135
|
|
|
141
136
|
## 8. Create Phase Directories
|
|
142
137
|
|
|
143
|
-
|
|
144
|
-
mkdir -p ".planning/phases/{NN}-{name}"
|
|
145
|
-
```
|
|
138
|
+
`phase add` (step 6) already created each phase's directory.
|
|
146
139
|
|
|
147
140
|
## 9. Commit Roadmap and Requirements Update
|
|
148
141
|
|
|
@@ -261,7 +254,7 @@ becomes:
|
|
|
261
254
|
|
|
262
255
|
<success_criteria>
|
|
263
256
|
- [ ] milestone-audit.md loaded and gaps parsed
|
|
264
|
-
- [ ] Gaps
|
|
257
|
+
- [ ] Gaps grouped by audit status (unsatisfied and orphaned block the milestone, partial is recommended)
|
|
265
258
|
- [ ] Gaps grouped into logical phases
|
|
266
259
|
- [ ] User confirmed phase plan
|
|
267
260
|
- [ ] roadmap.md updated with new phases
|
|
@@ -58,20 +58,21 @@ Update Active requirements section and "Last updated" footer.
|
|
|
58
58
|
```markdown
|
|
59
59
|
## Current Position
|
|
60
60
|
|
|
61
|
-
Phase
|
|
62
|
-
Plan
|
|
63
|
-
Status
|
|
64
|
-
Last
|
|
61
|
+
**Current Phase:** Not started (defining requirements)
|
|
62
|
+
**Current Plan:** —
|
|
63
|
+
**Status:** Defining requirements
|
|
64
|
+
**Last Activity:** [today]
|
|
65
|
+
**Last Activity Description:** Milestone v[X.Y] started
|
|
65
66
|
```
|
|
66
67
|
|
|
67
68
|
Keep Accumulated Context section from previous milestone.
|
|
68
69
|
|
|
69
70
|
## 6. Cleanup and Commit
|
|
70
71
|
|
|
71
|
-
Delete MILESTONE-context.md if exists (consumed).
|
|
72
|
+
Delete MILESTONE-context.md if exists (consumed). If git tracks it, add its path to `--files` so the deletion is committed (`--force` confirms it; a tracked deletion blocks the commit otherwise):
|
|
72
73
|
|
|
73
74
|
```bash
|
|
74
|
-
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs commit "docs: start milestone v[X.Y] [Name]" --files .planning/project.md .planning/state.md
|
|
75
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs commit "docs: start milestone v[X.Y] [Name]" --files .planning/project.md .planning/state.md [path of the deleted MILESTONE-context.md, if git tracked it] --force
|
|
75
76
|
```
|
|
76
77
|
|
|
77
78
|
## 7. Load Context and Resolve Models
|
|
@@ -34,7 +34,7 @@ Before scaffolding or coding anything, confirm with the user:
|
|
|
34
34
|
|
|
35
35
|
**Do NOT proceed** until the user has answered. Do not assume, research, or fill in blanks yourself. The user's intent drives everything — skipping this step leads to wasted scaffolding and mis-aligned implementation.
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Ask these after Step 1's checks (Step 1 runs before any user interaction) and carry the answers into project.md (Step 4); requirements.md is written in Step 7 from its template. Confirm with the user before scaffolding.
|
|
38
38
|
|
|
39
39
|
> **Auto mode exception:** If `--auto` is set with a provided idea document (see `<auto_mode>` below), the document IS the Phase 0 answer. Read it carefully and extract problem / success / scope / constraints from its contents.
|
|
40
40
|
|
|
@@ -46,7 +46,7 @@ Check if `--auto` flag is present in $ARGUMENTS.
|
|
|
46
46
|
**If auto mode:**
|
|
47
47
|
- Skip brownfield mapping offer (assume greenfield)
|
|
48
48
|
- Skip deep questioning (extract context from provided document)
|
|
49
|
-
- Config: YOLO mode is implicit
|
|
49
|
+
- Config: YOLO mode is implicit; depth, git and agents take their defaults (or idea.md frontmatter overrides) silently in Step 2a — no questions
|
|
50
50
|
- After config: run Steps 6-9 automatically with smart defaults:
|
|
51
51
|
- Research: Always yes
|
|
52
52
|
- Requirements: Include all table stakes + features from provided document
|
|
@@ -92,7 +92,7 @@ git init
|
|
|
92
92
|
|
|
93
93
|
## 2. Brownfield Offer
|
|
94
94
|
|
|
95
|
-
**If auto mode:** Skip to Step
|
|
95
|
+
**If auto mode:** Skip to Step 2a (assume greenfield); Step 2a applies the config defaults and continues at Step 4, which synthesizes project.md from the provided document.
|
|
96
96
|
|
|
97
97
|
**If `needs_codebase_map` is true** (from init — existing code detected but no codebase map):
|
|
98
98
|
|
|
@@ -985,7 +985,7 @@ Use AskUserQuestion:
|
|
|
985
985
|
- .planning/roadmap.md (Current roadmap to revise)
|
|
986
986
|
</files_to_read>
|
|
987
987
|
|
|
988
|
-
Update the roadmap based on feedback
|
|
988
|
+
Update the roadmap based on feedback: rewrite each changed file with one Write.
|
|
989
989
|
Return ROADMAP REVISED with changes made.
|
|
990
990
|
</revision>
|
|
991
991
|
", subagent_type="pan-roadmapper", model="{roadmapper_model}", description="Revise roadmap")
|
|
@@ -1016,7 +1016,7 @@ Parse JSON for `project_types` and `recommendations` arrays.
|
|
|
1016
1016
|
**If auto mode (P-1601 v3.7.5):** Auto-select ONLY `priority: "high"` recommendations. These are recommendations from explicitly-detected non-general project types (e.g., a recognized `web` or `ai` project). For `general` fallback projects with no explicit type signal, **skip auto-selection entirely** — leave `standards.md` absent rather than impose unrelated standards.
|
|
1017
1017
|
|
|
1018
1018
|
```bash
|
|
1019
|
-
HIGH_IDS=$(
|
|
1019
|
+
HIGH_IDS=$(printf '%s' "$RECOMMEND" | node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>console.log((JSON.parse(s).recommendations||[]).filter(r=>r.priority==='high').map(r=>r.id).join('\n')))")
|
|
1020
1020
|
if [ -n "$HIGH_IDS" ]; then
|
|
1021
1021
|
for id in $HIGH_IDS; do
|
|
1022
1022
|
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs standards select "$id"
|
|
@@ -1036,10 +1036,10 @@ Present recommendations:
|
|
|
1036
1036
|
|
|
1037
1037
|
Based on your project type ([types]), these standards are recommended:
|
|
1038
1038
|
|
|
1039
|
-
| Standard |
|
|
1039
|
+
| Standard | Priority | Why |
|
|
1040
1040
|
|----------|----------|-----|
|
|
1041
|
-
| [name] | [
|
|
1042
|
-
| [name] | [
|
|
1041
|
+
| [name] | [priority] | [reason] |
|
|
1042
|
+
| [name] | [priority] | [reason] |
|
|
1043
1043
|
```
|
|
1044
1044
|
|
|
1045
1045
|
Use AskUserQuestion:
|
|
@@ -1047,7 +1047,7 @@ Use AskUserQuestion:
|
|
|
1047
1047
|
- question: "Which standards would you like to apply? (advisory — guides agents, doesn't block)"
|
|
1048
1048
|
- multiSelect: true
|
|
1049
1049
|
- options: (from recommendations, max 4)
|
|
1050
|
-
- "[standard name]" — [
|
|
1050
|
+
- "[standard name]" — [reason]
|
|
1051
1051
|
|
|
1052
1052
|
For each selected standard:
|
|
1053
1053
|
```bash
|
|
@@ -1110,7 +1110,7 @@ Present completion summary:
|
|
|
1110
1110
|
╚══════════════════════════════════════════╝
|
|
1111
1111
|
```
|
|
1112
1112
|
|
|
1113
|
-
|
|
1113
|
+
Spawn discuss-phase for Phase 1 as a Task subagent, exactly as transition.md Route A does for a phase with no context.md (discuss-phase.md as execution_context, `ARGUMENTS='1 --auto'`); do not call SlashCommand.
|
|
1114
1114
|
|
|
1115
1115
|
**If interactive mode:**
|
|
1116
1116
|
|
|
@@ -6,8 +6,8 @@ Manage the circular optimization loop — apply reports, check stats, control tr
|
|
|
6
6
|
|
|
7
7
|
| Subcommand | Action |
|
|
8
8
|
|------------|--------|
|
|
9
|
-
| `apply` |
|
|
10
|
-
| `apply --report <file>` |
|
|
9
|
+
| `apply` | Record the suggestions from the most recent report |
|
|
10
|
+
| `apply --report <file>` | Record them from a specific report |
|
|
11
11
|
| `revert <apply_id>` / `revert --last` | Undo one apply exactly |
|
|
12
12
|
| `list` | List all reports |
|
|
13
13
|
| `stats` | Show cumulative stats |
|
|
@@ -40,17 +40,17 @@ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize apply [--report <path>
|
|
|
40
40
|
### Step 3 — Present results
|
|
41
41
|
|
|
42
42
|
Show the user:
|
|
43
|
-
- **Applied** — each item that was
|
|
43
|
+
- **Applied** — each item that was recorded (suggestions, config notes)
|
|
44
44
|
- **Skipped** — items that already exist, that an earlier apply already wrote, or that had unknown types
|
|
45
|
-
- **Still needs
|
|
45
|
+
- **Still needs a person** — every suggestion in `suggestions.md`
|
|
46
46
|
- **The `apply_id`**, and how to undo the apply: `/pan:optimize revert <apply_id>`
|
|
47
47
|
|
|
48
|
-
If memory
|
|
49
|
-
> Memory entries have been added to `.planning/memory/`. They will be loaded on the next agent run, reducing future memory misses for these topics.
|
|
48
|
+
If an applied item carries a `warning`, pass it on. An older report's memory actions write to `.planning/memory/`, which PAN's workflows do not load into agents.
|
|
50
49
|
|
|
51
50
|
### Step 4 — Point to manual review items
|
|
52
51
|
|
|
53
52
|
If `.planning/optimization/suggestions.md` exists, tell the user to review it for:
|
|
53
|
+
- Lessons (apply by writing them into the project's CLAUDE.md or AGENTS.md outside PAN's section, a test, or a comment at the cited code)
|
|
54
54
|
- Agent prompt improvements (apply by editing `agents/pan-*.md`)
|
|
55
55
|
- Workflow step additions (apply by editing `pan-wizard-core/workflows/*.md`)
|
|
56
56
|
|
|
@@ -125,7 +125,7 @@ Active session: sess_... (or none)
|
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
If `total_optimizations_applied` > 0, note:
|
|
128
|
-
> {N}
|
|
128
|
+
> {N} suggestions have been recorded across {apply_runs} apply runs. Each helps once a person has written it where the agents read.
|
|
129
129
|
|
|
130
130
|
---
|
|
131
131
|
|
|
@@ -142,11 +142,13 @@ Every agent spawn → hook logs completion event
|
|
|
142
142
|
↓
|
|
143
143
|
.planning/optimization/reports/{session}-opt-report.md
|
|
144
144
|
↓
|
|
145
|
-
/pan:optimize apply →
|
|
145
|
+
/pan:optimize apply → records suggestions
|
|
146
|
+
↓
|
|
147
|
+
A person writes each one where the agents read it
|
|
146
148
|
↓
|
|
147
149
|
Next build has better context → fewer errors/gaps
|
|
148
150
|
↓
|
|
149
151
|
(repeat, improving each time)
|
|
150
152
|
```
|
|
151
153
|
|
|
152
|
-
The key insight:
|
|
154
|
+
The key insight: a lesson changes the next run only from a place the next run's agents read: the project's instructions (CLAUDE.md or AGENTS.md, outside PAN's section), a test that fails when it is broken, or the code itself. PAN's workflows do not load `.planning/memory/` into agents (ADR-0036, amended `2026-10-04`). In the harness, a lesson recorded there changed nothing that the project's state, summaries and code did not already carry. The report says where each suggestion belongs, and a person puts it there.
|
|
@@ -91,8 +91,13 @@ timestamp=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs current-timestamp f
|
|
|
91
91
|
</step>
|
|
92
92
|
|
|
93
93
|
<step name="commit">
|
|
94
|
+
Record the stopping point in state.md too: the context monitor's note sends agents here to make state.md say where they are, and after a compaction PAN re-injects state.md's Stopped At and Resume File, not the handoff file.
|
|
95
|
+
|
|
94
96
|
```bash
|
|
95
|
-
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs
|
|
97
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs state record-session \
|
|
98
|
+
--stopped-at "Phase [XX] plan [P], task [X]/[Y] — next: [next_action]" \
|
|
99
|
+
--resume-file ".planning/phases/[XX-name]/.continue-here.md"
|
|
100
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs commit "wip: [phase-name] paused at task [X]/[Y]" --files .planning/phases/*/.continue-here.md .planning/state.md
|
|
96
101
|
```
|
|
97
102
|
</step>
|
|
98
103
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<purpose>
|
|
2
|
-
Generate unit and E2E tests for a completed phase based on its summary.md, context.md, and implementation. Classifies each changed file into TDD (unit), E2E (browser), or Skip categories, presents a test plan for user approval, then generates tests following RED-GREEN conventions.
|
|
2
|
+
Generate unit and E2E tests for a completed phase based on its summary.md, context.md, and implementation. Classifies each changed file into TDD (unit), Integration, E2E (browser), or Skip categories, presents a test plan for user approval, then generates tests following RED-GREEN conventions.
|
|
3
3
|
|
|
4
4
|
Users currently hand-craft `/pan:quick` prompts for test generation after each phase. This workflow standardizes the process with proper classification, quality gates, and gap reporting.
|
|
5
5
|
</purpose>
|
|
@@ -70,7 +70,7 @@ Extract the list of files modified by the phase from summary.md ("Files Changed"
|
|
|
70
70
|
|
|
71
71
|
**CRITICAL: Project Scope Boundary**
|
|
72
72
|
Skip any files inside PAN infrastructure directories — these are NOT project source code:
|
|
73
|
-
- `.claude/`, `.
|
|
73
|
+
- `.claude/`, `.opencode/`, `.gemini/`, `.codex/`, `.agents/`, `.planning/`, 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`)
|
|
74
74
|
If all changed files are inside these directories, report "No project source files to test" and exit.
|
|
75
75
|
|
|
76
76
|
For each file, classify into one of four categories:
|
|
@@ -334,7 +334,7 @@ Create a test coverage report and present to user:
|
|
|
334
334
|
|
|
335
335
|
Record test generation in project state:
|
|
336
336
|
```bash
|
|
337
|
-
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs state
|
|
337
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs state update "Last Activity Description" "Phase ${phase_number} tests generated"
|
|
338
338
|
```
|
|
339
339
|
|
|
340
340
|
If there are passing tests to commit:
|
|
@@ -374,7 +374,7 @@ Present next steps:
|
|
|
374
374
|
|
|
375
375
|
<success_criteria>
|
|
376
376
|
- [ ] Phase artifacts loaded (summary.md, context.md, optionally verification.md)
|
|
377
|
-
- [ ] All changed files classified into TDD/E2E/Skip categories
|
|
377
|
+
- [ ] All changed files classified into TDD/Integration/E2E/Skip categories
|
|
378
378
|
- [ ] Classification presented to user and approved
|
|
379
379
|
- [ ] Project test structure discovered (directories, conventions, runners)
|
|
380
380
|
- [ ] Test plan presented to user and approved
|