pan-wizard 3.35.0 → 3.37.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/CHANGELOG.md +3645 -0
- package/README.md +46 -52
- package/agents/pan-conductor.md +2 -3
- package/agents/pan-counterfactual.md +1 -2
- package/agents/pan-debugger.md +14 -3
- package/agents/pan-design-checker.md +1 -2
- package/agents/pan-designer.md +2 -3
- package/agents/pan-document_code.md +1 -2
- package/agents/pan-executor.md +25 -0
- package/agents/pan-hardener.md +4 -3
- package/agents/pan-integration-checker.md +1 -2
- package/agents/pan-knowledge.md +1 -2
- package/agents/pan-meta-reviewer.md +3 -3
- package/agents/pan-optimizer.md +4 -4
- package/agents/pan-phase-researcher.md +80 -475
- package/agents/pan-plan-checker.md +40 -3
- package/agents/pan-planner.md +21 -7
- package/agents/pan-previewer.md +3 -2
- package/agents/pan-project-researcher.md +72 -493
- package/agents/pan-release.md +1 -1
- package/agents/pan-reviewer.md +14 -3
- package/agents/pan-roadmapper.md +12 -7
- package/agents/pan-verifier.md +9 -4
- package/bin/install-lib.cjs +134 -14
- package/bin/install.js +59 -12
- package/commands/pan/army.md +1 -1
- package/commands/pan/autodev.md +76 -0
- package/commands/pan/cost.md +21 -1
- package/commands/pan/exec-phase.md +3 -4
- package/commands/pan/focus-auto.md +14 -7
- package/commands/pan/focus-design.md +4 -5
- package/commands/pan/focus-docs.md +24 -0
- package/commands/pan/learn.md +13 -6
- package/commands/pan/milestone-audit.md +8 -1
- package/commands/pan/milestone-done.md +10 -5
- package/commands/pan/milestone-new.md +2 -2
- package/commands/pan/new-project.md +15 -12
- package/commands/pan/plan-phase.md +15 -9
- package/commands/pan/preview.md +1 -1
- package/commands/pan/quick.md +1 -1
- package/commands/pan/review-deep.md +11 -5
- package/commands/pan/settings.md +6 -0
- package/commands/pan/verify-phase.md +6 -2
- package/docs/AGENTS.md +917 -0
- package/docs/ARCHITECTURE.md +1054 -0
- package/docs/CLI-REFERENCE.md +4582 -0
- package/docs/COMPARISON.md +116 -0
- package/docs/DEVELOPMENT.md +490 -0
- package/docs/ECOSYSTEM-REVIEW-2026-06.md +107 -0
- package/docs/ECOSYSTEM-REVIEW-2026-08.md +349 -0
- package/docs/EXAMPLES.md +584 -0
- package/docs/FAQ.md +254 -0
- package/docs/FIELD-HARVEST-2026-07.md +88 -0
- package/docs/FIELD-REPORT-army-2026-06.md +121 -0
- package/docs/HOOKS.md +638 -0
- package/docs/IMPROVEMENT-TODO.md +246 -0
- package/docs/INTERNALS.md +485 -0
- package/docs/MIGRATION-v2-to-v3.md +258 -0
- package/docs/SECURITY-HARDENING.md +230 -0
- package/docs/SKILLS-ENHANCEMENT-PLAN-V2.md +122 -0
- package/docs/SKILLS-FULL-TEXT.md +9685 -0
- package/docs/SKILLS-REFERENCE.md +1037 -0
- package/docs/TROUBLESHOOTING.md +1084 -0
- package/docs/USER-GUIDE.md +1437 -0
- package/docs/archive/SKILLS-ENHANCEMENT-PLAN.md +230 -0
- package/docs/audits/AUDIT-2026-08-e2e-ROADMAP.md +117 -0
- package/docs/audits/AUDIT-2026-08-e2e-VERIFICATION.md +693 -0
- package/docs/audits/AUDIT-2026-08-e2e.md +1546 -0
- package/docs/audits/OUTSTANDING-2026-08.md +275 -0
- package/docs/audits/STABILITY-TEST-2026-08.md +640 -0
- package/docs/branding/README-brand-draft.md +119 -0
- package/docs/branding/handoff/IMPLEMENTATION.md +205 -0
- package/docs/branding/handoff/README-brand-draft.md +119 -0
- package/docs/branding/handoff/image-prompts.md +46 -0
- package/docs/branding/image-prompts.md +46 -0
- package/docs/branding/nano-banana-prompts.txt +60 -0
- package/docs/context-monitor.md +13 -0
- package/docs/decisions/ADR-0001-strategic-feature-prioritization.md +83 -0
- package/docs/decisions/ADR-0002-copilot-cli-runtime.md +71 -0
- package/docs/decisions/ADR-0003-smart-execution.md +84 -0
- package/docs/decisions/ADR-0004-copilot-cli-interaction.md +89 -0
- package/docs/decisions/ADR-0005-command-naming.md +80 -0
- package/docs/decisions/ADR-0006-focus-commands.md +101 -0
- package/docs/decisions/ADR-0007-ship-v1.md +73 -0
- package/docs/decisions/ADR-0008-map-codebase-mermaid-togaf.md +80 -0
- package/docs/decisions/ADR-0009-production-deployment-checklist.md +68 -0
- package/docs/decisions/ADR-0010-standards-integration.md +79 -0
- package/docs/decisions/ADR-0011-help-commands-rewrite.md +64 -0
- package/docs/decisions/ADR-0012-contributors-attribution-index.md +42 -0
- package/docs/decisions/ADR-0013-strategic-feature-additions.md +53 -0
- package/docs/decisions/ADR-0014-internal-cleanup-code-quality.md +53 -0
- package/docs/decisions/ADR-0015-focus-auto-runner.md +296 -0
- package/docs/decisions/ADR-0016-enhanced-doc-sync.md +54 -0
- package/docs/decisions/ADR-0017-enhanced-focus-design.md +69 -0
- package/docs/decisions/ADR-0018-user-reality-testing.md +84 -0
- package/docs/decisions/ADR-0019-end-to-end-user-acceptance-testing.md +113 -0
- package/docs/decisions/ADR-0020-ai-drift-prevention.md +55 -0
- package/docs/decisions/ADR-0021-codebase-mapper-v2.md +76 -0
- package/docs/decisions/ADR-0022-lifecycle-completeness.md +63 -0
- package/docs/decisions/ADR-0023-opus-4-7-adoption.md +89 -0
- package/docs/decisions/ADR-0024-spec-b-v2-completion.md +137 -0
- package/docs/decisions/ADR-0025-behavioral-guardrails-layer.md +129 -0
- package/docs/decisions/ADR-0026-self-improvement-loop.md +171 -0
- package/docs/decisions/ADR-0027-doc-code-link-graph.md +164 -0
- package/docs/decisions/ADR-0028-unified-agents-skills-target.md +46 -0
- package/docs/decisions/ADR-0029-experiment-evaluator.md +76 -0
- package/docs/decisions/ADR-0030-planning-concurrency.md +37 -0
- package/docs/decisions/ADR-0031-focus-auto-backlog-source.md +47 -0
- package/docs/decisions/ADR-0032-squad-model.md +64 -0
- package/docs/decisions/ADR-0033-army-campaign.md +40 -0
- package/docs/decisions/ADR-0034-scheduled-campaigns.md +57 -0
- package/docs/decisions/ADR-0035-army-hud-dashboard.md +40 -0
- package/docs/decisions/ADR-0036-agentic-memory-architecture.md +106 -0
- package/docs/decisions/ADR-0037-pin-security-agents-to-opus.md +51 -0
- package/docs/decisions/ADR-0038-skill-aligned-decomposition.md +41 -0
- package/docs/decisions/ADR-0039-worktree-as-project-variant.md +37 -0
- package/docs/decisions/ADR-0040-memory-injection-defense.md +55 -0
- package/docs/decisions/ADR-0041-mcp-dual-era-bridge.md +47 -0
- package/docs/decisions/ADR-0042-design-parity-both-flows.md +45 -0
- package/docs/decisions/ADR-0043-addressable-planning-roots.md +56 -0
- package/docs/decisions/ADR-0044-bound-the-cached-context.md +104 -0
- package/docs/decisions/ADR-0045-agent-plugins-bundle.md +76 -0
- package/docs/decisions/ADR-0046-subagent-frontmatter-decisions.md +39 -0
- package/docs/decisions/ADR-0047-pan-harness.md +76 -0
- package/docs/decisions/ADR-0048-one-core-per-project.md +43 -0
- package/docs/decisions/ADR-0049-machine-verdicts-and-findings-ledger.md +116 -0
- package/docs/specs/ai_drift_prevention_featureai.md +286 -0
- package/docs/specs/codebase_mapper_v2_featureai.md +930 -0
- package/docs/specs/command_naming_optimization_featureai.md +930 -0
- package/docs/specs/comp_analysis_markdown_v1.md +149 -0
- package/docs/specs/continuous_autonomous_execution_featureai.md +304 -0
- package/docs/specs/contributors_attribution_index_featureai.md +476 -0
- package/docs/specs/copilot_cli_interaction_featureai.md +868 -0
- package/docs/specs/copilot_cli_runtime_featureai.md +647 -0
- package/docs/specs/custom-skills-assessment.md +461 -0
- package/docs/specs/deployment_audit_findings_featureai.md +243 -0
- package/docs/specs/doc_code_link_graph_featureai.md +253 -0
- package/docs/specs/documentation_alignment_cleanup_featureai.md +69 -0
- package/docs/specs/e2e_visual_testing_featureai.md +615 -0
- package/docs/specs/end_to_end_user_acceptance_testing_featureai.md +810 -0
- package/docs/specs/evidence-loop-plan.md +76 -0
- package/docs/specs/evidence_loop_featureai.md +497 -0
- package/docs/specs/focus-auto-optimize-category.md +449 -0
- package/docs/specs/focus-auto-optimize-superplan.md +188 -0
- package/docs/specs/focus_auto_runner_featureai.md +1102 -0
- package/docs/specs/focus_design_v2_featureai.md +197 -0
- package/docs/specs/focus_sync_v2_featureai.md +202 -0
- package/docs/specs/git_integration_overhaul_featureai.md +326 -0
- package/docs/specs/glm_zai_provider_featureai.md +200 -0
- package/docs/specs/googlecli_adoption_featureai.md +661 -0
- package/docs/specs/help_commands_rewrite_featureai.md +860 -0
- package/docs/specs/industry_analysis_strategic_additions_featureai.md +231 -0
- package/docs/specs/industry_comparison_and_feature_gaps_featureai.md +674 -0
- package/docs/specs/internal_cleanup_code_quality_featureai.md +486 -0
- package/docs/specs/investigations/README.md +31 -0
- package/docs/specs/investigations/digests/2026-09-28.md +47 -0
- package/docs/specs/investigations/digests/2026-10-08.md +62 -0
- package/docs/specs/investigations/digests/2026-10-10.md +61 -0
- package/docs/specs/investigations/features/debugger-red-loop-first.md +55 -0
- package/docs/specs/investigations/features/harness-cross-host-behaviour.md +93 -0
- package/docs/specs/investigations/features/optimize-apply-regression-gate.md +66 -0
- package/docs/specs/investigations/features/reviewer-smell-baseline.md +57 -0
- package/docs/specs/investigations/features/trace-failure-capture.md +69 -0
- package/docs/specs/lifecycle_completeness_featureai.md +754 -0
- package/docs/specs/local-first-ci.md +42 -0
- package/docs/specs/map_codebase_mermaid_togaf_featureai.md +805 -0
- package/docs/specs/market-delta-2026-09-superplan.md +310 -0
- package/docs/specs/market-ideas-2026-09.md +131 -0
- package/docs/specs/market-ideas-2026-10.md +428 -0
- package/docs/specs/market-ideas-ledger.md +177 -0
- package/docs/specs/memory-optimization-2026-10.md +285 -0
- package/docs/specs/multi-track-planning-roots.md +143 -0
- package/docs/specs/multi_model_routing_featureai.md +687 -0
- package/docs/specs/multi_model_routing_superplan.md +197 -0
- package/docs/specs/opus_47_existing_enhancements_featureai.md +247 -0
- package/docs/specs/opus_47_extended_features_featureai.md +363 -0
- package/docs/specs/opus_47_extended_features_v2_featureai.md +397 -0
- package/docs/specs/pan_focus_commands_featureai.md +2336 -0
- package/docs/specs/pan_zcode_mcp_bridge_featureai.md +120 -0
- package/docs/specs/product-excellence-superplan.md +315 -0
- package/docs/specs/product_excellence_program_2026_q4_featureai.md +365 -0
- package/docs/specs/production_deployment_readiness_featureai.md +433 -0
- package/docs/specs/production_readiness_ship_v1_featureai.md +698 -0
- package/docs/specs/real_test_enforcement_featureai.md +213 -0
- package/docs/specs/reality-check-2026-09-superplan.md +362 -0
- package/docs/specs/right-sized-ceremony.md +74 -0
- package/docs/specs/roadmap_and_competition_2026_q4_featureai.md +390 -0
- package/docs/specs/self_improvement_loop_featureai.md +875 -0
- package/docs/specs/skill-aligned-decomposition.md +155 -0
- package/docs/specs/standards_integration_featureai.md +833 -0
- package/docs/specs/testing-system-redesign-2026-09.md +267 -0
- package/docs/specs/user_reality_testing_system_featureai.md +788 -0
- package/docs/specs/watch-triggers.json +22 -0
- package/docs/specs/workflow-integration-redesign.md +742 -0
- package/docs/specs/workflow_state_consistency_featureai.md +183 -0
- package/hooks/dist/pan-context-monitor.js +9 -2
- package/hooks/dist/pan-cost-logger.js +5 -0
- package/hooks/dist/pan-guard.js +28 -5
- package/hooks/dist/pan-stop-guard.js +9 -9
- package/hooks/dist/pan-trace-logger.js +5 -0
- package/package.json +10 -2
- package/pan-wizard-core/bin/lib/agents-md.cjs +57 -8
- package/pan-wizard-core/bin/lib/autodev-report.cjs +180 -0
- package/pan-wizard-core/bin/lib/autodev.cjs +642 -0
- package/pan-wizard-core/bin/lib/ci.cjs +143 -0
- package/pan-wizard-core/bin/lib/commands.cjs +1 -1
- package/pan-wizard-core/bin/lib/config.cjs +41 -5
- package/pan-wizard-core/bin/lib/constants.cjs +27 -1
- package/pan-wizard-core/bin/lib/core.cjs +31 -14
- package/pan-wizard-core/bin/lib/cost.cjs +160 -4
- package/pan-wizard-core/bin/lib/cross-family.cjs +164 -0
- package/pan-wizard-core/bin/lib/debug-cases.cjs +104 -0
- package/pan-wizard-core/bin/lib/doc-lint.cjs +5 -3
- package/pan-wizard-core/bin/lib/failure-class.cjs +81 -0
- package/pan-wizard-core/bin/lib/findings.cjs +148 -9
- package/pan-wizard-core/bin/lib/focus.cjs +1 -1
- package/pan-wizard-core/bin/lib/git.cjs +1 -1
- package/pan-wizard-core/bin/lib/hosts.cjs +88 -0
- package/pan-wizard-core/bin/lib/init.cjs +7 -2
- package/pan-wizard-core/bin/lib/knowledge.cjs +2 -0
- package/pan-wizard-core/bin/lib/merge.cjs +50 -0
- package/pan-wizard-core/bin/lib/mutate.cjs +268 -0
- package/pan-wizard-core/bin/lib/next-action.cjs +112 -0
- package/pan-wizard-core/bin/lib/optimize.cjs +2 -2
- package/pan-wizard-core/bin/lib/phase-gate.cjs +15 -9
- package/pan-wizard-core/bin/lib/phase-remove.cjs +91 -11
- package/pan-wizard-core/bin/lib/phase.cjs +85 -13
- package/pan-wizard-core/bin/lib/plan-lint.cjs +310 -0
- package/pan-wizard-core/bin/lib/preview.cjs +26 -4
- package/pan-wizard-core/bin/lib/requirements-lint.cjs +130 -0
- package/pan-wizard-core/bin/lib/research-lint.cjs +268 -0
- package/pan-wizard-core/bin/lib/review-deep.cjs +14 -22
- package/pan-wizard-core/bin/lib/review-vote.cjs +105 -0
- package/pan-wizard-core/bin/lib/roadmap.cjs +1 -0
- package/pan-wizard-core/bin/lib/runner.cjs +2 -16
- package/pan-wizard-core/bin/lib/sizing.cjs +356 -0
- package/pan-wizard-core/bin/lib/squads.cjs +1 -1
- package/pan-wizard-core/bin/lib/state-write.cjs +247 -0
- package/pan-wizard-core/bin/lib/test-gate.cjs +433 -0
- package/pan-wizard-core/bin/lib/uat.cjs +149 -0
- package/pan-wizard-core/bin/lib/usage.cjs +104 -0
- package/pan-wizard-core/bin/lib/verdict.cjs +26 -3
- package/pan-wizard-core/bin/lib/verify-plan-set.cjs +30 -1
- package/pan-wizard-core/bin/lib/verify-preflight.cjs +2 -2
- package/pan-wizard-core/bin/lib/verify-red.cjs +174 -0
- package/pan-wizard-core/bin/lib/verify-retro.cjs +3 -2
- package/pan-wizard-core/bin/lib/verify-scope.cjs +143 -2
- package/pan-wizard-core/bin/lib/verify.cjs +86 -31
- package/pan-wizard-core/bin/lib/worktree.cjs +70 -0
- package/pan-wizard-core/bin/pan-tools.cjs +257 -28
- package/pan-wizard-core/learnings/universal/autonomous-loop.md +2 -2
- package/pan-wizard-core/mcp/orchestrator.cjs +4 -1
- package/pan-wizard-core/references/continuation-format.md +3 -3
- package/pan-wizard-core/references/design-methodology.md +1 -1
- package/pan-wizard-core/references/guardrails.md +1 -1
- package/pan-wizard-core/references/handoff-decisions.md +1 -1
- package/pan-wizard-core/references/model-profiles.md +2 -3
- package/pan-wizard-core/references/questioning.md +24 -0
- package/pan-wizard-core/references/ui-brand.md +4 -6
- package/pan-wizard-core/references/verdict-contract.md +2 -1
- package/pan-wizard-core/templates/config.json +10 -2
- package/pan-wizard-core/templates/debug.md +1 -0
- package/pan-wizard-core/templates/design.md +5 -4
- package/pan-wizard-core/templates/discovery.md +2 -2
- package/pan-wizard-core/templates/phase-prompt.md +7 -0
- package/pan-wizard-core/templates/requirements.md +9 -0
- package/pan-wizard-core/templates/research.md +10 -0
- package/pan-wizard-core/templates/summary-complex.md +5 -1
- package/pan-wizard-core/templates/summary-minimal.md +4 -0
- package/pan-wizard-core/templates/summary-standard.md +5 -1
- package/pan-wizard-core/templates/summary.md +8 -1
- package/pan-wizard-core/workflows/add-phase.md +4 -6
- package/pan-wizard-core/workflows/assumptions.md +19 -1
- package/pan-wizard-core/workflows/diagnose-issues.md +2 -0
- package/pan-wizard-core/workflows/discuss-phase.md +4 -2
- package/pan-wizard-core/workflows/exec-lean.md +69 -0
- package/pan-wizard-core/workflows/exec-phase.md +79 -15
- package/pan-wizard-core/workflows/execute-plan.md +3 -1
- package/{commands/pan → pan-wizard-core/workflows}/focus-doc-audit.md +13 -29
- package/{commands/pan → pan-wizard-core/workflows}/focus-drift-walking.md +3 -18
- package/{commands/pan → pan-wizard-core/workflows}/focus-exec.md +8 -23
- package/{commands/pan → pan-wizard-core/workflows}/focus-plan.md +6 -20
- package/{commands/pan → pan-wizard-core/workflows}/focus-scan.md +3 -16
- package/{commands/pan → pan-wizard-core/workflows}/focus-sync.md +7 -21
- package/pan-wizard-core/workflows/health.md +6 -0
- package/pan-wizard-core/workflows/help.md +114 -77
- package/pan-wizard-core/workflows/insert-phase.md +4 -6
- package/pan-wizard-core/workflows/learn.md +3 -3
- package/pan-wizard-core/workflows/milestone-audit.md +2 -2
- package/pan-wizard-core/workflows/milestone-new.md +38 -95
- package/pan-wizard-core/workflows/new-project.md +96 -258
- package/pan-wizard-core/workflows/optimize.md +107 -5
- package/pan-wizard-core/workflows/phase-tests.md +10 -0
- package/pan-wizard-core/workflows/plan-phase.md +106 -45
- package/pan-wizard-core/workflows/profile.md +50 -0
- package/pan-wizard-core/workflows/progress.md +10 -0
- package/pan-wizard-core/workflows/quick.md +34 -43
- package/pan-wizard-core/workflows/remove-phase.md +11 -1
- package/pan-wizard-core/workflows/research-phase.md +118 -40
- package/pan-wizard-core/workflows/resume-project.md +18 -2
- package/pan-wizard-core/workflows/settings.md +33 -19
- package/pan-wizard-core/workflows/todo-check.md +6 -2
- package/pan-wizard-core/workflows/transition.md +22 -4
- package/pan-wizard-core/workflows/uat-walkthrough.md +90 -0
- package/pan-wizard-core/workflows/update.md +1 -1
- package/pan-wizard-core/workflows/verify-phase.md +39 -46
- package/scripts/build-agent-plugin.js +35 -15
- package/scripts/build-help.cjs +106 -0
- package/scripts/build-plugin.js +10 -1
- package/scripts/deprecate-old-versions.js +70 -3
- package/scripts/generate-skills-docs.py +1 -1
- package/scripts/git-hooks/pre-push +27 -0
- package/scripts/install-git-hooks.js +7 -5
- package/scripts/install-pre-push.cjs +38 -0
- package/scripts/land.cjs +151 -0
- package/scripts/local-ci.cjs +501 -0
- package/scripts/local-schedule.cjs +277 -0
- package/scripts/mutation-probe.cjs +7 -80
- package/scripts/prompt-lint.cjs +32 -0
- package/scripts/prompt-rules.cjs +156 -0
- package/scripts/run-tests.cjs +7 -1
- package/scripts/test-quality-lint.cjs +3 -3
- package/scripts/test-surface.cjs +175 -6
- package/agents/pan-research-synthesizer.md +0 -246
- package/commands/pan/audit-deployment.md +0 -386
- package/commands/pan/dashboard.md +0 -22
- package/commands/pan/discord.md +0 -19
- package/commands/pan/mcp-bridge.md +0 -143
- package/commands/pan/milestone-cleanup.md +0 -19
- package/commands/pan/milestone-gaps.md +0 -35
- package/commands/pan/optimize.md +0 -115
- package/commands/pan/profile.md +0 -76
- package/commands/pan/research-phase.md +0 -189
- package/pan-wizard-core/bin/lib/bridge.cjs +0 -269
- package/pan-wizard-core/templates/research-project/architecture.md +0 -204
- package/pan-wizard-core/templates/research-project/features.md +0 -147
- package/pan-wizard-core/templates/research-project/pitfalls.md +0 -200
- package/pan-wizard-core/templates/research-project/stack.md +0 -120
- package/pan-wizard-core/templates/research-project/summary.md +0 -170
|
@@ -0,0 +1,1437 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="../assets/pan-avatar.png" alt="PanWizard" width="90" />
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
# PAN User Guide
|
|
6
|
+
|
|
7
|
+
A detailed reference for workflows, troubleshooting, and configuration. For quick-start setup, see the [README](../README.md).
|
|
8
|
+
|
|
9
|
+
**Other docs:** [FAQ](FAQ.md) · [Examples](EXAMPLES.md) · [Architecture](ARCHITECTURE.md) · [Development](DEVELOPMENT.md) · [CLI Reference](CLI-REFERENCE.md) · [Agents](AGENTS.md) · [Hooks](HOOKS.md)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Table of Contents
|
|
14
|
+
|
|
15
|
+
- [Getting Started](#getting-started)
|
|
16
|
+
- [Workflow Diagrams](#workflow-diagrams)
|
|
17
|
+
- [Command Reference](#command-reference)
|
|
18
|
+
- [Configuration Reference](#configuration-reference)
|
|
19
|
+
- [Usage Examples](#usage-examples)
|
|
20
|
+
- [Advanced Features](#advanced-features)
|
|
21
|
+
- [Native Workflows (Claude Code only)](#native-workflows-claude-code-only)
|
|
22
|
+
- [The Evidence Loop](#the-evidence-loop)
|
|
23
|
+
- [Self-Improvement Loop](#self-improvement-loop)
|
|
24
|
+
- [AI Agent Guardrails](#ai-agent-guardrails)
|
|
25
|
+
- [Advanced Planning Options](#advanced-planning-options)
|
|
26
|
+
- [Execution Model](#execution-model)
|
|
27
|
+
- [Bot-army campaigns](#bot-army-campaigns-panarmy)
|
|
28
|
+
- [Army & project dashboard](#army--project-dashboard-panhud)
|
|
29
|
+
- [Git Integration](#git-integration)
|
|
30
|
+
- [Requirement Tracing](#requirement-tracing)
|
|
31
|
+
- [Global Defaults](#global-defaults)
|
|
32
|
+
- [Web Search](#web-search)
|
|
33
|
+
- [Debug Logging](#debug-logging)
|
|
34
|
+
- [Troubleshooting](#troubleshooting)
|
|
35
|
+
- [Recovery Quick Reference](#recovery-quick-reference)
|
|
36
|
+
- [Multi-Runtime Reference](#multi-runtime-reference)
|
|
37
|
+
- [Project File Structure](#project-file-structure)
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Getting Started
|
|
42
|
+
|
|
43
|
+
A step-by-step walkthrough of your first PAN project, from initialization to verification.
|
|
44
|
+
|
|
45
|
+
### Step 1: Initialize a New Project
|
|
46
|
+
|
|
47
|
+
```text
|
|
48
|
+
/pan:new-project
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
PAN asks you questions about your project — what you're building, who it's for, and what success looks like. This is a collaborative conversation, not a form.
|
|
52
|
+
|
|
53
|
+
**What gets created:**
|
|
54
|
+
- `.planning/project.md` — Your project brief
|
|
55
|
+
- `.planning/requirements.md` — Scoped requirements with REQ-IDs
|
|
56
|
+
- `.planning/roadmap.md` — Phased delivery plan
|
|
57
|
+
- `.planning/config.json` — Project configuration
|
|
58
|
+
- `.planning/state.md` — Progress tracker
|
|
59
|
+
|
|
60
|
+
### Step 2: Plan a Phase
|
|
61
|
+
|
|
62
|
+
```text
|
|
63
|
+
/pan:plan-phase 1
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
PAN creates detailed execution plans for Phase 1 with specific tasks and validates them through a quality checker (with `--research`, or `workflow.research: true`, a researcher first answers the open questions that block building). Each plan targets a single concern with 2-3 atomic tasks, and carries a `## Review Focus` section: at most five untested inputs or failure modes, each tied to a task and a test (or `None — <reason>`). Before the checker runs, code checks send a broken plan set straight back to the planner: `verify plan-set`, `verify review-focus` and `verify decisions` (plans cite only the `DD-N` design decisions the design records, and every recorded one is cited). When the checker runs, `research lint` runs before it but never blocks: claims in the research's `## Claims` table with no source or checked date, and stale ones, go to the checker.
|
|
67
|
+
|
|
68
|
+
**What gets created:**
|
|
69
|
+
- `.planning/phases/01-{name}/01-01-plan.md` — First execution plan
|
|
70
|
+
- Additional `{phase}-{plan}-plan.md` files if the phase needs multiple plans
|
|
71
|
+
|
|
72
|
+
**Optional:** Run `/pan:discuss-phase 1` first to have PAN ask clarifying questions about your approach before planning.
|
|
73
|
+
|
|
74
|
+
### Step 3: Execute the Phase
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
/pan:exec-phase 1
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
PAN executes each plan's tasks in wave order — independent plans run in parallel, dependent plans run sequentially. Each task produces a git commit. If something breaks, PAN auto-fixes it (up to 3 attempts per task). An executor that finished but is unsure of something returns `DONE_WITH_CONCERNS` with each concern's reason and cost if wrong; the plan counts as complete and the concerns go to the reviewer, which judges the phase's diff against the plans' intent (`pan-tools review scope`).
|
|
81
|
+
|
|
82
|
+
**What gets created:**
|
|
83
|
+
- Your actual project files (code, config, etc.)
|
|
84
|
+
- `.planning/phases/01-{name}/01-01-summary.md` — Execution report per plan, plus `01-review.md` (the code review) and `01-verification.md` (the phase verification)
|
|
85
|
+
- Git commits for each completed task
|
|
86
|
+
|
|
87
|
+
After each wave PAN reports the phase's spend when it nears or reaches the phase budget (`cost.phase_budget_usd`, $20 by default; it only warns). At the end, `phase complete` runs the phase gate: with the default `workflow.phase_gate: enforce` it refuses to mark the phase complete when a check fails, such as a plan with no summary, a missing, failing or stale verification, or an open critical or high finding, and shows each reason. See [Phase gate refuses to complete a phase](TROUBLESHOOTING.md#phase-gate-refuses-to-complete-a-phase).
|
|
88
|
+
|
|
89
|
+
### Step 4: Verify the Work
|
|
90
|
+
|
|
91
|
+
```text
|
|
92
|
+
/pan:verify-phase 1
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
PAN re-runs goal-backward verification with a test-suite gate — checking that the codebase delivers what the phase promised — and lists the recommended fix plans. Create them with `/pan:plan-phase 1 --gaps`, then run `/pan:exec-phase 1 --gaps-only`.
|
|
96
|
+
|
|
97
|
+
**What gets created:**
|
|
98
|
+
- `.planning/phases/01-{name}/01-verification.md` — Verification results
|
|
99
|
+
- Recommended fix plans in the report (written to disk by `/pan:plan-phase 1 --gaps`)
|
|
100
|
+
|
|
101
|
+
### Step 5: Check Progress and Continue
|
|
102
|
+
|
|
103
|
+
```text
|
|
104
|
+
/pan:progress
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Shows your overall project status and tells you what to do next — plan the next phase, execute remaining plans, or verify completed work. `/pan:progress`, `/pan:resume` and the phase transition all get that next step from one router, `pan-tools next-action`, which reads `roadmap.md` and the phase directories; run it yourself to see the suggestion as JSON.
|
|
108
|
+
|
|
109
|
+
**Typical flow from here:**
|
|
110
|
+
- Plan the next phase: `/pan:plan-phase 2`
|
|
111
|
+
- If you need to pause: `/pan:pause`
|
|
112
|
+
- If you're resuming later: `/pan:resume`
|
|
113
|
+
|
|
114
|
+
### Tips for Your First Project
|
|
115
|
+
|
|
116
|
+
- **Start small** — Pick a project with 3-5 phases for your first run
|
|
117
|
+
- **Use `/pan:discuss-phase`** before planning if you're unsure about approach
|
|
118
|
+
- **Check `/pan:progress`** whenever you lose track of where you are
|
|
119
|
+
- **Use the `balanced` profile** (default) — the agents that plan, write and judge code are on the reasoning tier, which inherits the model you launched with (the researchers and the plan-checker run on the mid tier, and a few review agents pin their own model — see Model Profiles); switch to `budget` only when cost matters more than depth
|
|
120
|
+
- **Run `/clear`** between major commands to keep context fresh
|
|
121
|
+
|
|
122
|
+
### Capability-aware features
|
|
123
|
+
|
|
124
|
+
PAN emits all of these unconditionally. They pay off in full on Claude Code with a frontier reasoning model (Opus, for example); elsewhere they degrade rather than error, as described below the list:
|
|
125
|
+
|
|
126
|
+
- **Prompt caching** — the host caches each agent's prompt prefix by itself; nothing PAN runs can mark another agent's prompt for caching. What PAN controls is how much every agent re-reads: phase agents read their phase's roadmap slice instead of the whole roadmap and requirements, and `state compact` and `roadmap compact` keep the always-read planning files small (`/pan:hygiene` flags them when they grow). Requires a model/runtime that supports prompt caching.
|
|
127
|
+
- **Effort-tuned reasoning** — every agent declares an `effort:` level (`AGENT_BASE_EFFORT` in `core.cjs`): the plan and design checkers, planner, designer, debugger and conductor run at `xhigh`, execution, verification, release, the hardener, the roadmapper and the remaining specialists (optimizer, previewer, counterfactual, integration checker, experiment runner) at `high`, research, knowledge, the distiller and the reviewer/meta-reviewer at `medium`, and the mechanical `pan-document_code` pass at `low`. Catches logic gaps earlier where it matters most.
|
|
128
|
+
- **Single-shot map-codebase** — repos that fit the single-shot threshold (≤700K tokens, measured by `pan-tools codebase estimate-size`) map in a single agent instead of several parallel ones. Mode is chosen by repo size alone; holding a repo that large in one pass needs a model with a 1M-context window, so on smaller-context models prefer the sharded path (the command's hard-coded `estimate-size --threshold 700000` call decides the mode; lower that threshold in the command to force `sharded`).
|
|
129
|
+
- **How a lesson reaches the next phase** — through what the phase agents already read: `.planning/state.md` (its decisions), the phase summaries, the code and its tests, and the project's own instructions (`CLAUDE.md` or `AGENTS.md`, outside PAN's section). A lesson that should hold for the rest of the project belongs in those instructions, or in a test that fails when it is broken.
|
|
130
|
+
- **The agent memory store** — `.planning/memory/<agent>.md` keeps lessons you record (`memory append`, or the gated `memory record`) and `/pan:retro --write-memory`'s recurring gap patterns. **PAN's workflows do not load it into agents.** Harness runs found that a recorded lesson changed nothing that `state.md`, the summaries and the code did not already carry. Read it with `/pan:knowledge`.
|
|
131
|
+
- **What `memory select` leaves out:** a lesson that cites code (`memory append … --cites src/db.js#bulkInsert`) once that code is gone, and a lesson nobody has used for the expiry window.
|
|
132
|
+
- **Housekeeping:** `pan-tools memory prune --apply` archives what is left out, and `/pan:hygiene` reports it.
|
|
133
|
+
- **Inspect and trim:** `pan-tools memory list` shows the logs, and `pan-tools memory compact <agent> <max>` trims one (the entries it drops are kept in `.planning/memory/archive/<agent>.md`).
|
|
134
|
+
- **Milestone retrospective** — `/pan:retro` reports estimation accuracy, verification pass rates and the gap patterns that recur. Take a pattern that matters into the next milestone's plans or the project's instructions. Run after every `/pan:milestone-done`.
|
|
135
|
+
- **Capability-aware routing** — when a task needs thinking, the fast tier upgrades to mid; when cache is warm and context is small, mid downgrades to fast. The rules live in `adjustTierForCapabilities()` in `core.cjs`, which `resolveModelDetailed()` applies when a hint is present. They act only on hints passed to `pan-tools resolve-model --metadata`, and no workflow passes them today.
|
|
136
|
+
- **Commands stay out of the model's listing** — on Claude Code PAN's commands carry `disable-model-invocation: true`, so their descriptions are not sent to the model on every turn; you invoke them as `/pan:<name>`. (Installs by PAN 3.29.0 and earlier also wrote flat `.claude/skills/pan-*.md` shims for this; Claude Code only loads `skills/<name>/SKILL.md` directories, so the shims were never read, and upgrading removes them.)
|
|
137
|
+
|
|
138
|
+
On lower tiers (mid/fast models) and non-Claude runtimes, features degrade gracefully: on OpenCode, Gemini CLI and Copilot CLI the installer turns each agent's `effort:` into a prose "think step-by-step" preamble (Codex gets it as its native `model_reasoning_effort`, and Claude Code reads `effort:` natively whatever the tier), caching is a no-op, and the map-codebase command's `estimate-size --threshold 700000` call decides the map mode (lower it in the command to force the sharded path). None of this is gated at runtime — no feature, mode, or routing decision checks your model name before choosing a code path. (`/pan:cost` does look up the model ID recorded in the metrics log to price your token usage, but that only affects the number in a cost report, not what PAN runs. On Claude Code the context monitor reads the model ID to know the window it measures against; that decides only whether and when its note appears.) The one model-name check you'll notice is advisory and runs once: at the end of install, the installer looks up the `model` field in your `settings.json` against a hand-maintained table of known model IDs (`detectModelCapabilities()` in `bin/install-lib.cjs`) and prints a note if that model is known to lack 1M context or extended thinking. The table recognizes the current generations by name and deliberately fails forward — the per-family threshold is the last reduced-capability release it records, not the newest release it lists, so any Claude ID newer than that boundary (a new major, or a later point release inside a major it already lists) inherits that family's modern profile rather than reading as capability-less, and upgrading to a new flagship doesn't produce a bogus warning. An ID resolves either by matching an explicit branch in the table or — for Claude names — by carrying a family plus a readable release number strictly newer than that family's last reduced-capability release; anything that resolves neither way reads as `tier: 'unknown'` with every capability flag false. That result may trigger the note spuriously. Either way it's a hint, never a block. Pass `--skip-warnings` to silence it.
|
|
139
|
+
|
|
140
|
+
### Spec B v2 features
|
|
141
|
+
|
|
142
|
+
Spec B v2 (v3.0-v3.4) added a wave of new commands. Each has a clear single purpose. None modify the focus system. v3.5 added `/pan:learn`, `/pan:learn --optimize` and `/pan:git`, and the `security` and `distill` focus-auto categories.
|
|
143
|
+
|
|
144
|
+
- **`/pan:cost` (v3.0)** — token usage + estimated cost across all PAN invocations. Three output formats (`json`/`table`/`chart`). Auto-populated since v3.4 by the SubagentStop hook on Claude Code, Codex and Copilot CLI (not Gemini CLI or OpenCode); no manual instrumentation needed. Time-windowed with `--since YYYY-MM-DD --until YYYY-MM-DD`. `pan-tools cost budget --phase N` shows a phase's spend against `cost.phase_budget_usd` ($20 by default, warn only).
|
|
145
|
+
- **`/pan:preview phase <N> | phases | milestone` (v3.1)** — read-only foresight. Three modes:
|
|
146
|
+
- `phase N` — blast radius (files likely touched, tests at risk, risk score 1-10, migration flags) and a cost forecast (p10/p50/p90 per plan and per phase from this project's own cost ledger; `insufficient` until there are enough observations)
|
|
147
|
+
- `phases` — dependency graph (mermaid DAG + parallel batches + hidden coupling)
|
|
148
|
+
- `milestone` — ETA with confidence + bottleneck identification
|
|
149
|
+
- **`/pan:review-deep <phase>` (v3.2)** — security audit (OWASP + STRIDE via `pan-hardener`) + cross-check by `pan-meta-reviewer`. Merges reviewer + hardener + meta findings into one verdict ladder. Recommended for phases touching auth/payment/PII/migrations/public APIs. Also invokable as `/pan:exec-phase <N> --deep-review`; `/pan:focus-auto --step exec --deep-review` runs the hardener and meta-reviewer on each high-stakes item's changed files and merges them under the item's id. Costs ~3× a normal review.
|
|
150
|
+
- **`/pan:knowledge {ask|discuss|playbook}` (v3.2)** — three modes in one command:
|
|
151
|
+
- `ask "question"` — grounded Q&A with inline citations. Example: `/pan:knowledge ask "why does phase 4 have a race condition fix?"`
|
|
152
|
+
- `discuss <phase> "topic"` — multi-turn refinement with session state persistence. Benefits from prompt caching where the runtime and model support it.
|
|
153
|
+
- `playbook` — aggregate all agents' memory into `.planning/playbook.md` categorized by Conventions / Gotchas / Decisions / Tool choices / Anti-patterns / Recurring gaps.
|
|
154
|
+
- **`/pan:what-if <phase> "scenario"` (v3.3)** — counterfactual phase replay in an isolated git worktree. Agent explores the alternative, report lands in `.planning/counterfactuals/<phase>-<slug>.md`, worktree auto-deleted. Requires git.
|
|
155
|
+
|
|
156
|
+
#### Advanced flags and logging
|
|
157
|
+
|
|
158
|
+
- **`--hierarchical` flag on `/pan:exec-phase` (v3.4)** — spawn `pan-conductor` as a top-level orchestrator that decomposes the phase and spawns executor/reviewer/verifier sub-agents in waves. Bounded by a safety harness (2-level nesting, 12-spawn cap, budget ceiling, abort file). Claude Code only — agents-spawn-agents needs native sub-agent spawning; on the other four runtimes the flag is a no-op that warns and falls back to flat exec. No model gate: `pan-conductor` inherits the model you launched the session with. Use for phases with ≥4 autonomous plans where wall-clock reduction justifies the ~20-30% orchestration tax.
|
|
159
|
+
- **`--deep-review` flag on `/pan:exec-phase` and `/pan:focus-auto --step exec` (v3.4)** — on `/pan:exec-phase`, run the `/pan:review-deep` process inline after the normal reviewer step, before verification; on `/pan:focus-auto --step exec`, run the hardener and meta-reviewer on each high-stakes item's changed files and merge them under the item's id (no first-pass review). Recommended for high-stakes batches.
|
|
160
|
+
- **Automatic cost logging (v3.4)** — `hooks/pan-cost-logger.js` registered as a SubagentStop hook. Every sub-agent completion appends a record to `.planning/metrics/tokens.jsonl`. Visible in `/pan:cost report` without any manual `cost append` calls.
|
|
161
|
+
|
|
162
|
+
All Spec B v2 commands interoperate with the focus system via read boundaries and optional flags — no focus command was modified.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Workflow Diagrams
|
|
167
|
+
|
|
168
|
+
### Full Project Lifecycle
|
|
169
|
+
|
|
170
|
+
```text
|
|
171
|
+
┌──────────────────────────────────────────────────┐
|
|
172
|
+
│ NEW PROJECT │
|
|
173
|
+
│ /pan:new-project │
|
|
174
|
+
│ Questions -> Requirements -> Roadmap (+research)│
|
|
175
|
+
└─────────────────────────┬────────────────────────┘
|
|
176
|
+
│
|
|
177
|
+
┌──────────────▼─────────────┐
|
|
178
|
+
│ FOR EACH PHASE: │
|
|
179
|
+
│ │
|
|
180
|
+
│ ┌────────────────────┐ │
|
|
181
|
+
│ │ /pan:discuss-phase │ │ <- Lock in preferences
|
|
182
|
+
│ └──────────┬─────────┘ │
|
|
183
|
+
│ │ │
|
|
184
|
+
│ ┌──────────▼─────────┐ │
|
|
185
|
+
│ │ /pan:design-phase │ │ <- Architecture, ADR, threat-lite
|
|
186
|
+
│ └──────────┬─────────┘ │
|
|
187
|
+
│ │ │
|
|
188
|
+
│ ┌──────────▼─────────┐ │
|
|
189
|
+
│ │ /pan:plan-phase │ │ <- Plan + Verify (research opt-in)
|
|
190
|
+
│ └──────────┬─────────┘ │
|
|
191
|
+
│ │ │
|
|
192
|
+
│ ┌──────────▼─────────┐ │
|
|
193
|
+
│ │ /pan:exec-phase │ │ <- Parallel execution
|
|
194
|
+
│ └──────────┬─────────┘ │
|
|
195
|
+
│ │ │
|
|
196
|
+
│ ┌──────────▼─────────┐ │
|
|
197
|
+
│ │ /pan:verify-phase │ │ <- Goal-backward verify
|
|
198
|
+
│ └──────────┬─────────┘ │
|
|
199
|
+
│ │ │
|
|
200
|
+
│ Next Phase?────────────┘
|
|
201
|
+
│ │ No
|
|
202
|
+
└─────────────┼──────────────┘
|
|
203
|
+
│
|
|
204
|
+
┌───────────────▼──────────────┐
|
|
205
|
+
│ /pan:milestone-audit │
|
|
206
|
+
│ /pan:milestone-done │
|
|
207
|
+
└───────────────┬──────────────┘
|
|
208
|
+
│
|
|
209
|
+
Another milestone?
|
|
210
|
+
│ │
|
|
211
|
+
Yes No -> Done!
|
|
212
|
+
│
|
|
213
|
+
┌───────▼──────────────┐
|
|
214
|
+
│ /pan:milestone-new │
|
|
215
|
+
└──────────────────────┘
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Planning Agent Coordination
|
|
219
|
+
|
|
220
|
+
```text
|
|
221
|
+
/pan:plan-phase N
|
|
222
|
+
│
|
|
223
|
+
├── Phase Researcher (opt-in: --research)
|
|
224
|
+
│ │
|
|
225
|
+
│ ┌──────▼──────┐
|
|
226
|
+
│ │ research.md │
|
|
227
|
+
│ └──────┬──────┘
|
|
228
|
+
│ │
|
|
229
|
+
│ ┌──────▼──────┐
|
|
230
|
+
│ │ Planner │ <- Reads state.md, the roadmap slice,
|
|
231
|
+
│ │ │ context.md, research.md
|
|
232
|
+
│ └──────┬──────┘
|
|
233
|
+
│ │
|
|
234
|
+
│ ┌──────▼───────────┐ ┌────────┐
|
|
235
|
+
│ │ Plan Checker │────>│ PASS? │
|
|
236
|
+
│ └──────────────────┘ └───┬────┘
|
|
237
|
+
│ │
|
|
238
|
+
│ Yes │ No
|
|
239
|
+
│ │ │ │
|
|
240
|
+
│ │ └───┘ (revise: once by default, 2x under quality)
|
|
241
|
+
│ │
|
|
242
|
+
│ ┌─────▼──────┐
|
|
243
|
+
│ │ PLAN files │
|
|
244
|
+
│ └────────────┘
|
|
245
|
+
└── Done
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Validation Architecture (Nyquist Layer)
|
|
249
|
+
|
|
250
|
+
When the Nyquist layer is enabled (`workflow.nyquist_validation` — **off by
|
|
251
|
+
default**; see below) and the phase is researched (`--research`, or
|
|
252
|
+
`workflow.research: true`; research is off by default), plan-phase research maps
|
|
253
|
+
automated test coverage to each phase requirement before any code is written.
|
|
254
|
+
Without research the plan-phase warns and continues without a validation strategy. This ensures that when Claude's
|
|
255
|
+
executor commits a task, a feedback mechanism already exists to verify it within seconds.
|
|
256
|
+
|
|
257
|
+
The researcher detects your existing test infrastructure, maps each requirement to
|
|
258
|
+
a specific test command, and identifies any test scaffolding that must be created
|
|
259
|
+
before implementation begins (Wave 0 tasks).
|
|
260
|
+
|
|
261
|
+
With it enabled, the plan-checker treats test coverage as an additional verification
|
|
262
|
+
dimension: plans whose tasks lack automated verify commands are sent back for revision.
|
|
263
|
+
|
|
264
|
+
**Output:** `{phase}-validation.md` -- the feedback contract for the phase.
|
|
265
|
+
|
|
266
|
+
**Enable:** Set `workflow.nyquist_validation: true` in `/pan:settings`. It ships
|
|
267
|
+
off by default; turn it on for phases where planning test coverage up front matters.
|
|
268
|
+
|
|
269
|
+
### Execution Wave Coordination
|
|
270
|
+
|
|
271
|
+
```text
|
|
272
|
+
/pan:exec-phase N
|
|
273
|
+
│
|
|
274
|
+
├── Analyze plan dependencies
|
|
275
|
+
│
|
|
276
|
+
├── Wave 1 (independent plans):
|
|
277
|
+
│ ├── Executor A (fresh context) -> commit
|
|
278
|
+
│ └── Executor B (fresh context) -> commit
|
|
279
|
+
│
|
|
280
|
+
├── Wave 2 (depends on Wave 1):
|
|
281
|
+
│ └── Executor C (fresh context) -> commit
|
|
282
|
+
│
|
|
283
|
+
└── Verifier
|
|
284
|
+
└── Check codebase against phase goals
|
|
285
|
+
│
|
|
286
|
+
├── PASS -> verification.md (success)
|
|
287
|
+
└── FAIL -> gaps in verification.md -> /pan:plan-phase N --gaps
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Brownfield Workflow (Existing Codebase)
|
|
291
|
+
|
|
292
|
+
```text
|
|
293
|
+
/pan:map-codebase
|
|
294
|
+
│
|
|
295
|
+
▼
|
|
296
|
+
mapper agent(s)
|
|
297
|
+
│
|
|
298
|
+
├── codebase/stack.md
|
|
299
|
+
├── codebase/integrations.md
|
|
300
|
+
├── codebase/architecture.md
|
|
301
|
+
├── codebase/structure.md
|
|
302
|
+
├── codebase/conventions.md
|
|
303
|
+
├── codebase/testing.md
|
|
304
|
+
├── codebase/concerns.md
|
|
305
|
+
├── codebase/relationships.md
|
|
306
|
+
└── codebase/best-practices.md
|
|
307
|
+
│
|
|
308
|
+
┌───────▼──────────┐
|
|
309
|
+
│ /pan:new-project │ <- Questions focus on what you're ADDING
|
|
310
|
+
└──────────────────┘
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
## Command Reference
|
|
316
|
+
|
|
317
|
+
### Renamed commands
|
|
318
|
+
|
|
319
|
+
Some commands were folded into flags of another command. The old names keep working: the installer generates them as aliases.
|
|
320
|
+
|
|
321
|
+
| Old command | Now |
|
|
322
|
+
|-------------|-----|
|
|
323
|
+
| `/pan:dashboard` | `/pan:hud` |
|
|
324
|
+
| `/pan:milestone-cleanup` | `/pan:milestone-done --cleanup` |
|
|
325
|
+
| `/pan:milestone-gaps` | `/pan:milestone-audit --gaps` |
|
|
326
|
+
| `/pan:optimize` | `/pan:learn --optimize` |
|
|
327
|
+
| `/pan:research-phase` | `/pan:plan-phase --research-only` |
|
|
328
|
+
| `/pan:profile` | `/pan:settings --profile` |
|
|
329
|
+
| `/pan:focus-doc-audit` | `/pan:focus-docs` |
|
|
330
|
+
| `/pan:focus-sync` | `/pan:focus-docs --sync` |
|
|
331
|
+
| `/pan:focus-scan`, `/pan:focus-plan`, `/pan:focus-exec`, `/pan:focus-drift-walking` | `/pan:focus-auto --step scan`, `plan`, `exec`, `drift` |
|
|
332
|
+
|
|
333
|
+
`/pan:discord` and `/pan:mcp-bridge` were retired with no replacement. PAN's own MCP server is unaffected (see [MCP server registration](#mcp-server-registration)).
|
|
334
|
+
|
|
335
|
+
### Core Workflow
|
|
336
|
+
|
|
337
|
+
| Command | Purpose | When to Use |
|
|
338
|
+
|---------|---------|-------------|
|
|
339
|
+
| `/pan:new-project` | Full project init: questions, research (opt-in), requirements, roadmap | Start of a new project |
|
|
340
|
+
| `/pan:new-project --auto @idea.md` | Automated init from document | Have a PRD or idea doc ready |
|
|
341
|
+
| `/pan:discuss-phase <N>` | Capture implementation decisions | Before planning, to shape how it gets built |
|
|
342
|
+
| `/pan:design-phase <N>` | Design a phase — architecture, ADR, threat-lite — before planning | After discussing, before planning |
|
|
343
|
+
| `/pan:plan-phase [N]` | Plan + verify (research with `--research`); `--research-only <N>` runs the research step alone | Before executing a phase; research only for a complex or unfamiliar domain |
|
|
344
|
+
| `/pan:exec-phase <N>` | Execute all plans in parallel waves | After planning is complete |
|
|
345
|
+
| `/pan:verify-phase [N] [--uat]` | Goal-backward re-verification with a test-suite gate; lists gaps for `--gaps`. `--uat` walks you through the phase's acceptance tests instead (every runtime; answers recorded through `pan-tools uat record`) | After execution completes |
|
|
346
|
+
| `/pan:autodev [run\|resume\|status\|report\|replay]` | Unattended loop over the roadmap: a fresh host session per plan, execute and verify step (a lean phase: the engine plans it, then one session builds, reviews and verifies it), `phase complete` in the engine, stop reasons in code, a ledger per run in `.planning/autodev/` | When the roadmap is settled and you want phases built without supervision |
|
|
347
|
+
| `/pan:milestone-audit` | Verify milestone met its definition of done; `--gaps` creates phases for the gaps it found | Before completing milestone |
|
|
348
|
+
| `/pan:milestone-done <version>` | Archive milestone, tag release; `--cleanup` archives old phase directories from completed milestones | All phases verified |
|
|
349
|
+
| `/pan:milestone-new [name]` | Start next version cycle | After completing a milestone |
|
|
350
|
+
|
|
351
|
+
### Navigation
|
|
352
|
+
|
|
353
|
+
| Command | Purpose | When to Use |
|
|
354
|
+
|---------|---------|-------------|
|
|
355
|
+
| `/pan:progress` | Show status and next steps | Anytime -- "where am I?" |
|
|
356
|
+
| `/pan:resume` | Restore full context from last session | Starting a new session |
|
|
357
|
+
| `/pan:pause` | Save context handoff | Stopping mid-phase |
|
|
358
|
+
| `/pan:help` | Show all commands | Quick reference |
|
|
359
|
+
| `/pan:update` | Update PAN with changelog preview, reinstalling the runtime it runs in (for a `--config-dir` or `--unified-skills` install, re-run the installer with your original flags) | Check for new versions |
|
|
360
|
+
|
|
361
|
+
### Phase Management
|
|
362
|
+
|
|
363
|
+
| Command | Purpose | When to Use |
|
|
364
|
+
|---------|---------|-------------|
|
|
365
|
+
| `/pan:add-phase <description>` | Append new phase to roadmap | Scope grows after initial planning |
|
|
366
|
+
| `/pan:insert-phase <after> <description>` | Insert urgent work (decimal numbering) | Urgent fix mid-milestone |
|
|
367
|
+
| `/pan:remove-phase <N>` | Remove future phase and renumber | Descoping a feature |
|
|
368
|
+
| `/pan:assumptions <N>` | Preview Claude's intended approach | Before planning, to validate direction |
|
|
369
|
+
|
|
370
|
+
### Brownfield & Utilities
|
|
371
|
+
|
|
372
|
+
| Command | Purpose | When to Use |
|
|
373
|
+
|---------|---------|-------------|
|
|
374
|
+
| `/pan:map-codebase` | Analyze existing codebase (one agent for small repos, several in parallel above the size threshold) | Before `/pan:new-project` on existing code |
|
|
375
|
+
| `/pan:quick` | Ad-hoc task with PAN guarantees | Bug fixes, small features, config changes |
|
|
376
|
+
| `/pan:debug [desc]` | Systematic debugging with persistent state | When something breaks |
|
|
377
|
+
| `/pan:todo-add [desc]` | Capture an idea for later | Think of something during a session |
|
|
378
|
+
| `/pan:todo-check` | List pending todos | Review captured ideas |
|
|
379
|
+
| `/pan:settings` | Configure workflow toggles, model profile, branching and the phase budget; `--profile <profile>` is a quick profile switch | Change model, toggle agents, change the spend warning or the cost/quality tradeoff |
|
|
380
|
+
| `/pan:patches` | Restore local modifications after update | After `/pan:update` if you had local edits |
|
|
381
|
+
| `/pan:phase-budget` | Estimate context window utilization | Monitor context health during execution |
|
|
382
|
+
| `/pan:health [--repair]` | Validate `.planning/` directory integrity | Diagnose and auto-repair directory issues |
|
|
383
|
+
| `/pan:hygiene [--apply]` | Scan for PAN version drift + stale artifacts (legacy filenames, memory bloat and stale memory entries, poisoned ledgers, trace debris, an oversized state.md or roadmap.md, Claude Code's memory index); `--apply` executes the safe fixes, `state compact` and `roadmap compact` among them | Keep older projects aligned with the latest PAN |
|
|
384
|
+
| `/pan:phase-tests <N> [instructions]` | Generate tests for a completed phase | After execution, to add test coverage |
|
|
385
|
+
| `/pan:retro` | Milestone retrospective — estimation accuracy, gap patterns | After `/pan:milestone-done` |
|
|
386
|
+
| `/pan:links [--strict]` | Validate the doc–code link graph: inline `[[<id>]]` refs, `// @pan:` source anchors, `require-code-mention` contracts (ADR-0027) | Renamed an ADR or moved a module — catch broken refs |
|
|
387
|
+
|
|
388
|
+
### Spec B v2
|
|
389
|
+
|
|
390
|
+
| Command | Purpose | When to Use |
|
|
391
|
+
|---------|---------|-------------|
|
|
392
|
+
| `/pan:cost` | Token usage + estimated cost report (json/table/chart); `budget` (a phase's spend against `cost.phase_budget_usd`), `limits` (Claude Code's usage windows), and the `usage` census (`pan-tools usage`: which installed commands and agents this project has used) | Track AI costs across phases |
|
|
393
|
+
| `/pan:preview phase <N>\|phases\|milestone` | Read-only foresight: blast radius / dependency graph / milestone ETA | Before exec — "what will this touch?" |
|
|
394
|
+
| `/pan:review-deep <phase>` | Security audit (OWASP+STRIDE) + cross-checked by meta-reviewer | High-stakes phases (auth/payments/PII) |
|
|
395
|
+
| `/pan:knowledge {ask\|discuss\|playbook}` | Grounded Q&A, multi-turn discussion, or aggregate memory into playbook | Reflection or design discussion |
|
|
396
|
+
| `/pan:what-if <phase> "scenario"` | Counterfactual phase replay in isolated git worktree | Explore an alternative approach safely |
|
|
397
|
+
|
|
398
|
+
### Optimization & Git
|
|
399
|
+
|
|
400
|
+
| Command | Purpose | When to Use |
|
|
401
|
+
|---------|---------|-------------|
|
|
402
|
+
| `/pan:learn` | Analyze the most recent trace session, generate optimization report; `--optimize {apply\|revert\|list\|stats\|trace}` records the report's suggestions, undoes an apply, lists reports, shows stats and manages trace sessions | After a phase or campaign — "what can PAN learn?" |
|
|
403
|
+
| `/pan:git <subcommand>` | Phase-aware git workflow with safety guardrails (commit/branch/push/status/log/stash/diff/rollback/tag/sync) | Day-to-day git ops with branch-name conventions and safety checks |
|
|
404
|
+
|
|
405
|
+
### Operations (Pre-Flight, Dashboard, Learnings, Dependencies)
|
|
406
|
+
|
|
407
|
+
| Command | Purpose | When to Use |
|
|
408
|
+
|---------|---------|-------------|
|
|
409
|
+
| `pan-tools preflight [target]` | Validate state, blockers, git, config before execution | Before starting work: "am I ready?" |
|
|
410
|
+
| `pan-tools dashboard` | Aggregated project overview (JSON/text; for the visual HTML version see [`/pan:hud`](#army--project-dashboard-panhud)) | Quick status check: "where am I?" |
|
|
411
|
+
| `pan-tools learnings extract` | Extract learnings from phase summaries (co-changed key files, `patterns-established`) and `patterns.md` error patterns | After sessions: capture what you learned |
|
|
412
|
+
| `pan-tools learnings list` | List all extracted learnings | Review accumulated project knowledge |
|
|
413
|
+
| `pan-tools learnings prune --days N` | Remove old learnings | Housekeeping: keep learnings relevant |
|
|
414
|
+
| `pan-tools deps validate` | Cross-reference roadmap vs disk, find orphaned requirements | Project health: "is my plan consistent?" |
|
|
415
|
+
|
|
416
|
+
`pan-tools` throughout this guide is shorthand for `node .claude/pan-wizard-core/bin/pan-tools.cjs`; the installer adds no `pan-tools` command to your PATH. Use your runtime's directory in place of `.claude` (`.codex`, `.gemini`, `.opencode`, `.github`), or its global config directory after a `--global` install.
|
|
417
|
+
|
|
418
|
+
**Typical workflow:**
|
|
419
|
+
```bash
|
|
420
|
+
pan-tools preflight # Ready to work?
|
|
421
|
+
pan-tools dashboard # Where am I?
|
|
422
|
+
pan-tools deps validate # Roadmap consistent with reality?
|
|
423
|
+
pan-tools learnings extract # Capture patterns from recent sessions
|
|
424
|
+
pan-tools learnings list --raw # Review what's been learned
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
### Focus (Strategic Project Management)
|
|
428
|
+
|
|
429
|
+
| Command | Purpose | When to Use |
|
|
430
|
+
|---------|---------|-------------|
|
|
431
|
+
| `/pan:focus-auto` | Continuous scan→plan→exec loop with a layered safety harness; `--step scan\|plan\|exec\|drift` runs one stage (classify work items, budget a batch, execute it, or repair doc-code drift) | Hands-off batch work across categories, or one stage at a time |
|
|
432
|
+
| `/pan:focus-design` | Multi-phase strategic feature investigation | Before building a new feature |
|
|
433
|
+
| `/pan:focus-docs` | Multi-dimensional document audit with weighted quality scoring; `--sync` detects stale documentation counts | Quality assurance: "how trustworthy are my docs?", or after changes to check docs match code |
|
|
434
|
+
|
|
435
|
+
**Focus workflow:** `/pan:focus-auto --step scan` → `--step plan` → `--step exec`, then `/pan:focus-docs --sync`. Scan collects work from phases, todos, and error patterns. Plan budgets items using one of 4 modes (bugfix/balanced/features/full). Exec provides the execution pipeline. Sync verifies documentation stays current. Or use `focus-auto` to run continuous scan→plan→exec cycles across the supported categories (cleanup, tests, stability, features, docs, optimize, prompts, security, distill). Use `/pan:focus-auto --step drift` to detect and repair documentation-code drift across all directories. Use `/pan:focus-docs` for deep quality audits with per-file scoring. The `security` category targets OWASP Top 10 + STRIDE issues; the `distill` category targets AI-generated code bloat with a 5-pass deterministic→AST→graph→LLM→memory pipeline.
|
|
436
|
+
|
|
437
|
+
### Standards Integration
|
|
438
|
+
|
|
439
|
+
PAN includes a built-in catalog of industry standards (OWASP Top 10, WCAG 2.2, NIST SSDF, STRIDE, etc.). Standards are advisory — they guide agents during planning and verification but never block execution.
|
|
440
|
+
|
|
441
|
+
**Quick start:**
|
|
442
|
+
```bash
|
|
443
|
+
pan-tools standards recommend # Get recommendations based on your project type
|
|
444
|
+
pan-tools standards select owasp-top10 # Add a standard
|
|
445
|
+
pan-tools standards status # Check compliance progress
|
|
446
|
+
pan-tools validate health --standards # Include in health reports
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
**Per-phase tracking:**
|
|
450
|
+
```bash
|
|
451
|
+
pan-tools standards phase-track 1 # Which standards matter for phase 1?
|
|
452
|
+
pan-tools standards tools # What external tools can help verify?
|
|
453
|
+
pan-tools standards tools owasp-top10 # Tools for a specific standard
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
**How it works:** Selected standards are stored in `.planning/standards.md` as Markdown checklists. Agents naturally read this file as context. The verifier (Step 7b) runs per-phase standards tracking, auto-ticks checklist items it can confirm, and recommends external tools when coverage is low. The plan-checker's Standards Awareness dimension references selected standards when standards.md exists.
|
|
457
|
+
|
|
458
|
+
**Available standards:** OWASP Top 10, OWASP ASVS L1, OWASP LLM Top 10, OWASP Agentic Top 10, WCAG 2.2, NIST SSDF, ISO 25010, STRIDE, CWE Top 25, SOC 2 Dev Controls, TOGAF ADM, Conventional Commits.
|
|
459
|
+
|
|
460
|
+
### Doc-Code Link Graph
|
|
461
|
+
|
|
462
|
+
PAN treats your planning surface — ADRs, specs, learnings, references, workflows — as an explicit graph and lints its integrity. Renaming an ADR or moving a module no longer silently strands references.
|
|
463
|
+
|
|
464
|
+
**Two link types:**
|
|
465
|
+
|
|
466
|
+
- **Forward links**: inline `[[<id>]]` body-text refs and frontmatter `must_haves.key_links` entries. Recognized doc-id forms: `ADR-NNNN` (resolves via glob), `<path>.md`, `<path>` (tries `.md` then `/README.md`), and any with `#section`.
|
|
467
|
+
- **Backlinks**: `// @pan: <doc-id>` source-comment anchors (idiomatic per language: `//` for JS/TS/CJS, `#` for shell/Python, `<!--` for markdown/HTML). Anchors declare "this code is a load-bearing implementation of that doc."
|
|
468
|
+
|
|
469
|
+
**Backlink contract:** any doc with `require-code-mention: true` in YAML frontmatter must be anchored by at least one `@pan:` comment under source roots. The lint enforces this (`B-001` finding); without the frontmatter flag, anchors are advisory.
|
|
470
|
+
|
|
471
|
+
**Run it:**
|
|
472
|
+
|
|
473
|
+
```text
|
|
474
|
+
/pan:links # advisory — errors fail, warnings pass
|
|
475
|
+
/pan:links --strict # warnings also fail (B-002 single-source informational is exempt)
|
|
476
|
+
pan-tools validate health --links # attach link-graph summary to a health report
|
|
477
|
+
pan-tools links validate --doc-root docs --source-root src # your own layout; the flags replace the default roots and repeat
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
The default roots are PAN's own source layout: docs under `docs/`, `commands/`, `agents/` and parts of `pan-wizard-core/`, anchors under `pan-wizard-core/`, `bin/`, `hooks/` and `scripts/`. In your project, pass `--doc-root` and `--source-root` for your layout (`/pan:links` takes them too). Run bare in a project whose code lives under `src/`, it scans no source file and reports every `require-code-mention` doc as B-001; a run that scanned no doc or source files has misconfigured roots, not a clean graph.
|
|
481
|
+
|
|
482
|
+
**Finding codes:** F-001/F-002 (broken inline / missing section), F-003/F-004 (key_links path / regex), B-001 (uncovered `require-code-mention`), B-002 (informational single-source), A-001/A-002/A-004 (stale anchor target / section / empty id).
|
|
483
|
+
|
|
484
|
+
The convention is opt-in per doc — only docs with `require-code-mention: true` enforce backlinks; the rest are advisory. PAN's own ADR-0021, ADR-0026, and ADR-0027 are the canary opt-ins; their primary implementation files (`codebase.cjs`, `experiment.cjs`, `runner.cjs`, `links.cjs`) carry the matching `// @pan:` anchors. See [ADR-0027](decisions/ADR-0027-doc-code-link-graph.md) for design rationale and [docs/specs/doc_code_link_graph_featureai.md](specs/doc_code_link_graph_featureai.md) for the wire-level spec.
|
|
485
|
+
|
|
486
|
+
---
|
|
487
|
+
|
|
488
|
+
## Configuration Reference
|
|
489
|
+
|
|
490
|
+
PAN stores project settings in `.planning/config.json`. Configure during `/pan:new-project` or update later with `/pan:settings`.
|
|
491
|
+
|
|
492
|
+
### Full config.json Schema
|
|
493
|
+
|
|
494
|
+
```json
|
|
495
|
+
{
|
|
496
|
+
"model_profile": "balanced",
|
|
497
|
+
"commit_docs": true,
|
|
498
|
+
"search_gitignored": false,
|
|
499
|
+
"branching_strategy": "none",
|
|
500
|
+
"phase_branch_template": "pan/phase-{phase}-{slug}",
|
|
501
|
+
"milestone_branch_template": "pan/{milestone}-{slug}",
|
|
502
|
+
"workflow": {
|
|
503
|
+
"research": false,
|
|
504
|
+
"plan_check": true,
|
|
505
|
+
"verifier": true,
|
|
506
|
+
"nyquist_validation": false,
|
|
507
|
+
"phase_record_compact": false,
|
|
508
|
+
"phase_gate": "enforce",
|
|
509
|
+
"mutation_gate": "report",
|
|
510
|
+
"mutation_floor": 0.6,
|
|
511
|
+
"review_mode": "single",
|
|
512
|
+
"cross_family_review": "off",
|
|
513
|
+
"worktree_isolation": false,
|
|
514
|
+
"ceremony": "auto",
|
|
515
|
+
"lean_max_requirements": 5,
|
|
516
|
+
"phase_reports": { "enabled": false, "open": false, "theme": "auto", "index": true }
|
|
517
|
+
},
|
|
518
|
+
"parallelization": true,
|
|
519
|
+
"hooks": { "guard": "report" },
|
|
520
|
+
"cost": { "phase_budget_usd": 20 },
|
|
521
|
+
"brave_search": false,
|
|
522
|
+
"budget": {
|
|
523
|
+
"default_points": 50,
|
|
524
|
+
"micro_threshold_tasks": 3,
|
|
525
|
+
"micro_threshold_files": 2,
|
|
526
|
+
"enforce": false,
|
|
527
|
+
"verify_reserve": 0.15,
|
|
528
|
+
"max_usd_run": null,
|
|
529
|
+
"max_usd_day": null
|
|
530
|
+
},
|
|
531
|
+
"commit": {
|
|
532
|
+
"safety_checks": true,
|
|
533
|
+
"conventional_types": true,
|
|
534
|
+
"sensitive_patterns": ["\\.env$", "\\.pem$", "\\.key$", "credentials", "secret", "password", "token"]
|
|
535
|
+
},
|
|
536
|
+
"execution": {
|
|
537
|
+
"default_mode": "wave_order",
|
|
538
|
+
"rollback_snapshots": true,
|
|
539
|
+
"error_pattern_learning": true
|
|
540
|
+
},
|
|
541
|
+
"routing": {
|
|
542
|
+
"strategy": "static",
|
|
543
|
+
"provider": "auto",
|
|
544
|
+
"cascade_quality_gate": true,
|
|
545
|
+
"max_escalations": 1,
|
|
546
|
+
"complexity_thresholds": { "downgrade_max": 2, "upgrade_min": 6 }
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
This is what `config-ensure-section` writes (`buildConfigDefaults()` in `config.cjs`). `/pan:new-project` writes a smaller config of its own (`mode`, `depth`, `parallelization`, `commit_docs`, `model_profile` and the `workflow` agent toggles, plus `workflow.auto_advance` under `--auto`; if you accept your saved defaults it writes those instead), and keys it leaves out read their hardcoded defaults. Only a config `config-ensure-section` creates starts `brave_search` at `true` when a Brave key is detected. The nested `planning.{commit_docs, search_gitignored}` and `git.{branching_strategy, …}` forms written by older versions are read only when the flat key is absent — configs `config-ensure-section` creates carry every flat key and `/pan:new-project` configs carry a flat `commit_docs`, so set the flat keys.
|
|
552
|
+
|
|
553
|
+
### Core Settings
|
|
554
|
+
|
|
555
|
+
| Setting | Options | Default | What it Controls |
|
|
556
|
+
|---------|---------|---------|------------------|
|
|
557
|
+
| `mode` | `interactive`, `yolo` | asked by `/pan:new-project` (`--auto`: `yolo`) | `yolo` auto-approves decisions; `interactive` confirms at each step |
|
|
558
|
+
| `depth` | `quick`, `standard`, `comprehensive` | asked by `/pan:new-project` (`--auto`: `quick`) | Planning thoroughness: 3-5, 5-8, or 8-12 phases |
|
|
559
|
+
| `model_profile` | `quality`, `balanced`, `budget` | `balanced` | Model tier for each agent (see table below), and how much ceremony: `balanced` and `budget` size each phase and quick task (a precisely specified one gets its plan from the engine, with no planner, plan-checker or test-generation agent; one code review pass, the verifier and every gate still run); `quality` runs the full ceremony on everything, every agent on the reasoning tier |
|
|
560
|
+
| `workflow.ceremony` | `auto`, `full` | `auto` | `full` keeps the full ceremony on every piece of work without changing models; `--quality` does it for one run |
|
|
561
|
+
| `workflow.lean_max_requirements` | number | `5` | The most tasks in one engine-written lean plan; a lean phase with more requirements is split into several plans run in order. Above three times this (15) a phase goes to the planner, since one session holds a lean phase |
|
|
562
|
+
| `parallelization` | `true`, `false` | `true` | Execute independent plans within a wave in parallel |
|
|
563
|
+
| `brave_search` | `true`, `false` | `false`; `true` in a config `config-ensure-section` creates while a Brave key is detected (`/pan:new-project` does not set it) | Make the phase researcher (`/pan:plan-phase`, `/pan:plan-phase --research-only`) search with Brave instead of the built-in web search; the `/pan:new-project` and `/pan:milestone-new` researchers never read it (the search needs the `BRAVE_API_KEY` env var; `~/.pan-wizard/brave_api_key` only pre-sets this key) |
|
|
564
|
+
| `routing.strategy` | `static`, `complexity` | `static` | How model tiers are adjusted at runtime |
|
|
565
|
+
| `routing.provider` | `auto`, `anthropic`, `openai`, `google` | `auto` | LLM provider for tier→model mapping |
|
|
566
|
+
| `routing.max_escalations` | `0` or more | `1` | How many tiers a retry after a failure may climb (`fast → mid → reasoning`, never above the agent's quality tier). Only the `budget` profile runs agents low enough for it to matter; `/pan:exec-phase --gaps-only` retries on the escalated tier |
|
|
567
|
+
|
|
568
|
+
### Planning Settings
|
|
569
|
+
|
|
570
|
+
| Setting | Options | Default | What it Controls |
|
|
571
|
+
|---------|---------|---------|------------------|
|
|
572
|
+
| `commit_docs` | `true`, `false` | `true` | Whether `.planning/` files are committed to git |
|
|
573
|
+
| `search_gitignored` | `true`, `false` | `false` | Reserved — read by `loadConfig` and reported by `init map-codebase`, but no workflow or agent acts on it, so no search adds `--no-ignore` |
|
|
574
|
+
| `memory.auto_optimize` | `true`, `false` | `true` | Reconcile the always-loaded project memory (dedupe / cap-with-archive state.md's append-heavy sections) automatically at the focus-auto checkpoint and normal-flow session record. No-op when already lean; opt out to reconcile only via `pan-tools memory optimize`. |
|
|
575
|
+
| `budget.verify_reserve` | `0`–`0.5` | `0.15` | Fraction of the spawn budget held back for re-verification so the quality gate isn't starved. Surfaced as an indicator always; a hard early stop only when `budget.enforce` / `--enforce-budget` is on. Per-run override: `--verify-reserve`. |
|
|
576
|
+
|
|
577
|
+
> **Note:** If `.planning/` is in `.gitignore`, `commit_docs` is automatically `false` regardless of the config value.
|
|
578
|
+
|
|
579
|
+
### Workflow Toggles
|
|
580
|
+
|
|
581
|
+
| Setting | Options | Default | What it Controls |
|
|
582
|
+
|---------|---------|---------|------------------|
|
|
583
|
+
| `workflow.research` | `true`, `false` | `false` | Research before planning each phase (opt-in): the workflow writes at most 5 open questions that block building and one researcher answers them, each with a source or a recorded assumption. A config that already says `true` keeps it; `/pan:plan-phase N --research` researches one phase |
|
|
584
|
+
| `workflow.plan_check` | `true`, `false` | `true` | Plan verification loop: 2 checks (one revision) on the sized ceremony, 3 checks (2 revisions) under `quality`, `workflow.ceremony: full` or `--quality`; a lean phase is checked by the engine instead |
|
|
585
|
+
| `workflow.verifier` | `true`, `false` | `true` | Post-execution verification against phase goals |
|
|
586
|
+
| `workflow.nyquist_validation` | `true`, `false` | `false` | Validation architecture research during plan-phase; adds the Nyquist plan-check dimension. Off by default — opt-in via `pan-tools config-set workflow.nyquist_validation true`. |
|
|
587
|
+
| `workflow.auto_advance` | `true`, `false` | `false` | Chain discuss → plan → execute → verify → transition without prompting. **Scope:** within a phase the chain is automatic; at a phase boundary a chain that `/pan:plan-phase` drives stops (it runs exec-phase with `--no-transition`) and prints the next command; PAN's stop guard then blocks the session's stop once and tells the agent to spawn the next phase; a direct `/pan:exec-phase --auto` hands over to `transition.md`, which spawns the next phase as a Task subagent and, at the end of the milestone, turns `auto_advance` off and stops, showing `/pan:milestone-done` as the next step. Equivalent to passing `--auto` to `/pan:discuss-phase`, `/pan:plan-phase` and `/pan:exec-phase`. |
|
|
588
|
+
| `hooks.guard` | `off`, `report`, `enforce` | `report` | The pre-tool guard hook (Claude Code, Codex, Gemini CLI, Copilot CLI). `report` logs each credential written into a file, direct write to PAN's state, or edit to a test the phase does not declare, to `.planning/guard.jsonl`; `enforce` also denies the credential write, the direct state write (state.md goes through `pan-tools state` verbs), and a judge agent's write outside `.planning/`. |
|
|
589
|
+
| `workflow.phase_gate` | `enforce`, `warn` | `enforce` | The phase gate `phase complete` runs first: summaries for every plan, a passing and fresh verification, approved human items, a clean reconcile, no open critical or high finding, no committed stub, no weakened test. `warn` marks the phase complete and reports what failed (exec-phase then does not auto-advance); `enforce` refuses until each reason is fixed, or until `phase complete <N> --force --reason "<why>"`, which records the override. `pan-tools phase gate <N>` runs the gate alone. |
|
|
590
|
+
| `workflow.mutation_gate` | `off`, `report`, `gate` | `report` | The mutation report `/pan:verify-phase` runs on the phase's changed lines once the test gate passes (`pan-tools verify mutate`). `report` lists the mutants the suite did not kill and never refuses; `off` runs nothing; `gate` (opt-in) turns a score below `workflow.mutation_floor` into gaps: the verification goes to `gaps_found`, and `verify reconcile` refuses a passed one |
|
|
591
|
+
| `workflow.mutation_floor` | 0 to 1 | `0.6` | The share of sampled mutants the suite must kill in `gate` mode |
|
|
592
|
+
| `workflow.review_mode` | `single`, `lenses` | `single` | `lenses` runs the code reviewer once per lens (correctness, security, maintainability) and keeps the findings a quorum of passes reported (`pan-tools review vote`) |
|
|
593
|
+
| `workflow.cross_family_review` | `off`, `claude`, `codex`, `copilot`, `gemini`, `opencode` | `off` | A host to run one more, read-only review on during `/pan:review-deep`, so a second model family checks the change (`pan-tools review cross-family`). The host's CLI must be installed and signed in; the run spends on that host |
|
|
594
|
+
| `workflow.worktree_isolation` | `true`, `false` | `false` | On Claude Code, the native `/pan-exec-waves` script runs each executor in its own git worktree (`agent({isolation: "worktree"})`). Plans of a wave that share a file always run one after the other |
|
|
595
|
+
| `budget.max_usd_run`, `budget.max_usd_day` | dollars or `null` | `null` | `/pan:autodev`'s spend caps per run and per day; a run needs a run cap, here or as `--max-usd` |
|
|
596
|
+
| `workflow.phase_record_compact` | `true`, `false` | `false` | When combined with the lightweight-phase bypass (1-plan trivial phases, which already skip per-phase research), plan-phase writes one `${N}-record.md` (goal, locked decisions, plan summary, must_haves) in place of a per-phase context.md; execution still writes each plan's summary.md. Substantive phases (more than one plan, or more than scaffolding, config, docs or a single-file feature) ignore this flag. |
|
|
597
|
+
| `workflow.phase_reports` | object: `enabled`, `open`, `theme`, `index` | `{ "enabled": false, "open": false, "theme": "auto", "index": true }` | With `enabled: true`, `/pan:exec-phase` writes the phase's HTML report (as `/pan:report phase` does) at the verify→complete gate, plus the timeline index `.planning/report-index.html` when `index` is true, and adds them to the completion commit; `/pan:focus-auto` checkpoints and `/pan:army` missions render them too. `open` and `theme` are written but not read, and no automatic run opens a browser. |
|
|
598
|
+
| `workflow.stop_guard` | `true`, `false` | absent (guard on) | `false` turns off PAN's stop guard, which otherwise blocks a session's stop once while `workflow.auto_advance` is true or `mode` is `yolo` and unbuilt roadmap phases remain, unless state.md records failed verification, gaps or a blocker (Claude Code, Codex, Gemini CLI, Copilot CLI) |
|
|
599
|
+
|
|
600
|
+
Disable these to speed up phases in familiar domains or when conserving tokens.
|
|
601
|
+
|
|
602
|
+
### Budget Settings
|
|
603
|
+
|
|
604
|
+
| Setting | Options | Default | What it Controls |
|
|
605
|
+
|---------|---------|---------|------------------|
|
|
606
|
+
| `budget.default_points` | number | `50` | The point budget `init execute-phase` reports as `total_budget_points` (and `budget_exceeded` when the plans' estimated points pass it); `pan-conductor` (`/pan:exec-phase --hierarchical`) takes its points budget from `total_budget_points`; no workflow reads either field, and the focus commands keep their own defaults (no range validation) |
|
|
607
|
+
| `budget.micro_threshold_tasks` | number | `3` | Task-count ceiling (inclusive) at or below which — together with `micro_threshold_files` — `init execute-phase` classifies a plan as MICRO (`classifyPlanTier`); an explicit plan `tier:` overrides |
|
|
608
|
+
| `budget.micro_threshold_files` | number | `2` | File-count ceiling for the same MICRO classification |
|
|
609
|
+
| `budget.enforce` | `true`, `false` | `false` | Make the point budget a hard stop; advisory (tracked, never stops a run) by default |
|
|
610
|
+
| `cost.phase_budget_usd` | dollars, `0` = off | `20` | Spend per phase PAN warns about, in API-equivalent dollars: `near` from 80%, `over` at the budget, reported after each exec-phase wave and in plan-phase's final status. It only warns, never stops. Set it with `/pan:settings`; `pan-tools cost budget --phase N` shows it |
|
|
611
|
+
| `cost.weekly_limit_stop_pct` | `0`–`100` | `90` | Stop a `/pan:focus-auto` run (resumable) or an `/pan:army` campaign once Claude Code's 7-day usage window reaches this share, as the status line last saw it (`pan-tools cost limits`); `0` turns it off. Interactive Claude Code sessions on a subscription only: headless runs and other runtimes have no reading, so nothing stops on it there |
|
|
612
|
+
|
|
613
|
+
### Commit Safety Settings
|
|
614
|
+
|
|
615
|
+
| Setting | Options | Default | What it Controls |
|
|
616
|
+
|---------|---------|---------|------------------|
|
|
617
|
+
| `commit.safety_checks` | `true`, `false` | `true` | Enable deleted-file and sensitive-file checks before commit |
|
|
618
|
+
| `commit.conventional_types` | `true`, `false` | `true` | Reserved — written by the defaults but not read; `--type` is always accepted and validated against `feat`, `fix`, `docs`, `test`, `refactor`, `perf`, `chore` |
|
|
619
|
+
| `commit.sensitive_patterns` | array of regex | See default | File patterns blocked from commits (`.env`, `.pem`, etc.) |
|
|
620
|
+
|
|
621
|
+
### Execution Settings
|
|
622
|
+
|
|
623
|
+
| Setting | Options | Default | What it Controls |
|
|
624
|
+
|---------|---------|---------|------------------|
|
|
625
|
+
| `execution.default_mode` | `wave_order` | `wave_order` | Reserved — `init execute-phase` reports it as `execution_mode`, which no workflow reads; plans always run in wave order |
|
|
626
|
+
| `execution.rollback_snapshots` | `true`, `false` | `true` | Reserved — written by the defaults but not read; no workflow creates rollback tags, so run `pan-tools rollback-snapshot <phase>` yourself before a risky phase |
|
|
627
|
+
| `execution.error_pattern_learning` | `true`, `false` | `true` | Tool-failure capture: the trace hook records the failed tool calls in each subagent's own transcript (redacted) as `error/tool_error` events for `/pan:learn`. `false` turns the capture off (see [The evidence loop](#the-evidence-loop)) |
|
|
628
|
+
|
|
629
|
+
### Git Branching
|
|
630
|
+
|
|
631
|
+
| Setting | Options | Default | What it Controls |
|
|
632
|
+
|---------|---------|---------|------------------|
|
|
633
|
+
| `branching_strategy` | `none`, `phase`, `milestone` | `none` | When and how branches are created |
|
|
634
|
+
| `phase_branch_template` | Template string | `pan/phase-{phase}-{slug}` | Branch name for phase strategy |
|
|
635
|
+
| `milestone_branch_template` | Template string | `pan/{milestone}-{slug}` | Branch name for milestone strategy |
|
|
636
|
+
|
|
637
|
+
**Branching strategies explained:**
|
|
638
|
+
|
|
639
|
+
| Strategy | Creates Branch | Scope | Best For |
|
|
640
|
+
|----------|---------------|-------|----------|
|
|
641
|
+
| `none` | Never | N/A | Solo development, simple projects |
|
|
642
|
+
| `phase` | At each `exec-phase` | One phase per branch | Code review per phase, granular rollback |
|
|
643
|
+
| `milestone` | At first `exec-phase` | All phases share one branch | Release branches, PR per version |
|
|
644
|
+
|
|
645
|
+
**Template variables:** `{phase}` = zero-padded number (e.g., "03"), `{slug}` = lowercase hyphenated name, `{milestone}` = version (e.g., "v1.0").
|
|
646
|
+
|
|
647
|
+
### Model Profiles (Per-Agent Breakdown)
|
|
648
|
+
|
|
649
|
+
PAN uses abstract tier names (`reasoning`, `mid`, `fast`) that map to provider-specific models. On Anthropic: reasoning → `inherit` (the model your session runs on), mid → Sonnet, fast → Haiku. On OpenAI/Google: reasoning → inherit, mid/fast → provider equivalents. Under OpenCode, mid/fast resolve to OpenCode's `provider/model` ids, with the provider taken from the `model` in the project's `opencode.json` or `.opencode/opencode.json` (a model set only in OpenCode's global config is not read) when neither `routing.provider` nor `PAN_PROVIDER` names one (and from the runtime directories, where `.opencode/` alone counts as OpenAI, when that names none either).
|
|
650
|
+
|
|
651
|
+
| Agent | `quality` | `balanced` | `budget` |
|
|
652
|
+
|-------|-----------|------------|----------|
|
|
653
|
+
| pan-planner | reasoning | reasoning | mid |
|
|
654
|
+
| pan-roadmapper | reasoning | reasoning | mid |
|
|
655
|
+
| pan-executor | reasoning | reasoning | mid |
|
|
656
|
+
| pan-phase-researcher | reasoning | mid | fast |
|
|
657
|
+
| pan-project-researcher | reasoning | mid | fast |
|
|
658
|
+
| pan-debugger | reasoning | reasoning | mid |
|
|
659
|
+
| pan-document_code | reasoning | reasoning | fast |
|
|
660
|
+
| pan-verifier | reasoning | reasoning | fast |
|
|
661
|
+
| pan-plan-checker | reasoning | mid | fast |
|
|
662
|
+
| pan-integration-checker | reasoning | reasoning | fast |
|
|
663
|
+
| pan-reviewer | reasoning | reasoning | fast |
|
|
664
|
+
|
|
665
|
+
The table shows the core agents. Every other agent is on `reasoning` under `quality` and `balanced` too; `MODEL_PROFILES` in `core.cjs` has each one's `budget` tier. `balanced` differs from `quality` only in the researchers and the plan-checker (mid tier) and in the ceremony it runs (see `model_profile` above).
|
|
666
|
+
|
|
667
|
+
**Profile philosophy (cost reset):**
|
|
668
|
+
- **quality** and **balanced** -- Every agent runs on the `reasoning` tier, i.e. **`inherit` — the model you launched with** (under `balanced`, the researchers and the plan-checker run on the mid tier; a few review agents pin their own model; see the note below). PAN respects your model choice by default and does not silently demote agents to cheaper models; context isolation (each subagent in its own window), not a weaker model, is what keeps the main conversation clean.
|
|
669
|
+
- **budget** -- The opt-in cheap mode: mid for code-writing agents, fast for research and verification. Choose it explicitly for high-volume or less-critical work. Cheapness is opt-in, not the default.
|
|
670
|
+
|
|
671
|
+
> Model tiering takes effect where a PAN workflow passes the resolved tier as a Task spawn's `model` (from `init` or `resolve-model`), and it is what `pan-tools estimate-cost` (shown by `/pan:settings --profile`) prices — `/pan:cost` does not use it, since the hooks take each record's tier from the model id they record; a spawn that passes no model uses the agent file's static `model:` — unset means `inherit`. A few security-review agents deliberately pin `model: opus` in their own frontmatter; `grep -l '^model: opus' .claude/agents/*.md` lists them (`~/.claude/agents/` in a global install).
|
|
672
|
+
|
|
673
|
+
### Routing Strategies
|
|
674
|
+
|
|
675
|
+
The `routing.strategy` setting controls how tiers are adjusted at runtime:
|
|
676
|
+
|
|
677
|
+
- **static** (default) -- Profile assigns fixed tiers. Predictable, no surprises.
|
|
678
|
+
- **complexity** -- Adjusts tiers up or down from task metadata (file count, wave count, requirements, architecture flag) passed to `pan-tools resolve-model --metadata`. No workflow passes that metadata today, so a first attempt resolves as it does under `static`. Under `budget` it also cancels the `/pan:exec-phase --gaps-only` escalation: the retry carries only its attempt number, scores as a simple task and drops a tier before it climbs one.
|
|
679
|
+
|
|
680
|
+
### Cost Estimation
|
|
681
|
+
|
|
682
|
+
Run `pan-tools estimate-cost` to see relative cost multipliers before switching (`/pan:settings --profile <profile>` shows them after it switches). Cost tiers: reasoning = 15×, mid = 3×, fast = 1×.
|
|
683
|
+
|
|
684
|
+
### Per-Phase Model Override
|
|
685
|
+
|
|
686
|
+
`pan-tools resolve-model <agent> --metadata '{"phaseNum":"3"}'` reads a per-phase tier from an HTML comment in that phase's roadmap section. No workflow passes the phase today: `init plan-phase` and `init execute-phase` resolve every agent without it, so the comment does not change the model a phase's agents run on. Use `model_overrides` to change an agent's tier. The comment looks like this:
|
|
687
|
+
|
|
688
|
+
```markdown
|
|
689
|
+
## Phase 3: Quick UI polish
|
|
690
|
+
**Goal:** Style cleanup
|
|
691
|
+
<!-- model_tier: fast -->
|
|
692
|
+
```
|
|
693
|
+
|
|
694
|
+
Per-phase overrides sit between per-agent overrides (highest priority) and profile lookup (lowest priority).
|
|
695
|
+
|
|
696
|
+
---
|
|
697
|
+
|
|
698
|
+
## Usage Examples
|
|
699
|
+
|
|
700
|
+
### New Project (Full Cycle)
|
|
701
|
+
|
|
702
|
+
```bash
|
|
703
|
+
claude --dangerously-skip-permissions
|
|
704
|
+
/pan:new-project # Answer questions, configure, approve roadmap
|
|
705
|
+
/clear
|
|
706
|
+
/pan:discuss-phase 1 # Lock in your preferences
|
|
707
|
+
/pan:plan-phase 1 # Plan + verify (add --research to research first)
|
|
708
|
+
/pan:exec-phase 1 # Parallel execution
|
|
709
|
+
/pan:verify-phase 1 # Goal-backward verify + test gate
|
|
710
|
+
/clear
|
|
711
|
+
/pan:discuss-phase 2 # Repeat for each phase
|
|
712
|
+
...
|
|
713
|
+
/pan:milestone-audit # Check everything shipped
|
|
714
|
+
/pan:milestone-done 1.0 # Archive, tag, done
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
### New Project from Existing Document
|
|
718
|
+
|
|
719
|
+
```bash
|
|
720
|
+
/pan:new-project --auto @prd.md # Requirements and roadmap from your doc (research only with --research), then chains discuss → plan → execute → verify for phase 1
|
|
721
|
+
/clear
|
|
722
|
+
/pan:discuss-phase 2 --auto # the next command the chain prints, if the run stopped at the boundary (the stop guard first blocks one stop and tells the agent to spawn the next phase); for step-by-step runs set Auto-advance to No in /pan:settings and workflow.stop_guard to false (--auto writes mode: yolo, which keeps the stop guard armed)
|
|
723
|
+
```
|
|
724
|
+
|
|
725
|
+
### Existing Codebase
|
|
726
|
+
|
|
727
|
+
```bash
|
|
728
|
+
/pan:map-codebase # Analyze what exists (one agent, or several in parallel above the size threshold)
|
|
729
|
+
/pan:new-project # Questions focus on what you're ADDING
|
|
730
|
+
# (normal phase workflow from here)
|
|
731
|
+
```
|
|
732
|
+
|
|
733
|
+
### Quick Bug Fix
|
|
734
|
+
|
|
735
|
+
```bash
|
|
736
|
+
/pan:quick
|
|
737
|
+
> "Fix the login button not responding on mobile Safari"
|
|
738
|
+
```
|
|
739
|
+
|
|
740
|
+
### Resuming After a Break
|
|
741
|
+
|
|
742
|
+
```bash
|
|
743
|
+
/pan:progress # See where you left off and what's next
|
|
744
|
+
# or
|
|
745
|
+
/pan:resume # Full context restoration from last session
|
|
746
|
+
```
|
|
747
|
+
|
|
748
|
+
### Preparing for Release
|
|
749
|
+
|
|
750
|
+
```bash
|
|
751
|
+
/pan:milestone-audit # Check requirements coverage, detect stubs
|
|
752
|
+
/pan:milestone-audit --gaps # If audit found gaps, create phases to close them
|
|
753
|
+
/pan:milestone-done 1.0 # Archive, tag, done
|
|
754
|
+
```
|
|
755
|
+
|
|
756
|
+
### Speed vs Quality Presets
|
|
757
|
+
|
|
758
|
+
| Scenario | Mode | Depth | Profile | Research | Plan Check | Verifier |
|
|
759
|
+
|----------|------|-------|---------|----------|------------|----------|
|
|
760
|
+
| Prototyping | `yolo` | `quick` | `budget` | off | off | off |
|
|
761
|
+
| Normal dev | `interactive` | `standard` | `balanced` | off (the default) | on | on |
|
|
762
|
+
| Production | `interactive` | `comprehensive` | `quality` (full ceremony, every agent on the reasoning tier) | on (`workflow.research: true`) | on | on |
|
|
763
|
+
|
|
764
|
+
### Mid-Milestone Scope Changes
|
|
765
|
+
|
|
766
|
+
```bash
|
|
767
|
+
/pan:add-phase "Add audit logging" # Append a new phase to the roadmap
|
|
768
|
+
# or
|
|
769
|
+
/pan:insert-phase 3 "Hotfix rate limiter" # Insert urgent work between phases 3 and 4
|
|
770
|
+
# or
|
|
771
|
+
/pan:remove-phase 7 # Descope phase 7 and renumber
|
|
772
|
+
```
|
|
773
|
+
|
|
774
|
+
---
|
|
775
|
+
|
|
776
|
+
## Advanced Features
|
|
777
|
+
|
|
778
|
+
### Native Workflows (Claude Code only)
|
|
779
|
+
|
|
780
|
+
Claude Code can run orchestration as a **script** rather than as prose the model follows: the script holds the loop, the fan-out and the intermediate results, so the model's context holds only the final answer, and a step cannot be skimmed past. PAN ships a small set of these to `.claude/workflows/` on every Claude install (and inside the Claude plugin), each a deterministic port of one PAN protocol:
|
|
781
|
+
|
|
782
|
+
| Command | Ports | What it does |
|
|
783
|
+
|---|---|---|
|
|
784
|
+
| `/pan-review-pipeline [phase or change set]` | `/pan:review-deep` | Reviewer and security hardener in parallel, then the meta-reviewer merges and issues one verdict |
|
|
785
|
+
| `/pan-map-codebase` | `/pan:map-codebase` | Discovers the top-level areas, documents each in parallel, synthesises one overview |
|
|
786
|
+
| `/pan-exec-waves <phase>` | `/pan:exec-phase` wave dispatch | Reads the plan index, runs one executor per plan wave by wave (parallel within a wave unless `parallelization` is off), halts before the next wave on a failed plan, then runs the phase verifier unless `workflow.verifier` is off (then it says verification was skipped) |
|
|
787
|
+
| `/pan-diagnose-issues <phase>` | the `diagnose-issues` protocol (`workflows/diagnose-issues.md`, which `/pan:verify-phase N --uat` follows on every runtime for the gaps it records) | One debugger per failed UAT truth, in parallel, root cause only; writes the diagnoses back into the UAT gaps |
|
|
788
|
+
|
|
789
|
+
Two rules govern them. **They are additive**: the markdown commands remain the portable path and the only path on the other four runtimes, and the scripts never replace them. **They only port protocols whose control flow is known before the run** — a fixed fan-out, a wave that is genuinely a barrier. A step that depends on reading the last result stays in markdown, and a script never pretends to pause for you: `/pan-exec-waves` refuses a phase that contains checkpoint plans and tells you to run `/pan:exec-phase` instead.
|
|
790
|
+
|
|
791
|
+
**Measured, not assumed.** PAN's behavioural harness ran both paths on the same two-plan seed, five reps each (September 2026, Claude Code `2.1.233`): the markdown `/pan:exec-phase` completed every rep, and so did `/pan-exec-waves`, with the phase verifier's file written every time, about 15% faster and a few percent cheaper per rep. On Claude Code the native workflow is the recommended way to run a checkpoint-free phase; the markdown command stays the portable path and the fallback for phases with checkpoints. One caveat for headless or CI use: `claude -p` waits at most ten minutes for a background workflow before stopping it and dropping its result — set `CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS=0` (or a higher ceiling) when driving these workflows from a script. Interactive sessions are unaffected.
|
|
792
|
+
|
|
793
|
+
**Host controls that shape these runs** (Claude Code; each checked against the official Claude Code documentation on 2026-09-28):
|
|
794
|
+
|
|
795
|
+
- **Concurrency.** `CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS` caps how many agents a workflow script runs at once. The value is an integer from 1 to 256; the default is 16, or fewer on a machine with fewer CPUs. A wide wave in `/pan-exec-waves` queues behind this cap rather than failing, so lower it when parallel executors contend for a shared resource such as a database or a port.
|
|
796
|
+
- **Permissions for headless runs.** A headless run has nobody to approve a tool. When its permission mode does not already allow the Workflow tool, add a permission rule: `Workflow` for every workflow, or `Workflow(pan-exec-waves)` for one by name.
|
|
797
|
+
- **Cache visibility.** `/usage` includes a `Prompt cache (main)` line with the hit ratio, the miss count, whether the cache is warm or cold, and the likely cause of the last miss. Read it next to `/pan:cost` when a long session costs more than it should.
|
|
798
|
+
- **Scripted plugin installs.** `claude plugin install <plugin> --json` prints one JSON object (the outcome, a message and, on failure, a failure code) instead of text, for setup scripts that install the PAN plugin.
|
|
799
|
+
|
|
800
|
+
Each script names the markdown protocol it ports, and a test pins the pair so they cannot drift apart silently. Run them like any other slash command; `/workflows` shows progress per phase and per agent.
|
|
801
|
+
|
|
802
|
+
### The Evidence Loop
|
|
803
|
+
|
|
804
|
+
PAN's judges decide whether work passed: the plan checker, the reviewer, the design checker and the verifier. Their verdicts, what they found, and what was done about each finding are kept on record in `.planning/findings.jsonl`. The optimisation loop sees the failures that happen inside subagents.
|
|
805
|
+
|
|
806
|
+
- **Verdicts on the record.** Each judge's report ends with a machine-readable verdict: a fenced `pan-verdict` block, or the verifier's verification.md frontmatter. The workflows save each report in the phase directory (`NN-review.md`, `NN-plan-check.md`, `NN-design-check.md`, `NN-verification.md`) and record it with `pan-tools findings record`. They branch on the verdict the record prints and fall back to the old heading or `status:` read when a report has no valid verdict; exec-phase's auto-advance decision comes from the phase gate that `phase complete` runs (`pan-tools phase gate`).
|
|
807
|
+
- **Fix rounds close their findings on evidence.** A re-verification after a gap-closure round is the next attempt. The gaps it lists under `re_verification.gaps_closed` (or that a judge answers `resolved` with evidence) are marked fixed, and the retry is logged. A finding the new report neither repeats nor answers stays open.
|
|
808
|
+
- **Nothing is continued past silently.** When a phase moves on past open review, plan-check or design findings, the workflow records the reason. Findings nothing disposes stay `open` until you dispose them: the rows of a plain `PASS` review or a passing plan or design check, `unrequested` work, and human-verification items (a `PASS_WITH_WARNINGS` review defers all its open rows, INFO included). Examples of recorded reasons: warnings accepted at review, "continue anyway" at `NEEDS_FIXES`, "force proceed" after the third plan check. You can dispose findings yourself, too: `pan-tools findings dispose <id> --as deferred|dismissed|decision --reason "…"`. A reason is required.
|
|
809
|
+
- **A dismissal teaches the ledger, until the file changes.** After you dismiss a finding, the same judge raising it again is filtered while its file is unchanged: in that phase at first, and in every phase once you have dismissed it in two. When the file changes, the finding comes back. Security and logic findings, and findings that name no file, are never filtered. `pan-tools findings suppressions` lists what is being filtered.
|
|
810
|
+
- **Milestone audits read the record.** `/pan:milestone-audit` takes its tech debt from `pan-tools findings debt`, the deferred findings with their reasons. It lists the findings nobody disposed, instead of reconstructing either from prose.
|
|
811
|
+
- **Unrequested work is a finding.** The verifier runs `pan-tools verify scope <phase>`, which lists the files the phase changed that no plan declared. Whatever it judges to be work nobody asked for is recorded as `unrequested`. That finding does not fail the phase; keeping or removing the work is your decision.
|
|
812
|
+
- **Failures inside subagents reach `/pan:learn`.** On Claude Code the trace hook records the failed tool calls in a subagent's own transcript, redacted and grouped by tool and message (capped per spawn; the completion keeps the total): a failing test run, a missing file, a refused permission. `/pan:learn` ranks them by how often they recur across spawns and sessions. `/pan:learn --sessions 5` pools the last five sessions, so a suggestion rests on a pattern, not on one run's accident.
|
|
813
|
+
- **Applies can be undone.** `/pan:learn --optimize apply` records exactly what it wrote. `/pan:learn --optimize revert <apply_id>` (or `--last`) undoes one apply byte for byte, and refuses files someone edited since. Applying the same report twice writes nothing the second time.
|
|
814
|
+
|
|
815
|
+
`pan-tools findings list` shows the ledger, filtered by phase, agent, status, class or milestone. MCP clients read the same data as `pan://findings`.
|
|
816
|
+
|
|
817
|
+
### Self-Improvement Loop
|
|
818
|
+
|
|
819
|
+
PAN Wizard ships a **cross-project meta-learning loop** that lets PAN itself get smarter every release. Run experiments against fresh ideas in isolated folders, harvest the resulting telemetry back to the source repo, promote generalizable findings into shipped artifacts that future installs read automatically.
|
|
820
|
+
|
|
821
|
+
**The loop:**
|
|
822
|
+
|
|
823
|
+
```bash
|
|
824
|
+
# 1. Capture an idea (use the template at pan-wizard-core/templates/idea.md)
|
|
825
|
+
echo "# Idea: <title>
|
|
826
|
+
## Problem
|
|
827
|
+
...
|
|
828
|
+
## Success Criteria
|
|
829
|
+
...
|
|
830
|
+
## Scope
|
|
831
|
+
...
|
|
832
|
+
## Constraints
|
|
833
|
+
..." > my-idea.md
|
|
834
|
+
|
|
835
|
+
# 2. Scaffold an isolated experiment
|
|
836
|
+
pan-tools experiment new my-idea --idea my-idea.md --runtime claude --budget 60
|
|
837
|
+
|
|
838
|
+
# 3. Run the external session (autonomous; observation-only watchdog)
|
|
839
|
+
pan-tools experiment run my-idea
|
|
840
|
+
|
|
841
|
+
# 4. Harvest telemetry back to <source-repo>/experiments/my-idea/
|
|
842
|
+
pan-tools experiment harvest my-idea
|
|
843
|
+
|
|
844
|
+
# 5. Analyze with pan-optimizer
|
|
845
|
+
/pan:learn --experiment my-idea
|
|
846
|
+
|
|
847
|
+
# 6. Promote select findings (manual gate by design — no auto-promote yet)
|
|
848
|
+
pan-tools learn promote --pattern P-007 --scope universal --topic exec-patterns \
|
|
849
|
+
--summary "..." --rule "..." --evidence "..." --source-experiments my-idea
|
|
850
|
+
|
|
851
|
+
# 7. Validate the patterns store (catches duplicates, dangling refs, scope leaks)
|
|
852
|
+
pan-tools learn lint --raw
|
|
853
|
+
|
|
854
|
+
# 8. Refresh the topic→agent index so workflows can budget-load relevant patterns
|
|
855
|
+
pan-tools learn build-index --raw
|
|
856
|
+
```
|
|
857
|
+
|
|
858
|
+
**Two-tier learnings layout:**
|
|
859
|
+
|
|
860
|
+
- `pan-wizard-core/learnings/universal/` — ships to all 5 runtimes; consumed by user-project workflows. Includes patterns like atomic-state, concurrency, idempotency, secret-handling, test-patterns.
|
|
861
|
+
- `pan-wizard-core/learnings/internal/` — source-only; PAN-development patterns that should NOT leak to user installs.
|
|
862
|
+
- `pan-wizard-core/learnings/index.json` — generated topic→agent-relevance map. Workflows query it via `pan-tools learn topics-for --agent <role> --cue "<the task>" --token-budget N` to load only the topics that match the task, falling back to the role's tagged topics when none does, instead of skim-everything (avoids the distractor-density anti-pattern from external research).
|
|
863
|
+
|
|
864
|
+
The installer (`bin/install.js`) explicitly strips `learnings/internal/` from each install dir. A negative test in `tests/scenarios/learnings-installed.test.cjs` enforces this.
|
|
865
|
+
|
|
866
|
+
**Patterns-store maintenance commands:**
|
|
867
|
+
|
|
868
|
+
| Command | Purpose |
|
|
869
|
+
|---------|---------|
|
|
870
|
+
| `pan-tools learn promote --pattern <id> --scope <s> --topic <t>` | Append a finding to `learnings/{scope}/{topic}.md` |
|
|
871
|
+
| `pan-tools learn unpromote --pattern <id> --scope <s> --topic <t>` | Remove a finding |
|
|
872
|
+
| `pan-tools learn list-promoted` | Inventory of all patterns across both scopes |
|
|
873
|
+
| `pan-tools learn lint [--strict]` | Integrity checks (L-001..L-007); exits non-zero on errors |
|
|
874
|
+
| `pan-tools learn build-index` | Generate/refresh `learnings/index.json` |
|
|
875
|
+
| `pan-tools learn topics-for --agent <role> [--cue <task>]` | Budget-aware topic selection for an agent; with `--cue`, the topics that match the task |
|
|
876
|
+
|
|
877
|
+
**Subcommands of `/pan:experiment`:**
|
|
878
|
+
|
|
879
|
+
| Subcommand | Wave | Purpose |
|
|
880
|
+
|------------|------|---------|
|
|
881
|
+
| `new <slug>` | W1 | Scaffold an experiment folder |
|
|
882
|
+
| `list` | W1 | Enumerate experiments |
|
|
883
|
+
| `manifest <slug>` | W1 | Read scaffold metadata |
|
|
884
|
+
| `run <slug>` | W2 | Spawn external AI session, observe |
|
|
885
|
+
| `status <slug>` | W2 | Read run-state.json snapshot |
|
|
886
|
+
| `stop <slug>` | W2 | Reconcile a run's state after the fact; it cannot halt a run in flight (the synchronous runner records no pid until the run exits) |
|
|
887
|
+
| `harvest <slug>` | W3 | Copy telemetry back to source repo |
|
|
888
|
+
| `prune <slug>` | W3 | Soft-rename or hard-delete the experiment folder |
|
|
889
|
+
|
|
890
|
+
**Runtime support:**
|
|
891
|
+
|
|
892
|
+
The experiment runner uses `spawnSync` to invoke external AI runtimes headlessly:
|
|
893
|
+
- ✅ Claude Code (`claude -p <prompt>`)
|
|
894
|
+
- ✅ Codex CLI (`codex exec <prompt>`)
|
|
895
|
+
- ✅ Gemini CLI (`gemini -p <prompt>`)
|
|
896
|
+
- ✅ OpenCode (`opencode <prompt>`)
|
|
897
|
+
- ❌ GitHub Copilot CLI — the runner has no adapter for it (`RUNTIME_RUNNERS.copilot` is `null`), so `experiment run` refuses it; scaffold and harvest still work
|
|
898
|
+
|
|
899
|
+
**Spec & ADR:**
|
|
900
|
+
|
|
901
|
+
- Design: `docs/specs/self_improvement_loop_featureai.md`
|
|
902
|
+
- Decisions: `docs/decisions/ADR-0026-self-improvement-loop.md`
|
|
903
|
+
|
|
904
|
+
### AI Agent Guardrails
|
|
905
|
+
|
|
906
|
+
PAN Wizard ships `references/guardrails.md` — a consolidated rules doc that the phase workflows (`new-project`, `plan-phase`, `exec-phase`, `execute-plan`, `verify-phase`) and the planner, designer and reviewer agents load. It encodes anti-patterns (silent model swaps, skipping verification, scope creep), the **Code Preservation Principle** (surgical edits only — preserve config values, comments, formatting outside the user's explicit target), and the **Stop-the-Line Rule** (regressions halt feature work, no "I'll circle back").
|
|
907
|
+
|
|
908
|
+
This doc is read by your AI coding agent (Claude, Codex, Gemini, OpenCode, Copilot) at the start of every phase. You don't need to interact with it directly, but you can review the installed copy at:
|
|
909
|
+
|
|
910
|
+
| Runtime | Path |
|
|
911
|
+
|---------|------|
|
|
912
|
+
| Claude | `.claude/pan-wizard-core/references/guardrails.md` |
|
|
913
|
+
| Codex | `.codex/pan-wizard-core/references/guardrails.md` |
|
|
914
|
+
| Gemini | `.gemini/pan-wizard-core/references/guardrails.md` |
|
|
915
|
+
| OpenCode | `.opencode/pan-wizard-core/references/guardrails.md` |
|
|
916
|
+
| GitHub Copilot | `.github/pan-wizard-core/references/guardrails.md` |
|
|
917
|
+
|
|
918
|
+
The long workflows (`exec-phase`, `plan-phase`, `verify-phase`, `execute-plan`) gain `## Re-Read Checkpoints` sections that direct the agent to re-read specific sections at boundaries — preventing context-compaction drift across long sessions. `new-project.md` gates scaffolding behind a mandatory Phase 0 clarify step (problem / success / scope / constraints).
|
|
919
|
+
|
|
920
|
+
If your agent ever skips `/pan:verify-phase` "because tests passed" or silently changes a model, point it at this reference.
|
|
921
|
+
|
|
922
|
+
### Advanced Planning Options
|
|
923
|
+
|
|
924
|
+
The `/pan:plan-phase` command accepts several flags to customize planning behavior:
|
|
925
|
+
|
|
926
|
+
| Flag | Purpose |
|
|
927
|
+
|------|---------|
|
|
928
|
+
| `--prd <file>` | Use a PRD/acceptance criteria file instead of discuss-phase. Parses requirements into context.md automatically. Skips discussion entirely. |
|
|
929
|
+
| `--skip-research` | Skip research phase, go straight to planning (useful for familiar domains) |
|
|
930
|
+
| `--research` | Research this phase (research is opt-in); also re-researches when research.md already exists |
|
|
931
|
+
| `--gaps` | Gap closure mode: reads verification.md and creates fix plans |
|
|
932
|
+
| `--skip-verify` | Skip the plan verification loop |
|
|
933
|
+
|
|
934
|
+
Example:
|
|
935
|
+
|
|
936
|
+
```bash
|
|
937
|
+
/pan:plan-phase 3 --prd specs/auth-requirements.md
|
|
938
|
+
```
|
|
939
|
+
|
|
940
|
+
### Execution Model
|
|
941
|
+
|
|
942
|
+
**Wave-Based Parallelization:**
|
|
943
|
+
|
|
944
|
+
Plans within a phase are grouped by wave number (from plan.md frontmatter `wave: N`). Waves execute sequentially, but plans within a wave execute in parallel (when `parallelization: true` in config).
|
|
945
|
+
|
|
946
|
+
Wave 1 plans have no dependencies. Wave 2 plans depend on Wave 1 output. This is how PAN safely parallelizes work.
|
|
947
|
+
|
|
948
|
+
**Deviation Rules:**
|
|
949
|
+
|
|
950
|
+
During execution, the pan-executor automatically handles unexpected issues:
|
|
951
|
+
|
|
952
|
+
| Rule | Trigger | Action | Example |
|
|
953
|
+
|------|---------|--------|---------|
|
|
954
|
+
| Rule 1 | Bug in code | Auto-fix | Logic errors, null pointers, type errors |
|
|
955
|
+
| Rule 2 | Missing critical functionality | Auto-add | Missing validation, error handling, auth checks |
|
|
956
|
+
| Rule 3 | Blocking issue | Auto-fix | Missing dependency, broken imports, build errors |
|
|
957
|
+
| Rule 4 | Architectural change needed | STOP and ask | New DB table, schema changes, library switches |
|
|
958
|
+
|
|
959
|
+
Rules 1-3 are applied automatically (up to 3 fix attempts per task). Rule 4 creates a checkpoint requiring user decision.
|
|
960
|
+
|
|
961
|
+
**Gap Closure:**
|
|
962
|
+
|
|
963
|
+
After verification reports `gaps_found`, run `/pan:plan-phase N --gaps` to create the fix plans (`gap_closure: true`), then `/pan:exec-phase N --gaps-only` to execute only those.
|
|
964
|
+
|
|
965
|
+
**Checkpoint Automation:**
|
|
966
|
+
|
|
967
|
+
When `workflow.auto_advance: true` in config:
|
|
968
|
+
|
|
969
|
+
| Checkpoint | Behavior |
|
|
970
|
+
|------------|----------|
|
|
971
|
+
| `checkpoint:human-verify` | Auto-approved (skips visual verification) |
|
|
972
|
+
| `checkpoint:decision` | Takes the option the task's `auto_select` names; stops for you when it has none |
|
|
973
|
+
| `checkpoint:human-action` | Still stops (auth gates cannot be automated) |
|
|
974
|
+
|
|
975
|
+
### Bot-army campaigns (`/pan:army`)
|
|
976
|
+
|
|
977
|
+
**This is PAN's headline capability — ship a whole project, not just a phase.** `/pan:army` runs PAN's agents as a coordinated army: **Mission Control** (the reasoning-tier conductor) 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 approval (ADR-0032 squads · ADR-0033 campaign). It composes the pieces you already use: the `pan-conductor` safety harness, the focus-auto work loop, git worktrees, and the `/pan:retro` and `/pan:learn` reports.
|
|
978
|
+
|
|
979
|
+
**Taking on an existing project.** The army never plans blind. On a brownfield repo, Phase 0 runs an onboarding gate: if existing code has no codebase map yet, it stops and routes you through `/pan:map-codebase` (its `pan-document_code` mappers — workers in `pan-tools squad list`, not Architecture squad members — map the system into `.planning/codebase/`) and `/pan:new-project` (builds `roadmap.md` / `requirements.md` *against the existing system*), then you re-run `/pan:army`. From there, the Architecture squad reads the existing contracts before Build touches anything, and every Build agent forks its `army/<task>` branch from the commit you have checked out (`worktree create` bases it on `HEAD`) — so the existing code is never edited in place. For a greenfield repo, you go straight to the plan.
|
|
980
|
+
|
|
981
|
+
**The tiers.** Mission Control — the reasoning-tier `pan-conductor`, elevated to campaign scope — plans the goal and delegates rather than implementing. Work flows to the squads, each carrying an intended access contract:
|
|
982
|
+
|
|
983
|
+
| Squad | Role | Access |
|
|
984
|
+
|-------|------|--------|
|
|
985
|
+
| Architecture | Design the contract before code | `read-only` |
|
|
986
|
+
| Build | Turn the contract into committed code | `read-write-bash` |
|
|
987
|
+
| Quality | Adversarially break what Build makes | `read-only` |
|
|
988
|
+
| Release | Ship behind a human gate | `always-ask` |
|
|
989
|
+
|
|
990
|
+
Inspect the roster any time with `pan-tools squad list` and `pan-tools squad show <name>`.
|
|
991
|
+
|
|
992
|
+
**What the Access column is.** The `access` values `pan-tools squad list` reports — a role contract PAN's prompts assign, not a sandbox. `squads.cjs` is a registry that "modifies no agent and changes no execution path", so a label can differ from what an agent may actually do: several `read-only` squad members hold `Write` because they emit planning or verification artifacts. What actually constrains an agent is its own `tools:` frontmatter (`grep '^tools:' .claude/agents/*.md`, or `~/.claude/agents/*.md` in a global install), and Mission Control's grant includes `Write` and `Bash` — "delegates rather than implements" is how it is instructed to behave, not something the runtime prevents. The rail the grant does enforce is delegation depth: `grep -l '^tools:.*Task' .claude/agents/*.md` names every agent able to spawn another, so a squad agent cannot fan out further. For the irreversible step, branch protection on your own repo is what makes the human merge gate unbypassable.
|
|
993
|
+
|
|
994
|
+
**Parallel builds without collisions.** When the Build squad runs several tasks at once, each builder gets its own `army/<task>` branch in an isolated git worktree (`pan-tools worktree list` shows them), so two agents never edit the same working tree. Use `--no-build-worktrees` for small or strictly-serial projects; set `concurrency.serial_build: true` in `.planning/config.json` if your build tree corrupts under concurrent builds.
|
|
995
|
+
|
|
996
|
+
**Where those worktrees live, and how they leave.** Army worktrees are created as **siblings of your project directory** — a project at `~/code/myapp` gets `~/code/pan-army-<slug>/` — deliberately outside your tree so builders can never dirty it. They are scaffolding, not deliverables: the squash-merge into your protected branch is the permanent artifact. The campaign tears them down in two ways:
|
|
997
|
+
|
|
998
|
+
- **Per task, after its merge lands** (Phase 5): `pan-tools worktree remove <worktree_path> --branch <branch>`, the two values `worktree create` returned (`../pan-army-<slug>` and `army/<slug>`, the task name slugified). The `--branch` half matters — a squash-merged branch never looks merged to git, so deleting it explicitly is the only way it ever goes away.
|
|
999
|
+
- **At campaign end, and after any abort:** `pan-tools worktree cleanup`. The sweep removes every registered army worktree and its branch, prunes stale registrations, and deletes orphaned `army/*` branches — but it is deliberately cautious by default: a worktree with uncommitted changes, or a branch whose commits aren't reachable from your current branch (which may be the only copy of aborted work), is **kept and listed with the exact command to remove it**. `--force` sweeps those too. It never touches worktrees or branches outside the `army/` namespace.
|
|
1000
|
+
|
|
1001
|
+
A finished campaign should leave `pan-tools worktree list` empty. If it doesn't, run the sweep — leftover `pan-army-*` directories are a defect, not a souvenir.
|
|
1002
|
+
|
|
1003
|
+
**The loop.** Each cycle runs plan → delegate → execute → review → integrate → learn. Quality must return green before integration; the Release agent (`pan-release`) then prepares the squash-merge, runs your configured `verification` command, and surfaces an `always-ask` approval — a human merges to the protected branch, not a bot. Recovery is always `git revert` or redeploying the previous tag. Between missions, the campaign's learn step runs `/pan:retro` (and `/pan:learn` when traces exist) and names the recurring patterns in the plan for the next mission. Agent memory does not carry them, because PAN does not load it into agents.
|
|
1004
|
+
|
|
1005
|
+
**Running it:**
|
|
1006
|
+
|
|
1007
|
+
```text
|
|
1008
|
+
/pan:army "ship the v1 reporting module" --source backlog --max-cycles 5
|
|
1009
|
+
/pan:army "harden auth across the app" --squads architecture,build,quality --clean-seal
|
|
1010
|
+
/pan:army "<goal>" --dry-run # show the plan + squad delegation, run nothing
|
|
1011
|
+
/pan:army --status # campaign progress
|
|
1012
|
+
/pan:army --stop # graceful halt, state preserved
|
|
1013
|
+
```
|
|
1014
|
+
|
|
1015
|
+
The same caps that bound hierarchical exec bound the campaign — delegation-depth cap, per-cycle spawn/budget ceiling, and the `.planning/orchestration/abort` kill-switch — so a long campaign never relaxes a single safety rail. Campaign mode is built for Claude Code, because the squads are spawned as native sub-agents. Unlike `/pan:exec-phase --hierarchical`, which warns and runs flat on the other four runtimes, `/pan:army` has no runtime check or fallback of its own, so on those runtimes use the flat phase commands. That's a runtime constraint, not a model one — no model gate exists, and Mission Control runs on whatever model you launched with.
|
|
1016
|
+
|
|
1017
|
+
**Running it over days (scheduled, self-resuming).** `--schedule` arms a campaign that advances the backlog on a cadence instead of in one sitting ([ADR-0034](decisions/ADR-0034-scheduled-campaigns.md)):
|
|
1018
|
+
|
|
1019
|
+
```text
|
|
1020
|
+
/pan:army "burn down the v1 backlog" --schedule daily --daily-budget 200
|
|
1021
|
+
```
|
|
1022
|
+
|
|
1023
|
+
This writes a schedule descriptor (`.planning/orchestration/schedule.json`) — PAN does **not** run itself in the background (it's not a daemon). You wire an external trigger that polls `pan-tools campaign due` and runs `/pan:army --continue` when it reports due: a host scheduler (Claude Code routines / cron / scheduled tasks) or a `/loop`. Nothing surfaces a due campaign when you next open the project (ADR-0034's session-open nudge is not built), so without a trigger it waits until you run `/pan:army --continue`. The `--daily-budget` is advisory (it surfaces the day's spend) unless the schedule is armed with `--enforce-budget` (`/pan:army --schedule … --enforce-budget`, or `pan-tools campaign schedule --enforce-budget`), which pauses a due run once the day's spend is used up; `--advisory-budget` turns that back off. Manage it with `pan-tools campaign status` (active/paused, spent today, next-due) and `campaign schedule --pause | --resume | --disable`.
|
|
1024
|
+
|
|
1025
|
+
**The one thing scheduling never changes:** the merge to a protected branch stays an `always-ask` human gate. A scheduled campaign runs the backlog down to staged, reviewed, green PRs unattended — and waits for you at every merge. Autonomy runs up to the irreversible step, a human at the step.
|
|
1026
|
+
|
|
1027
|
+
### Army & project dashboard (`/pan:hud`)
|
|
1028
|
+
|
|
1029
|
+
`/pan:hud` (the old name `/pan:dashboard` still works) renders the whole picture of your project and its bot army as a **single, self-contained HTML page** — no server, no network, no external CSS or JS. It's a read-only *view*: every panel aggregates state PAN already tracks (`state.md`, the roadmap/phases on disk, the squad registry, the campaign schedule, army worktrees, the cost ledger, `requirements.md`, verification artifacts, and git history). The command writes only the rendered file, so it can never corrupt planning data.
|
|
1030
|
+
|
|
1031
|
+
```text
|
|
1032
|
+
/pan:hud # write .planning/hud.html
|
|
1033
|
+
/pan:hud --open # write it and launch in your default browser
|
|
1034
|
+
/pan:hud --out status.html
|
|
1035
|
+
/pan:hud --stdout > dashboard.html # print HTML instead of writing a file
|
|
1036
|
+
```
|
|
1037
|
+
|
|
1038
|
+
**What you see:** a mission banner (project, status, version/milestone, and metric cards for progress, current phase, requirements, and spend), the full roadmap with per-phase status, telemetry (spend, tokens, cache-hit rate, by-squad breakdown), requirements-and-quality with the latest verification artifacts, and recent commits.
|
|
1039
|
+
|
|
1040
|
+
**On an army project**, four extra panels appear: a command stack showing Mission Control over the four squads with per-squad agent drill-down, the campaign panel (cadence, next-due, daily-budget bar, run history), the safety harness (merge gate, abort switch, active worktrees, budget, concurrency), and the active `army/*` worktrees. These army panels self-hide on a plain (non-army) project, so you always get a complete, useful page (graceful degradation per [ADR-0035](decisions/ADR-0035-army-hud-dashboard.md)).
|
|
1041
|
+
|
|
1042
|
+
The file is fully self-contained — send `.planning/hud.html` to anyone and it opens with no dependencies. During a campaign, re-run after each cycle to watch squads, budget, worktrees, and committed output evolve.
|
|
1043
|
+
|
|
1044
|
+
**Per-phase reports (`/pan:report`).** Where `/pan:hud` renders the whole project at once, `/pan:report` (`pan-tools report phase <N> | index | all`) reuses the HUD's rendering to produce per-phase HTML reports — one page per phase, plus a project-level timeline index that links them together. Same self-contained, read-only, view-only guarantees as the dashboard.
|
|
1045
|
+
|
|
1046
|
+
### Git Integration
|
|
1047
|
+
|
|
1048
|
+
**Commit Format:**
|
|
1049
|
+
|
|
1050
|
+
PAN uses conventional commits with phase-plan scope:
|
|
1051
|
+
|
|
1052
|
+
```text
|
|
1053
|
+
{type}({phase}-{plan}): {description}
|
|
1054
|
+
```
|
|
1055
|
+
|
|
1056
|
+
Types for task commits: `feat`, `fix`, `test`, `refactor`, `perf`, `chore` (`references/git-integration.md`; `workflows/execute-plan.md`, which the executor loads, also lists `docs` and `style`). Planning-doc commits use `docs(...)` through `pan-tools commit`, whose `--type` accepts only `feat`, `fix`, `docs`, `test`, `refactor`, `perf`, `chore`
|
|
1057
|
+
|
|
1058
|
+
Example: `feat(03-02): add login endpoint`
|
|
1059
|
+
|
|
1060
|
+
**What Gets Committed:**
|
|
1061
|
+
|
|
1062
|
+
| Event | Commit |
|
|
1063
|
+
|-------|--------|
|
|
1064
|
+
| Each completed task | Individual commit by default (the executor may fold adjacent trivial tasks of one type, never `feat` or `fix`, into one commit) |
|
|
1065
|
+
| Plan completion | Metadata commit (`docs(XX-YY): complete <plan-name> plan`) |
|
|
1066
|
+
| Project init | `docs: initialize project`, `chore: add project config`, `docs: complete project research` (when research runs), `docs: define v1 requirements`, then `docs: create roadmap (N phases)` |
|
|
1067
|
+
| Planning docs | Controlled by `commit_docs` config |
|
|
1068
|
+
|
|
1069
|
+
**Branching Strategies (Detailed):**
|
|
1070
|
+
|
|
1071
|
+
When `branching_strategy: "phase"`:
|
|
1072
|
+
- A branch is created at exec-phase start using `phase_branch_template`
|
|
1073
|
+
- Example: `pan/phase-03-authentication`
|
|
1074
|
+
- All plan commits go to that branch
|
|
1075
|
+
- User merges branches after phase completion
|
|
1076
|
+
- Template variables: `{phase}` (zero-padded), `{slug}` (hyphenated name)
|
|
1077
|
+
|
|
1078
|
+
When `branching_strategy: "milestone"`:
|
|
1079
|
+
- First exec-phase of milestone creates milestone branch using `milestone_branch_template`
|
|
1080
|
+
- Example: `pan/v1.0-mvp`
|
|
1081
|
+
- All phases commit to same branch
|
|
1082
|
+
- After `/pan:milestone-done`, merge the milestone branch yourself (the command archives; it does not merge). Recommended options:
|
|
1083
|
+
|
|
1084
|
+
| Option | Git command | Result |
|
|
1085
|
+
|--------|-------------|--------|
|
|
1086
|
+
| Squash merge | `git merge --squash` | Single clean commit |
|
|
1087
|
+
| Merge with history | `git merge --no-ff` | Preserves all commits |
|
|
1088
|
+
| Delete without merging | `git branch -D` | Discard branch work |
|
|
1089
|
+
| Keep branches | (none) | Manual handling |
|
|
1090
|
+
|
|
1091
|
+
**Planning Doc Commits:**
|
|
1092
|
+
|
|
1093
|
+
When `commit_docs: false` or `.planning/` is gitignored, PAN automatically skips git operations for planning files. The `pan-tools commit` CLI handles this transparently.
|
|
1094
|
+
|
|
1095
|
+
### Requirement Tracing
|
|
1096
|
+
|
|
1097
|
+
PAN traces requirements from definition through implementation to verification:
|
|
1098
|
+
|
|
1099
|
+
```text
|
|
1100
|
+
requirements.md (checklist + traceability table)
|
|
1101
|
+
↓ REQ-01, REQ-02 assigned to phases in roadmap.md
|
|
1102
|
+
↓ Referenced in plan.md frontmatter: requirements: [REQ-01]
|
|
1103
|
+
↓ Auto-marked complete when the plan that lists them completes
|
|
1104
|
+
↓ Traceability table updated: Pending → Complete
|
|
1105
|
+
```
|
|
1106
|
+
|
|
1107
|
+
When each plan completes, the executor runs `pan-tools requirements mark-complete` for that plan's requirement IDs, updating both the checklist and the traceability table.
|
|
1108
|
+
|
|
1109
|
+
### Global Defaults
|
|
1110
|
+
|
|
1111
|
+
PAN supports global defaults at `~/.pan-wizard/defaults.json`. They seed each new project's `config.json` (when `config-ensure-section` creates it, or when you accept them in `/pan:new-project`); an existing project's config is not changed, and a key missing from a project's config falls back to the hardcoded default.
|
|
1112
|
+
|
|
1113
|
+
**Precedence:** `~/.pan-wizard/defaults.json` > hardcoded defaults when a config is created; after that PAN reads only the project's `.planning/config.json`, with the hardcoded default for any key it lacks
|
|
1114
|
+
|
|
1115
|
+
Example `~/.pan-wizard/defaults.json`:
|
|
1116
|
+
|
|
1117
|
+
```json
|
|
1118
|
+
{
|
|
1119
|
+
"model_profile": "budget",
|
|
1120
|
+
"parallelization": false,
|
|
1121
|
+
"workflow": {
|
|
1122
|
+
"research": false
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
```
|
|
1126
|
+
|
|
1127
|
+
A config seeded from this file starts on the budget profile, with sequential execution and per-phase research off. Individual projects can override these in their own config.json.
|
|
1128
|
+
|
|
1129
|
+
**Brave Search API key:** a file at `~/.pan-wizard/brave_api_key` (one line, the key only) makes a config that `config-ensure-section` creates (`/pan:settings` or `/pan:settings --profile` in a project with no config.json) start with `brave_search: true`; `/pan:new-project` does not set `brave_search`, so enable it with `pan-tools config-set brave_search true`. The search itself still needs `BRAVE_API_KEY` in the environment.
|
|
1130
|
+
|
|
1131
|
+
### Web Search
|
|
1132
|
+
|
|
1133
|
+
PAN research agents can search the web via Brave Search API.
|
|
1134
|
+
|
|
1135
|
+
**Setup:**
|
|
1136
|
+
|
|
1137
|
+
1. Get a free API key from [Brave Search API](https://brave.com/search/api/)
|
|
1138
|
+
2. Set the `BRAVE_API_KEY` environment variable — the only place the `websearch` verb reads it
|
|
1139
|
+
3. Turn it on with `pan-tools config-set brave_search true` (`/pan:new-project` does not set it; saving the key to `~/.pan-wizard/brave_api_key` only pre-sets it in a config `config-ensure-section` creates)
|
|
1140
|
+
|
|
1141
|
+
When configured, the phase researcher (`/pan:plan-phase`, `/pan:plan-phase --research-only`) searches with Brave instead of the built-in web search; the `/pan:new-project` and `/pan:milestone-new` researchers never receive the setting. The `brave_search` config option (default `false`; `true` only in a config `config-ensure-section` creates while a key is detected) controls whether this is enabled.
|
|
1142
|
+
|
|
1143
|
+
### Debug Logging
|
|
1144
|
+
|
|
1145
|
+
Every `pan-tools` command accepts `--verbose`:
|
|
1146
|
+
|
|
1147
|
+
```bash
|
|
1148
|
+
node pan-tools.cjs state load --verbose
|
|
1149
|
+
```
|
|
1150
|
+
|
|
1151
|
+
This sets `PAN_VERBOSE=1`. Few code paths use it: the archived-phase lookup writes a `[pan-tools]` line to stderr when `.planning/milestones/` cannot be read, and `drift-check` adds a `per_file` breakdown to its output. Most commands, `state load` included, print nothing extra.
|
|
1152
|
+
|
|
1153
|
+
---
|
|
1154
|
+
|
|
1155
|
+
## Troubleshooting
|
|
1156
|
+
|
|
1157
|
+
### "Project already initialized"
|
|
1158
|
+
|
|
1159
|
+
You ran `/pan:new-project` but `.planning/project.md` already exists. This is a safety check. If you want to start over, delete the `.planning/` directory first.
|
|
1160
|
+
|
|
1161
|
+
### Context Degradation During Long Sessions
|
|
1162
|
+
|
|
1163
|
+
Clear your context window between major commands: `/clear` in Claude Code. PAN is designed around fresh contexts -- every subagent gets a clean context window. If quality is dropping in the main session, clear and use `/pan:resume` or `/pan:progress` to restore state.
|
|
1164
|
+
|
|
1165
|
+
### Plans Seem Wrong or Misaligned
|
|
1166
|
+
|
|
1167
|
+
Run `/pan:discuss-phase N` before planning. Most plan quality issues come from Claude making assumptions that `context.md` would have prevented. You can also run `/pan:assumptions N` to see what Claude intends to do before committing to a plan.
|
|
1168
|
+
|
|
1169
|
+
### Execution Fails or Produces Stubs
|
|
1170
|
+
|
|
1171
|
+
Check that the plan was not too ambitious. Plans should have 2-3 tasks maximum. If tasks are too large, they exceed what a single context window can produce reliably. Re-plan with smaller scope.
|
|
1172
|
+
|
|
1173
|
+
### Lost Track of Where You Are
|
|
1174
|
+
|
|
1175
|
+
Run `/pan:progress`. It reads all state files and tells you exactly where you are and what to do next.
|
|
1176
|
+
|
|
1177
|
+
### Need to Change Something After Execution
|
|
1178
|
+
|
|
1179
|
+
Do not re-run `/pan:exec-phase`. Use `/pan:quick` for targeted fixes, or `/pan:verify-phase` to re-verify the phase and list gaps, then `/pan:plan-phase N --gaps`.
|
|
1180
|
+
|
|
1181
|
+
### Model Costs Too High
|
|
1182
|
+
|
|
1183
|
+
Switch to budget profile: `/pan:settings --profile budget`. Research is already off by default; disable the plan-check agent via `/pan:settings` if the domain is familiar. Pin one agent to a cheaper tier with `model_overrides` in config.json, for example `"model_overrides": {"pan-verifier": "fast"}`. Complexity routing and per-phase `<!-- model_tier: fast -->` comments are no cost lever today: no workflow passes the task metadata or the phase they need. Complexity routing's one effect on a workflow is under `budget`, where it keeps a `/pan:exec-phase --gaps-only` retry on the tier that left the gaps instead of escalating it.
|
|
1184
|
+
|
|
1185
|
+
### Working on a Sensitive/Private Project
|
|
1186
|
+
|
|
1187
|
+
Set `commit_docs: false` during `/pan:new-project` or with `pan-tools config-set commit_docs false` (`/pan:settings` has no `commit_docs` question). Add `.planning/` to your `.gitignore`. Planning artifacts stay local and never touch git.
|
|
1188
|
+
|
|
1189
|
+
### PAN Update Overwrote My Local Changes
|
|
1190
|
+
|
|
1191
|
+
The installer backs up locally modified files to `pan-local-patches/`. Run `/pan:patches` to merge your changes back.
|
|
1192
|
+
|
|
1193
|
+
### Subagent Appears to Fail but Work Was Done
|
|
1194
|
+
|
|
1195
|
+
A known workaround exists for a Claude Code classification bug. PAN's orchestrators (exec-phase, quick) spot-check actual output before reporting failure. If you see a failure message but commits were made, check `git log` -- the work may have succeeded.
|
|
1196
|
+
|
|
1197
|
+
### Phase Execution Hangs or Takes Too Long
|
|
1198
|
+
|
|
1199
|
+
**Cause:** Complex plans with many dependencies, or agent model too weak for the task.
|
|
1200
|
+
**Fix:** Check the plan complexity (number of tasks, wave count). If you're on the `budget` profile, the executor is running a mid-tier model — switch back to `balanced` (`/pan:settings --profile balanced`) so it inherits your session model, or lift just that agent with `"model_overrides": {"pan-executor": "opus"}` in `.planning/config.json` (override values are tiers: `opus` means the reasoning tier, so the executor inherits your session model rather than switching to Opus). Conversely, if simple tasks feel slow, the reasoning tier is the cost: the `budget` profile or a `model_overrides` entry trades depth for speed. (`quality` and `balanced` resolve the executor identically; the two differ only in the researchers and the plan-checker, and in how much ceremony a phase gets.)
|
|
1201
|
+
|
|
1202
|
+
### Plan Rejected by Checker Multiple Times
|
|
1203
|
+
|
|
1204
|
+
**Cause:** Plan-checker found structural issues the planner keeps reproducing.
|
|
1205
|
+
**Fix:** Run `/pan:discuss-phase N` to capture more context, then re-plan. Or disable the checker temporarily: set `workflow.plan_check: false` in `/pan:settings`. Check plan.md manually for missing `verify` commands on tasks or empty `must_haves` sections. A send-back before any checker runs comes from the code checks (`verify plan-set`, `verify review-focus`, `verify decisions`); run the named command on the phase to see the failing plan (see [Plans sent back for Review Focus or design decisions](TROUBLESHOOTING.md#plans-sent-back-for-review-focus-or-design-decisions)).
|
|
1206
|
+
|
|
1207
|
+
### Research Phase Returns Irrelevant Results
|
|
1208
|
+
|
|
1209
|
+
**Cause:** Phase goal is too vague, or domain is highly specialized.
|
|
1210
|
+
**Fix:** Run `/pan:discuss-phase N` first to sharpen requirements. Or leave research off (it is off by default; `--research` turns it on for one phase) if you already know the domain well.
|
|
1211
|
+
|
|
1212
|
+
### Verification Found Issues After Execution
|
|
1213
|
+
|
|
1214
|
+
**Cause:** Verifier detected gaps between phase goals and actual implementation.
|
|
1215
|
+
**Fix:** Read `.planning/phases/XX-name/XX-verification.md` for details. Run `/pan:plan-phase N --gaps` to create the gap-closure plans, then `/pan:exec-phase N --gaps-only` to execute only those.
|
|
1216
|
+
|
|
1217
|
+
### Git Commits Not Appearing
|
|
1218
|
+
|
|
1219
|
+
**Cause:** `commit_docs: false` in config, or `.planning/` is in `.gitignore`.
|
|
1220
|
+
**Fix:** Check `commit_docs` in `.planning/config.json` (`/pan:settings` does not show it). If you want planning docs committed, set `commit_docs: true` and remove `.planning/` from `.gitignore`. Code commits (task completions) are always created regardless of this setting.
|
|
1221
|
+
|
|
1222
|
+
### Context Monitor Warnings Not Showing
|
|
1223
|
+
|
|
1224
|
+
**Cause:** Hooks not installed, the session not yet near its compaction point (the note comes only when about a third of the room before compaction is left), or a runtime the monitor cannot measure. Gemini CLI and OpenCode run no context monitor. PAN registers the monitor only on Claude Code. On Codex there is no PAN status line and the monitor cannot read Codex's transcript. On Copilot CLI the hook payload names the session `sessionId`, which the monitor never read. In both cases it measured nothing, so PAN no longer registers it there (see [Feature Availability](#feature-availability)).
|
|
1225
|
+
**Fix:** Re-run `npx pan-wizard` to reinstall hooks. Check `.claude/settings.json` (local install) or `~/.claude/settings.json` (global) for hook registration. On Claude Code the monitor reads PAN's status line bridge (`<os-tmpdir>/pan-hooks-{uid}/claude-ctx-{session_id}.json`) when it is fresh, and the session transcript otherwise, so headless `claude -p` runs are covered. Read from the transcript, a native-1M model on Bedrock, Google Cloud or Foundry gives no note while it runs a 200K window there, because the transcript cannot tell that window from 1M; on a 1M window the note still comes, since a context past 200K tokens can only be in a 1M window.
|
|
1226
|
+
|
|
1227
|
+
### Wrong Model Being Used for Agents
|
|
1228
|
+
|
|
1229
|
+
**Cause:** Profile override or stale config.
|
|
1230
|
+
**Fix:** Check current profile: review `.planning/config.json` for `model_profile`, `model_overrides`, and `routing` settings. Switch profiles with `/pan:settings --profile balanced`. Per-agent overrides in `model_overrides` take precedence over profile, per-phase overrides, and routing strategy.
|
|
1231
|
+
|
|
1232
|
+
### Phase Will Not Complete (Phase Gate Refused)
|
|
1233
|
+
|
|
1234
|
+
**Cause:** `phase complete` runs the phase gate, and `workflow.phase_gate` defaults to `enforce` (a config without the key reads as `enforce`): a plan without a summary, a missing, failing or stale verification, an open critical or high finding, a committed stub or a weakened test refuses the completion with `phase_gate_refused`.
|
|
1235
|
+
**Fix:** `pan-tools phase gate <N>` lists each reason and its fix. Fix them and complete again, or override once with `pan-tools phase complete <N> --force --reason "<why>"` (recorded as a decision), or make the gate advisory with `pan-tools config-set workflow.phase_gate warn`. See [Phase gate refuses to complete a phase](TROUBLESHOOTING.md#phase-gate-refuses-to-complete-a-phase).
|
|
1236
|
+
|
|
1237
|
+
### Decimal Phase Numbering Issues
|
|
1238
|
+
|
|
1239
|
+
**Cause:** Inserted phases (e.g., 3.1) may not sort correctly in some views.
|
|
1240
|
+
**Fix:** PAN handles decimal phases natively. Use `/pan:insert-phase 3 "description"` to create them properly. Phase sorting uses numeric comparison, not string sorting (so 3.2 < 3.10).
|
|
1241
|
+
|
|
1242
|
+
---
|
|
1243
|
+
|
|
1244
|
+
## Recovery Quick Reference
|
|
1245
|
+
|
|
1246
|
+
| Problem | Solution |
|
|
1247
|
+
|---------|----------|
|
|
1248
|
+
| Lost context / new session | `/pan:resume` or `/pan:progress` |
|
|
1249
|
+
| Phase went wrong | `git revert` the phase commits, then re-plan |
|
|
1250
|
+
| Need to change scope | `/pan:add-phase`, `/pan:insert-phase`, or `/pan:remove-phase` |
|
|
1251
|
+
| Milestone audit found gaps | `/pan:milestone-audit --gaps` |
|
|
1252
|
+
| Something broke | `/pan:debug "description"` |
|
|
1253
|
+
| Quick targeted fix | `/pan:quick` |
|
|
1254
|
+
| Plan doesn't match your vision | `/pan:discuss-phase N` then re-plan |
|
|
1255
|
+
| Costs running high | `/pan:settings --profile budget`, `model_overrides` for one agent, toggle agents off via `/pan:settings` |
|
|
1256
|
+
| Update broke local changes | `/pan:patches` |
|
|
1257
|
+
| Phase gate refused completion | `pan-tools phase gate <N>`, fix the reasons; or `phase complete <N> --force --reason "<why>"` |
|
|
1258
|
+
|
|
1259
|
+
---
|
|
1260
|
+
|
|
1261
|
+
## Multi-Runtime Reference
|
|
1262
|
+
|
|
1263
|
+
PAN supports five runtimes. The core workflow is identical across all — the differences are in command syntax, file locations, and format.
|
|
1264
|
+
|
|
1265
|
+
### Command Syntax
|
|
1266
|
+
|
|
1267
|
+
| Runtime | Prefix | Example |
|
|
1268
|
+
|---------|--------|---------|
|
|
1269
|
+
| Claude Code | `/pan:` | `/pan:new-project` |
|
|
1270
|
+
| OpenCode | `/pan-` | `/pan-new-project` |
|
|
1271
|
+
| Gemini CLI | `/pan:` | `/pan:new-project` |
|
|
1272
|
+
| Codex | `$pan-` | `$pan-new-project` |
|
|
1273
|
+
| Copilot CLI | `/pan-` | `/pan-new-project` |
|
|
1274
|
+
|
|
1275
|
+
### Installation Locations
|
|
1276
|
+
|
|
1277
|
+
| Runtime | Global | Local |
|
|
1278
|
+
|---------|--------|-------|
|
|
1279
|
+
| Claude Code | `~/.claude/` | `./.claude/` |
|
|
1280
|
+
| OpenCode | `~/.config/opencode/` | `./.opencode/` |
|
|
1281
|
+
| Gemini CLI | `~/.gemini/` | `./.gemini/` |
|
|
1282
|
+
| Codex | `~/.codex/` | `./.codex/` |
|
|
1283
|
+
| Copilot CLI | `~/.copilot/` | `./.github/` |
|
|
1284
|
+
|
|
1285
|
+
> **Gemini CLI audience change:** from June 18, 2026, Google's Gemini CLI serves Gemini Code Assist (Standard/Enterprise) customers; individual free / AI Pro / Ultra accounts are directed to Antigravity CLI instead. PAN's `--gemini` install targets Gemini CLI and continues to work for those customers. Antigravity CLI is not yet a PAN install target, but it reads the shared `.agents/skills/` tree natively — install with `--unified-skills` (below) and PAN's command set is usable from Antigravity in the same project.
|
|
1286
|
+
|
|
1287
|
+
### MCP server registration
|
|
1288
|
+
|
|
1289
|
+
Every install also registers PAN's **MCP bridge**, which exposes the `pan-tools` engine
|
|
1290
|
+
to any MCP client as tools and resources. This happens automatically — there is no flag —
|
|
1291
|
+
and it writes **one file outside the runtime's own directory** for Claude Code, so it is
|
|
1292
|
+
worth knowing about:
|
|
1293
|
+
|
|
1294
|
+
| Runtime | File written | Key |
|
|
1295
|
+
|---|---|---|
|
|
1296
|
+
| Claude Code | **`.mcp.json` at your project root** | `mcpServers` |
|
|
1297
|
+
| Copilot CLI | `.github/mcp.json` | `mcpServers` |
|
|
1298
|
+
| Gemini CLI | `.gemini/settings.json` (merged alongside hooks) | `mcpServers` |
|
|
1299
|
+
| OpenCode | `.opencode/opencode.json` (merged alongside permissions) | `mcp` |
|
|
1300
|
+
| Codex | *nothing* — a copy-pasteable TOML snippet is printed instead | — |
|
|
1301
|
+
|
|
1302
|
+
The merge is non-destructive: any MCP servers you already had are preserved, and a config
|
|
1303
|
+
file PAN cannot parse is **left untouched** and reported rather than rewritten. Uninstall
|
|
1304
|
+
removes only PAN's `pan` entry, deleting the file only if PAN was its sole occupant.
|
|
1305
|
+
|
|
1306
|
+
Two deliberate exceptions. **Codex** keeps MCP config in `config.toml`, and PAN is
|
|
1307
|
+
zero-dependency with no TOML merger — hand-editing your config is riskier than printing a
|
|
1308
|
+
snippet, so it prints one. **A global Claude install writes nothing**, because user-scope
|
|
1309
|
+
MCP config lives in `~/.claude.json`, a file keyed by every project you have ever opened;
|
|
1310
|
+
the installer prints the `claude mcp add` command instead.
|
|
1311
|
+
|
|
1312
|
+
Claude Code prompts once to approve a project-scoped server. Verify a registration with
|
|
1313
|
+
`pan-tools validate deployment` — its `mcp` block tells you whether the entry is present,
|
|
1314
|
+
parseable, and pointing at a server that exists.
|
|
1315
|
+
|
|
1316
|
+
### Unified skills tree (`--unified-skills`, ADR-0028 Phase 1 — alpha)
|
|
1317
|
+
|
|
1318
|
+
Adding `--unified-skills` to any install compiles PAN's commands **once** into the runtime-neutral `.agents/skills/` tree (project root for local installs, `~/.agents/skills/` for global) instead of the per-runtime command formats below. The tree follows the Agent Skills standard (`SKILL.md` per skill directory) and the proprietary command surface is swept so commands don't resolve twice. Codex, Gemini CLI, OpenCode, Copilot CLI and Antigravity CLI list `.agents/skills/` among their skill locations. **Claude Code does not** — its skills documentation names only `.claude/skills/<name>/SKILL.md` locations, plugin skills and the legacy `.claude/commands/` — so for Claude the installer also copies every compiled skill, unchanged, into `.claude/skills/`, and PAN's commands there are `/pan-<name>` rather than `/pan:<name>`. On Gemini CLI skills have no slash command of their own; the model activates one when a request matches its description, and `/skills list` shows what loaded. Agents, hooks, and settings still install per-runtime.
|
|
1319
|
+
|
|
1320
|
+
```bash
|
|
1321
|
+
npx pan-wizard --claude --local --unified-skills
|
|
1322
|
+
```
|
|
1323
|
+
|
|
1324
|
+
Unified installs also ship a shared `pan-wizard-core` copy at `.agents/pan-wizard-core/`, which the compiled skills resolve against — so the tree's content is the same no matter which runtime installed it, and several runtimes can share one install safely. Uninstalls are ref-counted: the shared tree stays until the last runtime tracking it uninstalls. Alpha status reflects that per-runtime discovery of the installed skills hasn't been live-verified on every runtime yet — see ADR-0028.
|
|
1325
|
+
|
|
1326
|
+
### File Format Differences
|
|
1327
|
+
|
|
1328
|
+
| Component | Claude Code | OpenCode | Gemini | Codex | Copilot CLI |
|
|
1329
|
+
|-----------|------------|----------|--------|-------|-------------|
|
|
1330
|
+
| Commands | `commands/pan/*.md` | `commands/pan-*.md` | `commands/pan/*.toml` | `.agents/skills/pan-*/SKILL.md`¹ | `skills/pan-*/SKILL.md` |
|
|
1331
|
+
| Agents | `agents/*.md` | `agents/*.md` | `agents/*.md` | `agents/*.toml` | `agents/*.agent.md` |
|
|
1332
|
+
| Hooks | `hooks/*.js` in settings.json | Not supported | `hooks/*.js` in settings.json | `hooks/*.js`, registered in `.codex/hooks.json`¹ | `hooks/*.js`, registered in `.github/hooks/pan.json`² |
|
|
1333
|
+
| Config | `settings.json` | `opencode.json` | `settings.json` | `config.toml` | `.github/copilot/settings.json` (local) / `~/.copilot/settings.json` (global) |
|
|
1334
|
+
|
|
1335
|
+
Codex and Copilot CLI use a "skills" format rather than slash commands. Each command becomes a skill directory with a `SKILL.md` file. Copilot CLI agents use `.agent.md` extension. The content is equivalent — only the container format differs.
|
|
1336
|
+
|
|
1337
|
+
¹ **Codex (since June 2026):** skills install to the shared `.agents/skills/` tree at the project root (local installs) or `~/.agents/skills/` (global installs) — Codex no longer reads `$CODEX_HOME/skills`. Codex agents are standalone TOML files in `.codex/agents/` (required fields `name`/`description`/`developer_instructions`; PAN's per-agent `effort` maps to `model_reasoning_effort`). Note that project-scoped `.codex/` configuration only loads once the project is **trusted** in Codex — the installer prints a reminder.
|
|
1338
|
+
|
|
1339
|
+
² **Copilot CLI (since June 2026):** hook registration lives in `.github/hooks/pan.json` (Copilot CLI's `version: 1` schema with `type: "command"` entries), not in `config.json`. PAN's hooks are Node.js scripts invoked via the cross-platform `command` key, so they run on Windows and Unix alike. Reinstalling migrates any hook registrations left in `config.json` by older PAN versions.
|
|
1340
|
+
|
|
1341
|
+
### Feature Availability
|
|
1342
|
+
|
|
1343
|
+
| Feature | Claude Code | OpenCode | Gemini | Codex | Copilot CLI |
|
|
1344
|
+
|---------|------------|----------|--------|-------|-------------|
|
|
1345
|
+
| All commands | Yes | Yes | Yes | Yes | Yes |
|
|
1346
|
+
| All agents | Yes | Yes | Yes | Yes | Yes |
|
|
1347
|
+
| Hooks: update check, context monitor, cost + trace loggers | Yes | No | Update check only (Gemini has no context metric or subagent event for the others) | Update check and loggers (no context monitor: it cannot measure on Codex) | Update check and loggers (no context monitor: it cannot measure on Copilot) |
|
|
1348
|
+
| Statusline (the context bridge the monitor reads) | Yes | No | No (Gemini CLI has no statusline command) | No | Yes (the monitor does not read it there) |
|
|
1349
|
+
| Stop guard (auto-advance boundary) | Yes | No | Yes | Yes | Yes |
|
|
1350
|
+
| State re-injection after context compaction | Yes | Yes (a plugin adds PAN's position to the compaction prompt) | Yes (two steps: `PreCompress` marks, `AfterTool` injects) | Yes | Yes (two steps: `preCompact` marks, `postToolUse` injects) |
|
|
1351
|
+
| Model profiles | Yes | Yes | Yes | Yes | Yes |
|
|
1352
|
+
| Wave-based parallel execution | Yes | Depends on runtime | Depends on runtime | Yes | Yes |
|
|
1353
|
+
| Hierarchical exec (`/pan:exec-phase --hierarchical`) | Yes | No (flat fallback) | No (flat fallback) | No (flat fallback) | No (flat fallback) |
|
|
1354
|
+
| Bot-army campaigns (`/pan:army`) | Yes | No gate or fallback | No gate or fallback | No gate or fallback | No gate or fallback |
|
|
1355
|
+
| `--dangerously-skip-permissions` | Yes | N/A | N/A | N/A | N/A |
|
|
1356
|
+
|
|
1357
|
+
Hooks are supported by Claude Code, Gemini CLI, Codex (since June 2026, via `.codex/hooks.json` with Claude-compatible event names), and Copilot CLI. OpenCode runs no command hooks; instead PAN installs one OpenCode plugin, `.opencode/plugins/pan-wizard.js`, which adds PAN's position to the compaction prompt. On Gemini CLI PAN registers the update check (`SessionStart`), the stop guard (`AfterAgent`, Gemini's end-of-turn event) and the state re-injection's two steps (`PreCompress` and `AfterTool`). Gemini exposes no context-window usage to hooks and has no subagent-completion event, so the context monitor and the cost and trace loggers do not run there. Two trust gates can keep registered hooks from running: headless Copilot (`copilot -p`) loads repository hooks only in a trusted folder (see [Troubleshooting](TROUBLESHOOTING.md#pans-hooks-do-not-run-under-copilot--p)), and Codex skips a new or changed hook until you trust it in `/hooks` — repeat that after a PAN upgrade that changes the hooks.
|
|
1358
|
+
|
|
1359
|
+
**Copilot CLI interaction handling:** Copilot CLI has no structured input controls (no checkboxes, radio buttons, or multi-select). PAN Wizard's install-time converter automatically rewrites `AskUserQuestion` blocks into numbered text menus with clear selection instructions. Single-select questions show "Type a number or label to choose", multi-select shows "Type the numbers you want, separated by commas (e.g., 1,3)". This runs transparently during installation — no user configuration needed.
|
|
1360
|
+
|
|
1361
|
+
---
|
|
1362
|
+
|
|
1363
|
+
## Project File Structure
|
|
1364
|
+
|
|
1365
|
+
For reference, here is what PAN creates in your project:
|
|
1366
|
+
|
|
1367
|
+
```text
|
|
1368
|
+
.planning/
|
|
1369
|
+
project.md # Project vision and context (always loaded)
|
|
1370
|
+
requirements.md # Scoped v1/v2 requirements with IDs
|
|
1371
|
+
roadmap.md # Phase breakdown with status tracking
|
|
1372
|
+
state.md # Decisions, blockers, session memory
|
|
1373
|
+
state-history.md # Settled state history, archived by state compact
|
|
1374
|
+
roadmap-history.md # Shipped phases' full sections, archived by roadmap compact
|
|
1375
|
+
memory/ # Agent memory logs (recorded by hand; no workflow loads them), archive/, quarantine.md
|
|
1376
|
+
config.json # Workflow configuration
|
|
1377
|
+
milestones.md # Index of completed milestones
|
|
1378
|
+
milestones/ # Per-version archives (v{version}-roadmap.md, v{version}-requirements.md) from /pan:milestone-done
|
|
1379
|
+
patterns.md # Error patterns (PAT-NNN), read when present; nothing PAN ships writes it
|
|
1380
|
+
session-history.md # Session summaries, counted when present; nothing PAN ships writes it
|
|
1381
|
+
research/ # Answers to open questions, only with /pan:new-project --research
|
|
1382
|
+
todos/
|
|
1383
|
+
pending/ # Captured ideas awaiting work
|
|
1384
|
+
completed/ # Todos completed via /pan:todo-check or `pan-tools todo complete`
|
|
1385
|
+
debug/ # Active debug sessions
|
|
1386
|
+
resolved/ # Archived debug sessions
|
|
1387
|
+
codebase/ # Brownfield codebase mapping (from /pan:map-codebase)
|
|
1388
|
+
quick/ # Quick mode task plans and summaries
|
|
1389
|
+
phases/
|
|
1390
|
+
XX-phase-name/
|
|
1391
|
+
XX-YY-plan.md # Atomic execution plans
|
|
1392
|
+
XX-YY-summary.md # Execution outcomes and decisions
|
|
1393
|
+
XX-context.md # Your implementation preferences
|
|
1394
|
+
XX-research.md # Answers to the phase's open questions (only with --research)
|
|
1395
|
+
XX-roadmap-slice.md # This phase's roadmap and requirements lines, read by phase agents
|
|
1396
|
+
XX-validation.md # Test coverage mapping (Nyquist layer)
|
|
1397
|
+
XX-verification.md # Post-execution verification results
|
|
1398
|
+
XX-uat.md # User acceptance testing results (/pan:verify-phase --uat)
|
|
1399
|
+
XX-review.md # Code review report, saved by exec-phase
|
|
1400
|
+
XX-plan-check.md # Plan-checker report, saved by plan-phase
|
|
1401
|
+
XX-design.md # Phase design (architecture, phase ADR, threat-lite), written by /pan:design-phase
|
|
1402
|
+
XX-design-check.md # Design-checker report, saved by /pan:design-phase (the judges' findings go to .planning/findings.jsonl)
|
|
1403
|
+
```
|
|
1404
|
+
|
|
1405
|
+
### File Details
|
|
1406
|
+
|
|
1407
|
+
| File | Created by | Purpose | Size guidance |
|
|
1408
|
+
|------|-----------|---------|---------------|
|
|
1409
|
+
| `project.md` | `/pan:new-project` | Project vision, goals, constraints. Always loaded into agent context. | No set limit; `/pan:hygiene` warns when it grows large |
|
|
1410
|
+
| `requirements.md` | `/pan:new-project` | Scoped requirements (v1/v2/out-of-scope) with unique IDs for traceability. | No limit |
|
|
1411
|
+
| `roadmap.md` | `/pan:new-project` | Phase breakdown with status (Not started / In progress / Complete / Deferred). The single source of truth for progress. | No limit |
|
|
1412
|
+
| `state.md` | `/pan:new-project` | Decisions made, blockers, cross-session memory. Updated after every plan and at each phase transition. | Keep under 100 lines (`templates/state.md`); `state compact` moves settled history to `state-history.md` |
|
|
1413
|
+
| `state-history.md` | `pan-tools state compact --apply` (or `/pan:hygiene --apply`) | Settled state history moved out of state.md, so it stops being re-read on every agent call. | Append-only archive |
|
|
1414
|
+
| `roadmap-history.md` | `pan-tools roadmap compact --apply` (or `/pan:hygiene --apply`) | Shipped phases' full sections; roadmap.md keeps a stub, and `roadmap get-phase` reads the full section back from here. | Append-only archive |
|
|
1415
|
+
| `memory/` | `memory append` / `memory record`, `/pan:retro --write-memory`, `memory optimize` | Agent memory logs, their `archive/`, and PAN's archives (`quarantine.md`, `state-archive.md`). No workflow loads them into agents; `/pan:knowledge` reads the logs. | `/pan:hygiene` reports stale entries |
|
|
1416
|
+
| `config.json` | `/pan:new-project` | Workflow configuration (mode, depth, profile, toggles). See [Configuration Reference](#configuration-reference). | Auto-managed |
|
|
1417
|
+
| `milestones.md` + `milestones/` | `/pan:milestone-done` | Index of completed milestones with dates and summaries, plus the per-version `v{version}-roadmap.md` / `v{version}-requirements.md` archives. | Append-only |
|
|
1418
|
+
| `patterns.md` | Nothing PAN ships (`appendErrorPattern()` has no caller); `learnings extract`, `preflight` and `/pan:focus-auto --step scan` read it when it exists | Error patterns (PAT-NNN) for cross-session learning. | Append-only, auto-increment |
|
|
1419
|
+
| `session-history.md` | Nothing PAN ships (`appendSessionSummary()` has no caller); `pan-tools progress health` counts its entries when it exists | Session summaries with phase, test counts, decisions. | Keeps last 20 entries |
|
|
1420
|
+
| `research/` | `/pan:new-project --research` | `questions.md` (at most 5 open questions that block building) and `research-summary.md` (one answer per question, with its source, plus v2 ideas). Only when research was asked for. | Read-only after creation |
|
|
1421
|
+
| `codebase/` | `/pan:map-codebase` | Brownfield analysis — the codebase-map documents (`stack.md`, `integrations.md`, `architecture.md`, `structure.md`, `conventions.md`, `testing.md`, `concerns.md`, `relationships.md`, `best-practices.md`). | Read-only after creation |
|
|
1422
|
+
| `XX-context.md` | `/pan:discuss-phase` | Your implementation preferences for a phase. Feeds into research and planning. | No set limit |
|
|
1423
|
+
| `XX-research.md` | `/pan:plan-phase --research` (or `workflow.research: true`) | Answers to the phase's open questions, each with a source or a recorded assumption. | Read-only after creation |
|
|
1424
|
+
| `XX-roadmap-slice.md` | `/pan:plan-phase`, `/pan:plan-phase --research-only`, `/pan:exec-phase`, `/pan:verify-phase` | The phase's section of roadmap.md, its dependencies' goals and its requirement lines; the researcher, planner, checker, executors and verifier read it instead of the whole files. | Rewritten when it changes |
|
|
1425
|
+
| `XX-YY-plan.md` | `/pan:plan-phase` | Atomic execution plan with XML-structured tasks, verification steps. | 2-3 tasks per plan |
|
|
1426
|
+
| `XX-validation.md` | `/pan:plan-phase` | Test coverage mapping — which tests verify which requirements. | Auto-generated |
|
|
1427
|
+
| `XX-YY-summary.md` | `/pan:exec-phase` | What was built, files changed, decisions made during execution. | Auto-generated |
|
|
1428
|
+
| `XX-verification.md` | `/pan:exec-phase`, `/pan:verify-phase` | Goal-backward check — did the phase deliver what it promised? | Auto-generated |
|
|
1429
|
+
| `XX-uat.md` | `/pan:verify-phase --uat` (the walkthrough scaffolds it and records each of your answers through `pan-tools uat record`); its diagnosis step, or the native `/pan-diagnose-issues` script on Claude Code, writes root causes into its gaps | Manual acceptance-test record. | One entry per acceptance test |
|
|
1430
|
+
|
|
1431
|
+
### Privacy
|
|
1432
|
+
|
|
1433
|
+
By default, `.planning/` is committed to git. To keep it private:
|
|
1434
|
+
|
|
1435
|
+
1. Set `commit_docs: false` in config.json
|
|
1436
|
+
2. Add `.planning/` to `.gitignore`
|
|
1437
|
+
3. If previously tracked: `git rm -r --cached .planning/ && git commit -m "chore: stop tracking planning docs"`
|