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,742 @@
|
|
|
1
|
+
# Workflow Integration Redesign — featureAI Spec
|
|
2
|
+
|
|
3
|
+
**Generated:** 2026-03-01
|
|
4
|
+
**Status:** Proposed
|
|
5
|
+
**Method:** featureAI 10-phase analysis applied to end-to-end workflow redesign
|
|
6
|
+
**Goal:** Integrate 14 capabilities from custom skills into PAN Wizard's existing 8 workflows by redesigning flows end-to-end — not bolting features on, but weaving them into natural decision points.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Phase 0: Problem Framing
|
|
11
|
+
|
|
12
|
+
### Problem Statement
|
|
13
|
+
|
|
14
|
+
PAN Wizard's current workflow treats all work identically: every task gets the full discuss -> plan -> execute -> verify pipeline regardless of size. A one-line typo fix and a multi-module feature both go through the same research, planning, and verification ceremony. This wastes context tokens, time, and user patience. Meanwhile, capabilities that users naturally need during execution — safety checks before commits, rollback points before risky changes, error pattern learning, execution budgets, dry-run previews — don't exist in the shipped product despite being proven in the custom skills used to build PAN Wizard itself.
|
|
15
|
+
|
|
16
|
+
### Demand Evidence
|
|
17
|
+
|
|
18
|
+
| Evidence Type | Source | Finding |
|
|
19
|
+
|--------------|--------|---------|
|
|
20
|
+
| Internal dogfooding | 12 development sessions | PanMonty tier system used in every session; MICRO tier skipped 60-80% of ceremony for XS/S items |
|
|
21
|
+
| ExecPlan usage | 12 sessions | Capacity budgeting prevented context exhaustion; 40-60 point budgets scoped sessions |
|
|
22
|
+
| Commit safety | Session 12 | Accidental install artifacts caught by commit safety checks |
|
|
23
|
+
| Session continuity | Every multi-session project | Session start/end preserved context across 12+ sessions |
|
|
24
|
+
|
|
25
|
+
### Success Criteria
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
SC-1: XS/S tasks complete in 1 pan-tools round-trip (no agent spawn)
|
|
29
|
+
SC-2: Execution budget prevents context exhaustion before phase completion
|
|
30
|
+
SC-3: Commit safety checks catch sensitive files and unintended deletions
|
|
31
|
+
SC-4: Error patterns learned in session N are available in session N+1
|
|
32
|
+
SC-5: --dry-run shows what would execute without executing
|
|
33
|
+
SC-6: Rollback snapshot exists before every execute-phase
|
|
34
|
+
SC-7: All 674+ existing tests pass unchanged
|
|
35
|
+
SC-8: Zero new runtime dependencies
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Phase 1: Current Flow Gaps
|
|
41
|
+
|
|
42
|
+
### Gap Map — Where Capabilities Are Missing
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
CURRENT FLOW: MISSING CAPABILITY:
|
|
46
|
+
|
|
47
|
+
new-project (no gaps — flow is solid)
|
|
48
|
+
│
|
|
49
|
+
▼
|
|
50
|
+
discuss-phase (no gaps — flow is solid)
|
|
51
|
+
│
|
|
52
|
+
▼
|
|
53
|
+
plan-phase ─────────────────────── ① No priority/effort metadata in plan.md
|
|
54
|
+
│ ② No tier classification (all plans = FULL)
|
|
55
|
+
│ ③ No feature ladder (v0/v1/v2) in plans
|
|
56
|
+
▼
|
|
57
|
+
execute-phase ──────────────────── ④ No rollback snapshot before execution
|
|
58
|
+
│ ⑤ No capacity budget (executes until done or crash)
|
|
59
|
+
│ ⑥ No tier-aware execution (XS treated same as XL)
|
|
60
|
+
│ ⑦ No dry-run preview
|
|
61
|
+
│ ⑧ No execution modes (bugfix/balanced/features)
|
|
62
|
+
│ ⑨ No smart test skip for docs-only changes
|
|
63
|
+
├── execute-plan (subagent) ─── ⑩ No error pattern consultation before execution
|
|
64
|
+
│ ⑪ No commit safety checks (sensitive/deleted files)
|
|
65
|
+
│ ⑫ No conventional commit types
|
|
66
|
+
▼
|
|
67
|
+
verify-work (no gaps — flow is solid)
|
|
68
|
+
│
|
|
69
|
+
▼
|
|
70
|
+
transition ─────────────────────── ⑬ No session summary generation
|
|
71
|
+
│ ⑭ No error pattern capture from execution
|
|
72
|
+
▼
|
|
73
|
+
progress ───────────────────────── ⑮ No codebase TODO/FIXME scanning
|
|
74
|
+
⑯ No project-wide health check (only .planning/)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Gap Classification
|
|
78
|
+
|
|
79
|
+
| # | Gap | Source Skill | Effort | Priority |
|
|
80
|
+
|---|-----|-------------|--------|----------|
|
|
81
|
+
| ① | Priority/effort in plan.md | SuperPlan | XS | P3 |
|
|
82
|
+
| ② | Tier classification | PanMonty | M | P2 |
|
|
83
|
+
| ③ | Feature ladder | FeatureAI | S | P4 |
|
|
84
|
+
| ④ | Rollback snapshots | PanMonty | S | P1 |
|
|
85
|
+
| ⑤ | Capacity budget | ExecPlan | M | P1 |
|
|
86
|
+
| ⑥ | Tier-aware execution | PanMonty | L | P2 |
|
|
87
|
+
| ⑦ | Dry-run preview | ExecPlan | S | P2 |
|
|
88
|
+
| ⑧ | Execution modes | ExecPlan | M | P3 |
|
|
89
|
+
| ⑨ | Smart test skip | Commit | XS | P2 |
|
|
90
|
+
| ⑩ | Error pattern consultation | PanMonty | S | P3 |
|
|
91
|
+
| ⑪ | Commit safety checks | Commit | S | P1 |
|
|
92
|
+
| ⑫ | Conventional commit types | Commit | XS | P3 |
|
|
93
|
+
| ⑬ | Session summary | Session End | S | P2 |
|
|
94
|
+
| ⑭ | Error pattern capture | PanMonty + Session End | S | P2 |
|
|
95
|
+
| ⑮ | Codebase TODO scanning | SuperPlan | S | P3 |
|
|
96
|
+
| ⑯ | Extended health check | Check | M | P3 |
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Phase 2: Redesigned Flow
|
|
101
|
+
|
|
102
|
+
### Design Principle
|
|
103
|
+
|
|
104
|
+
**Don't add commands. Enhance existing ones.**
|
|
105
|
+
|
|
106
|
+
Every integration point below modifies an existing workflow, command, or pan-tools function. No new `/pan:` commands are created. The cognitive load delta is zero — users invoke the same commands; they just work better.
|
|
107
|
+
|
|
108
|
+
### The Redesigned End-to-End Flow
|
|
109
|
+
|
|
110
|
+
```text
|
|
111
|
+
┌─────────────────────────────────────────────────────────────────────────┐
|
|
112
|
+
│ PAN WIZARD v0.3 — REDESIGNED FLOW │
|
|
113
|
+
│ │
|
|
114
|
+
│ Additions marked with ★ │
|
|
115
|
+
│ Modifications marked with ◆ │
|
|
116
|
+
└─────────────────────────────────────────────────────────────────────────┘
|
|
117
|
+
|
|
118
|
+
/pan:new-project
|
|
119
|
+
│ (unchanged — already solid)
|
|
120
|
+
▼
|
|
121
|
+
/pan:discuss-phase
|
|
122
|
+
│ (unchanged — already solid)
|
|
123
|
+
▼
|
|
124
|
+
/pan:plan-phase <phase>
|
|
125
|
+
│
|
|
126
|
+
├─ ★ CLASSIFY TIER: Auto-classify each plan into MICRO/STANDARD/FULL
|
|
127
|
+
│ based on: task_count, files_modified count, has checkpoints
|
|
128
|
+
│ → Writes `tier: micro|standard|full` to plan.md frontmatter
|
|
129
|
+
│
|
|
130
|
+
├─ ★ PRIORITY/EFFORT: Planner assigns priority (P0-P4) and effort
|
|
131
|
+
│ (XS/S/M/L/XL) to each plan
|
|
132
|
+
│ → Writes `priority: P0-P4` and `effort: XS-XL` to frontmatter
|
|
133
|
+
│
|
|
134
|
+
└─ ★ OPTIONAL FEATURE LADDER: For L/XL plans, planner defines
|
|
135
|
+
v0 (MVP) / v1 (complete) / v2 (enhanced) scope
|
|
136
|
+
→ Writes `delivery: {v0: "...", v1: "...", v2: "..."}` to frontmatter
|
|
137
|
+
│
|
|
138
|
+
▼
|
|
139
|
+
/pan:execute-phase <phase> [--dry-run] [--budget N] [--mode bugfix|balanced|features]
|
|
140
|
+
│
|
|
141
|
+
├─ ★ ROLLBACK SNAPSHOT: Before any execution begins
|
|
142
|
+
│ → `git tag pan-rollback-{phase}-{timestamp}`
|
|
143
|
+
│ → Record tag name in execution context
|
|
144
|
+
│
|
|
145
|
+
├─ ★ DRY-RUN: If --dry-run, show execution plan and exit
|
|
146
|
+
│ → Display: plans by wave, estimated budget, tier distribution
|
|
147
|
+
│ → No agents spawned, no files modified
|
|
148
|
+
│
|
|
149
|
+
├─ ★ CAPACITY BUDGET: Track cumulative budget consumption
|
|
150
|
+
│ → XS=1, S=2, M=4, L=10, XL=20 points
|
|
151
|
+
│ → Default: 50 points (configurable via --budget)
|
|
152
|
+
│ → Stop when budget exhausted, report remaining items
|
|
153
|
+
│
|
|
154
|
+
├─ ★ EXECUTION MODE: Reorder plans based on mode
|
|
155
|
+
│ → bugfix: P0 first → P1 → smallest-first
|
|
156
|
+
│ → balanced: P0-P2 (60%) → P3-P4 (40%)
|
|
157
|
+
│ → features: P0 mandatory → P3-P4 (80%) → P1-P2 (20%)
|
|
158
|
+
│ → (default if no --mode: execute in wave order as today)
|
|
159
|
+
│
|
|
160
|
+
├─ ◆ TIER-AWARE EXECUTION (per plan):
|
|
161
|
+
│ │
|
|
162
|
+
│ ├─ MICRO (XS/S, ≤3 tasks, ≤2 files):
|
|
163
|
+
│ │ → Execute inline in orchestrator (no subagent spawn)
|
|
164
|
+
│ │ → Single commit, skip summary.md ceremony
|
|
165
|
+
│ │ → Minimal state update (advance-plan + commit)
|
|
166
|
+
│ │ → Saves: ~30s agent spawn + 200K context allocation
|
|
167
|
+
│ │
|
|
168
|
+
│ ├─ STANDARD (M, ≤8 tasks):
|
|
169
|
+
│ │ → Spawn pan-executor as today
|
|
170
|
+
│ │ → Skip: research consultation, extensive verification
|
|
171
|
+
│ │ → summary.md required but compact format
|
|
172
|
+
│ │
|
|
173
|
+
│ └─ FULL (L/XL, or autonomous=false):
|
|
174
|
+
│ → Full executor flow as today (unchanged)
|
|
175
|
+
│ → Full summary.md, full verification
|
|
176
|
+
│
|
|
177
|
+
├─ ◆ EXECUTE-PLAN (subagent, per plan):
|
|
178
|
+
│ │
|
|
179
|
+
│ ├─ ★ CONSULT ERROR PATTERNS: Before starting execution
|
|
180
|
+
│ │ → Read .planning/patterns.md (if exists)
|
|
181
|
+
│ │ → Include relevant patterns in executor prompt
|
|
182
|
+
│ │ → "Known pitfall: toPosix() required for JSON paths"
|
|
183
|
+
│ │
|
|
184
|
+
│ ├─ ◆ COMMIT SAFETY CHECKS: Before every git commit
|
|
185
|
+
│ │ → Check for deleted files: warn if unintentional
|
|
186
|
+
│ │ → Check for sensitive files: .env, .pem, .key, credentials
|
|
187
|
+
│ │ → Block commit if sensitive file detected
|
|
188
|
+
│ │
|
|
189
|
+
│ ├─ ◆ CONVENTIONAL COMMIT TYPE: Auto-assign from task type
|
|
190
|
+
│ │ → auto task → `feat:` or `fix:` based on task name
|
|
191
|
+
│ │ → tdd task → `test:` for RED, `feat:` for GREEN
|
|
192
|
+
│ │ → docs → `docs:`
|
|
193
|
+
│ │ → Stored in summary.md commit_type field
|
|
194
|
+
│ │
|
|
195
|
+
│ └─ ★ SMART TEST SKIP: If plan only modifies .md files
|
|
196
|
+
│ → Skip test verification step
|
|
197
|
+
│ → Mark in summary.md: `test_strategy: skipped_docs_only`
|
|
198
|
+
│
|
|
199
|
+
├─ ★ BUDGET CHECKPOINT: After each wave completes
|
|
200
|
+
│ → Display: points consumed / budget remaining / plans remaining
|
|
201
|
+
│ → If budget < next plan's effort: stop and report
|
|
202
|
+
│ → Remaining items carry forward to next /pan:execute-phase
|
|
203
|
+
│
|
|
204
|
+
└─ (continue to verification as today)
|
|
205
|
+
│
|
|
206
|
+
▼
|
|
207
|
+
(verify-work — unchanged)
|
|
208
|
+
│
|
|
209
|
+
▼
|
|
210
|
+
/pan:transition (phase complete → next phase)
|
|
211
|
+
│
|
|
212
|
+
├─ ★ SESSION SUMMARY: Auto-generate session summary
|
|
213
|
+
│ → Append to .planning/session-history.md:
|
|
214
|
+
│ ### {date} — Phase {N}: {name}
|
|
215
|
+
│ - Plans executed: N, Tests: before→after
|
|
216
|
+
│ - Key decisions: [from state.md]
|
|
217
|
+
│ - Duration: {estimated from metrics}
|
|
218
|
+
│ → Keep last 20 entries, trim oldest
|
|
219
|
+
│
|
|
220
|
+
├─ ★ ERROR PATTERN CAPTURE: If executor reported deviations
|
|
221
|
+
│ → Extract Rule 1-3 deviations from summary.md files
|
|
222
|
+
│ → Append to .planning/patterns.md:
|
|
223
|
+
│ ### PAT-NNN: {short description}
|
|
224
|
+
│ - Wrong: {what was tried}
|
|
225
|
+
│ - Right: {what worked}
|
|
226
|
+
│ - Context: Phase {N}, Plan {M}
|
|
227
|
+
│
|
|
228
|
+
└─ (continue transition as today)
|
|
229
|
+
│
|
|
230
|
+
▼
|
|
231
|
+
/pan:progress
|
|
232
|
+
│
|
|
233
|
+
├─ ★ CODEBASE TODO SCAN: Extend progress health subcommand
|
|
234
|
+
│ → Scan source files for TODO, FIXME, HACK, STUB
|
|
235
|
+
│ → Add `codebase_todos: N` to health output
|
|
236
|
+
│ → Add to health grade calculation (many TODOs = lower grade)
|
|
237
|
+
│
|
|
238
|
+
└─ ★ EXTENDED HEALTH: validate health --full
|
|
239
|
+
→ Run tests (npm test or equivalent)
|
|
240
|
+
→ Check build (if build script exists)
|
|
241
|
+
→ Cross-reference command count vs documented count
|
|
242
|
+
→ Full project integrity, not just .planning/
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Phase 3: Architecture & Implementation Design
|
|
248
|
+
|
|
249
|
+
### 3.1 What Changes Where
|
|
250
|
+
|
|
251
|
+
| Integration | Module | Function | Change Type |
|
|
252
|
+
|------------|--------|----------|-------------|
|
|
253
|
+
| Tier classification | `phase.cjs` | New: `classifyPlanTier()` | New helper |
|
|
254
|
+
| Priority/effort frontmatter | `template.cjs` | `cmdTemplateFill()` | Add optional fields |
|
|
255
|
+
| Rollback snapshot | `commands.cjs` | New: `cmdRollbackSnapshot()` | New command |
|
|
256
|
+
| Dry-run | `init.cjs` | `cmdInitExecutePhase()` | New `--dry-run` flag |
|
|
257
|
+
| Capacity budget | `commands.cjs` | New: `trackBudget()` | New helper |
|
|
258
|
+
| Budget in progress | `commands.cjs` | `cmdProgressRender()` | Add budget display |
|
|
259
|
+
| Execution modes | `init.cjs` | `cmdInitExecutePhase()` | New `--mode` flag |
|
|
260
|
+
| Inline MICRO execution | execute-phase workflow | Orchestrator change | Workflow .md change |
|
|
261
|
+
| Error pattern read | execute-plan workflow | Executor context | Workflow .md change |
|
|
262
|
+
| Error pattern write | transition workflow | Post-phase summary | Workflow .md change |
|
|
263
|
+
| Commit safety | `commands.cjs` | `cmdCommit()` | Add pre-commit checks |
|
|
264
|
+
| Conventional types | `commands.cjs` | `cmdCommit()` | Add `--type` flag |
|
|
265
|
+
| Smart test skip | execute-plan workflow | Executor decision | Workflow .md change |
|
|
266
|
+
| Session summary | transition workflow | Post-transition | Workflow .md change |
|
|
267
|
+
| TODO scanning | `commands.cjs` | `cmdListTodos()` | Extend to scan source |
|
|
268
|
+
| Extended health | `verify.cjs` | `cmdValidateHealth()` | Add `--full` flag |
|
|
269
|
+
|
|
270
|
+
### 3.2 New Files
|
|
271
|
+
|
|
272
|
+
| File | Purpose |
|
|
273
|
+
|------|---------|
|
|
274
|
+
| `.planning/patterns.md` | Error pattern learning (created on first capture) |
|
|
275
|
+
| `.planning/session-history.md` | Session summaries (created on first transition) |
|
|
276
|
+
|
|
277
|
+
No new core modules. No new commands. No new agents. All changes are extensions of existing code.
|
|
278
|
+
|
|
279
|
+
### 3.3 New plan.md Frontmatter Fields (All Optional)
|
|
280
|
+
|
|
281
|
+
```yaml
|
|
282
|
+
---
|
|
283
|
+
phase: "05-setup"
|
|
284
|
+
plan: "01"
|
|
285
|
+
type: execute
|
|
286
|
+
wave: 1
|
|
287
|
+
depends_on: []
|
|
288
|
+
files_modified: ["src/auth.ts"]
|
|
289
|
+
autonomous: true
|
|
290
|
+
must_haves: {...}
|
|
291
|
+
# ★ NEW — all optional, backward-compatible
|
|
292
|
+
tier: micro # micro | standard | full (auto-classified)
|
|
293
|
+
priority: P2 # P0-P4 (planner assigns)
|
|
294
|
+
effort: S # XS | S | M | L | XL (planner assigns)
|
|
295
|
+
delivery: # Only for L/XL plans
|
|
296
|
+
v0: "Basic auth with username/password"
|
|
297
|
+
v1: "Add OAuth2 + MFA"
|
|
298
|
+
v2: "Add SSO + SAML"
|
|
299
|
+
---
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### 3.4 New Config Options
|
|
303
|
+
|
|
304
|
+
```json
|
|
305
|
+
{
|
|
306
|
+
"budget": {
|
|
307
|
+
"default_points": 50,
|
|
308
|
+
"micro_threshold_tasks": 3,
|
|
309
|
+
"micro_threshold_files": 2
|
|
310
|
+
},
|
|
311
|
+
"commit": {
|
|
312
|
+
"safety_checks": true,
|
|
313
|
+
"conventional_types": true,
|
|
314
|
+
"sensitive_patterns": ["\\.env$", "\\.pem$", "\\.key$", "credentials", "secret"]
|
|
315
|
+
},
|
|
316
|
+
"execution": {
|
|
317
|
+
"default_mode": "wave_order",
|
|
318
|
+
"rollback_snapshots": true,
|
|
319
|
+
"error_pattern_learning": true
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### 3.5 Output Contract Changes
|
|
325
|
+
|
|
326
|
+
**`pan-tools commit` — Enhanced output:**
|
|
327
|
+
```json
|
|
328
|
+
{
|
|
329
|
+
"committed": true,
|
|
330
|
+
"hash": "abc1234",
|
|
331
|
+
"reason": "committed",
|
|
332
|
+
"type": "feat",
|
|
333
|
+
"safety_checks": {
|
|
334
|
+
"deleted_files": [],
|
|
335
|
+
"sensitive_files_blocked": []
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
**`pan-tools init execute-phase` — Enhanced output:**
|
|
341
|
+
```json
|
|
342
|
+
{
|
|
343
|
+
...existing fields...,
|
|
344
|
+
"plans_by_tier": { "micro": 2, "standard": 3, "full": 1 },
|
|
345
|
+
"total_budget_points": 50,
|
|
346
|
+
"estimated_points": 24,
|
|
347
|
+
"execution_mode": "wave_order",
|
|
348
|
+
"rollback_tag": "pan-rollback-05-20260301T120000",
|
|
349
|
+
"dry_run": false
|
|
350
|
+
}
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
**`pan-tools progress health` — Enhanced output:**
|
|
354
|
+
```json
|
|
355
|
+
{
|
|
356
|
+
...existing fields...,
|
|
357
|
+
"codebase_todos": 3,
|
|
358
|
+
"session_count": 12,
|
|
359
|
+
"patterns_count": 5,
|
|
360
|
+
"budget_remaining": 26
|
|
361
|
+
}
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
### 3.6 Backward Compatibility
|
|
365
|
+
|
|
366
|
+
| Change | Backward Compatible? | Migration |
|
|
367
|
+
|--------|---------------------|-----------|
|
|
368
|
+
| New plan.md frontmatter fields | Yes — all optional | Old plans work fine, new fields added by planner |
|
|
369
|
+
| Enhanced commit output | Yes — new fields added, none removed | Callers that don't check new fields unaffected |
|
|
370
|
+
| New config options | Yes — defaults applied if missing | `config-ensure-section` merges defaults |
|
|
371
|
+
| `--dry-run` flag | Yes — new flag, ignored if not present | No change to existing invocations |
|
|
372
|
+
| `--budget` flag | Yes — new flag, default=50 | No change to existing invocations |
|
|
373
|
+
| `--mode` flag | Yes — new flag, default=wave_order | No change to existing invocations |
|
|
374
|
+
| patterns.md file | Yes — only read if exists | No file = no patterns consulted |
|
|
375
|
+
| session-history.md file | Yes — only written on transition | Created automatically |
|
|
376
|
+
|
|
377
|
+
**Zero breaking changes. Every enhancement is opt-in or transparent.**
|
|
378
|
+
|
|
379
|
+
---
|
|
380
|
+
|
|
381
|
+
## Phase 4: Design Synthesis
|
|
382
|
+
|
|
383
|
+
### Guide-Level Explanation
|
|
384
|
+
|
|
385
|
+
PAN Wizard v0.3 introduces **smart execution** — the system automatically classifies work by size and adjusts its behavior accordingly. Small tasks (fix a typo, update a doc) skip the full agent ceremony and execute inline. Medium tasks get the standard executor flow. Large tasks get everything including verification.
|
|
386
|
+
|
|
387
|
+
You don't need to learn anything new. Run the same commands you always have:
|
|
388
|
+
|
|
389
|
+
```bash
|
|
390
|
+
/pan:execute-phase 5
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
Behind the scenes, PAN now:
|
|
394
|
+
1. Creates a git rollback tag before starting
|
|
395
|
+
2. Classifies each plan as MICRO/STANDARD/FULL
|
|
396
|
+
3. Executes MICRO plans inline (no agent spawn — 10x faster)
|
|
397
|
+
4. Tracks a point budget to prevent context exhaustion
|
|
398
|
+
5. Checks for sensitive files before every commit
|
|
399
|
+
6. Learns from errors and applies patterns in future sessions
|
|
400
|
+
|
|
401
|
+
Want more control? Three new optional flags:
|
|
402
|
+
|
|
403
|
+
```bash
|
|
404
|
+
/pan:execute-phase 5 --dry-run # Preview what would execute
|
|
405
|
+
/pan:execute-phase 5 --budget 30 # Limit to 30 budget points
|
|
406
|
+
/pan:execute-phase 5 --mode bugfix # Prioritize P0-P1 items
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
### Reference-Level Explanation
|
|
410
|
+
|
|
411
|
+
#### Tier Classification Algorithm
|
|
412
|
+
|
|
413
|
+
```text
|
|
414
|
+
function classifyPlanTier(plan):
|
|
415
|
+
if plan.autonomous == false:
|
|
416
|
+
return 'full'
|
|
417
|
+
if plan.task_count <= 3 AND plan.files_modified.length <= 2:
|
|
418
|
+
return 'micro'
|
|
419
|
+
if plan.task_count <= 8:
|
|
420
|
+
return 'standard'
|
|
421
|
+
return 'full'
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
Overridable: if `tier:` is set in plan.md frontmatter, that takes precedence.
|
|
425
|
+
|
|
426
|
+
#### Budget Point System
|
|
427
|
+
|
|
428
|
+
| Effort | Points | Plans per 50-point budget |
|
|
429
|
+
|--------|--------|---------------------------|
|
|
430
|
+
| XS | 1 | Up to 50 |
|
|
431
|
+
| S | 2 | Up to 25 |
|
|
432
|
+
| M | 4 | Up to 12 |
|
|
433
|
+
| L | 10 | Up to 5 |
|
|
434
|
+
| XL | 20 | Up to 2 |
|
|
435
|
+
|
|
436
|
+
Budget tracking lives in the orchestrator's execution loop, not in pan-tools state. It's ephemeral per `/pan:execute-phase` invocation.
|
|
437
|
+
|
|
438
|
+
#### MICRO Execution Path
|
|
439
|
+
|
|
440
|
+
For plans classified as MICRO:
|
|
441
|
+
1. Orchestrator reads plan.md directly (no agent spawn)
|
|
442
|
+
2. Implements tasks inline using Edit/Write/Bash tools
|
|
443
|
+
3. Single atomic commit with conventional type
|
|
444
|
+
4. Calls `pan-tools state advance-plan` and `pan-tools commit`
|
|
445
|
+
5. Skips summary.md creation (minimal overhead)
|
|
446
|
+
6. Total: 1 round-trip vs 3-4 for agent-based execution
|
|
447
|
+
|
|
448
|
+
This saves ~30 seconds of agent spawn overhead and ~200K tokens of context allocation per MICRO plan.
|
|
449
|
+
|
|
450
|
+
#### Commit Safety Protocol
|
|
451
|
+
|
|
452
|
+
Added to `cmdCommit()` before git operations:
|
|
453
|
+
|
|
454
|
+
```text
|
|
455
|
+
1. git status --porcelain → parse for deleted files (^D or ^ D)
|
|
456
|
+
2. If deleted files AND not --force: return { error: "Deleted files detected", files: [...], hint: "Use --force to confirm" }
|
|
457
|
+
3. git diff --cached --name-only → match against config.commit.sensitive_patterns
|
|
458
|
+
4. If matches found: return { error: "Sensitive file detected", files: [...], hint: "Remove from staging" }
|
|
459
|
+
5. Proceed with commit
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
#### Error Pattern File Format
|
|
463
|
+
|
|
464
|
+
```markdown
|
|
465
|
+
# Error Patterns
|
|
466
|
+
|
|
467
|
+
### PAT-001: toPosix required for JSON path output
|
|
468
|
+
- **Wrong:** `output({ path: path.join(dir, file) })`
|
|
469
|
+
- **Right:** `output({ path: toPosix(path.join(dir, file)) })`
|
|
470
|
+
- **Context:** Phase 7, Plan 2 — Windows backslash in JSON output
|
|
471
|
+
- **Date:** 2026-02-27
|
|
472
|
+
|
|
473
|
+
### PAT-002: readStateSafe for file reads
|
|
474
|
+
- **Wrong:** `if (existsSync(f)) readFileSync(f)` (TOCTOU race)
|
|
475
|
+
- **Right:** `try { readFileSync(f) } catch { return null }`
|
|
476
|
+
- **Context:** Phase 8, Plan 1 — concurrent access crash
|
|
477
|
+
- **Date:** 2026-02-28
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
## Phase 5: ADR
|
|
483
|
+
|
|
484
|
+
```markdown
|
|
485
|
+
# ADR-0003: Smart Execution with Tier Classification and Budget Control
|
|
486
|
+
|
|
487
|
+
## Status
|
|
488
|
+
Proposed
|
|
489
|
+
|
|
490
|
+
## Context
|
|
491
|
+
PAN Wizard's execute-phase workflow treats all plans identically — every plan
|
|
492
|
+
spawns a full executor agent with 200K context, creates a detailed summary.md,
|
|
493
|
+
and goes through the complete verification flow. For XS/S tasks (typo fixes,
|
|
494
|
+
doc updates, single-file changes), this overhead takes longer than the actual
|
|
495
|
+
work. Meanwhile, there's no mechanism to prevent context exhaustion when a
|
|
496
|
+
phase has many plans, and no safety checks before git commits.
|
|
497
|
+
|
|
498
|
+
Custom skills developed during PAN Wizard's own construction (PanMonty,
|
|
499
|
+
ExecPlan, Commit) proved that tier-based execution, capacity budgets, and
|
|
500
|
+
commit safety checks significantly improve development velocity and safety.
|
|
501
|
+
|
|
502
|
+
## Decision
|
|
503
|
+
Integrate these capabilities into existing workflows rather than creating
|
|
504
|
+
new commands:
|
|
505
|
+
|
|
506
|
+
1. **Tier classification** (micro/standard/full) based on plan complexity,
|
|
507
|
+
stored in plan.md frontmatter, auto-assigned by planner
|
|
508
|
+
2. **MICRO execution** inline in orchestrator (no agent spawn)
|
|
509
|
+
3. **Capacity budgets** tracked per execution session (default 50 points)
|
|
510
|
+
4. **Rollback snapshots** via git tags before execution
|
|
511
|
+
5. **Commit safety** checks for deleted/sensitive files
|
|
512
|
+
6. **Error pattern learning** from execution deviations
|
|
513
|
+
7. **Session summaries** appended to session-history.md
|
|
514
|
+
8. **Dry-run mode** for execution preview
|
|
515
|
+
|
|
516
|
+
## Consequences
|
|
517
|
+
|
|
518
|
+
### Positive
|
|
519
|
+
- MICRO plans execute 10x faster (skip agent spawn)
|
|
520
|
+
- Budget prevents context window exhaustion
|
|
521
|
+
- Rollback provides safety net for risky changes
|
|
522
|
+
- Commit safety catches sensitive files before they hit git
|
|
523
|
+
- Error patterns improve over time (cross-session learning)
|
|
524
|
+
- Zero new commands to learn — same UX, better behavior
|
|
525
|
+
|
|
526
|
+
### Negative
|
|
527
|
+
- Tier classification adds complexity to plan-phase workflow
|
|
528
|
+
- Budget tracking adds state to orchestrator loop
|
|
529
|
+
- patterns.md and session-history.md are new persistent files
|
|
530
|
+
|
|
531
|
+
### Neutral
|
|
532
|
+
- All new features are optional and backward-compatible
|
|
533
|
+
- Existing plans without tier/priority/effort work unchanged
|
|
534
|
+
- Config defaults preserve current behavior
|
|
535
|
+
|
|
536
|
+
## Options Considered
|
|
537
|
+
1. **New commands** (rejected — adds cognitive load, fragments workflow)
|
|
538
|
+
2. **Separate tool** (rejected — loses integration with PAN state)
|
|
539
|
+
3. **Enhance existing workflows** (chosen — zero new commands, natural integration)
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
---
|
|
543
|
+
|
|
544
|
+
## Phase 6: Error Handling
|
|
545
|
+
|
|
546
|
+
| Failure Mode | Detection | Recovery | User Sees |
|
|
547
|
+
|-------------|-----------|----------|-----------|
|
|
548
|
+
| Rollback tag creation fails | try-catch on `git tag` | Continue without snapshot, warn user | `"rollback_tag": null, "warning": "..."` |
|
|
549
|
+
| Budget exhausted mid-wave | Point check after each plan | Stop, report remaining plans | Budget report with carry-forward list |
|
|
550
|
+
| Sensitive file in commit | Pattern match on staged files | Block commit, return error | `"error": "Sensitive file: .env"` |
|
|
551
|
+
| patterns.md malformed | try-catch on read/parse | Skip pattern consultation | Silent skip, no crash |
|
|
552
|
+
| session-history.md write fails | try-catch on writeFileSync | Log warning, continue | Phase completes, history not written |
|
|
553
|
+
| Tier classification wrong | User can set `tier:` in frontmatter | Manual override takes precedence | User control preserved |
|
|
554
|
+
|
|
555
|
+
---
|
|
556
|
+
|
|
557
|
+
## Phase 7: Security
|
|
558
|
+
|
|
559
|
+
| Input | Validation |
|
|
560
|
+
|-------|------------|
|
|
561
|
+
| `--budget N` | parseInt, clamp 1-200, reject NaN |
|
|
562
|
+
| `--mode` | Enum check: wave_order, bugfix, balanced, features |
|
|
563
|
+
| `--type` | Enum check: feat, fix, docs, test, refactor, chore |
|
|
564
|
+
| Sensitive patterns | Compiled once from config, matched via regex |
|
|
565
|
+
| patterns.md content | Read-only, try-catch, never eval'd |
|
|
566
|
+
| Rollback tag name | Sanitized via generateSlug() — no shell injection |
|
|
567
|
+
|
|
568
|
+
No new attack surface. All inputs are CLI flags with strict validation. No new file parsing beyond patterns.md (which is only read, never executed).
|
|
569
|
+
|
|
570
|
+
---
|
|
571
|
+
|
|
572
|
+
## Phase 8: Implementation Roadmap
|
|
573
|
+
|
|
574
|
+
### Wave 1: Foundation (No workflow changes needed)
|
|
575
|
+
|
|
576
|
+
| Task | Files | Effort | Tests |
|
|
577
|
+
|------|-------|--------|-------|
|
|
578
|
+
| 1.1 Add `classifyPlanTier()` to phase.cjs | phase.cjs | XS | 3 unit tests |
|
|
579
|
+
| 1.2 Add `tier`, `priority`, `effort` to plan.md template | template.cjs | XS | 2 tests |
|
|
580
|
+
| 1.3 Add commit safety checks to `cmdCommit()` | commands.cjs | S | 5 tests (deleted, sensitive, force) |
|
|
581
|
+
| 1.4 Add `--type` flag to `cmdCommit()` | commands.cjs, pan-tools.cjs | XS | 2 tests |
|
|
582
|
+
| 1.5 Add `cmdRollbackSnapshot()` to commands.cjs | commands.cjs, pan-tools.cjs | S | 3 tests |
|
|
583
|
+
|
|
584
|
+
**Wave 1 total:** 15 tests, ~S-M combined effort
|
|
585
|
+
|
|
586
|
+
### Wave 2: Execution Enhancements (Workflow changes)
|
|
587
|
+
|
|
588
|
+
| Task | Files | Effort | Tests |
|
|
589
|
+
|------|-------|--------|-------|
|
|
590
|
+
| 2.1 Add `--dry-run` to init execute-phase | init.cjs, pan-tools.cjs | S | 3 tests |
|
|
591
|
+
| 2.2 Add `--budget` tracking to init execute-phase | init.cjs | S | 3 tests |
|
|
592
|
+
| 2.3 Add `--mode` execution ordering | init.cjs | S | 4 tests (one per mode) |
|
|
593
|
+
| 2.4 Add `plans_by_tier` to execute-phase init output | init.cjs | XS | 2 tests |
|
|
594
|
+
| 2.5 Update execute-phase.md workflow for MICRO inline | workflows/execute-phase.md | M | Manual verification |
|
|
595
|
+
| 2.6 Update execute-plan.md for error pattern consultation | workflows/execute-plan.md | S | Manual verification |
|
|
596
|
+
|
|
597
|
+
**Wave 2 total:** 12 tests + 2 workflow updates, ~M combined effort
|
|
598
|
+
|
|
599
|
+
### Wave 3: Learning & Reporting
|
|
600
|
+
|
|
601
|
+
| Task | Files | Effort | Tests |
|
|
602
|
+
|------|-------|--------|-------|
|
|
603
|
+
| 3.1 Add error pattern write to transition.md | workflows/transition.md | S | Manual verification |
|
|
604
|
+
| 3.2 Add session summary to transition.md | workflows/transition.md | S | Manual verification |
|
|
605
|
+
| 3.3 Extend `cmdListTodos()` for codebase scanning | commands.cjs | S | 3 tests |
|
|
606
|
+
| 3.4 Add `--full` to `cmdValidateHealth()` | verify.cjs | M | 4 tests |
|
|
607
|
+
| 3.5 Extend `progress health` with patterns/todos/sessions | commands.cjs | S | 2 tests |
|
|
608
|
+
| 3.6 Add budget config defaults to config-ensure-section | config.cjs | XS | 1 test |
|
|
609
|
+
|
|
610
|
+
**Wave 3 total:** 10 tests + 2 workflow updates, ~M combined effort
|
|
611
|
+
|
|
612
|
+
### Wave 4: Documentation & Polish
|
|
613
|
+
|
|
614
|
+
| Task | Files | Effort |
|
|
615
|
+
|------|-------|--------|
|
|
616
|
+
| 4.1 Update CLI-REFERENCE.md with new flags | docs/CLI-REFERENCE.md | S |
|
|
617
|
+
| 4.2 Update USER-GUIDE.md with tier/budget explanation | docs/USER-GUIDE.md | S |
|
|
618
|
+
| 4.3 Update ARCHITECTURE.md with patterns.md lifecycle | docs/ARCHITECTURE.md | XS |
|
|
619
|
+
| 4.4 Update CHANGELOG.md | CHANGELOG.md | XS |
|
|
620
|
+
| 4.5 Create ADR-0003 | docs/decisions/ | XS |
|
|
621
|
+
|
|
622
|
+
**Wave 4 total:** docs only, ~S combined effort
|
|
623
|
+
|
|
624
|
+
### Dependency Graph
|
|
625
|
+
|
|
626
|
+
```text
|
|
627
|
+
Wave 1 (foundation)
|
|
628
|
+
├── 1.1 classifyPlanTier
|
|
629
|
+
├── 1.2 frontmatter fields
|
|
630
|
+
├── 1.3 commit safety ─────────────────┐
|
|
631
|
+
├── 1.4 commit types │
|
|
632
|
+
└── 1.5 rollback snapshot │
|
|
633
|
+
│
|
|
634
|
+
Wave 2 (execution) ← depends on Wave 1 │
|
|
635
|
+
├── 2.1 dry-run │
|
|
636
|
+
├── 2.2 budget tracking │
|
|
637
|
+
├── 2.3 execution modes │
|
|
638
|
+
├── 2.4 tier output │
|
|
639
|
+
├── 2.5 MICRO execution ← needs 1.1 │
|
|
640
|
+
└── 2.6 error patterns ← needs 3.1 │ (can be parallel with Wave 3)
|
|
641
|
+
│
|
|
642
|
+
Wave 3 (learning) ← depends on Wave 1 │
|
|
643
|
+
├── 3.1 pattern write │
|
|
644
|
+
├── 3.2 session summary │
|
|
645
|
+
├── 3.3 TODO scanning │
|
|
646
|
+
├── 3.4 extended health │
|
|
647
|
+
├── 3.5 enhanced progress ← needs 3.3,3.4
|
|
648
|
+
└── 3.6 config defaults │
|
|
649
|
+
│
|
|
650
|
+
Wave 4 (docs) ← depends on Waves 1-3 │
|
|
651
|
+
└── 4.1-4.5 documentation ◄┘
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
**Waves 2 and 3 can execute in parallel.** Wave 4 depends on all.
|
|
655
|
+
|
|
656
|
+
---
|
|
657
|
+
|
|
658
|
+
## Phase 9: Test Plan
|
|
659
|
+
|
|
660
|
+
### Test Pyramid
|
|
661
|
+
|
|
662
|
+
| Level | Count | What |
|
|
663
|
+
|-------|-------|------|
|
|
664
|
+
| Unit | 22 | classifyPlanTier, commit safety, budget math, TODO scanning |
|
|
665
|
+
| Integration | 15 | cmdCommit with safety, init execute-phase with flags, progress health |
|
|
666
|
+
| Workflow | 4 | MICRO execution path, dry-run, budget exhaustion, mode ordering |
|
|
667
|
+
| **Total** | **41** | |
|
|
668
|
+
|
|
669
|
+
### Key Test Scenarios
|
|
670
|
+
|
|
671
|
+
**Tier classification:**
|
|
672
|
+
- 1 task, 1 file → MICRO
|
|
673
|
+
- 5 tasks, 3 files → STANDARD
|
|
674
|
+
- 12 tasks, 8 files → FULL
|
|
675
|
+
- autonomous=false → always FULL
|
|
676
|
+
- Explicit `tier: micro` in frontmatter → MICRO regardless of size
|
|
677
|
+
|
|
678
|
+
**Commit safety:**
|
|
679
|
+
- No deleted, no sensitive → commit succeeds
|
|
680
|
+
- Deleted file present → error with file list
|
|
681
|
+
- Deleted file + --force → commit proceeds
|
|
682
|
+
- .env in staging → blocked, error
|
|
683
|
+
- .env.example in staging → not blocked (no match)
|
|
684
|
+
|
|
685
|
+
**Budget:**
|
|
686
|
+
- Budget 50, plan effort S (2pts) → budget 48 remaining
|
|
687
|
+
- Budget 3, next plan M (4pts) → stop, report
|
|
688
|
+
- Budget 0 → stop immediately
|
|
689
|
+
- No --budget flag → default 50
|
|
690
|
+
|
|
691
|
+
**Execution modes:**
|
|
692
|
+
- bugfix mode: P0 plans before P3 plans
|
|
693
|
+
- balanced mode: 60/40 split honored
|
|
694
|
+
- features mode: P0 mandatory, then P3-P4 first
|
|
695
|
+
- wave_order (default): wave 1 before wave 2 (unchanged)
|
|
696
|
+
|
|
697
|
+
---
|
|
698
|
+
|
|
699
|
+
## Phase 10: Summary
|
|
700
|
+
|
|
701
|
+
### What Changes for Users
|
|
702
|
+
|
|
703
|
+
**Nothing to learn. Same commands, smarter behavior.**
|
|
704
|
+
|
|
705
|
+
| Before (v0.2) | After (v0.3) |
|
|
706
|
+
|---------------|-------------|
|
|
707
|
+
| All plans spawn full executor agents | MICRO plans execute inline (10x faster) |
|
|
708
|
+
| Execute until done or context crash | Budget stops execution gracefully |
|
|
709
|
+
| No safety net | Rollback snapshot before execution |
|
|
710
|
+
| No commit checks | Sensitive file detection |
|
|
711
|
+
| No learning | Error patterns carry across sessions |
|
|
712
|
+
| No session memory | Session summaries preserved |
|
|
713
|
+
| No preview | `--dry-run` shows execution plan |
|
|
714
|
+
| One execution strategy | `--mode` for bugfix/balanced/features |
|
|
715
|
+
|
|
716
|
+
### What Changes for Developers
|
|
717
|
+
|
|
718
|
+
| Area | Changes |
|
|
719
|
+
|------|---------|
|
|
720
|
+
| Core modules | 6 functions added/modified across 4 modules |
|
|
721
|
+
| Workflow .md files | 4 workflows updated |
|
|
722
|
+
| New files created at runtime | `patterns.md`, `session-history.md` (both optional) |
|
|
723
|
+
| New frontmatter fields | `tier`, `priority`, `effort`, `delivery` (all optional) |
|
|
724
|
+
| New config options | `budget.*`, `commit.*`, `execution.*` (all with defaults) |
|
|
725
|
+
| New CLI flags | `--dry-run`, `--budget N`, `--mode`, `--type`, `--force` |
|
|
726
|
+
| Tests | ~41 new tests |
|
|
727
|
+
| Breaking changes | Zero |
|
|
728
|
+
|
|
729
|
+
### Implementation Effort
|
|
730
|
+
|
|
731
|
+
| Wave | Effort | Tests | Parallel? |
|
|
732
|
+
|------|--------|-------|-----------|
|
|
733
|
+
| 1: Foundation | S-M | 15 | No (first) |
|
|
734
|
+
| 2: Execution | M | 12 | Yes (with Wave 3) |
|
|
735
|
+
| 3: Learning | M | 10 | Yes (with Wave 2) |
|
|
736
|
+
| 4: Docs | S | 0 | No (last) |
|
|
737
|
+
| **Total** | **~L** | **37+** | 2 parallel waves |
|
|
738
|
+
|
|
739
|
+
### Next Step
|
|
740
|
+
|
|
741
|
+
Create superplan from this spec: `/superplan --refresh`
|
|
742
|
+
Execute: `/execplan --mode balanced`
|