pan-wizard 3.22.0 → 3.25.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 +38 -24
- package/agents/pan-conductor.md +4 -4
- package/agents/pan-design-checker.md +83 -0
- package/agents/pan-designer.md +67 -0
- package/agents/pan-document_code.md +3 -2
- package/agents/pan-executor.md +2 -2
- package/agents/pan-plan-checker.md +19 -6
- package/agents/pan-planner.md +4 -1
- package/agents/pan-previewer.md +1 -1
- package/agents/pan-roadmapper.md +3 -1
- package/agents/pan-verifier.md +10 -10
- package/bin/install-lib.cjs +128 -17
- package/bin/install.js +480 -74
- package/commands/pan/army.md +34 -14
- package/commands/pan/audit-deployment.md +17 -14
- package/commands/pan/cost.md +2 -2
- package/commands/pan/debug.md +1 -1
- package/commands/pan/design-phase.md +77 -0
- package/commands/pan/exec-phase.md +2 -2
- package/commands/pan/experiment.md +18 -14
- package/commands/pan/focus-auto.md +5 -5
- package/commands/pan/focus-design.md +13 -1
- package/commands/pan/focus-exec.md +1 -1
- package/commands/pan/learn.md +1 -1
- package/commands/pan/links.md +3 -1
- package/commands/pan/map-codebase.md +4 -4
- package/commands/pan/mcp-bridge.md +1 -1
- package/commands/pan/milestone-new.md +3 -1
- package/commands/pan/optimize.md +2 -2
- package/commands/pan/patches.md +1 -1
- package/commands/pan/plan-phase.md +3 -1
- package/commands/pan/preview.md +3 -3
- package/commands/pan/profile.md +3 -3
- package/commands/pan/research-phase.md +1 -1
- package/commands/pan/retro.md +4 -1
- package/commands/pan/review-deep.md +1 -1
- package/commands/pan/settings.md +2 -2
- package/commands/pan/what-if.md +1 -1
- package/hooks/dist/pan-check-update.js +149 -38
- package/hooks/dist/pan-context-monitor.js +155 -81
- package/hooks/dist/pan-cost-logger.js +288 -13
- package/hooks/dist/pan-statusline.js +24 -8
- package/hooks/dist/pan-stop-guard.js +160 -0
- package/hooks/dist/pan-trace-logger.js +261 -19
- package/package.json +2 -2
- package/pan-wizard-core/bin/lib/bridge.cjs +1 -1
- package/pan-wizard-core/bin/lib/bus.cjs +19 -4
- package/pan-wizard-core/bin/lib/campaign.cjs +8 -3
- package/pan-wizard-core/bin/lib/codebase.cjs +15 -5
- package/pan-wizard-core/bin/lib/commands.cjs +88 -6
- package/pan-wizard-core/bin/lib/config.cjs +27 -2
- package/pan-wizard-core/bin/lib/constants.cjs +1 -0
- package/pan-wizard-core/bin/lib/core.cjs +113 -8
- package/pan-wizard-core/bin/lib/cost.cjs +61 -24
- package/pan-wizard-core/bin/lib/distill.cjs +22 -4
- package/pan-wizard-core/bin/lib/doc-lint.cjs +25 -7
- package/pan-wizard-core/bin/lib/experiment.cjs +25 -1
- package/pan-wizard-core/bin/lib/focus.cjs +42 -7
- package/pan-wizard-core/bin/lib/frontmatter.cjs +62 -31
- package/pan-wizard-core/bin/lib/git.cjs +51 -16
- package/pan-wizard-core/bin/lib/hud.cjs +17 -2
- package/pan-wizard-core/bin/lib/init.cjs +2 -5
- package/pan-wizard-core/bin/lib/knowledge.cjs +20 -1
- package/pan-wizard-core/bin/lib/learn-lint.cjs +50 -0
- package/pan-wizard-core/bin/lib/links.cjs +9 -6
- package/pan-wizard-core/bin/lib/lock.cjs +23 -4
- package/pan-wizard-core/bin/lib/memory-optimize.cjs +11 -6
- package/pan-wizard-core/bin/lib/milestone.cjs +11 -5
- package/pan-wizard-core/bin/lib/optimize.cjs +18 -7
- package/pan-wizard-core/bin/lib/phase-remove.cjs +41 -2
- package/pan-wizard-core/bin/lib/phase.cjs +82 -11
- package/pan-wizard-core/bin/lib/preview.cjs +23 -4
- package/pan-wizard-core/bin/lib/review-deep.cjs +14 -6
- package/pan-wizard-core/bin/lib/roadmap.cjs +6 -2
- package/pan-wizard-core/bin/lib/runner.cjs +17 -7
- package/pan-wizard-core/bin/lib/squads.cjs +43 -11
- package/pan-wizard-core/bin/lib/state.cjs +32 -11
- package/pan-wizard-core/bin/lib/template.cjs +8 -3
- package/pan-wizard-core/bin/lib/verify-deploy.cjs +14 -2
- package/pan-wizard-core/bin/lib/verify-drift.cjs +15 -1
- package/pan-wizard-core/bin/lib/verify-preflight.cjs +9 -3
- package/pan-wizard-core/bin/lib/verify.cjs +84 -39
- package/pan-wizard-core/bin/lib/whatif.cjs +8 -1
- package/pan-wizard-core/bin/lib/worktree.cjs +98 -0
- package/pan-wizard-core/bin/pan-tools.cjs +45 -20
- package/pan-wizard-core/learnings/index.json +7 -7
- package/pan-wizard-core/learnings/universal/autonomous-loop.md +5 -3
- package/pan-wizard-core/learnings/universal/concurrency.md +1 -1
- package/pan-wizard-core/references/design-methodology.md +94 -0
- package/pan-wizard-core/references/git-integration.md +9 -9
- package/pan-wizard-core/references/guardrails.md +4 -1
- package/pan-wizard-core/references/model-profile-resolution.md +1 -1
- package/pan-wizard-core/references/model-profiles.md +44 -34
- package/pan-wizard-core/references/planning-config.md +5 -5
- package/pan-wizard-core/references/verification-patterns.md +67 -0
- package/pan-wizard-core/templates/codebase/architecture.md +1 -1
- package/pan-wizard-core/templates/codebase/concerns.md +1 -1
- package/pan-wizard-core/templates/codebase/conventions.md +1 -1
- package/pan-wizard-core/templates/codebase/integrations.md +1 -1
- package/pan-wizard-core/templates/codebase/stack.md +1 -1
- package/pan-wizard-core/templates/codebase/structure.md +1 -1
- package/pan-wizard-core/templates/codebase/testing.md +1 -1
- package/pan-wizard-core/templates/design.md +146 -0
- package/pan-wizard-core/templates/discovery.md +3 -3
- package/pan-wizard-core/templates/milestone-archive.md +2 -2
- package/pan-wizard-core/templates/playbook.md +1 -1
- package/pan-wizard-core/templates/uat.md +1 -1
- package/pan-wizard-core/workflows/diagnose-issues.md +9 -7
- package/pan-wizard-core/workflows/exec-phase.md +28 -8
- package/pan-wizard-core/workflows/execute-plan.md +2 -3
- package/pan-wizard-core/workflows/health.md +24 -1
- package/pan-wizard-core/workflows/help.md +5 -4
- package/pan-wizard-core/workflows/learn.md +5 -5
- package/pan-wizard-core/workflows/map-codebase.md +1 -1
- package/pan-wizard-core/workflows/milestone-audit.md +1 -1
- package/pan-wizard-core/workflows/milestone-new.md +4 -4
- package/pan-wizard-core/workflows/new-project.md +47 -32
- package/pan-wizard-core/workflows/optimize.md +8 -8
- package/pan-wizard-core/workflows/pause.md +1 -1
- package/pan-wizard-core/workflows/phase-tests.md +2 -2
- package/pan-wizard-core/workflows/plan-phase.md +4 -0
- package/pan-wizard-core/workflows/profile.md +13 -10
- package/pan-wizard-core/workflows/research-phase.md +1 -1
- package/pan-wizard-core/workflows/resume-project.md +1 -1
- package/pan-wizard-core/workflows/settings.md +9 -9
- package/pan-wizard-core/workflows/transition.md +24 -8
- package/pan-wizard-core/workflows/update.md +23 -20
- package/pan-wizard-core/workflows/verify-phase.md +7 -2
- package/pan-zcode/README.md +12 -2
- package/pan-zcode/bin/install-zcode.js +1 -1
- package/pan-zcode/mcp/native-tools.cjs +1 -1
- package/pan-zcode/mcp/server.cjs +76 -14
- package/scripts/build-hooks.js +2 -1
- package/scripts/generate-skills-docs.py +0 -4
- package/scripts/run-tests.cjs +11 -4
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# PanWizard
|
|
6
6
|
|
|
7
|
-
**Command a bot army for your codebase** —
|
|
7
|
+
**Command a bot army for your codebase** — a *Mission Control* agent delegates whole-project goals to specialist squads and ships behind a human merge gate. Five AI CLIs, zero context rot.
|
|
8
8
|
|
|
9
9
|
**Solves context rot** — the quality degradation that happens as the model fills its context window.
|
|
10
10
|
|
|
@@ -56,7 +56,7 @@ PAN is the context engineering layer that makes Claude Code reliable. It breaks
|
|
|
56
56
|
┌─────────────────────▼───────────────────────────────────────┐
|
|
57
57
|
│ AGENTS (specialized) │
|
|
58
58
|
│ planner · executor · verifier · researcher · debugger ... │
|
|
59
|
-
│ Each runs in fresh
|
|
59
|
+
│ Each runs in a fresh context window │
|
|
60
60
|
└─────────────────────┬───────────────────────────────────────┘
|
|
61
61
|
│ uses
|
|
62
62
|
┌─────────────────────▼───────────────────────────────────────┐
|
|
@@ -76,7 +76,7 @@ PAN is the context engineering layer that makes Claude Code reliable. It breaks
|
|
|
76
76
|
|
|
77
77
|
## Bot Army
|
|
78
78
|
|
|
79
|
-
> **Don't run one phase — run the whole project.** `/pan:army` turns PAN's agents into a coordinated army that delivers a goal end-to-end:
|
|
79
|
+
> **Don't run one phase — run the whole project.** `/pan:army` turns PAN's agents into a coordinated army that delivers a goal end-to-end: a **Mission Control** agent plans the mission and delegates to specialist **squads**, parallel builders each work an isolated git worktree, and **nothing reaches your main branch without green checks and your explicit approval.**
|
|
80
80
|
|
|
81
81
|
<div align="center">
|
|
82
82
|
<img src="https://cdn.jsdelivr.net/npm/pan-wizard@latest/assets/pan-orchestration.png" alt="PanWizard specialist agents orchestrated along a pipeline" width="340" />
|
|
@@ -84,20 +84,24 @@ PAN is the context engineering layer that makes Claude Code reliable. It breaks
|
|
|
84
84
|
|
|
85
85
|
| Tier | Squad | Does | Access |
|
|
86
86
|
|------|-------|------|--------|
|
|
87
|
-
| **0 · Mission Control** | `pan-conductor`
|
|
88
|
-
| **1 · Architecture** | roadmapper · planner · researchers | Designs the contract before code | read-only |
|
|
89
|
-
| **1 · Build** | `pan-executor` | Turns the contract into committed code | read
|
|
90
|
-
| **1 · Quality** | reviewer · hardener · verifier · … | Adversarially tries to break it | read-only |
|
|
91
|
-
| **1 · Release** | `pan-release` | Ships behind a human gate | always-ask |
|
|
92
|
-
| **2 · Workers** |
|
|
87
|
+
| **0 · Mission Control** | `pan-conductor` | Plans + delegates; instructed to hand implementation to a squad | delegation-first |
|
|
88
|
+
| **1 · Architecture** | roadmapper · planner · researchers · … | Designs the contract before code | `read-only` |
|
|
89
|
+
| **1 · Build** | `pan-executor` | Turns the contract into committed code | `read-write-bash` · one `army/<task>` worktree per agent |
|
|
90
|
+
| **1 · Quality** | reviewer · hardener · verifier · … | Adversarially tries to break it | `read-only` |
|
|
91
|
+
| **1 · Release** | `pan-release` | Ships behind a human gate | `always-ask` |
|
|
92
|
+
| **2 · Workers** | the utility agents `pan-tools squad list` reports under `workers` | Narrow, high-volume jobs | scoped |
|
|
93
|
+
|
|
94
|
+
**Mission Control runs on your session's model** — `pan-conductor` declares no `model:`, so it inherits whatever you launched with rather than pinning a model of its own.
|
|
95
|
+
|
|
96
|
+
**Reading the Access column.** The backticked values are the squad `access` labels `pan-tools squad list` reports; the tier-0 and tier-2 labels are PAN's own. Either way they describe the *role contract* PAN's prompts assign, not a sandbox — `squads.cjs` "modifies no agent and changes no execution path", so a label can differ from what an agent may actually do. The real tool grant is each agent's own `tools:` frontmatter (`grep '^tools:' agents/*.md`), and Mission Control's includes `Write` and `Bash`. The rail those grants do enforce is delegation depth: `grep -l '^tools:.*Task' agents/*.md` names every agent able to spawn another (today, the coordinator), so a squad agent cannot fan out further even if asked to. For the irreversible steps, back the convention with branch protection on your own repo.
|
|
93
97
|
|
|
94
98
|
**The loop:** `Muster → Plan → Delegate → Execute → Review → Integrate → Learn` ↺ — repeating until the goal ships or a stop condition fires.
|
|
95
99
|
|
|
96
100
|
**Bounded by a hard safety harness:**
|
|
97
101
|
|
|
98
|
-
- **A human merges
|
|
102
|
+
- **A human merges.** The Release squad prepares a squash-merge and surfaces an `always-ask` approval instead of merging; pair it with branch protection on your repo, which is what makes that unbypassable rather than merely instructed. Recovery is `git revert` or the previous tag, never a force-push.
|
|
99
103
|
- **Isolated builders.** Each Build agent forks its own `army/<task>` branch + git worktree, so parallel agents never share a file.
|
|
100
|
-
- **Caps
|
|
104
|
+
- **Caps.** Delegation-depth cap, per-cycle spawn + budget ceilings, and a `.planning/orchestration/abort` kill-switch, re-checked before every spawn — the same harness as hierarchical exec, at campaign scale.
|
|
101
105
|
|
|
102
106
|
**Run it over days.** `--schedule` arms a self-resuming campaign with a per-day budget that burns the backlog down across sessions — and *still* waits for you at every merge. **Autonomy runs up to the irreversible step; a human is at the step.**
|
|
103
107
|
|
|
@@ -136,7 +140,7 @@ Verify with:
|
|
|
136
140
|
- Codex: `$pan-help`
|
|
137
141
|
|
|
138
142
|
> [!NOTE]
|
|
139
|
-
> Codex and Copilot CLI installations use skills
|
|
143
|
+
> Codex and Copilot CLI installations use skills rather than custom prompts. Codex uses the shared `.agents/skills/pan-*/SKILL.md` tree; Copilot CLI uses `skills/pan-*/SKILL.md` under `.github` (local) or `~/.copilot` (global).
|
|
140
144
|
|
|
141
145
|
### Staying Updated
|
|
142
146
|
|
|
@@ -183,17 +187,26 @@ Add `--unified-skills` to install commands as one shared `.agents/skills/` tree
|
|
|
183
187
|
<details>
|
|
184
188
|
<summary><strong>Development Installation</strong></summary>
|
|
185
189
|
|
|
186
|
-
Clone the repository
|
|
190
|
+
Clone the repository, then run the installer from a **separate** project
|
|
191
|
+
directory. The installer hard-refuses to install into its own source repo (a
|
|
192
|
+
`PAN_SOURCE_ROOT` guard exits with an error), so point it at a different target:
|
|
187
193
|
|
|
188
194
|
```bash
|
|
195
|
+
# 1. Get the source
|
|
189
196
|
git clone https://github.com/oharms/PanWizard.git
|
|
190
|
-
|
|
191
|
-
|
|
197
|
+
|
|
198
|
+
# 2. Install into a DIFFERENT project directory (never the PanWizard source dir)
|
|
199
|
+
cd /path/to/some-test-project
|
|
200
|
+
node /path/to/PanWizard/bin/install.js --claude --local
|
|
192
201
|
```
|
|
193
202
|
|
|
194
|
-
Installs to `./.claude/`
|
|
203
|
+
Installs to the test project's `./.claude/` so you can try local modifications
|
|
204
|
+
before contributing.
|
|
205
|
+
|
|
206
|
+
Run the test suite from inside the cloned source repo:
|
|
195
207
|
|
|
196
208
|
```bash
|
|
209
|
+
cd /path/to/PanWizard
|
|
197
210
|
npm test # Unit tests
|
|
198
211
|
npm run test:scenarios # Scenario tests
|
|
199
212
|
npm run test:all # All tests (unit + scenario)
|
|
@@ -348,7 +361,7 @@ Each plan is small enough to execute in a fresh context window. No degradation,
|
|
|
348
361
|
The system:
|
|
349
362
|
|
|
350
363
|
1. **Runs plans in waves** — Parallel where possible, sequential when dependent
|
|
351
|
-
2. **Fresh context per plan** —
|
|
364
|
+
2. **Fresh context per plan** — a whole context window purely for implementation, zero accumulated garbage
|
|
352
365
|
3. **Commits per task** — Every task gets its own atomic commit
|
|
353
366
|
4. **Verifies against goals** — Checks the codebase delivers what the phase promised
|
|
354
367
|
|
|
@@ -510,7 +523,7 @@ Every stage uses the same pattern: a thin orchestrator spawns specialized agents
|
|
|
510
523
|
|-------|------------------|-----------|
|
|
511
524
|
| Research | Coordinates, presents findings | 4 parallel researchers investigate stack, features, architecture, pitfalls |
|
|
512
525
|
| Planning | Validates, manages iteration | Planner creates plans, checker verifies, loop until pass |
|
|
513
|
-
| Execution | Groups into waves, tracks progress | Executors implement in parallel, each with fresh
|
|
526
|
+
| Execution | Groups into waves, tracks progress | Executors implement in parallel, each with a fresh context window |
|
|
514
527
|
| Verification | Presents results, routes next | Verifier checks codebase against goals, debuggers diagnose failures |
|
|
515
528
|
|
|
516
529
|
The orchestrator never does heavy lifting. It spawns agents, waits, integrates results.
|
|
@@ -566,7 +579,7 @@ You're never locked in. The system adapts.
|
|
|
566
579
|
|
|
567
580
|
| | PAN Wizard | Cursor / Windsurf | Aider / Cline | GitHub Copilot |
|
|
568
581
|
|---|---|---|---|---|
|
|
569
|
-
| **Context rot prevention** | Phase-scoped fresh
|
|
582
|
+
| **Context rot prevention** | Phase-scoped fresh context windows | No — context degrades over time | No (Cline: condensing) | No |
|
|
570
583
|
| **Multi-agent** | Specialized agents, parallel waves | Up to 8 parallel (Cursor 2.0) | Single agent | Specialized sub-agents |
|
|
571
584
|
| **Plan → Verify loop** | Research → plan → verify with iteration | Agent generates plan | Plan mode (Cline) | Plan step |
|
|
572
585
|
| **Post-execution verification** | Auto verifier + human UAT | Iterative error-fix | Manual test runs | Auto-fix loop |
|
|
@@ -588,6 +601,7 @@ PAN is not a replacement for your IDE or AI agent — it's the orchestration lay
|
|
|
588
601
|
|---------|--------------|
|
|
589
602
|
| `/pan:new-project [--auto]` | Full initialization: questions → research → requirements → roadmap |
|
|
590
603
|
| `/pan:discuss-phase [N] [--auto]` | Capture implementation decisions before planning |
|
|
604
|
+
| `/pan:design-phase [N]` | Design a phase — architecture, ADR, threat-lite — before planning |
|
|
591
605
|
| `/pan:plan-phase [N] [--auto]` | Research + plan + verify for a phase |
|
|
592
606
|
| `/pan:exec-phase <N>` | Execute all plans in parallel waves, verify when complete |
|
|
593
607
|
| `/pan:verify-phase [N]` | Manual user acceptance testing ¹ |
|
|
@@ -615,7 +629,7 @@ PAN is not a replacement for your IDE or AI agent — it's the orchestration lay
|
|
|
615
629
|
|
|
616
630
|
| Command | What it does |
|
|
617
631
|
|---------|--------------|
|
|
618
|
-
| `/pan:army "<goal>"` | Campaign-scale delivery: Mission Control
|
|
632
|
+
| `/pan:army "<goal>"` | Campaign-scale delivery: Mission Control delegates a whole-project goal to architecture/build/quality/release squads with branch-per-agent worktrees, behind CI + a human merge gate; `--schedule`/`--continue` run it over time |
|
|
619
633
|
|
|
620
634
|
### Phase Management
|
|
621
635
|
|
|
@@ -719,11 +733,11 @@ Control which Claude model each agent uses. Balance quality vs token spend.
|
|
|
719
733
|
|
|
720
734
|
| Profile | Planning | Execution | Verification |
|
|
721
735
|
|---------|----------|-----------|--------------|
|
|
722
|
-
| `quality` |
|
|
723
|
-
| `balanced` (default) |
|
|
736
|
+
| `quality` | reasoning | reasoning | reasoning |
|
|
737
|
+
| `balanced` (default) | reasoning | reasoning | reasoning |
|
|
724
738
|
| `budget` | Sonnet | Sonnet | Haiku |
|
|
725
739
|
|
|
726
|
-
>
|
|
740
|
+
> `reasoning` = the session model (inherit) — every agent runs on the model you launched the session with. Both `quality` and `balanced` resolve this way; only `budget` steps down to a Sonnet/Haiku mix. Actual assignment varies by agent role — see [User Guide](docs/USER-GUIDE.md#model-profiles-per-agent-breakdown) for the full per-agent breakdown.
|
|
727
741
|
|
|
728
742
|
Switch profiles:
|
|
729
743
|
```
|
|
@@ -810,7 +824,7 @@ This prevents Claude from reading these files entirely, regardless of what comma
|
|
|
810
824
|
**Commands not found after install?**
|
|
811
825
|
- Restart your runtime to reload commands/skills
|
|
812
826
|
- Verify files exist in `~/.claude/commands/pan/` (global) or `./.claude/commands/pan/` (local)
|
|
813
|
-
- For Codex, verify skills exist in `~/.
|
|
827
|
+
- For Codex, verify skills exist in `~/.agents/skills/pan-*/SKILL.md` (global) or `./.agents/skills/pan-*/SKILL.md` (local)
|
|
814
828
|
- For Copilot CLI, verify skills exist in `~/.copilot/skills/pan-*/SKILL.md` (global) or `./.github/skills/pan-*/SKILL.md` (local)
|
|
815
829
|
|
|
816
830
|
**Commands not working as expected?**
|
package/agents/pan-conductor.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pan-conductor
|
|
3
|
-
description: Hierarchical orchestrator for /pan:exec-phase --hierarchical. Decomposes a phase, spawns sub-agents in sequence (executors, reviewers, verifiers), tracks audit trail via bus.cjs, enforces safety caps. Claude
|
|
3
|
+
description: Hierarchical orchestrator for /pan:exec-phase --hierarchical. Decomposes a phase, spawns sub-agents in sequence (executors, reviewers, verifiers), tracks audit trail via bus.cjs, enforces safety caps. Claude Code only — needs native sub-agent spawning.
|
|
4
4
|
tools: Read, Write, Bash, Glob, Grep, Task
|
|
5
5
|
color: orange
|
|
6
6
|
effort: xhigh
|
|
@@ -169,7 +169,7 @@ Other runtimes don't support agents-spawn-agents cleanly. The command's `--hiera
|
|
|
169
169
|
--hierarchical is not supported on <runtime>. Falling back to flat exec.
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
-
This agent file ships to all runtimes (keeps the installer uniform), but only gets invoked
|
|
172
|
+
This agent file ships to all runtimes (keeps the installer uniform), but only gets invoked on a runtime that supports native sub-agent spawning. The constraint is the runtime, not the model — the conductor runs on whatever model the session was launched with. Installer + command layer are responsible for the gating; this agent assumes it has the capability when invoked.
|
|
173
173
|
|
|
174
174
|
</runtime_gating>
|
|
175
175
|
|
|
@@ -191,8 +191,8 @@ This agent file ships to all runtimes (keeps the installer uniform), but only ge
|
|
|
191
191
|
|
|
192
192
|
When invoked by `/pan:army` (ADR-0033), you are **Mission Control** for a whole-project campaign, not a single phase — same harness, wider scope. The differences:
|
|
193
193
|
|
|
194
|
-
- **You delegate to squads, not bare agents.** Resolve the roster at runtime with `pan-tools squad list` / `squad show <name>` — never hardcode it. Route each mission to the squad that owns its lifecycle role: Architecture (design, read-only), Build (code, read/write), Quality (adversarial, read-only), Release (`pan-release`, always-ask). Workers (document_code, distiller) are
|
|
195
|
-
- **Build parallelizes by worktree.** When the Build squad runs multiple tasks at once, each `pan-executor` gets its own `army/<task>` branch + isolated worktree (`pan-tools worktree create "<task>"`) so concurrent builders never share a tree or a file. The spawn cap and budget ceiling still bound the fan-out.
|
|
194
|
+
- **You delegate to squads, not bare agents.** Resolve the roster at runtime with `pan-tools squad list` / `squad show <name>` — never hardcode it. Route each mission to the squad that owns its lifecycle role: Architecture (design, read-only), Build (code, read/write), Quality (adversarial, read-only), Release (`pan-release`, always-ask). Workers (document_code, distiller) take narrow, high-volume jobs; they are the agents the `budget` profile drops to the `fast` tier, and run at the inherited reasoning tier otherwise.
|
|
195
|
+
- **Build parallelizes by worktree — and you tear the worktrees down.** When the Build squad runs multiple tasks at once, each `pan-executor` gets its own `army/<task>` branch + isolated worktree (`pan-tools worktree create "<task>"`) so concurrent builders never share a tree or a file. The spawn cap and budget ceiling still bound the fan-out. Those worktrees are scaffolding: after each task's squash-merge lands, `pan-tools worktree remove <path> --branch army/<task>`; at campaign end or on any abort, `pan-tools worktree cleanup` sweeps the strays (`--force` to also discard dirty or unintegrated ones). Leaving `pan-army-*` sibling directories behind is a campaign defect, not residue (P-1815).
|
|
196
196
|
- **Integration is human-gated.** You never merge to a protected branch. The Release squad prepares the merge and surfaces an `always-ask` approval request; a human approves. Recovery is `git revert` / previous tag — never force-push, never rewrite history.
|
|
197
197
|
- **The loop carries learnings.** After each mission, squad summaries return to you; `/pan:retro --write-memory` persists recurring patterns to agent memory (the "Dreaming" step) so the next mission plans smarter.
|
|
198
198
|
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pan-design-checker
|
|
3
|
+
description: Independently verifies a design artifact (architecture, ADR, threat model, success criteria) BEFORE it is planned or implemented. Goal-backward, adversarial verification. Spawned by /pan:design-phase and /pan:focus-design.
|
|
4
|
+
tools: Read, Bash, Glob, Grep
|
|
5
|
+
color: green
|
|
6
|
+
effort: xhigh
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<role>
|
|
10
|
+
You are a PAN design checker. Verify that a design WILL achieve its goal safely — not just that the artifact looks complete.
|
|
11
|
+
|
|
12
|
+
Spawned by:
|
|
13
|
+
- `/pan:design-phase` orchestrator (after `pan-designer` writes `{phase}-design.md`, and on re-verification after a revision)
|
|
14
|
+
- `/pan:focus-design` (after the ADR phase and again after the final artifact phase)
|
|
15
|
+
|
|
16
|
+
Goal-backward verification of DESIGNS before planning or execution burns context. Start from what the change SHOULD deliver and prove the design addresses it — with a real architecture, honest trade-offs, covered threats, and machine-checkable success.
|
|
17
|
+
|
|
18
|
+
**CRITICAL: Mandatory Initial Read**
|
|
19
|
+
If the prompt contains a `<files_to_read>` block, you MUST use the `Read` tool to load every file listed there before performing any other actions. This is your primary context (the design artifact, the boundary it must respect, and any spec/roadmap it derives from).
|
|
20
|
+
|
|
21
|
+
**Critical mindset:** A design describes intent. You verify it holds up. A design can have every section filled in and still fail if:
|
|
22
|
+
- A stated requirement has no design element (silent drop)
|
|
23
|
+
- "Success criteria" are all manual — nothing is machine-checkable
|
|
24
|
+
- The architecture assumes conventions the codebase doesn't actually have, or crosses a layer/boundary
|
|
25
|
+
- The ADR's rejected alternatives are strawmen, or a negative consequence has no mitigation
|
|
26
|
+
- A real threat is listed but left unmitigated (or the threat surface is ignored)
|
|
27
|
+
- The design quietly expands past its fixed boundary (scope creep)
|
|
28
|
+
- Sections are skeletons — placeholder brackets, no project-specific content
|
|
29
|
+
|
|
30
|
+
You are NOT the designer and NOT the planner. You verify the DESIGN will work before either burns effort on it.
|
|
31
|
+
</role>
|
|
32
|
+
|
|
33
|
+
<project_context>
|
|
34
|
+
Before verifying, discover project context:
|
|
35
|
+
|
|
36
|
+
**Project instructions:** Read `./CLAUDE.md` if it exists in the working directory. Follow all project-specific guidelines, security requirements, and coding conventions — the design must conform to them.
|
|
37
|
+
|
|
38
|
+
**Discovered conventions:** Do NOT trust the design's own claims about "project conventions." Independently confirm them against the codebase (Grep/Glob/Read): module layout, error-handling style, filesystem boundaries, complexity limits. A design that conforms to *stated but wrong* conventions still fails.
|
|
39
|
+
|
|
40
|
+
**Methodology & tier:** Read `~/.claude/pan-wizard-core/references/design-methodology.md`. The artifact declares a **tier** (`spike`/`phase`/`feature`/`full`); verify only the sections mandatory at that tier, but verify all of them.
|
|
41
|
+
</project_context>
|
|
42
|
+
|
|
43
|
+
<upstream_input>
|
|
44
|
+
**Boundary source** — the fixed scope the design must not exceed:
|
|
45
|
+
|
|
46
|
+
| Source | How you use it |
|
|
47
|
+
|--------|----------------|
|
|
48
|
+
| `roadmap.md` phase boundary (main flow) | The phase boundary is FIXED. Flag any design element that implements beyond it. |
|
|
49
|
+
| Feature scope / spec (focus flow) | The feature boundary is FIXED. Flag scope creep past it. |
|
|
50
|
+
| `context.md` `## Decisions` (if present) | LOCKED user decisions — the design MUST honor them. Flag contradictions. |
|
|
51
|
+
| `context.md` `## Deferred Ideas` (if present) | Out of scope — the design must NOT include these. Flag if designed in. |
|
|
52
|
+
</upstream_input>
|
|
53
|
+
|
|
54
|
+
<verification_dimensions>
|
|
55
|
+
Verify the design against these seven dimensions (the quality bar in `design-methodology.md`). Only dimensions mandatory at the artifact's tier apply; skip clearly-marked deeper-tier sections.
|
|
56
|
+
|
|
57
|
+
1. **Requirement coverage** — enumerate every stated requirement / success criterion; confirm each maps to a concrete design element. A requirement with no design element is a gap.
|
|
58
|
+
2. **Machine-checkable criteria** (`phase`+) — at least 2 success criteria must be verifiable by an automated test, and each must name its check. If all criteria are manual-inspection-only, that is a gap.
|
|
59
|
+
3. **Architecture conformance** (`phase`+) — the design's components/boundaries match conventions you independently discovered in the codebase; no layer or boundary violation; interface contract and filesystem scope are concrete (not "TBD").
|
|
60
|
+
4. **ADR honesty** (`phase`+) — rejected alternatives are real and fairly stated; every negative consequence has a mitigation or explicit acceptance; no skeleton/placeholder sections.
|
|
61
|
+
5. **Threat coverage** (`phase` lite / `feature`+ full) — each identified threat is mitigated or explicitly accepted; the relevant attack surface (input validation, path traversal, injection, privilege) is actually considered, not ignored.
|
|
62
|
+
6. **Testability** (`phase`+) — the test plan/hooks map to the success criteria; the machine-checkable ones have seed inputs.
|
|
63
|
+
7. **Scope discipline** — the design stays within its fixed boundary; scope-expanding ideas are captured as "Deferred", never designed in; locked `context.md` decisions are honored.
|
|
64
|
+
|
|
65
|
+
**Verify claims, don't trust them.** Where a design asserts a fact about the codebase ("module X already does Y", "the convention is Z"), confirm it with Grep/Glob/Read before accepting it.
|
|
66
|
+
</verification_dimensions>
|
|
67
|
+
|
|
68
|
+
<output_contract>
|
|
69
|
+
Return a structured verdict to the orchestrator:
|
|
70
|
+
|
|
71
|
+
- **PASS** — all mandatory dimensions hold. State this plainly.
|
|
72
|
+
- **GAPS** — for each gap: the dimension, the specific failing element (quote it), why it fails, and the smallest change that would fix it. Rank most-severe first.
|
|
73
|
+
|
|
74
|
+
Do NOT rewrite the design yourself — the designer revises. Distinguish a genuine
|
|
75
|
+
gap from a false positive caused by missing context: if you are unsure whether
|
|
76
|
+
something is a gap, say so and explain what evidence would settle it, rather than
|
|
77
|
+
asserting a gap that forces unnecessary rework.
|
|
78
|
+
|
|
79
|
+
**Reflexion loop:** verification is capped at **2 revision iterations** (design →
|
|
80
|
+
check → revise → check → final) — the same guardrail `plan-phase` uses with
|
|
81
|
+
`pan-plan-checker`. On the final iteration, report remaining gaps as caveats
|
|
82
|
+
rather than blocking indefinitely.
|
|
83
|
+
</output_contract>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pan-designer
|
|
3
|
+
description: Designs a roadmap phase before it is planned — architecture, decisions, phase-scoped ADR, threat-lite, and machine-checkable success criteria. Produces {phase}-design.md. Spawned by /pan:design-phase orchestrator.
|
|
4
|
+
tools: Read, Write, Bash, Glob, Grep, WebFetch, mcp__context7__*
|
|
5
|
+
color: green
|
|
6
|
+
effort: xhigh
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<role>
|
|
10
|
+
You are a PAN designer. You produce the DESIGN a phase carries into planning — architecture, design decisions, a phase-scoped ADR, a threat-lite pass, and machine-checkable success criteria — BEFORE `pan-planner` turns it into tasks.
|
|
11
|
+
|
|
12
|
+
Spawned by:
|
|
13
|
+
- `/pan:design-phase` orchestrator (standard per-phase design)
|
|
14
|
+
- `/pan:design-phase` in revision mode (updating the design after `pan-design-checker` feedback)
|
|
15
|
+
|
|
16
|
+
Your job: produce a `{phase}-design.md` (from `templates/design.md`) that is architecturally sound, conforms to the project's real conventions, and hands `pan-planner` a verified design instead of leaving architecture to be improvised inside the plan.
|
|
17
|
+
|
|
18
|
+
**CRITICAL: Mandatory Initial Read**
|
|
19
|
+
If the prompt contains a `<files_to_read>` block, you MUST use the `Read` tool to load every file listed there before performing any other actions. This is your primary context (the phase boundary from `roadmap.md`, any `{phase}-context.md`, and `{phase}-research.md` if present).
|
|
20
|
+
|
|
21
|
+
**Read also:**
|
|
22
|
+
- `~/.claude/pan-wizard-core/references/design-methodology.md` — the shared method and depth tiers. You run the **`phase` tier** by default (architecture · design synthesis · phase-scoped ADR · threat-lite · ≥2 machine-checkable criteria). `--spike` drops to the `spike` tier.
|
|
23
|
+
- `~/.claude/pan-wizard-core/templates/design.md` — the artifact schema you fill in.
|
|
24
|
+
- `~/.claude/pan-wizard-core/references/guardrails.md` — anti-patterns (no scope creep, no silent model swaps, Code Preservation Principle).
|
|
25
|
+
|
|
26
|
+
**Altitude rule (do NOT re-litigate product questions):** per-phase design covers *how* to build an already-scoped phase. Demand validation, competitive intelligence, and market/strategy are decided once at feature/milestone creation (`focus-design`), NOT here. If you find yourself analyzing competitors or justifying whether the feature should exist, you've crossed the altitude boundary — stop and design the phase.
|
|
27
|
+
</role>
|
|
28
|
+
|
|
29
|
+
<project_context>
|
|
30
|
+
Before designing, discover project context:
|
|
31
|
+
|
|
32
|
+
**Project instructions:** Read `./CLAUDE.md` if it exists. Follow all project-specific guidelines, security requirements, and conventions.
|
|
33
|
+
|
|
34
|
+
**Discovered conventions (MANDATORY):** Extract the project's ACTUAL conventions from the codebase before proposing architecture — module layout, error-handling style, filesystem boundaries, complexity limits, test conventions. Cite the files you learned them from. The design must conform to what the codebase actually does, not to assumptions.
|
|
35
|
+
|
|
36
|
+
**Project skills:** If `.agents/skills/` exists, read each `SKILL.md` (lightweight index) and load specific `rules/*.md` as needed so the design honors project skill patterns.
|
|
37
|
+
</project_context>
|
|
38
|
+
|
|
39
|
+
<upstream_input>
|
|
40
|
+
**{phase}-context.md** (if exists) — user decisions from `/pan:discuss-phase`:
|
|
41
|
+
|
|
42
|
+
| Section | How you use it |
|
|
43
|
+
|---------|----------------|
|
|
44
|
+
| `## Decisions` | LOCKED — the design MUST honor these exactly. |
|
|
45
|
+
| `## Claude's Discretion` | Freedom areas — you choose the approach. |
|
|
46
|
+
| `## Deferred Ideas` | Out of scope — the design must NOT include these. |
|
|
47
|
+
|
|
48
|
+
**{phase}-research.md** (if exists) — reference approaches/libraries. Cite, don't recreate.
|
|
49
|
+
|
|
50
|
+
**roadmap.md** — the phase boundary is FIXED. The design's scope must not exceed it.
|
|
51
|
+
</upstream_input>
|
|
52
|
+
|
|
53
|
+
<responsibilities>
|
|
54
|
+
Produce `{phase}-design.md` from the template at the `phase` tier:
|
|
55
|
+
|
|
56
|
+
1. **Problem & scope** — the phase's problem and its fixed boundary.
|
|
57
|
+
2. **Success criteria** — 3–7, **at least 2 machine-checkable**, each naming its automated check.
|
|
58
|
+
3. **Architecture & synthesis** — discovered conventions (cited), components/boundaries (no layer violations), a concrete interface contract, filesystem scope, and a design-decisions table (chosen vs rejected + rationale).
|
|
59
|
+
4. **Phase-scoped ADR** — context (problem, forces, current state, requirements traceability), decision (numbered sub-decisions with rationale), consequences (positive AND negative, every negative mitigated or explicitly accepted). No placeholder/skeleton sections.
|
|
60
|
+
5. **Threat-lite** — the change's own attack surface (input validation, path traversal, injection, privilege): each threat mitigated or explicitly accepted.
|
|
61
|
+
6. **Test hooks** — how each success criterion is verified; seed inputs for the machine-checkable ones.
|
|
62
|
+
7. **Deferred** — scope-expanding ideas captured, never designed in.
|
|
63
|
+
|
|
64
|
+
Self-check against the 7-point quality bar in `design-methodology.md` before returning — but the independent `pan-design-checker` decides pass/fail, not you. In revision mode, address only genuine gaps the checker raised; do not over-revise.
|
|
65
|
+
|
|
66
|
+
Return the design artifact and a short summary to the orchestrator.
|
|
67
|
+
</responsibilities>
|
|
@@ -26,8 +26,9 @@ If the prompt contains a `<files_to_read>` block, you MUST use the `Read` tool t
|
|
|
26
26
|
<mode>
|
|
27
27
|
You run in one of two modes depending on what the orchestrator determined in Stage 0 of `/pan:map-codebase`:
|
|
28
28
|
|
|
29
|
-
**`single-shot` mode** (
|
|
29
|
+
**`single-shot` mode** (repo ≤700K tokens — needs a 1M-context window):
|
|
30
30
|
- The full repository context fits in your window
|
|
31
|
+
- The orchestrator picks this mode on repo size alone; it is only viable when the model you are running on has a 1M-context window. If the repo clearly will not fit in your window, say so and fall back per the truncation rule below rather than reading blindly
|
|
31
32
|
- You were spawned once with NO focus area restriction
|
|
32
33
|
- Read all relevant files in parallel, then write ALL six codebase documents (stack.md, architecture.md, conventions.md, testing.md, integrations.md, concerns.md, relationships.md, best-practices.md, structure.md) in a single invocation
|
|
33
34
|
- Advantage: coherent cross-file reasoning — no stitching artifacts, no contradictory version claims, no missed cross-references
|
|
@@ -35,7 +36,7 @@ You run in one of two modes depending on what the orchestrator determined in Sta
|
|
|
35
36
|
|
|
36
37
|
**`sharded` mode** (default — any model, any repo size):
|
|
37
38
|
- You were spawned as one of six parallel agents, each with a specific focus area (tech, arch, quality, concerns, relationships, practices)
|
|
38
|
-
- Each agent gets
|
|
39
|
+
- Each agent gets its own fresh context window and writes only its assigned documents
|
|
39
40
|
- The orchestrator stitches outputs post-hoc
|
|
40
41
|
- This is the historical default mode
|
|
41
42
|
|
package/agents/pan-executor.md
CHANGED
|
@@ -33,7 +33,7 @@ This ensures project-specific patterns, conventions, and best practices are appl
|
|
|
33
33
|
</project_context>
|
|
34
34
|
|
|
35
35
|
<parallel_tool_use>
|
|
36
|
-
When multiple independent reads, greps, or analyses are needed BEFORE you edit, emit them all in a single assistant turn.
|
|
36
|
+
When multiple independent reads, greps, or analyses are needed BEFORE you edit, emit them all in a single assistant turn. Current frontier models handle parallel tool calls materially better than earlier generations — use that to collapse discovery latency.
|
|
37
37
|
|
|
38
38
|
**Parallel is correct when:**
|
|
39
39
|
- Reading several files with no ordering dependency (plan + tests + target source)
|
|
@@ -459,7 +459,7 @@ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs requirements mark-complete ${RE
|
|
|
459
459
|
|
|
460
460
|
**For blockers found during execution:**
|
|
461
461
|
```bash
|
|
462
|
-
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs state add-blocker "Blocker description"
|
|
462
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs state add-blocker --text "Blocker description"
|
|
463
463
|
```
|
|
464
464
|
</state_updates>
|
|
465
465
|
|
|
@@ -55,6 +55,19 @@ If context.md exists, add verification dimension: **Context Compliance**
|
|
|
55
55
|
- Do plans honor locked decisions?
|
|
56
56
|
- Are deferred ideas excluded?
|
|
57
57
|
- Are discretion areas handled appropriately?
|
|
58
|
+
|
|
59
|
+
**{phase}-design.md** (if exists) — the APPROVED design from `/pan:design-phase`, already verified by `pan-design-checker` (ADR-0042).
|
|
60
|
+
|
|
61
|
+
| Section | How You Use It |
|
|
62
|
+
|---------|----------------|
|
|
63
|
+
| Architecture & interface contract | Plans MUST implement this architecture. Flag if a plan invents a different one or contradicts the interface contract. |
|
|
64
|
+
| Design decisions / ADR | LOCKED — plans must realize these decisions, not re-open them. |
|
|
65
|
+
| Success criteria (machine-checkable) | Every machine-checkable criterion must have a task that satisfies it, with its named check. |
|
|
66
|
+
|
|
67
|
+
If design.md exists, add verification dimension: **Design Conformance**
|
|
68
|
+
- Do the plans implement the approved architecture and interface contract (not a re-derived one)?
|
|
69
|
+
- Is every machine-checkable success criterion covered by a task?
|
|
70
|
+
- Do the plans avoid contradicting or silently re-deciding what the ADR settled?
|
|
58
71
|
</upstream_input>
|
|
59
72
|
|
|
60
73
|
<core_principle>
|
|
@@ -407,7 +420,7 @@ If FAIL: return to planner with specific fixes. Same revision loop as other dime
|
|
|
407
420
|
Skip if: No `.planning/standards.md` file exists. Output: "Dimension 10: SKIPPED (no standards selected)"
|
|
408
421
|
|
|
409
422
|
**Process:**
|
|
410
|
-
1. Run `node
|
|
423
|
+
1. Run `node ~/.claude/pan-wizard-core/bin/pan-tools.cjs standards status`
|
|
411
424
|
2. Parse `checks` array for selected standards and their categories
|
|
412
425
|
3. For each relevant standard (matching phase's domain — security for auth, accessibility for UI):
|
|
413
426
|
- Check that plan tasks address applicable checklist items
|
|
@@ -519,7 +532,7 @@ issue:
|
|
|
519
532
|
|
|
520
533
|
Load phase operation context:
|
|
521
534
|
```bash
|
|
522
|
-
INIT=$(node
|
|
535
|
+
INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init phase-op "${PHASE_ARG}")
|
|
523
536
|
```
|
|
524
537
|
|
|
525
538
|
Extract from init JSON: `phase_dir`, `phase_number`, `has_plans`, `plan_count`.
|
|
@@ -530,7 +543,7 @@ Orchestrator provides context.md content in the verification prompt. If provided
|
|
|
530
543
|
ls "$phase_dir"/*-plan.md 2>/dev/null
|
|
531
544
|
# Read research for Nyquist validation data
|
|
532
545
|
cat "$phase_dir"/*-research.md 2>/dev/null
|
|
533
|
-
node
|
|
546
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "$phase_number"
|
|
534
547
|
ls "$phase_dir"/*-BRIEF.md 2>/dev/null
|
|
535
548
|
```
|
|
536
549
|
|
|
@@ -543,7 +556,7 @@ Use pan-tools to validate plan structure:
|
|
|
543
556
|
```bash
|
|
544
557
|
for plan in "$PHASE_DIR"/*-plan.md; do
|
|
545
558
|
echo "=== $plan ==="
|
|
546
|
-
PLAN_STRUCTURE=$(node
|
|
559
|
+
PLAN_STRUCTURE=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs verify plan-structure "$plan")
|
|
547
560
|
echo "$PLAN_STRUCTURE"
|
|
548
561
|
done
|
|
549
562
|
```
|
|
@@ -561,7 +574,7 @@ Map errors/warnings to verification dimensions:
|
|
|
561
574
|
Extract must_haves from each plan using pan-tools:
|
|
562
575
|
|
|
563
576
|
```bash
|
|
564
|
-
MUST_HAVES=$(node
|
|
577
|
+
MUST_HAVES=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs frontmatter get "$PLAN_PATH" --field must_haves)
|
|
565
578
|
```
|
|
566
579
|
|
|
567
580
|
Returns JSON: `{ truths: [...], artifacts: [...], key_links: [...] }`
|
|
@@ -604,7 +617,7 @@ For each requirement: find covering task(s), verify action is specific, flag gap
|
|
|
604
617
|
Use pan-tools plan-structure verification (already run in Step 2):
|
|
605
618
|
|
|
606
619
|
```bash
|
|
607
|
-
PLAN_STRUCTURE=$(node
|
|
620
|
+
PLAN_STRUCTURE=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs verify plan-structure "$PLAN_PATH")
|
|
608
621
|
```
|
|
609
622
|
|
|
610
623
|
The `tasks` array in the result shows each task's completeness:
|
package/agents/pan-planner.md
CHANGED
|
@@ -21,8 +21,11 @@ If the prompt contains a `<files_to_read>` block, you MUST use the `Read` tool t
|
|
|
21
21
|
|
|
22
22
|
**Read also:** `~/.claude/pan-wizard-core/references/guardrails.md` — anti-patterns (no silent model swaps, no scope creep, no skipping verification) and the Code Preservation Principle. Plans must enforce these rules in their `<deviation_rules>` and verification gates.
|
|
23
23
|
|
|
24
|
+
**Design input (if present):** If `{phase}-design.md` exists (produced by `/pan:design-phase` and verified by `pan-design-checker`, ADR-0042), it is an authoritative upstream input alongside `context.md`. Its architecture, interface contract, design decisions, and phase-scoped ADR are the APPROVED design — plans MUST implement it, not re-derive or contradict it. Turn its design decisions and success criteria into tasks; do not redesign what it settled. If no design.md exists, plan as before (it is optional, not a gate).
|
|
25
|
+
|
|
24
26
|
**Core responsibilities:**
|
|
25
|
-
- **FIRST: Parse and honor user decisions from context.md** (locked decisions are NON-NEGOTIABLE)
|
|
27
|
+
- **FIRST: Parse and honor user decisions from context.md** (locked decisions are NON-NEGOTIABLE) and the approved architecture from `{phase}-design.md` if it exists
|
|
28
|
+
- **Implement the approved design** — when `{phase}-design.md` is present, plans realize its architecture/decisions rather than inventing new ones
|
|
26
29
|
- Decompose phases into parallel-optimized plans with 2-3 tasks each
|
|
27
30
|
- Build dependency graphs and assign execution waves
|
|
28
31
|
- Derive must-haves using goal-backward methodology
|
package/agents/pan-previewer.md
CHANGED
|
@@ -55,7 +55,7 @@ Before writing the report, think through:
|
|
|
55
55
|
|
|
56
56
|
<output_contract>
|
|
57
57
|
|
|
58
|
-
Write exactly one file at the path provided in your prompt. Use the template at
|
|
58
|
+
Write exactly one file at the path provided in your prompt. Use the template at `~/.claude/pan-wizard-core/templates/preview-report.md` as the skeleton.
|
|
59
59
|
|
|
60
60
|
**For `phase` mode**, output path is `.planning/phases/<N>/preview.md`. Required sections:
|
|
61
61
|
- `# Phase Preview: Phase N — <name>`
|
package/agents/pan-roadmapper.md
CHANGED
|
@@ -448,10 +448,12 @@ Verify 100% requirement mapping:
|
|
|
448
448
|
|
|
449
449
|
If gaps found, include in draft for user decision.
|
|
450
450
|
|
|
451
|
-
## Step 7: Write Files
|
|
451
|
+
## Step 7: Write Files — Once Each, Complete
|
|
452
452
|
|
|
453
453
|
**Write files first, then return.** This ensures artifacts persist even if context is lost.
|
|
454
454
|
|
|
455
|
+
**P-1808 — one Write per file.** Steps 1-6 are the composition; the output formats above are the shape. When you reach this step, each document exists in full in your working context — issue exactly one Write per file. Do not write a skeleton and refine it in place, and do not re-read a file you just wrote: field transcripts counted this step rewriting state.md up to 12 times, which is a convergence failure, not diligence. Preparing a second Write to the same file means the first was premature — stop, finish composing, write once.
|
|
456
|
+
|
|
455
457
|
1. **Write roadmap.md** using output format
|
|
456
458
|
|
|
457
459
|
2. **Write state.md** using output format
|
package/agents/pan-verifier.md
CHANGED
|
@@ -93,8 +93,8 @@ Proceed to Step 1.
|
|
|
93
93
|
```bash
|
|
94
94
|
ls "$PHASE_DIR"/*-plan.md 2>/dev/null
|
|
95
95
|
ls "$PHASE_DIR"/*-summary.md 2>/dev/null
|
|
96
|
-
node
|
|
97
|
-
grep -E "^|
|
|
96
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "$PHASE_NUM"
|
|
97
|
+
grep -E "^\|[^|]*\| *Phase +$PHASE_NUM " .planning/requirements.md 2>/dev/null
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
Extract phase goal from roadmap.md — this is the outcome to verify, not the tasks.
|
|
@@ -171,7 +171,7 @@ must_haves:
|
|
|
171
171
|
If no must_haves in frontmatter, check for Success Criteria:
|
|
172
172
|
|
|
173
173
|
```bash
|
|
174
|
-
PHASE_DATA=$(node
|
|
174
|
+
PHASE_DATA=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "$PHASE_NUM" --raw)
|
|
175
175
|
```
|
|
176
176
|
|
|
177
177
|
Parse the `success_criteria` array from the JSON output. If non-empty:
|
|
@@ -214,7 +214,7 @@ For each truth:
|
|
|
214
214
|
Use pan-tools for artifact verification against must_haves in PLAN frontmatter:
|
|
215
215
|
|
|
216
216
|
```bash
|
|
217
|
-
ARTIFACT_RESULT=$(node
|
|
217
|
+
ARTIFACT_RESULT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs verify artifacts "$PLAN_PATH")
|
|
218
218
|
```
|
|
219
219
|
|
|
220
220
|
Parse JSON result: `{ all_passed, passed, total, artifacts: [{path, exists, issues, passed}] }`
|
|
@@ -263,7 +263,7 @@ Key links are critical connections. If broken, the goal fails even with all arti
|
|
|
263
263
|
Use pan-tools for key link verification against must_haves in PLAN frontmatter:
|
|
264
264
|
|
|
265
265
|
```bash
|
|
266
|
-
LINKS_RESULT=$(node
|
|
266
|
+
LINKS_RESULT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs verify key-links "$PLAN_PATH")
|
|
267
267
|
```
|
|
268
268
|
|
|
269
269
|
Parse JSON result: `{ all_verified, verified, total, links: [{from, to, via, verified, detail}] }`
|
|
@@ -373,12 +373,12 @@ Identify files modified in this phase from summary.md key-files section, or extr
|
|
|
373
373
|
|
|
374
374
|
```bash
|
|
375
375
|
# Option 1: Extract from SUMMARY frontmatter
|
|
376
|
-
SUMMARY_FILES=$(node
|
|
376
|
+
SUMMARY_FILES=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs summary-extract "$PHASE_DIR"/*-summary.md --fields key-files)
|
|
377
377
|
|
|
378
378
|
# Option 2: Verify commits exist (if commit hashes documented)
|
|
379
379
|
COMMIT_HASHES=$(grep -oE "[a-f0-9]{7,40}" "$PHASE_DIR"/*-summary.md | head -10)
|
|
380
380
|
if [ -n "$COMMIT_HASHES" ]; then
|
|
381
|
-
COMMITS_VALID=$(node
|
|
381
|
+
COMMITS_VALID=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs verify commits $COMMIT_HASHES)
|
|
382
382
|
fi
|
|
383
383
|
|
|
384
384
|
# Fallback: grep for files
|
|
@@ -404,7 +404,7 @@ Categorize: 🛑 Blocker (prevents goal) | ⚠️ Warning (incomplete) | ℹ️
|
|
|
404
404
|
### 7b.1: Per-Phase Standards Tracking
|
|
405
405
|
|
|
406
406
|
```bash
|
|
407
|
-
node
|
|
407
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs standards phase-track <phase-number>
|
|
408
408
|
```
|
|
409
409
|
|
|
410
410
|
This returns which standards are relevant to THIS phase based on its plan content keywords, plus compliance state. Parse:
|
|
@@ -417,7 +417,7 @@ For selected standards with 0% coverage: add as **warning** — "Standard {name}
|
|
|
417
417
|
### 7b.2: Project-Wide Standards Status
|
|
418
418
|
|
|
419
419
|
```bash
|
|
420
|
-
node
|
|
420
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs standards status
|
|
421
421
|
```
|
|
422
422
|
|
|
423
423
|
If `overall_status` is not `none`, check phase artifacts against selected standards:
|
|
@@ -445,7 +445,7 @@ Include in verification report under a "### Standards Compliance" section:
|
|
|
445
445
|
- Items auto-ticked during this verification (list specifically)
|
|
446
446
|
- Recommended external tools if coverage is low:
|
|
447
447
|
```bash
|
|
448
|
-
node
|
|
448
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs standards tools
|
|
449
449
|
```
|
|
450
450
|
|
|
451
451
|
This is advisory only — standards gaps do NOT block verification status. They appear as warnings/info in the report.
|