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,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pan:autodev
|
|
3
|
+
group: Phase Lifecycle
|
|
4
|
+
description: Run the roadmap unattended — a deterministic loop that plans, executes, verifies and completes phase after phase, each step in a fresh host session, and stops in code
|
|
5
|
+
argument-hint: "[run | resume | status | report | replay] [--host claude|codex|gemini|opencode] [--max-usd N] [--max-usd-day N] [--max-turns N] [--worktrees] [--quality] [--ci [local] [--ci-rounds N] [--ci-push] [--ci-base B]] [--run <id>]"
|
|
6
|
+
allowed-tools:
|
|
7
|
+
- Read
|
|
8
|
+
- Bash
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<objective>
|
|
12
|
+
Drive the project's roadmap with no model in the control loop. `pan-tools autodev` is a foreground Node process: each turn it reads `.planning/` from disk, asks the next-action router for the next unit (plan, execute or verify a phase, or complete a verified one), and runs it. Plan, execute and verify units each get a fresh headless session on the host; `phase complete` runs in the engine, so the phase gate decides.
|
|
13
|
+
|
|
14
|
+
It stops in code, with one of these reasons:
|
|
15
|
+
|
|
16
|
+
| Stop | Meaning |
|
|
17
|
+
|------|---------|
|
|
18
|
+
| `done` | Every phase is finished; the milestone audit is next |
|
|
19
|
+
| `human_needed` | A verifier asked for a human check, or there is no roadmap |
|
|
20
|
+
| `gate_failed` | The phase gate refused to complete a phase |
|
|
21
|
+
| `ci_failed` | With `--ci`: the pull request checks (or, with `--ci local`, the project's own gate) still failed after the fix rounds |
|
|
22
|
+
| `forecast_exceeded` | An execute unit cost more than the project's p90 forecast for it |
|
|
23
|
+
| `budget_usd` | Spend reached `--max-usd` (the run) or `--max-usd-day` (today, across runs) |
|
|
24
|
+
| `turns` | `--max-turns` units have run (20 when not given) |
|
|
25
|
+
| `no_progress` | A unit ran and changed nothing on disk |
|
|
26
|
+
|
|
27
|
+
Two options change how units run:
|
|
28
|
+
|
|
29
|
+
- `--worktrees`: a phase with two or more plans runs each plan in its own git worktree and session (`/pan:exec-phase N --plan <id>`). Plans of a wave that share a file run one after the other. Before a group of plans is merged back, `pan-tools worktree preflight` merges them onto HEAD in a throwaway worktree and runs the tests: branches that pass alone but break together, or conflict, stop the run for a human.
|
|
30
|
+
- `--ci`: after each completed phase, the pull request's checks (GitHub's `gh` CLI) are the oracle. A check that already fails on the base branch is ignored. A failure starts a fix round, a fresh session given the failing checks and log; after `--ci-rounds` rounds (3) the run stops with `ci_failed`. The checks must be for HEAD: push the branch yourself, or pass `--ci-push` to have autodev push after each phase.
|
|
31
|
+
- `--ci local`: the same rounds with no pull request: the oracle is the project's own gate, run here after each completed phase — `npm run ci:local` when `package.json` has that script, else `npm test`. Its exit code decides, and its output is the fix round's feedback.
|
|
32
|
+
|
|
33
|
+
A failed session is classified before anything else happens: a compile or assertion failure is retried with its error in the prompt, then once more at a higher tier; a timeout or an unknown failure is restarted once; a missing CLI or login, a merge conflict, the guard's deny or an undeclared file stops for a human.
|
|
34
|
+
</objective>
|
|
35
|
+
|
|
36
|
+
<process>
|
|
37
|
+
1. **Check the subcommand** in `$ARGUMENTS`: `run` (the default), `resume`, `status`, `report` or `replay`.
|
|
38
|
+
|
|
39
|
+
2. **Status** only reports the latest run (or `--run <id>`):
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs autodev status
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
3. **Run or resume.** Say what will happen first: which host runs the sessions (`--host`, Claude Code by default; Copilot CLI has no unattended adapter yet), and the spend and unit caps. Each session spends on that host, so a run needs a spend cap: `--max-usd`, or `budget.max_usd_run` in `.planning/config.json` (and optionally a day cap, `--max-usd-day` or `budget.max_usd_day`). Ask the user for the cap if neither is set; it is their approval. Then run it in the foreground and wait; a run can take hours:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs autodev run --host claude --max-usd 20 --max-turns 12
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Add `--worktrees` or `--ci` only when the user asked for them; `--ci-push` pushes the branch, so name that before running it.
|
|
52
|
+
|
|
53
|
+
After an interrupted run, resume it: the unit that was in flight runs again first.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs autodev resume
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
4. **Write the dossier** and check the record:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs autodev report
|
|
63
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs autodev replay
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`report` writes `dossier.md` (a PR body) and `dossier.html` beside the ledger: per phase, the requirements, plans, units and commits, test gate, verdict, findings and cost. `replay` re-runs the stop logic over the recorded decisions and says whether it decides the same; `identical: false` means the record and the code disagree, so say so.
|
|
67
|
+
|
|
68
|
+
5. **Report** the result: `stop.reason` and `stop.detail`, the units run, `spent_usd`, and the ledger path (`.planning/autodev/<run>/ledger.jsonl`, one `started` and one `finished` row per unit with its argv, exit, cost and commits). Then route on the reason:
|
|
69
|
+
- `done` → `/pan:milestone-audit`
|
|
70
|
+
- `human_needed` → show the phase's verification and the human checks it lists
|
|
71
|
+
- `ci_failed` → show the failing checks and the last fix round from the ledger
|
|
72
|
+
- `gate_failed` → show the gate's reasons (`pan-tools phase gate <N>`), then `/pan:plan-phase <N> --gaps`
|
|
73
|
+
- `budget_usd`, `turns` → offer `autodev resume` with a higher cap
|
|
74
|
+
- `forecast_exceeded` → show the unit's cost and forecast from the ledger; offer `autodev resume` once the user has looked
|
|
75
|
+
- `no_progress` → show the last unit's `stderr_tail` from the ledger; the session likely could not run the command
|
|
76
|
+
</process>
|
package/commands/pan/cost.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: pan:cost
|
|
3
3
|
group: Observability
|
|
4
4
|
description: Show token usage and estimated cost across PAN commands and agents
|
|
5
|
-
argument-hint: "[report|append|clear|rebuild|limits] [--format json|table|chart] [--since YYYY-MM-DD] [--until YYYY-MM-DD] [--apply] [--no-main-thread]"
|
|
5
|
+
argument-hint: "[report|append|clear|rebuild|limits|budget] [--format json|table|chart] [--since YYYY-MM-DD] [--until YYYY-MM-DD] [--apply] [--no-main-thread]"
|
|
6
6
|
allowed-tools:
|
|
7
7
|
- Read
|
|
8
8
|
- Bash
|
|
@@ -77,6 +77,26 @@ Delete the cost log. Useful at the start of a billing cycle.
|
|
|
77
77
|
pan-tools cost clear
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
+
### `budget`
|
|
81
|
+
|
|
82
|
+
A phase's spend against its budget: `cost.phase_budget_usd` in `.planning/config.json`, **20 dollars per phase by default**, `0` to turn it off. Change it with `/pan:settings` or `pan-tools config-set cost.phase_budget_usd 50`. It only warns: `near` from 80% of the budget, `over` once spend reaches it; nothing ever stops on it. exec-phase reports it after each wave and plan-phase in its final status. On a subscription the dollars are API-equivalent (the tokens priced at the rate table).
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
pan-tools cost budget --phase <N> [--raw]
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Prints `{phase, budget_usd, spent_usd, pct, status, mode, warn_at_pct, unpriced}`; `status` is `off`, `ok`, `near` or `over`, and `--raw` prints it. `unpriced` counts the phase's rows with no known rate (not added to the spend).
|
|
89
|
+
|
|
90
|
+
### `usage` (census)
|
|
91
|
+
|
|
92
|
+
Which of the installed PAN commands and agents this project has used, from its own files only: the cost ledger and the trace sessions. Nothing is sent anywhere.
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs usage [--raw]
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Prints `{local_only, commands: {used, never_used, unfinished, installed}, agents: {used, never_used, installed}, sources}`. Each used entry has `calls` and `last_used`, and a command also has `sessions` and `finished`. `unfinished` lists commands that were started but never finished: every trace session for them stopped without ending, the newest more than six hours ago. `--raw` prints a one-line summary. Use it to see which parts of PAN this project actually runs.
|
|
99
|
+
|
|
80
100
|
### `limits`
|
|
81
101
|
|
|
82
102
|
`pan-tools cost limits` shows Claude Code's 5-hour and 7-day usage windows as the status line last saw them, and whether the 7-day one has reached `cost.weekly_limit_stop_pct` (default 90%), where `/pan:focus-auto` and `/pan:army` stop. Interactive Claude Code sessions on a subscription only: headless runs and other runtimes have no reading.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: pan:exec-phase
|
|
3
3
|
group: Phase Lifecycle
|
|
4
4
|
description: Execute all plans in a phase with wave-based parallelization
|
|
5
|
-
argument-hint: "<phase-number> [--gaps-only] [--skip-tests] [--skip-review] [--fast] [--deep-review] [--hierarchical] [--auto]"
|
|
5
|
+
argument-hint: "<phase-number> [--plan <id>] [--gaps-only] [--skip-tests] [--skip-review] [--fast] [--deep-review] [--hierarchical] [--auto] [--quality]"
|
|
6
6
|
allowed-tools:
|
|
7
7
|
- Read
|
|
8
8
|
- Write
|
|
@@ -89,9 +89,8 @@ Execute the execute-phase workflow from @~/.claude/pan-wizard-core/workflows/exe
|
|
|
89
89
|
Preserve all workflow gates (wave execution, checkpoint handling, verification, state updates, routing).
|
|
90
90
|
|
|
91
91
|
**Context Management Across Waves:**
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
- DISCARD: Raw tool output from previous waves
|
|
92
|
+
- Carry forward: Phase goals, test baseline, current wave tasks, file paths being modified
|
|
93
|
+
- Summarise: Completed wave results to one-line summaries
|
|
95
94
|
|
|
96
95
|
**Attention Anchor — emit after each wave completes:**
|
|
97
96
|
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: focus-auto
|
|
3
3
|
group: Focus
|
|
4
4
|
description: Continuous scan-plan-exec loop with purpose-driven categories and a layered safety harness
|
|
5
|
-
argument-hint: "[--source scan|backlog] [--category CAT] [--mode MODE] [--budget N] [--max-cycles N] [--total-budget N] [--enforce-budget] [--verify-reserve F] [--continue] [--stop] [--status] [--dry-run] [--deep-review] [--parallel-research] [--parallel-verify] [--clean-seal]"
|
|
5
|
+
argument-hint: "[--source scan|backlog] [--category CAT] [--mode MODE] [--budget N] [--max-cycles N] [--total-budget N] [--enforce-budget] [--verify-reserve F] [--continue] [--stop] [--status] [--dry-run] [--deep-review] [--parallel-research] [--parallel-verify] [--clean-seal] [--step scan|plan|exec|drift]"
|
|
6
6
|
allowed-tools:
|
|
7
7
|
- Read
|
|
8
8
|
- Write
|
|
@@ -12,6 +12,14 @@ allowed-tools:
|
|
|
12
12
|
- Glob
|
|
13
13
|
- Agent
|
|
14
14
|
---
|
|
15
|
+
<routes>
|
|
16
|
+
These flags select another mode of this command. Each was a separate command, and its old name still runs this one as an alias. When one is present, follow the named workflow instead of the steps below, with the rest of the arguments as its `$ARGUMENTS`, and stop when it ends.
|
|
17
|
+
|
|
18
|
+
- `--step scan` — one deep scan for prioritised work items, no loop: @~/.claude/pan-wizard-core/workflows/focus-scan.md (formerly `focus-scan`)
|
|
19
|
+
- `--step plan` — one capacity-budgeted work batch from the scan: @~/.claude/pan-wizard-core/workflows/focus-plan.md (formerly `focus-plan`)
|
|
20
|
+
- `--step exec` — execute the planned batch once: @~/.claude/pan-wizard-core/workflows/focus-exec.md (formerly `focus-exec`)
|
|
21
|
+
- `--step drift` — documentation-code drift detection and repair: @~/.claude/pan-wizard-core/workflows/focus-drift-walking.md (formerly `focus-drift-walking`)
|
|
22
|
+
</routes>
|
|
15
23
|
|
|
16
24
|
# /pan:focus-auto — Continuous Autonomous Improvement Campaigns
|
|
17
25
|
|
|
@@ -197,7 +205,7 @@ HARD STOP conditions:
|
|
|
197
205
|
|
|
198
206
|
**For each cycle (1 to max_cycles), execute Steps 2.1 through 2.5 without stopping:**
|
|
199
207
|
|
|
200
|
-
#### Step 2.1: Scan (INLINE — do NOT invoke /pan:focus-scan)
|
|
208
|
+
#### Step 2.1: Scan (INLINE — do NOT invoke /pan:focus-auto --step scan)
|
|
201
209
|
|
|
202
210
|
Perform a deep codebase scan to find actionable work items with evidence.
|
|
203
211
|
|
|
@@ -254,7 +262,7 @@ Write scan results to `.planning/focus/scan-<YYYY-MM-DD>-<category>.md` with:
|
|
|
254
262
|
- Items grouped by priority tier, each with: ID, title, symptom, root cause, fix guidance, file paths, effort size
|
|
255
263
|
- Summary: item count by priority, total points
|
|
256
264
|
|
|
257
|
-
#### Step 2.2: Plan (INLINE — do NOT invoke /pan:focus-plan)
|
|
265
|
+
#### Step 2.2: Plan (INLINE — do NOT invoke /pan:focus-auto --step plan)
|
|
258
266
|
|
|
259
267
|
Create a capacity-budgeted batch from the scan items found in Step 2.1.
|
|
260
268
|
|
|
@@ -277,7 +285,7 @@ Write batch to `.planning/focus/batch-<YYYY-MM-DD>-<category>.json`:
|
|
|
277
285
|
"deferred": [{ "id": "...", "title": "...", "reason": "..." }] }
|
|
278
286
|
```
|
|
279
287
|
|
|
280
|
-
#### Step 2.3: Execute (INLINE — do NOT invoke /pan:focus-exec)
|
|
288
|
+
#### Step 2.3: Execute (INLINE — do NOT invoke /pan:focus-auto --step exec)
|
|
281
289
|
|
|
282
290
|
Implement each item from the batch created in Step 2.2. Record `tests_before` by running the test suite first.
|
|
283
291
|
|
|
@@ -364,9 +372,8 @@ Check the response for stop conditions:
|
|
|
364
372
|
#### Step 2.5: Inter-Cycle Context Management
|
|
365
373
|
|
|
366
374
|
Between cycles, manage context to prevent quality degradation over long campaigns:
|
|
367
|
-
- **
|
|
368
|
-
- **
|
|
369
|
-
- **DISCARD:** Raw tool output from previous cycles, superseded scan results
|
|
375
|
+
- **Carry forward:** Current cycle goals, test baseline, error states, active file paths
|
|
376
|
+
- **Summarise:** Previous cycle results to a one-line summary each
|
|
370
377
|
|
|
371
378
|
Display one-line cycle summary: `Cycle N/M | X/Y pts | Z items done | Tests: A -> B`
|
|
372
379
|
|
|
@@ -27,7 +27,7 @@ Research, design, and specify a new feature with strategic analysis. $ARGUMENTS
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## Project Scope Boundary
|
|
31
31
|
|
|
32
32
|
This command investigates and designs features for the **host project** — NOT for PAN Wizard itself.
|
|
33
33
|
|
|
@@ -57,9 +57,8 @@ Prefer local evidence over web research. Start with the codebase, then broaden.
|
|
|
57
57
|
## Context Management Across Phases
|
|
58
58
|
|
|
59
59
|
This pipeline spans 10+ phases. Manage context to maintain quality:
|
|
60
|
-
- **
|
|
61
|
-
- **
|
|
62
|
-
- **DISCARD:** Raw web fetch content after extracting relevant data, superseded design drafts
|
|
60
|
+
- **Carry forward:** Problem statement, success criteria, key architectural decisions, file paths being designed for
|
|
61
|
+
- **Summarise:** Research findings (compress to key takeaways after each research phase), competitive analysis results
|
|
63
62
|
- After Phase 3 (Strategic Analysis), summarize all findings from Phases 0-3 into a compact brief before entering design phases
|
|
64
63
|
|
|
65
64
|
**Progressive context loading — load only what the current phase needs:**
|
|
@@ -1050,7 +1049,7 @@ Write ADR to: `docs/decisions/ADR-NNNN-<feature_name>.md`
|
|
|
1050
1049
|
|
|
1051
1050
|
**ADR completeness gate:** Before saving, verify the ADR passes ALL checks from Phase 5.2. The ADR file must contain every section defined in Phase 5.1 with substantive content — no placeholder brackets, no skeleton sections, no missing tables. If any section would be empty, go back to the relevant phase and extract the content.
|
|
1052
1051
|
|
|
1053
|
-
**Independent verification gate:** The final artifact must have PASSED `pan-design-checker` in Phase 5.4 (or reached the 2-iteration cap with remaining gaps recorded as caveats). Re-run the checker here on the *saved* spec + ADR as a final gate — the independent pass, not just the 5.2 self-check, is what authorizes handing this design to `/pan:focus-plan`.
|
|
1052
|
+
**Independent verification gate:** The final artifact must have PASSED `pan-design-checker` in Phase 5.4 (or reached the 2-iteration cap with remaining gaps recorded as caveats). Re-run the checker here on the *saved* spec + ADR as a final gate — the independent pass, not just the 5.2 self-check, is what authorizes handing this design to `/pan:focus-auto --step plan`.
|
|
1054
1053
|
|
|
1055
1054
|
**Minimum ADR size:** A proper ADR for a `--full` mode investigation should be 80-200+ lines. If the ADR is under 60 lines, it is almost certainly missing required sections. For `--internal` mode, minimum 60 lines. For `--outward` mode, minimum 70 lines.
|
|
1056
1055
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: focus-docs
|
|
3
|
+
group: Focus
|
|
4
|
+
description: Documentation audit and sync — accuracy, freshness, links, cross-consistency and structure; --sync updates stale docs after changes
|
|
5
|
+
argument-hint: "[file|directory] [--deep] [--links] [--fix] [--all] [--score-only] [--min-score N] [--format markdown|json|checklist] | --sync [--readme | --docs | --arch | --all]"
|
|
6
|
+
allowed-tools:
|
|
7
|
+
- Read
|
|
8
|
+
- Write
|
|
9
|
+
- Edit
|
|
10
|
+
- Bash
|
|
11
|
+
- Grep
|
|
12
|
+
- Glob
|
|
13
|
+
- Agent
|
|
14
|
+
- WebFetch
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# /pan:focus-docs — Documentation audit and sync
|
|
18
|
+
|
|
19
|
+
One command for a project's documentation. $ARGUMENTS
|
|
20
|
+
|
|
21
|
+
- **Default: audit.** Score documents for accuracy, freshness, links, cross-consistency and structure, and fix what `--fix` allows: follow @~/.claude/pan-wizard-core/workflows/focus-doc-audit.md.
|
|
22
|
+
- **`--sync`: synchronise after changes.** Check staleness and update counts and references in README, docs and architecture: follow @~/.claude/pan-wizard-core/workflows/focus-sync.md with the rest of the arguments.
|
|
23
|
+
|
|
24
|
+
The old `focus-doc-audit` and `focus-sync` names run this command as aliases.
|
package/commands/pan/learn.md
CHANGED
|
@@ -2,14 +2,21 @@
|
|
|
2
2
|
name: pan:learn
|
|
3
3
|
group: Self-Improvement
|
|
4
4
|
description: Analyze trace sessions or harvested experiments via pan-optimizer; generate ranked optimization reports
|
|
5
|
-
argument-hint: "[--session <id> | --sessions <n> | --experiment <slug>] [--apply]"
|
|
5
|
+
argument-hint: "[--session <id> | --sessions <n> | --experiment <slug>] [--apply] | --optimize <subcommand>"
|
|
6
6
|
allowed-tools:
|
|
7
7
|
- Read
|
|
8
8
|
- Bash
|
|
9
9
|
- Glob
|
|
10
10
|
- Grep
|
|
11
11
|
- Task
|
|
12
|
+
- Write
|
|
13
|
+
- Edit
|
|
12
14
|
---
|
|
15
|
+
<routes>
|
|
16
|
+
These flags select another mode of this command. Each was a separate command, and its old name still runs this one as an alias. When one is present, follow the named workflow instead of the steps below, with the rest of the arguments as its `$ARGUMENTS`, and stop when it ends.
|
|
17
|
+
|
|
18
|
+
- `--optimize <apply|revert|list|stats|trace …>` — manage the optimisation loop: record a report's suggestions, undo them, list reports, view stats, manage trace sessions: @~/.claude/pan-wizard-core/workflows/optimize.md (formerly `optimize`)
|
|
19
|
+
</routes>
|
|
13
20
|
|
|
14
21
|
# /pan:learn
|
|
15
22
|
|
|
@@ -28,7 +35,7 @@ Analyze the most recent trace session and generate an optimization report.
|
|
|
28
35
|
- `--session <id>` — analyze a specific session instead of the most recent
|
|
29
36
|
- `--sessions <n>` — pool the last n sessions into one analysis, so recommendations rest on failures that recur across runs
|
|
30
37
|
- `--experiment <slug>` *(v3.7.0+, W3)* — analyze a harvested experiment instead of the current project's traces: the workflow runs its `pan-tools` steps with `--cwd` set to the harvest folder (the `harvest_path` `/pan:experiment harvest <slug>` printed, `<source-repo>/experiments/<slug>/` by default), so the analysis and the optimizer's report land in that folder's `.planning/optimization/reports/`. Used by the self-improvement loop. Run `/pan:experiment harvest <slug>` first.
|
|
31
|
-
- `--apply` — record the report's suggestions right after generating it (equivalent to running `/pan:optimize apply` immediately after)
|
|
38
|
+
- `--apply` — record the report's suggestions right after generating it (equivalent to running `/pan:learn --optimize apply` immediately after)
|
|
32
39
|
|
|
33
40
|
**What it does:**
|
|
34
41
|
|
|
@@ -36,11 +43,11 @@ Analyze the most recent trace session and generate an optimization report.
|
|
|
36
43
|
2. Performs local analysis (error/gap/redundancy patterns, agent stats)
|
|
37
44
|
3. Writes `.planning/optimization/reports/{session}-analysis.json`
|
|
38
45
|
4. Invokes `pan-optimizer` agent to produce `.planning/optimization/reports/{session}-opt-report.md`
|
|
39
|
-
5. If `--apply` flag: immediately runs `/pan:optimize apply` on the new report
|
|
46
|
+
5. If `--apply` flag: immediately runs `/pan:learn --optimize apply` on the new report
|
|
40
47
|
6. Prints the optimization summary
|
|
41
48
|
|
|
42
49
|
**When to run:**
|
|
43
|
-
- After any `/pan:exec-phase` or `/pan:focus-exec` that had a trace session active
|
|
50
|
+
- After any `/pan:exec-phase` or `/pan:focus-auto --step exec` that had a trace session active
|
|
44
51
|
- After a full build cycle to capture all decisions and errors
|
|
45
52
|
- On demand to understand what PAN did and how to make it smarter
|
|
46
53
|
|
|
@@ -59,7 +66,7 @@ The optimization report in `.planning/optimization/reports/` contains:
|
|
|
59
66
|
- Redundancy analysis with token waste estimates
|
|
60
67
|
- Prompt improvement suggestions (require human review before applying)
|
|
61
68
|
- Workflow gap suggestions (require human review)
|
|
62
|
-
- An `## Auto-Apply Actions` JSON block, which `/pan:optimize apply` records in `.planning/optimization/suggestions.md`
|
|
69
|
+
- An `## Auto-Apply Actions` JSON block, which `/pan:learn --optimize apply` records in `.planning/optimization/suggestions.md`
|
|
63
70
|
- A circular optimization score (0–100)
|
|
64
71
|
|
|
65
72
|
Nothing in the report reaches an agent until a person writes it where the agents read. PAN's workflows do not load `.planning/memory/` into agents.
|
|
@@ -75,6 +82,6 @@ Nothing in the report reaches an agent until a person writes it where the agents
|
|
|
75
82
|
→ Needs review: 2 prompt improvements, 1 workflow gap
|
|
76
83
|
```
|
|
77
84
|
|
|
78
|
-
**See also:** `/pan:optimize`, `/pan:exec-phase`, `/pan:experiment` (v3.7.0+ self-improvement loop)
|
|
85
|
+
**See also:** `/pan:learn --optimize`, `/pan:exec-phase`, `/pan:experiment` (v3.7.0+ self-improvement loop)
|
|
79
86
|
|
|
80
87
|
Follow the workflow at `~/.claude/pan-wizard-core/workflows/learn.md`.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: pan:milestone-audit
|
|
3
3
|
group: Milestone
|
|
4
4
|
description: Audit milestone completion against original intent before archiving
|
|
5
|
-
argument-hint: "[version] [--track <name>] [--all-tracks]"
|
|
5
|
+
argument-hint: "[version] [--track <name>] [--all-tracks] [--gaps]"
|
|
6
6
|
allowed-tools:
|
|
7
7
|
- Read
|
|
8
8
|
- Glob
|
|
@@ -10,7 +10,14 @@ allowed-tools:
|
|
|
10
10
|
- Bash
|
|
11
11
|
- Task
|
|
12
12
|
- Write
|
|
13
|
+
- AskUserQuestion
|
|
13
14
|
---
|
|
15
|
+
<routes>
|
|
16
|
+
These flags select another mode of this command. Each was a separate command, and its old name still runs this one as an alias. When one is present, follow the named workflow instead of the steps below, with the rest of the arguments as its `$ARGUMENTS`, and stop when it ends.
|
|
17
|
+
|
|
18
|
+
- `--gaps` — create the phases that close the gaps of the most recent audit (`.planning/v*-milestone-audit.md`), grouped, with your confirmation: @~/.claude/pan-wizard-core/workflows/milestone-gaps.md (formerly `milestone-gaps`)
|
|
19
|
+
</routes>
|
|
20
|
+
|
|
14
21
|
<objective>
|
|
15
22
|
Verify milestone achieved its definition of done. Check requirements coverage, cross-phase integration, and end-to-end flows.
|
|
16
23
|
|
|
@@ -3,12 +3,17 @@ type: prompt
|
|
|
3
3
|
name: pan:milestone-done
|
|
4
4
|
group: Milestone
|
|
5
5
|
description: Archive completed milestone and prepare for next version
|
|
6
|
-
argument-hint: <version>
|
|
6
|
+
argument-hint: "<version> [--cleanup]"
|
|
7
7
|
allowed-tools:
|
|
8
8
|
- Read
|
|
9
9
|
- Write
|
|
10
10
|
- Bash
|
|
11
11
|
---
|
|
12
|
+
<routes>
|
|
13
|
+
These flags select another mode of this command. Each was a separate command, and its old name still runs this one as an alias. When one is present, follow the named workflow instead of the steps below, with the rest of the arguments as its `$ARGUMENTS`, and stop when it ends.
|
|
14
|
+
|
|
15
|
+
- `--cleanup` — archive the phase directories of completed milestones into `.planning/milestones/v{X.Y}-phases/`, with a dry-run summary first: @~/.claude/pan-wizard-core/workflows/milestone-cleanup.md (formerly `milestone-cleanup`)
|
|
16
|
+
</routes>
|
|
12
17
|
|
|
13
18
|
<objective>
|
|
14
19
|
Mark milestone {{version}} complete, archive to milestones/, and update roadmap.md and requirements.md.
|
|
@@ -45,8 +50,8 @@ The full milestone-done workflow is inlined in <process> below — there is no s
|
|
|
45
50
|
|
|
46
51
|
- Look for `.planning/v{{version}}-milestone-audit.md`
|
|
47
52
|
- If missing or stale: recommend `/pan:milestone-audit` first
|
|
48
|
-
- If audit status is `gaps_found`: recommend `/pan:milestone-gaps` first
|
|
49
|
-
- If audit status is `tech_debt`: present the debt; proceed on the user's say-so (it becomes accepted debt), or recommend `/pan:milestone-gaps` for a cleanup phase
|
|
53
|
+
- If audit status is `gaps_found`: recommend `/pan:milestone-audit --gaps` first
|
|
54
|
+
- If audit status is `tech_debt`: present the debt; proceed on the user's say-so (it becomes accepted debt), or recommend `/pan:milestone-audit --gaps` for a cleanup phase
|
|
50
55
|
- If audit status is `passed`: proceed to step 1
|
|
51
56
|
|
|
52
57
|
```markdown
|
|
@@ -57,7 +62,7 @@ The full milestone-done workflow is inlined in <process> below — there is no s
|
|
|
57
62
|
requirements coverage, cross-phase integration, and E2E flows.
|
|
58
63
|
|
|
59
64
|
{If audit has gaps:}
|
|
60
|
-
⚠ Milestone audit found gaps. Run `/pan:milestone-gaps` to create
|
|
65
|
+
⚠ Milestone audit found gaps. Run `/pan:milestone-audit --gaps` to create
|
|
61
66
|
phases that close the gaps, or proceed anyway to accept as tech debt.
|
|
62
67
|
|
|
63
68
|
{If audit passed:}
|
|
@@ -122,7 +127,7 @@ The full milestone-done workflow is inlined in <process> below — there is no s
|
|
|
122
127
|
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize learn --sessions 5 2>/dev/null || true
|
|
123
128
|
```
|
|
124
129
|
|
|
125
|
-
Present the optimization summary to the user and suggest `/pan:optimize apply` to record its suggestions, each naming where a person should make the change.
|
|
130
|
+
Present the optimization summary to the user and suggest `/pan:learn --optimize apply` to record its suggestions, each naming where a person should make the change.
|
|
126
131
|
|
|
127
132
|
</process>
|
|
128
133
|
|
|
@@ -11,13 +11,13 @@ allowed-tools:
|
|
|
11
11
|
- AskUserQuestion
|
|
12
12
|
---
|
|
13
13
|
<objective>
|
|
14
|
-
Start a new milestone: questioning → research (
|
|
14
|
+
Start a new milestone: questioning → research (opt-in, at most 5 open questions) → requirements → roadmap.
|
|
15
15
|
|
|
16
16
|
Brownfield equivalent of new-project. Project exists, project.md has history. Gathers "what's next", updates project.md, then runs requirements → roadmap cycle.
|
|
17
17
|
|
|
18
18
|
**Creates/Updates:**
|
|
19
19
|
- `.planning/project.md` — updated with new milestone goals
|
|
20
|
-
- `.planning/research/` —
|
|
20
|
+
- `.planning/research/` — answers to at most 5 open questions (only with research, NEW features only)
|
|
21
21
|
- `.planning/requirements.md` — scoped requirements for this milestone
|
|
22
22
|
- `.planning/roadmap.md` — phase structure (continues numbering)
|
|
23
23
|
- `.planning/state.md` — reset for new milestone
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: pan:new-project
|
|
3
3
|
group: Getting Started
|
|
4
4
|
description: Initialize a new project with deep context gathering and project.md
|
|
5
|
-
argument-hint: "[--auto]"
|
|
5
|
+
argument-hint: "[--auto] [--research [market]]"
|
|
6
6
|
allowed-tools:
|
|
7
7
|
- Read
|
|
8
8
|
- Bash
|
|
@@ -12,16 +12,18 @@ allowed-tools:
|
|
|
12
12
|
---
|
|
13
13
|
<context>
|
|
14
14
|
**Flags:**
|
|
15
|
-
- `--auto` — Automatic mode. Asks no questions: applies the auto-mode defaults (idea.md frontmatter can override them), then runs
|
|
15
|
+
- `--auto` — Automatic mode. Asks no questions: applies the auto-mode defaults (idea.md frontmatter can override them), then runs requirements → roadmap without interaction (research only when asked for). Needs an idea document — an @ reference, or the idea pasted after the flag.
|
|
16
|
+
- `--research` — Research is off by default. With this flag the workflow lists at most 5 open questions that block building and one researcher answers them, each with a source or a recorded assumption; findings settle decisions and never add v1 scope. A precise brief skips research anyway.
|
|
17
|
+
- `--research market` — Research, plus a comparison of at most 5 comparable products; what the brief does not cover becomes v2 candidates for you to accept.
|
|
16
18
|
</context>
|
|
17
19
|
|
|
18
20
|
<objective>
|
|
19
|
-
Initialize a new project through unified flow: questioning → research (
|
|
21
|
+
Initialize a new project through unified flow: questioning → research (opt-in) → requirements → roadmap.
|
|
20
22
|
|
|
21
23
|
**Creates:**
|
|
22
24
|
- `.planning/project.md` — project context
|
|
23
25
|
- `.planning/config.json` — workflow preferences
|
|
24
|
-
- `.planning/research/` —
|
|
26
|
+
- `.planning/research/` — answers to at most 5 open questions (only with research)
|
|
25
27
|
- `.planning/requirements.md` — scoped requirements
|
|
26
28
|
- `.planning/roadmap.md` — phase structure
|
|
27
29
|
- `.planning/state.md` — project memory
|
|
@@ -50,7 +52,7 @@ Load context in layers — do NOT read everything upfront. Each layer builds on
|
|
|
50
52
|
- Entry points — main files, index files, server files
|
|
51
53
|
- Test infrastructure — test framework, test directory
|
|
52
54
|
|
|
53
|
-
**Layer 3: Hotspots (
|
|
55
|
+
**Layer 3: Hotspots (brownfield only, when writing requirements)**
|
|
54
56
|
- Most-changed files (git log --name-only) — where active work happens
|
|
55
57
|
- Largest files — complexity centers
|
|
56
58
|
- Import graph roots — most-depended-on modules
|
|
@@ -74,8 +76,8 @@ IF .planning/ already exists AND contains project.md:
|
|
|
74
76
|
ELSE IF --auto flag AND an idea document provided (@ reference or pasted text):
|
|
75
77
|
→ ASK nothing: apply the auto-mode defaults (workflow step 2a; idea.md frontmatter can override them)
|
|
76
78
|
→ SKIP interactive questioning (use the document as project context)
|
|
77
|
-
→
|
|
78
|
-
→ GENERATE requirements from research
|
|
79
|
+
→ RESEARCH only with --research or frontmatter research_enabled: true (never for a precise brief)
|
|
80
|
+
→ GENERATE requirements from the document (research settles decisions, never adds v1 scope)
|
|
79
81
|
→ GENERATE roadmap from requirements
|
|
80
82
|
→ No further interaction until complete
|
|
81
83
|
|
|
@@ -85,9 +87,9 @@ ELSE IF --auto flag WITHOUT an idea document:
|
|
|
85
87
|
|
|
86
88
|
ELSE (interactive mode — default):
|
|
87
89
|
→ RUN questioning flow (freeform deep questioning — references/questioning.md)
|
|
88
|
-
→
|
|
89
|
-
→ IF
|
|
90
|
-
→ IF
|
|
90
|
+
→ IF --research: research; ELSE ASK: "Research open questions?" (default: Skip research)
|
|
91
|
+
→ IF research: write ≤5 blocking questions → one pan-project-researcher → research check → continue
|
|
92
|
+
→ IF skip (or no question blocks building): continue
|
|
91
93
|
→ PRESENT requirements for approval
|
|
92
94
|
→ PRESENT roadmap for approval
|
|
93
95
|
→ COMMIT if commit_docs=true
|
|
@@ -95,8 +97,9 @@ ELSE (interactive mode — default):
|
|
|
95
97
|
|
|
96
98
|
**Research routing:**
|
|
97
99
|
```
|
|
98
|
-
IF user
|
|
99
|
-
IF user declines research: skip directly to requirements generation
|
|
100
|
+
IF user asks for research: write at most 5 open questions, spawn ONE pan-project-researcher
|
|
101
|
+
IF user declines research (the default): skip directly to requirements generation
|
|
102
|
+
IF no question blocks building: no research, say so
|
|
100
103
|
IF codebase already has substantial code: suggest skipping research (existing code IS the context)
|
|
101
104
|
```
|
|
102
105
|
</routing_decision_tree>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: pan:plan-phase
|
|
3
3
|
group: Phase Lifecycle
|
|
4
4
|
description: Create detailed phase plan (plan.md) with verification loop
|
|
5
|
-
argument-hint: "[phase] [--auto] [--research] [--skip-research] [--gaps] [--skip-verify] [--prd <file>]"
|
|
5
|
+
argument-hint: "[phase] [--auto] [--research] [--skip-research] [--gaps] [--skip-verify] [--prd <file>] [--research-only] [--quality]"
|
|
6
6
|
agent: pan-planner
|
|
7
7
|
allowed-tools:
|
|
8
8
|
- Read
|
|
@@ -14,14 +14,20 @@ allowed-tools:
|
|
|
14
14
|
- WebFetch
|
|
15
15
|
- mcp__context7__*
|
|
16
16
|
---
|
|
17
|
+
<routes>
|
|
18
|
+
These flags select another mode of this command. Each was a separate command, and its old name still runs this one as an alias. When one is present, follow the named workflow instead of the steps below, with the rest of the arguments as its `$ARGUMENTS`, and stop when it ends.
|
|
19
|
+
|
|
20
|
+
- `--research-only <phase>` — research the phase without planning it (or re-research a planned one): @~/.claude/pan-wizard-core/workflows/research-phase.md, with the phase as its argument (formerly `research-phase`)
|
|
21
|
+
</routes>
|
|
22
|
+
|
|
17
23
|
<objective>
|
|
18
|
-
Create executable phase prompts (plan.md files) for a roadmap phase with
|
|
24
|
+
Create executable phase prompts (plan.md files) for a roadmap phase with verification, and research only when asked for.
|
|
19
25
|
|
|
20
|
-
**Default flow:** Research (
|
|
26
|
+
**Default flow:** Plan → Verify → Done. Research is opt-in (`--research`, or `workflow.research: true`): it answers at most 5 open questions that block building, with one researcher, and never adds scope
|
|
21
27
|
|
|
22
28
|
**Design input (ADR-0042):** if `{phase}-design.md` exists (from `/pan:design-phase`, verified by `pan-design-checker`), it is an authoritative upstream input — `pan-planner` implements its approved architecture/decisions and `pan-plan-checker` verifies conformance (Design Conformance dimension). It is optional: a phase without a design.md plans exactly as before. The plan-phase workflow does not list it in the planner's or checker's `<files_to_read>`, so they use it only when they find it in the phase directory themselves.
|
|
23
29
|
|
|
24
|
-
**Orchestrator role:** Parse arguments, validate phase,
|
|
30
|
+
**Orchestrator role:** Parse arguments, validate phase, answer open questions (only when research was asked for), spawn pan-planner, verify with pan-plan-checker, iterate until pass or max iterations, present results.
|
|
25
31
|
</objective>
|
|
26
32
|
|
|
27
33
|
<execution_context>
|
|
@@ -33,7 +39,7 @@ Create executable phase prompts (plan.md files) for a roadmap phase with integra
|
|
|
33
39
|
Phase number: $ARGUMENTS (optional — auto-detects next unplanned phase if omitted)
|
|
34
40
|
|
|
35
41
|
**Flags:**
|
|
36
|
-
- `--research` —
|
|
42
|
+
- `--research` — Research this phase (off by default): write at most 5 blocking questions, one researcher answers them, `pan-tools research check` verifies; re-researches even if research.md exists
|
|
37
43
|
- `--skip-research` — Skip research, go straight to planning
|
|
38
44
|
- `--gaps` — Gap closure mode (reads verification.md, skips research)
|
|
39
45
|
- `--skip-verify` — Skip verification loop
|
|
@@ -49,16 +55,16 @@ During the plan-checker verification iteration:
|
|
|
49
55
|
2. For each identified gap: verify it is a genuine gap by re-reading the relevant requirement
|
|
50
56
|
3. Do not blindly accept all critiques — some may be false positives from missing context
|
|
51
57
|
4. Revise the plan to address genuine gaps only
|
|
52
|
-
5.
|
|
58
|
+
5. Bounded revisions: by default (sized ceremony) the workflow checks twice (plan → check → revise → check), and under the full ceremony (`quality`, `workflow.ceremony: full`, `--quality`) three times; after the last check the user chooses force proceed, guidance or abandon. A lean phase is planned and checked by the engine, with no planner or checker
|
|
53
59
|
This prevents over-revision while ensuring real gaps are closed.
|
|
54
60
|
</reflexion_loop>
|
|
55
61
|
|
|
56
62
|
<completion_contract>
|
|
57
63
|
Planning is complete when ALL conditions are met:
|
|
58
64
|
1. At least one plan.md file created in the phase directory
|
|
59
|
-
2. Plan-checker passed (or
|
|
65
|
+
2. Plan-checker passed (or the revision limit reached, one by default and two under the full ceremony, with final approval), or the engine's plan check recorded for a lean phase
|
|
60
66
|
3. Each plan contains: objective, task breakdown with estimates, dependency ordering, and key file links
|
|
61
|
-
4. Research.md exists
|
|
67
|
+
4. Research.md exists only when research was asked for (`--research` or `workflow.research: true`) and a question blocked building
|
|
62
68
|
5. User presented with results and next-step options
|
|
63
69
|
|
|
64
70
|
Planning FAILS if: phase not found in roadmap, or planner agent returns empty/malformed output after retries.
|
|
@@ -123,7 +129,7 @@ ELSE:
|
|
|
123
129
|
→ IF checker PASSES: done
|
|
124
130
|
→ IF checker finds gaps (check 1 or 2): revise plan, re-check
|
|
125
131
|
→ IF checker finds gaps (check 3): stop revising; the user chooses force proceed (open issues recorded as deferred), guidance and retry, or abandon
|
|
126
|
-
→
|
|
132
|
+
→ One revision by default (two checks), two under the full ceremony (three checks)
|
|
127
133
|
```
|
|
128
134
|
</routing_decision_tree>
|
|
129
135
|
|
package/commands/pan/preview.md
CHANGED
|
@@ -31,7 +31,7 @@ Consolidates Spec B v1's architect + simulate + predict-milestone into one entry
|
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
**What it does:**
|
|
34
|
-
1. `pan-tools preview phase <N>` returns `{files_mentioned, test_files_mentioned, risk_signals, risk_score, plans[], status}`.
|
|
34
|
+
1. `pan-tools preview phase <N>` returns `{files_mentioned, test_files_mentioned, risk_signals, risk_score, plans[], status, cost_forecast}`. `cost_forecast` gives p10/p50/p90 dollars per plan (`per_plan`) and for the phase (`phase`) from this project's own cost ledger, or `status: insufficient` with `n` when fewer than five past runs back it.
|
|
35
35
|
2. Spawn `pan-previewer` with the payload as `<preview_input>`.
|
|
36
36
|
3. Agent writes `.planning/phases/<NN-slug>/preview.md` with files touched / tests at risk / migration steps / risk assessment / bottom line.
|
|
37
37
|
|
package/commands/pan/quick.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: pan:quick
|
|
3
3
|
group: Session & Progress
|
|
4
4
|
description: Execute a quick task with PAN guarantees (atomic commits, state tracking) but skip optional agents
|
|
5
|
-
argument-hint: "[--full] [description]"
|
|
5
|
+
argument-hint: "[--full] [--quality] [description]"
|
|
6
6
|
allowed-tools:
|
|
7
7
|
- Read
|
|
8
8
|
- Write
|
|
@@ -18,7 +18,7 @@ Run a deeper review pass on a phase than `pan-reviewer` alone provides. Two new
|
|
|
18
18
|
1. **pan-hardener** — OWASP Top 10 (2025) + STRIDE threat model on files changed in the phase.
|
|
19
19
|
2. **pan-meta-reviewer** — reads both the reviewer's and hardener's output, flags things both missed, disputes overstated severities.
|
|
20
20
|
|
|
21
|
-
Outputs are merged by `review-deep.cjs` into a single `.planning/reviews/<phase>/deep-review.md` with verdict, coverage stats, and conflict table.
|
|
21
|
+
Outputs are merged by `review-deep.cjs` into a single `.planning/reviews/<phase>/deep-review.md` with verdict, coverage stats, and conflict table.
|
|
22
22
|
|
|
23
23
|
Consolidates Spec B v1's X-4 (self-review) + X-12 (harden) into a single command.
|
|
24
24
|
</objective>
|
|
@@ -49,7 +49,7 @@ Runs the normal exec → reviewer pipeline, then runs this command's process inl
|
|
|
49
49
|
### Integrated with focus-exec
|
|
50
50
|
|
|
51
51
|
```
|
|
52
|
-
/pan:focus-exec --deep-review
|
|
52
|
+
/pan:focus-auto --step exec --deep-review
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
Per-item deep review during focus campaigns: focus-exec runs the hardener and meta-reviewer on the item's changed files and merges them under the item's id (`review-deep merge <item-id>` with no `--reviewer-file`), since an item has no phase or first-pass review. Useful for high-stakes batches.
|
|
@@ -68,14 +68,21 @@ Per-item deep review during focus campaigns: focus-exec runs the hardener and me
|
|
|
68
68
|
- Prompt includes: `<files_to_read>` with both `{directory}/{phase_number}-review.md` AND `.planning/reviews/<N>/hardener.md` (and representative diff snippets); `<output_path>` = `.planning/reviews/<N>/meta.md`.
|
|
69
69
|
- Agent reads both first-pass reports, identifies missed patterns, disputes overstated severities, writes to output path.
|
|
70
70
|
|
|
71
|
+
3b. **Cross-family lane (only when the project turned it on).** A reviewer from the author's own model family shares its blind spots. Run:
|
|
72
|
+
```
|
|
73
|
+
pan-tools review cross-family <N>
|
|
74
|
+
```
|
|
75
|
+
With `workflow.cross_family_review: off` (the default) it returns `enabled: false` and runs nothing: skip to the merge. With a host set, it runs the review on that host's CLI, read-only, and writes `.planning/reviews/<N>/cross-family-<host>.md`; pass that file to the merge as `--cross-file`. If the host's CLI is missing or fails, say so and merge without it.
|
|
76
|
+
|
|
71
77
|
4. **Merge** — call:
|
|
72
78
|
```
|
|
73
79
|
pan-tools review-deep merge <N> \
|
|
74
80
|
--reviewer-file {directory}/{phase_number}-review.md \
|
|
75
81
|
--hardener-file .planning/reviews/<N>/hardener.md \
|
|
76
|
-
--meta-file .planning/reviews/<N>/meta.md
|
|
82
|
+
--meta-file .planning/reviews/<N>/meta.md \
|
|
83
|
+
[--cross-file .planning/reviews/<N>/cross-family-<host>.md]
|
|
77
84
|
```
|
|
78
|
-
The merger parses
|
|
85
|
+
The merger parses every input, sorts by severity, computes verdict (`ok` | `ok_with_minor` | `fix_before_merge` | `review_required` | `block`), and writes `.planning/reviews/<N>/deep-review.md`.
|
|
79
86
|
|
|
80
87
|
5. **Report back** — echo verdict + finding count + conflict count. If verdict is `block` or `review_required`, recommend the user review `deep-review.md` before proceeding.
|
|
81
88
|
|
|
@@ -101,7 +108,6 @@ Verdict is driven by the highest-severity finding across all three sources. Meta
|
|
|
101
108
|
- `.planning/reviews/<N>/hardener.md` — pan-hardener output (new)
|
|
102
109
|
- `.planning/reviews/<N>/meta.md` — pan-meta-reviewer output (new)
|
|
103
110
|
- `.planning/reviews/<N>/deep-review.md` — merged consolidated report (final deliverable)
|
|
104
|
-
- `.planning/bus/review-handoff.jsonl` — audit trail entry (append-only)
|
|
105
111
|
|
|
106
112
|
</output_files>
|
|
107
113
|
|