pan-wizard 3.33.0 → 3.35.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 +29 -26
- package/agents/pan-conductor.md +18 -17
- package/agents/pan-counterfactual.md +2 -2
- package/agents/pan-debugger.md +30 -9
- package/agents/pan-design-checker.md +2 -1
- package/agents/pan-designer.md +2 -2
- package/agents/pan-distiller.md +3 -3
- package/agents/pan-document_code.md +14 -14
- package/agents/pan-executor.md +30 -9
- package/agents/pan-experiment-runner.md +9 -8
- package/agents/pan-hardener.md +1 -1
- package/agents/pan-integration-checker.md +2 -2
- package/agents/pan-knowledge.md +1 -1
- package/agents/pan-meta-reviewer.md +4 -4
- package/agents/pan-optimizer.md +39 -43
- package/agents/pan-phase-researcher.md +10 -10
- package/agents/pan-plan-checker.md +37 -34
- package/agents/pan-planner.md +57 -44
- package/agents/pan-previewer.md +1 -1
- package/agents/pan-project-researcher.md +12 -12
- package/agents/pan-release.md +1 -1
- package/agents/pan-research-synthesizer.md +3 -3
- package/agents/pan-reviewer.md +26 -3
- package/agents/pan-roadmapper.md +15 -14
- package/agents/pan-verifier.md +33 -25
- package/bin/install-lib.cjs +176 -38
- package/bin/install.js +81 -63
- package/commands/pan/army.md +15 -11
- package/commands/pan/assumptions.md +2 -2
- package/commands/pan/audit-deployment.md +11 -12
- package/commands/pan/cost.md +8 -8
- package/commands/pan/dashboard.md +0 -3
- package/commands/pan/debug.md +10 -7
- package/commands/pan/design-phase.md +5 -5
- package/commands/pan/discuss-phase.md +2 -0
- package/commands/pan/exec-phase.md +21 -37
- package/commands/pan/experiment.md +9 -8
- package/commands/pan/focus-auto.md +22 -20
- package/commands/pan/focus-design.md +7 -6
- package/commands/pan/focus-doc-audit.md +4 -3
- package/commands/pan/focus-drift-walking.md +4 -3
- package/commands/pan/focus-exec.md +6 -6
- package/commands/pan/focus-plan.md +12 -11
- package/commands/pan/focus-scan.md +5 -3
- package/commands/pan/focus-sync.md +3 -2
- package/commands/pan/git.md +8 -8
- package/commands/pan/health.md +2 -2
- package/commands/pan/hud.md +4 -7
- package/commands/pan/hygiene.md +14 -7
- package/commands/pan/knowledge.md +9 -10
- package/commands/pan/learn.md +10 -7
- package/commands/pan/links.md +4 -1
- package/commands/pan/map-codebase.md +1 -1
- package/commands/pan/mcp-bridge.md +19 -21
- package/commands/pan/milestone-done.md +6 -3
- package/commands/pan/milestone-new.md +1 -1
- package/commands/pan/new-project.md +10 -10
- package/commands/pan/optimize.md +18 -14
- package/commands/pan/patches.md +2 -6
- package/commands/pan/pause.md +1 -1
- package/commands/pan/phase-tests.md +3 -2
- package/commands/pan/plan-phase.md +9 -19
- package/commands/pan/preview.md +2 -3
- package/commands/pan/profile.md +2 -2
- package/commands/pan/quick.md +1 -1
- package/commands/pan/remove-phase.md +1 -1
- package/commands/pan/report.md +3 -7
- package/commands/pan/research-phase.md +16 -15
- package/commands/pan/resume.md +9 -11
- package/commands/pan/retro.md +5 -3
- package/commands/pan/review-deep.md +7 -9
- package/commands/pan/settings.md +1 -1
- package/commands/pan/verify-phase.md +0 -11
- package/commands/pan/what-if.md +3 -4
- package/hooks/dist/pan-context-monitor.js +352 -44
- package/hooks/dist/pan-cost-logger.js +30 -0
- package/hooks/dist/pan-guard.js +244 -0
- package/hooks/dist/pan-statusline.js +73 -24
- package/hooks/dist/pan-stop-guard.js +7 -2
- package/package.json +1 -1
- package/pan-wizard-core/bin/lib/agents-md.cjs +44 -6
- package/pan-wizard-core/bin/lib/bridge.cjs +6 -5
- package/pan-wizard-core/bin/lib/campaign.cjs +4 -2
- package/pan-wizard-core/bin/lib/commands-learnings.cjs +19 -2
- package/pan-wizard-core/bin/lib/commands.cjs +57 -6
- package/pan-wizard-core/bin/lib/config.cjs +7 -1
- package/pan-wizard-core/bin/lib/constants.cjs +18 -6
- package/pan-wizard-core/bin/lib/context-budget.cjs +12 -9
- package/pan-wizard-core/bin/lib/core.cjs +53 -19
- package/pan-wizard-core/bin/lib/cost-rebuild.cjs +13 -1
- package/pan-wizard-core/bin/lib/cost.cjs +142 -13
- package/pan-wizard-core/bin/lib/distill.cjs +6 -3
- package/pan-wizard-core/bin/lib/doc-lint.cjs +30 -11
- package/pan-wizard-core/bin/lib/findings.cjs +135 -21
- 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 +184 -17
- package/pan-wizard-core/bin/lib/init.cjs +13 -4
- package/pan-wizard-core/bin/lib/knowledge.cjs +17 -1
- package/pan-wizard-core/bin/lib/learn-index.cjs +111 -10
- package/pan-wizard-core/bin/lib/learn-lint.cjs +30 -3
- package/pan-wizard-core/bin/lib/memory-optimize.cjs +8 -4
- package/pan-wizard-core/bin/lib/memory.cjs +508 -54
- package/pan-wizard-core/bin/lib/milestone.cjs +8 -3
- package/pan-wizard-core/bin/lib/optimize.cjs +97 -17
- package/pan-wizard-core/bin/lib/phase-gate.cjs +174 -0
- 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 +39 -13
- package/pan-wizard-core/bin/lib/preview.cjs +34 -31
- package/pan-wizard-core/bin/lib/roadmap-compact.cjs +267 -0
- package/pan-wizard-core/bin/lib/roadmap.cjs +243 -9
- package/pan-wizard-core/bin/lib/runner.cjs +2 -1
- package/pan-wizard-core/bin/lib/state-compact.cjs +11 -6
- package/pan-wizard-core/bin/lib/state.cjs +43 -28
- package/pan-wizard-core/bin/lib/template.cjs +11 -4
- package/pan-wizard-core/bin/lib/verdict.cjs +140 -10
- package/pan-wizard-core/bin/lib/verify-integrity.cjs +181 -0
- package/pan-wizard-core/bin/lib/verify-plan-set.cjs +230 -0
- 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 +11 -7
- package/pan-wizard-core/bin/lib/verify.cjs +30 -28
- package/pan-wizard-core/bin/lib/whatif.cjs +53 -9
- package/pan-wizard-core/bin/pan-tools.cjs +114 -19
- package/pan-wizard-core/learnings/index.json +5 -5
- package/pan-wizard-core/mcp/merge-gate.cjs +14 -3
- package/pan-wizard-core/mcp/native-tools.cjs +3 -3
- package/pan-wizard-core/opencode/pan-wizard.js +139 -0
- package/pan-wizard-core/references/checkpoints.md +3 -3
- package/pan-wizard-core/references/continuation-format.md +3 -3
- package/pan-wizard-core/references/decimal-phase-calculation.md +2 -3
- package/pan-wizard-core/references/design-methodology.md +1 -1
- package/pan-wizard-core/references/git-integration.md +4 -6
- package/pan-wizard-core/references/git-planning-commit.md +2 -2
- package/pan-wizard-core/references/guardrails.md +2 -2
- package/pan-wizard-core/references/handoff-decisions.md +3 -3
- package/pan-wizard-core/references/model-profile-resolution.md +5 -5
- package/pan-wizard-core/references/model-profiles.md +15 -10
- package/pan-wizard-core/references/phase-argument-parsing.md +7 -7
- package/pan-wizard-core/references/planning-config.md +7 -7
- package/pan-wizard-core/references/tdd.md +10 -1
- package/pan-wizard-core/references/verdict-contract.md +6 -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/config.json +2 -6
- package/pan-wizard-core/templates/continue-here.md +1 -1
- package/pan-wizard-core/templates/debug-subagent-prompt.md +5 -3
- package/pan-wizard-core/templates/debug.md +15 -1
- package/pan-wizard-core/templates/milestone-archive.md +6 -6
- package/pan-wizard-core/templates/milestone.md +1 -1
- package/pan-wizard-core/templates/phase-prompt.md +31 -17
- package/pan-wizard-core/templates/planner-subagent-prompt.md +5 -5
- package/pan-wizard-core/templates/preview-report.md +1 -1
- 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/state.md +4 -4
- package/pan-wizard-core/templates/summary-complex.md +1 -0
- package/pan-wizard-core/templates/summary-minimal.md +1 -0
- package/pan-wizard-core/templates/summary-standard.md +2 -1
- package/pan-wizard-core/templates/summary.md +18 -2
- package/pan-wizard-core/templates/uat.md +3 -3
- package/pan-wizard-core/templates/user-setup.md +8 -8
- package/pan-wizard-core/templates/verification-report.md +53 -8
- package/pan-wizard-core/workflows/add-phase.md +1 -1
- package/pan-wizard-core/workflows/assumptions.md +1 -1
- package/pan-wizard-core/workflows/diagnose-issues.md +4 -4
- package/pan-wizard-core/workflows/discuss-phase.md +10 -8
- package/pan-wizard-core/workflows/exec-phase.md +75 -95
- package/pan-wizard-core/workflows/execute-plan.md +8 -7
- package/pan-wizard-core/workflows/health.md +13 -12
- package/pan-wizard-core/workflows/help.md +8 -9
- package/pan-wizard-core/workflows/learn.md +13 -11
- package/pan-wizard-core/workflows/map-codebase.md +10 -10
- package/pan-wizard-core/workflows/milestone-audit.md +10 -10
- package/pan-wizard-core/workflows/milestone-gaps.md +18 -25
- package/pan-wizard-core/workflows/milestone-new.md +7 -6
- package/pan-wizard-core/workflows/new-project.md +17 -25
- 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 +53 -42
- package/pan-wizard-core/workflows/profile.md +2 -2
- package/pan-wizard-core/workflows/progress.md +6 -8
- package/pan-wizard-core/workflows/quick.md +7 -5
- 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 +4 -3
- package/pan-wizard-core/workflows/transition.md +16 -12
- package/pan-wizard-core/workflows/update.md +25 -17
- package/pan-wizard-core/workflows/verify-phase.md +22 -20
- 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-hooks.js +1 -0
- package/scripts/build-plugin.js +3 -1
- package/scripts/generate-skills-docs.py +15 -6
- package/scripts/prompt-lint.cjs +167 -0
- package/scripts/test-surface.cjs +1 -0
|
@@ -46,6 +46,7 @@ The full milestone-done workflow is inlined in <process> below — there is no s
|
|
|
46
46
|
- Look for `.planning/v{{version}}-milestone-audit.md`
|
|
47
47
|
- If missing or stale: recommend `/pan:milestone-audit` first
|
|
48
48
|
- If audit status is `gaps_found`: recommend `/pan:milestone-gaps` first
|
|
49
|
+
- If audit status is `tech_debt`: present the debt; proceed on the user's say-so (it becomes accepted debt), or recommend `/pan:milestone-gaps` for a cleanup phase
|
|
49
50
|
- If audit status is `passed`: proceed to step 1
|
|
50
51
|
|
|
51
52
|
```markdown
|
|
@@ -87,6 +88,7 @@ The full milestone-done workflow is inlined in <process> below — there is no s
|
|
|
87
88
|
- Create `.planning/milestones/v{{version}}-roadmap.md`
|
|
88
89
|
- Extract full phase details from roadmap.md
|
|
89
90
|
- Fill milestone-archive.md template
|
|
91
|
+
- Add this milestone's entry to `.planning/milestones.md` from @~/.claude/pan-wizard-core/templates/milestone.md (create the file with that template's header if it does not exist)
|
|
90
92
|
- Update roadmap.md to one-line summary with link
|
|
91
93
|
|
|
92
94
|
5. **Archive requirements:**
|
|
@@ -104,7 +106,7 @@ The full milestone-done workflow is inlined in <process> below — there is no s
|
|
|
104
106
|
|
|
105
107
|
7. **Commit and tag:**
|
|
106
108
|
|
|
107
|
-
- Stage: milestones.md, project.md, roadmap.md, state.md, archive files
|
|
109
|
+
- Stage: milestones.md, project.md, roadmap.md, state.md, archive files, and the deleted requirements.md, and commit with `--force` (the user confirmed the milestone in step 1): `pan-tools commit` refuses any pending deletion, staged or not (`deleted_files_detected`), unless git pairs it with the archive as a rename
|
|
108
110
|
- Commit: `chore: archive v{{version}} milestone`
|
|
109
111
|
- Tag: `git tag -a v{{version}} -m "[milestone summary]"`
|
|
110
112
|
- Ask about pushing tag
|
|
@@ -116,10 +118,11 @@ The full milestone-done workflow is inlined in <process> below — there is no s
|
|
|
116
118
|
|
|
117
119
|
```bash
|
|
118
120
|
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize trace end 2>/dev/null || true
|
|
119
|
-
|
|
121
|
+
# trace end cleared the active-session pointer, so pool the recent sessions
|
|
122
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize learn --sessions 5 2>/dev/null || true
|
|
120
123
|
```
|
|
121
124
|
|
|
122
|
-
Present the optimization summary to the user and suggest `/pan:optimize apply` to
|
|
125
|
+
Present the optimization summary to the user and suggest `/pan:optimize apply` to record its suggestions, each naming where a person should make the change.
|
|
123
126
|
|
|
124
127
|
</process>
|
|
125
128
|
|
|
@@ -22,7 +22,7 @@ Brownfield equivalent of new-project. Project exists, project.md has history. Ga
|
|
|
22
22
|
- `.planning/roadmap.md` — phase structure (continues numbering)
|
|
23
23
|
- `.planning/state.md` — reset for new milestone
|
|
24
24
|
|
|
25
|
-
**After:** `/pan:design-phase [N]` → `/pan:plan-phase [N]`
|
|
25
|
+
**After:** `/pan:discuss-phase [N]` (then, optionally, `/pan:design-phase [N]`) → `/pan:plan-phase [N]` for the first phase.
|
|
26
26
|
|
|
27
27
|
**Design altitude (ADR-0042):** product/strategic design — demand validation, competitive intelligence, market positioning — belongs HERE at milestone creation (via the requirements/research cycle, or `/pan:focus-design` for a strategic feature), done ONCE. Per-phase architecture/ADR/threat design is `/pan:design-phase`, run per phase. Do not defer product questions to per-phase design, and do not re-open them there.
|
|
28
28
|
</objective>
|
|
@@ -12,7 +12,7 @@ allowed-tools:
|
|
|
12
12
|
---
|
|
13
13
|
<context>
|
|
14
14
|
**Flags:**
|
|
15
|
-
- `--auto` — Automatic mode.
|
|
15
|
+
- `--auto` — Automatic mode. Asks no questions: applies the auto-mode defaults (idea.md frontmatter can override them), then runs research → requirements → roadmap without interaction. Needs an idea document — an @ reference, or the idea pasted after the flag.
|
|
16
16
|
</context>
|
|
17
17
|
|
|
18
18
|
<objective>
|
|
@@ -26,7 +26,7 @@ Initialize a new project through unified flow: questioning → research (optiona
|
|
|
26
26
|
- `.planning/roadmap.md` — phase structure
|
|
27
27
|
- `.planning/state.md` — project memory
|
|
28
28
|
|
|
29
|
-
**After this command:** Run `/pan:plan-phase 1` to
|
|
29
|
+
**After this command:** Run `/pan:discuss-phase 1` to gather context, or `/pan:plan-phase 1` to plan directly. With `--auto` the workflow continues into `/pan:discuss-phase 1 --auto` itself.
|
|
30
30
|
</objective>
|
|
31
31
|
|
|
32
32
|
<execution_context>
|
|
@@ -68,23 +68,23 @@ Use this decision tree to select the correct path. Evaluate conditions top-to-bo
|
|
|
68
68
|
|
|
69
69
|
```
|
|
70
70
|
IF .planning/ already exists AND contains project.md:
|
|
71
|
-
→ WARN: "Project already initialized. Use /pan:
|
|
71
|
+
→ WARN: "Project already initialized. Use /pan:progress to continue."
|
|
72
72
|
→ STOP (do not overwrite existing project)
|
|
73
73
|
|
|
74
|
-
ELSE IF --auto flag AND @ reference
|
|
75
|
-
→ ASK
|
|
76
|
-
→ SKIP interactive questioning (use the
|
|
74
|
+
ELSE IF --auto flag AND an idea document provided (@ reference or pasted text):
|
|
75
|
+
→ ASK nothing: apply the auto-mode defaults (workflow step 2a; idea.md frontmatter can override them)
|
|
76
|
+
→ SKIP interactive questioning (use the document as project context)
|
|
77
77
|
→ RUN research automatically
|
|
78
|
-
→ GENERATE requirements from research +
|
|
78
|
+
→ GENERATE requirements from research + the document
|
|
79
79
|
→ GENERATE roadmap from requirements
|
|
80
80
|
→ No further interaction until complete
|
|
81
81
|
|
|
82
|
-
ELSE IF --auto flag WITHOUT
|
|
83
|
-
→ ERROR: "--auto requires an @
|
|
82
|
+
ELSE IF --auto flag WITHOUT an idea document:
|
|
83
|
+
→ ERROR: "--auto requires an idea document" (an @ reference, or the idea pasted after the flag)
|
|
84
84
|
→ STOP
|
|
85
85
|
|
|
86
86
|
ELSE (interactive mode — default):
|
|
87
|
-
→ RUN questioning flow (
|
|
87
|
+
→ RUN questioning flow (freeform deep questioning — references/questioning.md)
|
|
88
88
|
→ ASK: "Should I research the domain ecosystem?" (Y/N)
|
|
89
89
|
→ IF Y: spawn researchers → synthesize → continue
|
|
90
90
|
→ IF N: skip research → continue
|
package/commands/pan/optimize.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pan:optimize
|
|
3
3
|
group: Self-Improvement
|
|
4
|
-
description: Manage the circular optimization loop —
|
|
4
|
+
description: Manage the circular optimization loop — record a report's suggestions, undo them, view stats, list reports, manage trace sessions
|
|
5
|
+
argument-hint: "apply [--report <file>] | revert <apply_id> | revert --last | list | stats | trace init|end|current|list"
|
|
5
6
|
allowed-tools:
|
|
6
7
|
- Read
|
|
7
8
|
- Write
|
|
@@ -13,7 +14,7 @@ allowed-tools:
|
|
|
13
14
|
|
|
14
15
|
# /pan:optimize
|
|
15
16
|
|
|
16
|
-
Manage the circular optimization loop:
|
|
17
|
+
Manage the circular optimization loop: record a report's suggestions, view stats, list reports.
|
|
17
18
|
|
|
18
19
|
**Usage:**
|
|
19
20
|
```
|
|
@@ -32,14 +33,15 @@ Manage the circular optimization loop: apply recommendations, view stats, list r
|
|
|
32
33
|
**Subcommands:**
|
|
33
34
|
|
|
34
35
|
### apply
|
|
35
|
-
|
|
36
|
+
Record the suggestions from the most recent (or specified) optimization report.
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
- Suggestions appended to `.planning/optimization/suggestions.md`
|
|
38
|
+
Recorded automatically:
|
|
39
|
+
- Suggestions appended to `.planning/optimization/suggestions.md`: lessons, prompt changes and workflow changes, each naming where it belongs
|
|
40
40
|
- Config notes appended to `.planning/optimization/config-suggestions.md`
|
|
41
|
+
- An older report's memory actions (`memory_entry`, `memory`, `memory_append`) still write to `.planning/memory/`, a `memory_entry` only if it passes the checks of the `memory record` command. The result warns that PAN's workflows do not load that folder into agents
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
A person makes every change the suggestions describe (never auto-applied):
|
|
44
|
+
- Lessons, written into the project's instructions (CLAUDE.md or AGENTS.md, outside PAN's section), a test, or a comment at the cited code
|
|
43
45
|
- Agent prompt changes
|
|
44
46
|
- Workflow step additions
|
|
45
47
|
- Structural changes to commands
|
|
@@ -47,7 +49,7 @@ Requires human review (never auto-applied):
|
|
|
47
49
|
After applying, the report lists what was applied and what still needs review, plus the `apply_id` that undoes it. Every apply is recorded action by action in `.planning/optimization/applied.jsonl`: the path, whether the file was created or appended to, the exact text, and a hash of the file after the write. Applying the same report a second time writes nothing: each action names the apply that already wrote it.
|
|
48
50
|
|
|
49
51
|
### revert
|
|
50
|
-
Undo one apply exactly: delete the
|
|
52
|
+
Undo one apply exactly: delete the files it created and cut the text it appended (`revert --last` for the newest).
|
|
51
53
|
|
|
52
54
|
Revert never destroys work someone did since:
|
|
53
55
|
- It refuses a file whose content changed after the apply. The comparison ignores line endings, so a CRLF checkout still matches.
|
|
@@ -63,12 +65,12 @@ List all optimization reports in `.planning/optimization/reports/`, most recent
|
|
|
63
65
|
Show cumulative optimization statistics:
|
|
64
66
|
- Total trace sessions run
|
|
65
67
|
- Total events traced
|
|
66
|
-
- Total errors
|
|
68
|
+
- Total errors seen (`total_errors_traced`; gaps and redundancies are not totalled)
|
|
67
69
|
- Total optimizations applied across all runs, the apply runs, the reverted runs, and the last `apply_id`
|
|
68
70
|
- Current active trace session (if any)
|
|
69
71
|
|
|
70
72
|
### trace init
|
|
71
|
-
Start a
|
|
73
|
+
Start a trace session before running a build — or join the active one: `trace init` reuses an unended session started within the last hour (`reused: true`, keeping that session's description) instead of opening a new one. The hook fires automatically on SubagentStop, but calling `trace init` first lets you attach a description to a new session.
|
|
72
74
|
|
|
73
75
|
```
|
|
74
76
|
/pan:optimize trace init --description "building express web server"
|
|
@@ -80,7 +82,7 @@ Start a new trace session before running a build. The hook fires automatically o
|
|
|
80
82
|
Finalize the current trace session (writes summary stats to session.json).
|
|
81
83
|
|
|
82
84
|
### trace current
|
|
83
|
-
Show the active trace session ID and event count.
|
|
85
|
+
Show the active trace session ID (`optimize trace current` returns only `session_id` and `active`; `trace list` carries each session's event count).
|
|
84
86
|
|
|
85
87
|
### trace list
|
|
86
88
|
List all trace sessions, most recent first.
|
|
@@ -98,14 +100,16 @@ List all trace sessions, most recent first.
|
|
|
98
100
|
│ ↓ │
|
|
99
101
|
│ /pan:learn ← analyze + report │
|
|
100
102
|
│ ↓ │
|
|
101
|
-
│ /pan:optimize apply ←
|
|
103
|
+
│ /pan:optimize apply ← record suggestions │
|
|
102
104
|
│ ↓ │
|
|
103
|
-
│
|
|
105
|
+
│ You make the changes ← instructions, tests, code │
|
|
104
106
|
│ ↑ │
|
|
105
107
|
│ └──────────────────────────────────────────┘
|
|
106
108
|
└─────────────────────────────────────────────────────┘
|
|
107
109
|
```
|
|
108
110
|
|
|
109
|
-
Each iteration
|
|
111
|
+
Each iteration puts what the last run lacked where the next run's agents read it: fewer repeated errors and gaps.
|
|
110
112
|
|
|
111
113
|
**See also:** `/pan:learn`, `/pan:exec-phase`
|
|
114
|
+
|
|
115
|
+
Follow the workflow at `~/.claude/pan-wizard-core/workflows/optimize.md`. Each subcommand runs `node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize <subcommand> [flags]` — e.g. `optimize apply --report <path>`, `optimize revert --last`, `optimize trace init --description "..."`.
|
package/commands/pan/patches.md
CHANGED
|
@@ -23,12 +23,8 @@ After a PAN update wipes and reinstalls files, this command merges user's previo
|
|
|
23
23
|
Check for local patches directory:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
#
|
|
26
|
+
# This install's own dir — the installer templates ~/.claude/ to it, local or global
|
|
27
27
|
PATCHES_DIR=~/.claude/pan-local-patches
|
|
28
|
-
# Local install fallback
|
|
29
|
-
if [ ! -d "$PATCHES_DIR" ]; then
|
|
30
|
-
PATCHES_DIR=~/.claude/pan-local-patches
|
|
31
|
-
fi
|
|
32
28
|
```
|
|
33
29
|
|
|
34
30
|
Read `backup-meta.json` from the patches directory.
|
|
@@ -61,7 +57,7 @@ Exit.
|
|
|
61
57
|
|
|
62
58
|
For each file in `backup-meta.json`:
|
|
63
59
|
|
|
64
|
-
1. **Read the backed-up version** (user's modified copy from `pan-local-patches/`)
|
|
60
|
+
1. **Read the backed-up version** (user's modified copy from `pan-local-patches/<file>`; a file listed in `backup-meta.json`'s `external_files` — a Codex skill under `../.agents/skills/` — is at `pan-local-patches/` + the path that map gives)
|
|
65
61
|
2. **Read the newly installed version** (current file after update)
|
|
66
62
|
3. **Compare and merge:**
|
|
67
63
|
|
package/commands/pan/pause.md
CHANGED
|
@@ -74,7 +74,7 @@ context:
|
|
|
74
74
|
The workflow handles all logic including:
|
|
75
75
|
1. Phase directory detection
|
|
76
76
|
2. State gathering with user clarifications
|
|
77
|
-
3. Handoff file writing with timestamp — **using the schema from `<handoff_schema
|
|
77
|
+
3. Handoff file writing with timestamp — **using the schema from `<handoff_schema>`, in place of the format in the workflow's write step and `templates/continue-here.md`** (`/pan:resume` parses this schema's fields)
|
|
78
78
|
4. Git commit
|
|
79
79
|
5. Confirmation with resume instructions
|
|
80
80
|
</process>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pan:phase-tests
|
|
3
3
|
group: Phase Management
|
|
4
|
-
description: Generate tests for a completed phase
|
|
4
|
+
description: Generate tests for a completed phase from its summaries, context decisions, verification report and implementation
|
|
5
5
|
argument-hint: "<phase> [additional instructions]"
|
|
6
6
|
allowed-tools:
|
|
7
7
|
- Read
|
|
@@ -30,7 +30,8 @@ Output: Test files committed with message `test(phase-{N}): add unit and E2E tes
|
|
|
30
30
|
Phase: $ARGUMENTS
|
|
31
31
|
|
|
32
32
|
@.planning/state.md
|
|
33
|
-
|
|
33
|
+
|
|
34
|
+
This phase's goal and requirements, if the workflow needs them: `node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap slice <phase> --raw`, with only the phase number from $ARGUMENTS, since the instructions after it are free text that can break a shell line (the whole roadmap.md only for something it leaves out).
|
|
34
35
|
</context>
|
|
35
36
|
|
|
36
37
|
<process>
|
|
@@ -19,7 +19,7 @@ Create executable phase prompts (plan.md files) for a roadmap phase with integra
|
|
|
19
19
|
|
|
20
20
|
**Default flow:** Research (if needed) → Plan → Verify → Done
|
|
21
21
|
|
|
22
|
-
**Design input (ADR-0042):** if `{phase}-design.md` exists (from `/pan:design-phase`, verified by `pan-design-checker`), it is an authoritative upstream input — `pan-planner` implements its approved architecture/decisions and `pan-plan-checker` verifies conformance (Design Conformance dimension). It is optional: a phase without a design.md plans exactly as before.
|
|
22
|
+
**Design input (ADR-0042):** if `{phase}-design.md` exists (from `/pan:design-phase`, verified by `pan-design-checker`), it is an authoritative upstream input — `pan-planner` implements its approved architecture/decisions and `pan-plan-checker` verifies conformance (Design Conformance dimension). It is optional: a phase without a design.md plans exactly as before. The plan-phase workflow does not list it in the planner's or checker's `<files_to_read>`, so they use it only when they find it in the phase directory themselves.
|
|
23
23
|
|
|
24
24
|
**Orchestrator role:** Parse arguments, validate phase, research domain (unless skipped), spawn pan-planner, verify with pan-plan-checker, iterate until pass or max iterations, present results.
|
|
25
25
|
</objective>
|
|
@@ -38,6 +38,7 @@ Phase number: $ARGUMENTS (optional — auto-detects next unplanned phase if omit
|
|
|
38
38
|
- `--gaps` — Gap closure mode (reads verification.md, skips research)
|
|
39
39
|
- `--skip-verify` — Skip verification loop
|
|
40
40
|
- `--prd <file>` — Use a PRD/acceptance criteria file instead of discuss-phase. Parses requirements into context.md automatically. Skips discuss-phase entirely.
|
|
41
|
+
- `--auto` — Autonomous mode: sets `workflow.auto_advance` and asks nothing (with no context.md it plans from the project-level research, requirements and idea.md); after planning it runs `/pan:exec-phase N --auto --no-transition` and, once the phase completes, prints `Next: /pan:discuss-phase <next phase> --auto` and stops.
|
|
41
42
|
|
|
42
43
|
Normalize phase input in step 2 before any directory lookups.
|
|
43
44
|
</context>
|
|
@@ -48,7 +49,7 @@ During the plan-checker verification iteration:
|
|
|
48
49
|
2. For each identified gap: verify it is a genuine gap by re-reading the relevant requirement
|
|
49
50
|
3. Do not blindly accept all critiques — some may be false positives from missing context
|
|
50
51
|
4. Revise the plan to address genuine gaps only
|
|
51
|
-
5.
|
|
52
|
+
5. At most 2 revisions: the workflow checks up to three times (plan → check → revise → check → revise → check); after the third check the user chooses force proceed, guidance or abandon
|
|
52
53
|
This prevents over-revision while ensuring real gaps are closed.
|
|
53
54
|
</reflexion_loop>
|
|
54
55
|
|
|
@@ -57,7 +58,7 @@ Planning is complete when ALL conditions are met:
|
|
|
57
58
|
1. At least one plan.md file created in the phase directory
|
|
58
59
|
2. Plan-checker passed (or max 2 revision iterations exhausted with final approval)
|
|
59
60
|
3. Each plan contains: objective, task breakdown with estimates, dependency ordering, and key file links
|
|
60
|
-
4. Research.md exists
|
|
61
|
+
4. Research.md exists, unless research was skipped (`--skip-research`, `--gaps`, `workflow.research: false`, or the single-plan lightweight-phase bypass)
|
|
61
62
|
5. User presented with results and next-step options
|
|
62
63
|
|
|
63
64
|
Planning FAILS if: phase not found in roadmap, or planner agent returns empty/malformed output after retries.
|
|
@@ -67,7 +68,7 @@ Planning FAILS if: phase not found in roadmap, or planner agent returns empty/ma
|
|
|
67
68
|
Avoid these planning anti-patterns:
|
|
68
69
|
```
|
|
69
70
|
BAD: Plan has 25 tasks for a single phase → too granular, executor loses context
|
|
70
|
-
GOOD:
|
|
71
|
+
GOOD: 2-3 tasks per plan, each with clear scope and testable outcome (more work means more plans)
|
|
71
72
|
|
|
72
73
|
BAD: Task says "Implement the feature" with no file links or acceptance criteria
|
|
73
74
|
→ Executor guesses at scope, misses edge cases
|
|
@@ -92,7 +93,7 @@ IF --gaps flag is set:
|
|
|
92
93
|
ELSE IF --prd <file> flag is set:
|
|
93
94
|
→ SKIP discuss-phase entirely
|
|
94
95
|
→ PARSE PRD file into context.md
|
|
95
|
-
→
|
|
96
|
+
→ RUN research as usual (step 3.5 writes context.md from the PRD, then continues to step 5)
|
|
96
97
|
→ PLAN from parsed requirements
|
|
97
98
|
→ VERIFY (unless --skip-verify)
|
|
98
99
|
|
|
@@ -120,23 +121,12 @@ IF --skip-verify:
|
|
|
120
121
|
ELSE:
|
|
121
122
|
→ Spawn pan-plan-checker
|
|
122
123
|
→ IF checker PASSES: done
|
|
123
|
-
→ IF checker finds gaps (
|
|
124
|
-
→ IF checker finds gaps (
|
|
125
|
-
→ Max 2
|
|
124
|
+
→ IF checker finds gaps (check 1 or 2): revise plan, re-check
|
|
125
|
+
→ IF checker finds gaps (check 3): stop revising; the user chooses force proceed (open issues recorded as deferred), guidance and retry, or abandon
|
|
126
|
+
→ Max 2 revisions, so at most 3 checks
|
|
126
127
|
```
|
|
127
128
|
</routing_decision_tree>
|
|
128
129
|
|
|
129
|
-
<cache_priming>
|
|
130
|
-
**Before spawning research + planner agents, prime the prompt cache.** All sub-agents spawned within the next 5 minutes hit cached context instead of re-reading project.md / requirements.md / roadmap.md / state.md / standards.md.
|
|
131
|
-
|
|
132
|
-
Run once per invocation:
|
|
133
|
-
```
|
|
134
|
-
pan-tools cache prime --summary
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
Returns `{blocks: [{path, bytes, cache}], total_bytes, sha}`. On a host runtime that supports prompt caching (Claude Code does), the host translates these block references into `cache_control: ephemeral`. Where prompt caching is unavailable this is a no-op — nothing breaks.
|
|
138
|
-
</cache_priming>
|
|
139
|
-
|
|
140
130
|
<process>
|
|
141
131
|
Execute the plan-phase workflow from @~/.claude/pan-wizard-core/workflows/plan-phase.md end-to-end.
|
|
142
132
|
Preserve all workflow gates (validation, research, planning, verification loop, routing).
|
package/commands/pan/preview.md
CHANGED
|
@@ -19,7 +19,6 @@ Consolidates Spec B v1's architect + simulate + predict-milestone into one entry
|
|
|
19
19
|
</objective>
|
|
20
20
|
|
|
21
21
|
<execution_context>
|
|
22
|
-
@~/.claude/pan-wizard-core/bin/lib/preview.cjs
|
|
23
22
|
@~/.claude/pan-wizard-core/templates/preview-report.md
|
|
24
23
|
</execution_context>
|
|
25
24
|
|
|
@@ -60,7 +59,7 @@ Consolidates Spec B v1's architect + simulate + predict-milestone into one entry
|
|
|
60
59
|
```
|
|
61
60
|
|
|
62
61
|
**What it does:**
|
|
63
|
-
1. `pan-tools preview milestone` returns `{phases_total,
|
|
62
|
+
1. `pan-tools preview milestone` returns `{current_milestone, phases_total, phases_completed, phases_remaining, avg_phase_duration_days, velocity_phases_per_week, eta_date, confidence_pct, bottleneck, sample_size}`.
|
|
64
63
|
2. Spawn `pan-previewer` with `mode: milestone`.
|
|
65
64
|
3. Agent writes `.planning/milestones/preview-<today>.md` with ETA + confidence + bottleneck + caveats + bottom line.
|
|
66
65
|
|
|
@@ -74,7 +73,7 @@ Consolidates Spec B v1's architect + simulate + predict-milestone into one entry
|
|
|
74
73
|
|
|
75
74
|
**Before committing to a milestone date externally:** run `/pan:preview milestone`. Look at `confidence_pct` and `sample_size`. If sample is <3, don't promise a date.
|
|
76
75
|
|
|
77
|
-
**Before running phases in parallel:** run `/pan:preview phases`. Parallel batches from the data layer are based on declared `
|
|
76
|
+
**Before running phases in parallel:** run `/pan:preview phases`. Parallel batches from the data layer are based on declared dependencies only — the roadmap's `**Depends on:** Phase N` line and any `phase:N` entry in a plan's `depends_on`; `hidden_coupling_count > 0` means there are cross-phase references the author should promote to explicit deps (on the roadmap's Depends on line) before parallelizing.
|
|
78
77
|
|
|
79
78
|
</workflow>
|
|
80
79
|
|
package/commands/pan/profile.md
CHANGED
|
@@ -10,7 +10,7 @@ allowed-tools:
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
<objective>
|
|
13
|
-
Switch the model profile used by PAN agents.
|
|
13
|
+
Switch the model profile used by PAN agents. Sets the model tier PAN's workflows pass when they spawn an agent (mapped to the detected provider's models), balancing quality vs token spend. `/pan:army` and `pan-conductor` spawn with no model, so the agents they run use their own `model:` pin, else the session model, under every profile.
|
|
14
14
|
|
|
15
15
|
Routes to the profile workflow which handles:
|
|
16
16
|
- Argument validation (quality/balanced/budget)
|
|
@@ -37,7 +37,7 @@ The workflow handles all logic including:
|
|
|
37
37
|
</process>
|
|
38
38
|
|
|
39
39
|
<tier_decision_tree>
|
|
40
|
-
**Capability-aware routing** (shipped v2.10.0 — E-7).
|
|
40
|
+
**Capability-aware routing** (shipped v2.10.0 — E-7). `resolveModel` can adjust the profile's tier per call from three hints — context estimate, whether the task needs extended thinking, and whether prompt cache is warm — but only when the caller passes them (`resolve-model <agent> --metadata '{…}'`). No shipped workflow, command or agent passes them, so the tree and the quick guide below describe what a caller's hints would do.
|
|
41
41
|
|
|
42
42
|
The decision order `resolveModel` applies after the baseline profile pick:
|
|
43
43
|
|
package/commands/pan/quick.md
CHANGED
|
@@ -28,5 +28,5 @@ Roadmap and state are resolved in-workflow via `init phase-op` and targeted read
|
|
|
28
28
|
|
|
29
29
|
<process>
|
|
30
30
|
Execute the remove-phase workflow from @~/.claude/pan-wizard-core/workflows/remove-phase.md end-to-end.
|
|
31
|
-
Preserve all validation gates (future phase check, work check), renumbering logic, and commit.
|
|
31
|
+
Preserve all validation gates (future phase check, work check), renumbering logic, and commit. The removal deletes tracked files, so commit with `--force` once the user has confirmed it: without it `pan-tools commit` refuses any pending deletion (`deleted_files_detected`).
|
|
32
32
|
</process>
|
package/commands/pan/report.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: pan:report
|
|
3
3
|
group: Observability
|
|
4
4
|
description: Generate a self-contained HTML report for one phase, or a project-level timeline index linking every phase report
|
|
5
|
-
argument-hint: "phase <N>
|
|
5
|
+
argument-hint: "phase <N> [--out <file>] [--open] [--stdout] | index [--out <file>] [--open] [--stdout] [--bundle] | all [--open]"
|
|
6
6
|
allowed-tools:
|
|
7
7
|
- Read
|
|
8
8
|
- Bash
|
|
@@ -13,13 +13,9 @@ Render **self-contained HTML reports** — no server, no network, no external CS
|
|
|
13
13
|
|
|
14
14
|
Like `pan:hud`, these are *views*, not a new source of truth: every value is read from what PAN already tracks on disk (the phase's `plan`/`summary`/`verification` artifacts and their frontmatter, `roadmap.md`, and the cost ledger). The command only writes the rendered file(s), so it can never corrupt planning data. Reports reuse the HUD's visual language, so they look like part of the same product.
|
|
15
15
|
|
|
16
|
-
Reports are honest by construction: the `verify reconcile` verdict is shown beside the (rubber-stampable) self-reported verification status, status is framed as a current-disk snapshot, and any spend is gated so a poisoned or unpriced ledger never renders a fake
|
|
16
|
+
Reports are honest by construction: the `verify reconcile` verdict is shown beside the (rubber-stampable) self-reported verification status, status is framed as a current-disk snapshot, and any spend is gated so a poisoned or unpriced ledger never renders a fake zero-dollar spend.
|
|
17
17
|
</objective>
|
|
18
18
|
|
|
19
|
-
<execution_context>
|
|
20
|
-
@~/.claude/pan-wizard-core/bin/lib/phase-report.cjs
|
|
21
|
-
</execution_context>
|
|
22
|
-
|
|
23
19
|
<usage>
|
|
24
20
|
|
|
25
21
|
```
|
|
@@ -48,7 +44,7 @@ pan-tools report all [--open]
|
|
|
48
44
|
{
|
|
49
45
|
"action": "phase",
|
|
50
46
|
"phase": "03",
|
|
51
|
-
"path": "
|
|
47
|
+
"path": "/abs/path/to/project/.planning/phases/03-auth-sessions/03-report.html",
|
|
52
48
|
"bytes": 16183,
|
|
53
49
|
"status": "complete",
|
|
54
50
|
"written": true,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: pan:research-phase
|
|
3
3
|
group: Phase Lifecycle
|
|
4
4
|
description: Research how to implement a phase (standalone - usually use /pan:plan-phase instead)
|
|
5
|
-
argument-hint: "
|
|
5
|
+
argument-hint: "<phase>"
|
|
6
6
|
allowed-tools:
|
|
7
7
|
- Read
|
|
8
8
|
- Bash
|
|
@@ -38,7 +38,7 @@ Normalize phase input in step 1 before any directory lookups.
|
|
|
38
38
|
INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init phase-op "$ARGUMENTS")
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
Extract from init JSON: `phase_dir`, `phase_number`, `phase_name`, `phase_found`, `commit_docs`, `has_research`, `state_path`, `requirements_path`, `context_path`, `research_path`.
|
|
41
|
+
Extract from init JSON: `phase_dir`, `padded_phase`, `phase_slug`, `phase_number`, `phase_name`, `phase_found`, `commit_docs`, `has_research`, `state_path`, `requirements_path`, `context_path`, `research_path`. `phase_dir` is null when the phase is in the roadmap but has no directory yet: create it (`mkdir -p ".planning/phases/${padded_phase}-${phase_slug}"`) and use that path as `phase_dir`, as discuss-phase does.
|
|
42
42
|
|
|
43
43
|
Resolve researcher model:
|
|
44
44
|
```bash
|
|
@@ -63,8 +63,11 @@ Use `has_research` and `research_path` from INIT.
|
|
|
63
63
|
|
|
64
64
|
## 3. Gather Phase Context
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
Write this phase's roadmap slice (its section, its dependencies' goals and its requirement lines), then use paths from INIT (do not inline file contents in orchestrator context):
|
|
67
|
+
```bash
|
|
68
|
+
SLICE_PATH=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap slice "${phase_number}" --write --raw)
|
|
69
|
+
```
|
|
70
|
+
- `slice_path` (from the command above; `requirements_path` if it is empty)
|
|
68
71
|
- `context_path`
|
|
69
72
|
- `state_path`
|
|
70
73
|
|
|
@@ -72,7 +75,7 @@ Present summary with phase description and what files the researcher will load.
|
|
|
72
75
|
|
|
73
76
|
## 4. Spawn pan-phase-researcher Agent
|
|
74
77
|
|
|
75
|
-
Research
|
|
78
|
+
Research mode: the prompt below names `ecosystem`; pan-phase-researcher defines no modes, so treat it as context, not a switch.
|
|
76
79
|
|
|
77
80
|
```markdown
|
|
78
81
|
<research_type>
|
|
@@ -98,7 +101,7 @@ Mode: ecosystem
|
|
|
98
101
|
</objective>
|
|
99
102
|
|
|
100
103
|
<files_to_read>
|
|
101
|
-
- {
|
|
104
|
+
- {slice_path} (This phase's roadmap and requirements)
|
|
102
105
|
- {context_path} (Phase context from discuss-phase, if exists)
|
|
103
106
|
- {state_path} (Prior project decisions and blockers)
|
|
104
107
|
</files_to_read>
|
|
@@ -128,14 +131,14 @@ Before declaring complete, verify:
|
|
|
128
131
|
</quality_gate>
|
|
129
132
|
|
|
130
133
|
<output>
|
|
131
|
-
Write to:
|
|
134
|
+
Write to: {phase_dir}/{padded_phase}-research.md
|
|
132
135
|
</output>
|
|
133
136
|
```
|
|
134
137
|
|
|
135
138
|
```
|
|
136
139
|
Task(
|
|
137
|
-
prompt=
|
|
138
|
-
subagent_type="
|
|
140
|
+
prompt=filled_prompt,
|
|
141
|
+
subagent_type="pan-phase-researcher",
|
|
139
142
|
model="{researcher_model}",
|
|
140
143
|
description="Research Phase {phase}"
|
|
141
144
|
)
|
|
@@ -145,9 +148,7 @@ Task(
|
|
|
145
148
|
|
|
146
149
|
**`## RESEARCH COMPLETE`:** Display summary, offer: Plan phase, Dig deeper, Review full, Done.
|
|
147
150
|
|
|
148
|
-
**`##
|
|
149
|
-
|
|
150
|
-
**`## RESEARCH INCONCLUSIVE`:** Show what was attempted, offer: Add context, Try different mode, Manual.
|
|
151
|
+
**`## RESEARCH BLOCKED`:** Show the blocker and what was attempted, offer: Provide context (then spawn a continuation, step 6), Skip research, Abort.
|
|
151
152
|
|
|
152
153
|
## 6. Spawn Continuation Agent
|
|
153
154
|
|
|
@@ -158,7 +159,7 @@ Continue research for Phase {phase_number}: {phase_name}
|
|
|
158
159
|
|
|
159
160
|
<prior_state>
|
|
160
161
|
<files_to_read>
|
|
161
|
-
-
|
|
162
|
+
- {phase_dir}/{padded_phase}-research.md (Existing research)
|
|
162
163
|
</files_to_read>
|
|
163
164
|
</prior_state>
|
|
164
165
|
|
|
@@ -170,8 +171,8 @@ Continue research for Phase {phase_number}: {phase_name}
|
|
|
170
171
|
|
|
171
172
|
```
|
|
172
173
|
Task(
|
|
173
|
-
prompt=
|
|
174
|
-
subagent_type="
|
|
174
|
+
prompt=continuation_prompt,
|
|
175
|
+
subagent_type="pan-phase-researcher",
|
|
175
176
|
model="{researcher_model}",
|
|
176
177
|
description="Continue research Phase {phase}"
|
|
177
178
|
)
|
package/commands/pan/resume.md
CHANGED
|
@@ -62,22 +62,20 @@ ELSE IF .continue-here.md exists:
|
|
|
62
62
|
→ PRESENT: position, blockers, next action
|
|
63
63
|
→ ROUTE to the command that was paused (exec-phase, plan-phase, etc.)
|
|
64
64
|
|
|
65
|
-
ELSE IF state.md exists
|
|
65
|
+
ELSE IF state.md exists (its Status is free text — Ready to plan, Ready to execute, In progress, Phase complete, Milestone complete and the like; none says "blocked"):
|
|
66
|
+
→ IF state.md's `### Blockers/Concerns` lists a blocker:
|
|
67
|
+
→ PRESENT the blockers first
|
|
68
|
+
→ OFFER: debug (/pan:debug) or unblock manually
|
|
66
69
|
→ FIND incomplete work: plans without summaries, phases mid-execution
|
|
67
70
|
→ IF incomplete phase found:
|
|
68
71
|
→ PRESENT phase status + what remains
|
|
69
72
|
→ OFFER: continue execution (/pan:exec-phase) or verify (/pan:verify-phase)
|
|
70
|
-
→ IF
|
|
73
|
+
→ ELSE IF roadmap phases remain incomplete (`roadmap analyze`):
|
|
71
74
|
→ PRESENT milestone progress
|
|
72
|
-
→ OFFER: next unplanned phase (/pan:plan-phase) or audit (/pan:milestone-audit)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
→ OFFER: debug (/pan:debug) or unblock manually
|
|
77
|
-
|
|
78
|
-
ELSE IF state.md exists AND has status "completed":
|
|
79
|
-
→ "Current milestone is complete. Run /pan:milestone-done or /pan:milestone-new."
|
|
80
|
-
→ STOP
|
|
75
|
+
→ OFFER: next unplanned phase (/pan:discuss-phase, or /pan:plan-phase when it has a context.md) or audit (/pan:milestone-audit)
|
|
76
|
+
→ ELSE (every roadmap phase complete):
|
|
77
|
+
→ "Current milestone is complete. Run /pan:milestone-audit, then /pan:milestone-done, or /pan:milestone-new."
|
|
78
|
+
→ STOP
|
|
81
79
|
|
|
82
80
|
ELSE (state.md missing or unreadable):
|
|
83
81
|
→ ATTEMPT reconstruction from .planning/ artifacts
|
package/commands/pan/retro.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: pan:retro
|
|
3
3
|
group: Milestone Lifecycle
|
|
4
4
|
description: Milestone retrospective — analyze estimation accuracy, verification patterns, and common gaps
|
|
5
|
-
argument-hint: ""
|
|
5
|
+
argument-hint: "[--write-memory] [--max N]"
|
|
6
6
|
allowed-tools:
|
|
7
7
|
- Read
|
|
8
8
|
- Bash
|
|
@@ -14,7 +14,7 @@ Analyze completed milestone work to identify process improvement opportunities.
|
|
|
14
14
|
|
|
15
15
|
Examines roadmap phases (planned vs completed, gap closures), verification results (pass rates, common gaps), and estimation accuracy. Output guides future planning improvements.
|
|
16
16
|
|
|
17
|
-
This is a reflection command — **read-only by default**: with no flags it does not modify any files. Passing `--write-memory`
|
|
17
|
+
This is a reflection command — **read-only by default**: with no flags it does not modify any files. Passing `--write-memory` is the one exception: it appends recurring-pattern entries to the agent logs in `.planning/memory/`, which `/pan:knowledge` reads. PAN's workflows do not load those logs into agents, so a pattern meant to change the next plan goes into that plan's brief or the project's instructions.
|
|
18
18
|
</objective>
|
|
19
19
|
|
|
20
20
|
<execution_context>
|
|
@@ -24,8 +24,10 @@ This is a reflection command — **read-only by default**: with no flags it does
|
|
|
24
24
|
<context>
|
|
25
25
|
No arguments required. Operates on the current `.planning/` directory.
|
|
26
26
|
|
|
27
|
+
Flags: $ARGUMENTS
|
|
28
|
+
|
|
27
29
|
**Flags:**
|
|
28
|
-
- `--write-memory` — after analysis, append recurring-pattern entries to agent memory (
|
|
30
|
+
- `--write-memory` — after analysis, append recurring-pattern entries to the agent logs in `.planning/memory/` (stored for `/pan:knowledge`, not loaded into agents). `--max N` caps the planner lessons (default 3). Without `--write-memory` the command is strictly read-only.
|
|
29
31
|
|
|
30
32
|
The retro command is typically run after `/pan:milestone-done` to reflect on the milestone before starting the next one.
|
|
31
33
|
</context>
|