pan-wizard 3.36.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 +36 -48
- 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 +1 -2
- package/agents/pan-document_code.md +1 -2
- package/agents/pan-hardener.md +2 -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 +79 -488
- package/agents/pan-plan-checker.md +12 -2
- package/agents/pan-planner.md +10 -6
- package/agents/pan-previewer.md +1 -2
- package/agents/pan-project-researcher.md +70 -499
- package/agents/pan-release.md +1 -1
- package/agents/pan-reviewer.md +9 -3
- package/agents/pan-roadmapper.md +12 -7
- package/agents/pan-verifier.md +7 -2
- 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/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/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 +31 -2
- package/pan-wizard-core/bin/lib/constants.cjs +27 -1
- package/pan-wizard-core/bin/lib/core.cjs +22 -10
- package/pan-wizard-core/bin/lib/cost.cjs +14 -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/failure-class.cjs +81 -0
- package/pan-wizard-core/bin/lib/findings.cjs +34 -4
- package/pan-wizard-core/bin/lib/focus.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 +16 -5
- 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.cjs +48 -4
- package/pan-wizard-core/bin/lib/plan-lint.cjs +150 -1
- package/pan-wizard-core/bin/lib/preview.cjs +23 -4
- package/pan-wizard-core/bin/lib/requirements-lint.cjs +130 -0
- package/pan-wizard-core/bin/lib/research-lint.cjs +150 -3
- 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/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/uat.cjs +149 -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 +37 -1
- package/pan-wizard-core/bin/lib/verify-retro.cjs +3 -2
- package/pan-wizard-core/bin/lib/verify.cjs +59 -4
- package/pan-wizard-core/bin/lib/worktree.cjs +70 -0
- package/pan-wizard-core/bin/pan-tools.cjs +168 -27
- package/pan-wizard-core/learnings/universal/autonomous-loop.md +2 -2
- package/pan-wizard-core/references/continuation-format.md +3 -3
- package/pan-wizard-core/references/guardrails.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 +5 -1
- package/pan-wizard-core/templates/debug.md +1 -0
- package/pan-wizard-core/templates/discovery.md +2 -2
- package/pan-wizard-core/templates/requirements.md +9 -0
- 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 +36 -8
- 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 +31 -53
- 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 +86 -43
- 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/research-phase.md +118 -40
- package/pan-wizard-core/workflows/resume-project.md +18 -2
- package/pan-wizard-core/workflows/settings.md +21 -24
- 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 +2 -2
- package/scripts/build-agent-plugin.js +35 -15
- 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/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 +9 -2
- 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 -210
- package/pan-wizard-core/templates/research-project/features.md +0 -153
- package/pan-wizard-core/templates/research-project/pitfalls.md +0 -206
- package/pan-wizard-core/templates/research-project/stack.md +0 -126
- package/pan-wizard-core/templates/research-project/summary.md +0 -170
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pan:mcp-bridge
|
|
3
|
-
group: External tools
|
|
4
|
-
description: Discover available MCP tools and recommend which ones apply to a phase. Discovery-only; auto-invocation deferred.
|
|
5
|
-
argument-hint: "list | recommend <phase> [--max N] [--min-score N] | cache [--servers <json>] [--runtime <name>]"
|
|
6
|
-
allowed-tools:
|
|
7
|
-
- Read
|
|
8
|
-
- Bash
|
|
9
|
-
- Write
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
<objective>
|
|
13
|
-
Surface Model Context Protocol (MCP) tools visible to the host runtime and recommend which ones might apply to a specific phase plan.
|
|
14
|
-
|
|
15
|
-
Reduced scope from Spec B v1's X-7: **discovery and recommendation only**. Auto-injection of MCP tools into planner context and auto-invocation from executor agents are deliberately deferred and still unscheduled (the v3.5 target passed without them). This kept v3.3 narrow and avoids coupling PAN to Claude Code's MCP schema stability.
|
|
16
|
-
</objective>
|
|
17
|
-
|
|
18
|
-
Each subcommand runs `node ~/.claude/pan-wizard-core/bin/pan-tools.cjs bridge <list|recommend|cache> [flags]`. The CLI verb is `bridge`, not `mcp-bridge`: `pan-tools mcp-bridge` is an unknown command.
|
|
19
|
-
|
|
20
|
-
<subcommands>
|
|
21
|
-
|
|
22
|
-
### `list`
|
|
23
|
-
|
|
24
|
-
Show cached MCP tools with server grouping and schemas.
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
/pan:mcp-bridge list
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
**Output (JSON):**
|
|
31
|
-
```json
|
|
32
|
-
{
|
|
33
|
-
"cached_at": "2026-04-18T12:34:56Z",
|
|
34
|
-
"runtime": "claude",
|
|
35
|
-
"server_count": 3,
|
|
36
|
-
"tool_count": 12,
|
|
37
|
-
"tools": [
|
|
38
|
-
{ "server": "linear", "name": "linear.updateTicket", "description": "...", "schema": {...} },
|
|
39
|
-
...
|
|
40
|
-
],
|
|
41
|
-
"source": "cache" | "empty"
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
When `source: "empty"`, nothing has seeded the cache yet: no hook or host writes it, only `cache --servers` (or an external script). See the `cache` subcommand for manual seeding.
|
|
46
|
-
|
|
47
|
-
### `recommend <phase>`
|
|
48
|
-
|
|
49
|
-
Given a phase number, match cached MCP tools against the phase's plan text and return tools ranked by keyword relevance.
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
/pan:mcp-bridge recommend 7
|
|
53
|
-
/pan:mcp-bridge recommend 12 --max 5 --min-score 2
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
**Flags:**
|
|
57
|
-
- `--max N` — cap recommendations (default 10)
|
|
58
|
-
- `--min-score N` — minimum keyword hit count (default 1)
|
|
59
|
-
|
|
60
|
-
**Output (JSON):**
|
|
61
|
-
```json
|
|
62
|
-
{
|
|
63
|
-
"phase": "7",
|
|
64
|
-
"phase_name": "API refactor",
|
|
65
|
-
"runtime": "claude",
|
|
66
|
-
"total_candidates": 12,
|
|
67
|
-
"recommendations": [
|
|
68
|
-
{
|
|
69
|
-
"server": "linear",
|
|
70
|
-
"name": "linear.updateTicket",
|
|
71
|
-
"description": "Update a Linear issue",
|
|
72
|
-
"score": 3,
|
|
73
|
-
"hits": ["linear", "ticket", "update"]
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Scoring is naive keyword frequency with word boundaries — not semantic embeddings. A tool's name and description are tokenized into keywords (≥3 chars); each match in the phase plan text scores 1 point.
|
|
80
|
-
|
|
81
|
-
### `cache`
|
|
82
|
-
|
|
83
|
-
Write or inspect the MCP tools cache at `.planning/bridge/available-tools.json`.
|
|
84
|
-
|
|
85
|
-
```
|
|
86
|
-
# Inspect current cache (prints the same JSON as `list`)
|
|
87
|
-
/pan:mcp-bridge cache
|
|
88
|
-
|
|
89
|
-
# Seed cache from scripted discovery (for testing or external pipeline)
|
|
90
|
-
/pan:mcp-bridge cache --runtime claude --servers '[{"name":"linear","tools":[{"name":"linear.updateTicket","description":"Update ticket"}]}]'
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
Nothing else writes this file: no hook or installer step populates it, so `list` and `recommend` see only what this command (or an external script) has recorded.
|
|
94
|
-
|
|
95
|
-
</subcommands>
|
|
96
|
-
|
|
97
|
-
<workflow>
|
|
98
|
-
|
|
99
|
-
**New to a project with MCP tools?** Run `/pan:mcp-bridge list` to see what's available. If empty, nothing has seeded the cache: record each server with its tools, `/pan:mcp-bridge cache --servers '[{"name":"<server>","tools":[{"name":"<tool>","description":"…"}]}]'`, taking the tool names and descriptions from the MCP tools your session has loaded. A server recorded without `tools` adds no tool to `list` (only `server_count` counts it, and `source` then reads `cache`) and nothing to `recommend`, and the host runtime's MCP config names only the servers and how to start them. Each runtime keeps that config somewhere different: Claude Code in `.mcp.json` at the project root (project scope) or `~/.claude.json` (user and local scopes), OpenCode in `opencode.json`, Copilot in `.github/mcp.json`, Codex in its own config, Gemini in its settings file.
|
|
100
|
-
|
|
101
|
-
**Planning a phase that might touch external systems?** Run `/pan:mcp-bridge recommend <phase>` to get a ranked shortlist. Copy relevant tool names into the phase plan's "External tools" section so the executor knows to invoke them.
|
|
102
|
-
|
|
103
|
-
**Pre-milestone review:** walk through each remaining phase with `/pan:mcp-bridge recommend` to catch "we should have automated this via Linear/Slack/etc." realizations before shipping.
|
|
104
|
-
|
|
105
|
-
</workflow>
|
|
106
|
-
|
|
107
|
-
<caveats>
|
|
108
|
-
|
|
109
|
-
**Discovery is a cache, not a live probe.** Only `cache --servers` (or an external script) populates `.planning/bridge/available-tools.json`; no hook or host writes it. PAN does not query MCP servers directly — that would require runtime-specific HTTP or IPC integration this command deliberately avoids.
|
|
110
|
-
|
|
111
|
-
**Keyword scoring is crude.** "Postgres" and "PostgreSQL" are different tokens; `postgresql` in a plan won't match a `postgres.query` tool unless the plan also says "postgres." Tune your plan language or expand tool descriptions to improve matches.
|
|
112
|
-
|
|
113
|
-
**No runtime is special.** Each runtime PAN installs into reads MCP servers from its own config (see the workflow section above); the cache schema is generic, so whatever lists a runtime's servers can populate the same file.
|
|
114
|
-
|
|
115
|
-
**No automatic invocation.** This command never calls MCP tools. It tells you what's available and what might apply. The actual invocation happens via the host runtime's normal tool-use flow (Claude Code's tool calls, etc.) when the executor agent decides to use a recommended tool.
|
|
116
|
-
|
|
117
|
-
</caveats>
|
|
118
|
-
|
|
119
|
-
<runtime_compatibility>
|
|
120
|
-
|
|
121
|
-
| Runtime | list | recommend | cache |
|
|
122
|
-
|---------|------|-----------|-------|
|
|
123
|
-
| Claude Code | Full once seeded | Full once seeded | Full |
|
|
124
|
-
| OpenCode | Full once seeded | Full once seeded | Full |
|
|
125
|
-
| Gemini CLI | Full once seeded | Full once seeded | Full |
|
|
126
|
-
| Codex CLI | Full once seeded | Full once seeded | Full |
|
|
127
|
-
| Copilot CLI | Full once seeded | Full once seeded | Full |
|
|
128
|
-
|
|
129
|
-
On every runtime, `list` reports zero tools (`source: "empty"`) and `recommend` an empty `recommendations` list with a `reason` until `cache --servers` (or an external script) populates the cache; no host or hook writes it.
|
|
130
|
-
|
|
131
|
-
</runtime_compatibility>
|
|
132
|
-
|
|
133
|
-
<future_scope>
|
|
134
|
-
|
|
135
|
-
Explicitly deferred from v3.3 (documented in ADR-0024 / Spec B v2 notes):
|
|
136
|
-
|
|
137
|
-
1. **Auto-inject recommended tools into planner context** — requires a stable MCP schema contract and a plan-template extension. Unscheduled.
|
|
138
|
-
2. **Auto-invoke MCP tools from executor agent** — requires permission-gating and per-tool safety review. Unscheduled.
|
|
139
|
-
3. **Cross-runtime tool discovery** — filling the cache automatically from each runtime's own MCP config and servers. No timeline; needs ecosystem signal.
|
|
140
|
-
|
|
141
|
-
Until those land, this command is the minimum viable integration: you see what's there, you get suggestions, you decide manually.
|
|
142
|
-
|
|
143
|
-
</future_scope>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pan:milestone-cleanup
|
|
3
|
-
group: Milestone
|
|
4
|
-
description: Archive accumulated phase directories from completed milestones
|
|
5
|
-
---
|
|
6
|
-
<objective>
|
|
7
|
-
Archive phase directories from completed milestones into `.planning/milestones/v{X.Y}-phases/`.
|
|
8
|
-
|
|
9
|
-
Use when `.planning/phases/` has accumulated directories from past milestones.
|
|
10
|
-
</objective>
|
|
11
|
-
|
|
12
|
-
<execution_context>
|
|
13
|
-
@~/.claude/pan-wizard-core/workflows/milestone-cleanup.md
|
|
14
|
-
</execution_context>
|
|
15
|
-
|
|
16
|
-
<process>
|
|
17
|
-
Follow the cleanup workflow at @~/.claude/pan-wizard-core/workflows/milestone-cleanup.md.
|
|
18
|
-
Identify completed milestones, show a dry-run summary, and archive on confirmation.
|
|
19
|
-
</process>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pan:milestone-gaps
|
|
3
|
-
group: Milestone
|
|
4
|
-
description: Create phases to close all gaps identified by milestone audit
|
|
5
|
-
allowed-tools:
|
|
6
|
-
- Read
|
|
7
|
-
- Write
|
|
8
|
-
- Bash
|
|
9
|
-
- Glob
|
|
10
|
-
- Grep
|
|
11
|
-
- AskUserQuestion
|
|
12
|
-
---
|
|
13
|
-
<objective>
|
|
14
|
-
Create all phases necessary to close gaps identified by `/pan:milestone-audit`.
|
|
15
|
-
|
|
16
|
-
Reads milestone-audit.md, groups gaps into logical phases, creates phase entries in roadmap.md, and offers to plan each phase.
|
|
17
|
-
|
|
18
|
-
One command creates all fix phases — no manual `/pan:add-phase` per gap.
|
|
19
|
-
</objective>
|
|
20
|
-
|
|
21
|
-
<execution_context>
|
|
22
|
-
@~/.claude/pan-wizard-core/workflows/milestone-gaps.md
|
|
23
|
-
</execution_context>
|
|
24
|
-
|
|
25
|
-
<context>
|
|
26
|
-
**Audit results:**
|
|
27
|
-
Glob: .planning/v*-milestone-audit.md (use most recent)
|
|
28
|
-
|
|
29
|
-
Original intent and current planning state are loaded on demand inside the workflow.
|
|
30
|
-
</context>
|
|
31
|
-
|
|
32
|
-
<process>
|
|
33
|
-
Execute the plan-milestone-gaps workflow from @~/.claude/pan-wizard-core/workflows/milestone-gaps.md end-to-end.
|
|
34
|
-
Preserve all workflow gates (audit loading, prioritization, phase grouping, user confirmation, roadmap updates).
|
|
35
|
-
</process>
|
package/commands/pan/optimize.md
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pan:optimize
|
|
3
|
-
group: Self-Improvement
|
|
4
|
-
description: Manage the circular optimization loop — record a report's suggestions, undo them, view stats, list reports, manage trace sessions
|
|
5
|
-
argument-hint: "apply [--report <file>] | revert <apply_id> | revert --last | list | stats | trace init|end|current|list"
|
|
6
|
-
allowed-tools:
|
|
7
|
-
- Read
|
|
8
|
-
- Write
|
|
9
|
-
- Edit
|
|
10
|
-
- Bash
|
|
11
|
-
- Glob
|
|
12
|
-
- Grep
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# /pan:optimize
|
|
16
|
-
|
|
17
|
-
Manage the circular optimization loop: record a report's suggestions, view stats, list reports.
|
|
18
|
-
|
|
19
|
-
**Usage:**
|
|
20
|
-
```
|
|
21
|
-
/pan:optimize apply
|
|
22
|
-
/pan:optimize apply --report <filename>
|
|
23
|
-
/pan:optimize revert <apply_id>
|
|
24
|
-
/pan:optimize revert --last
|
|
25
|
-
/pan:optimize list
|
|
26
|
-
/pan:optimize stats
|
|
27
|
-
/pan:optimize trace init [--description "what you're building"]
|
|
28
|
-
/pan:optimize trace end
|
|
29
|
-
/pan:optimize trace current
|
|
30
|
-
/pan:optimize trace list
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
**Subcommands:**
|
|
34
|
-
|
|
35
|
-
### apply
|
|
36
|
-
Record the suggestions from the most recent (or specified) optimization report.
|
|
37
|
-
|
|
38
|
-
Recorded automatically:
|
|
39
|
-
- Suggestions appended to `.planning/optimization/suggestions.md`: lessons, prompt changes and workflow changes, each naming where it belongs
|
|
40
|
-
- Config notes appended to `.planning/optimization/config-suggestions.md`
|
|
41
|
-
- An older report's memory actions (`memory_entry`, `memory`, `memory_append`) still write to `.planning/memory/`, a `memory_entry` only if it passes the checks of the `memory record` command. The result warns that PAN's workflows do not load that folder into agents
|
|
42
|
-
|
|
43
|
-
A person makes every change the suggestions describe (never auto-applied):
|
|
44
|
-
- Lessons, written into the project's instructions (CLAUDE.md or AGENTS.md, outside PAN's section), a test, or a comment at the cited code
|
|
45
|
-
- Agent prompt changes
|
|
46
|
-
- Workflow step additions
|
|
47
|
-
- Structural changes to commands
|
|
48
|
-
|
|
49
|
-
After applying, the report lists what was applied and what still needs review, plus the `apply_id` that undoes it. Every apply is recorded action by action in `.planning/optimization/applied.jsonl`: the path, whether the file was created or appended to, the exact text, and a hash of the file after the write. Applying the same report a second time writes nothing: each action names the apply that already wrote it.
|
|
50
|
-
|
|
51
|
-
### revert
|
|
52
|
-
Undo one apply exactly: delete the files it created and cut the text it appended (`revert --last` for the newest).
|
|
53
|
-
|
|
54
|
-
Revert never destroys work someone did since:
|
|
55
|
-
- It refuses a file whose content changed after the apply. The comparison ignores line endings, so a CRLF checkout still matches.
|
|
56
|
-
- It refuses a file that a later apply also wrote. Revert that later apply first.
|
|
57
|
-
- It says which files it refused, and why.
|
|
58
|
-
|
|
59
|
-
A CRLF file comes back CRLF. Applies logged before apply records existed cannot be reverted. After a revert, the same report can be applied again.
|
|
60
|
-
|
|
61
|
-
### list
|
|
62
|
-
List all optimization reports in `.planning/optimization/reports/`, most recent first.
|
|
63
|
-
|
|
64
|
-
### stats
|
|
65
|
-
Show cumulative optimization statistics:
|
|
66
|
-
- Total trace sessions run
|
|
67
|
-
- Total events traced
|
|
68
|
-
- Total errors seen (`total_errors_traced`; gaps and redundancies are not totalled)
|
|
69
|
-
- Total optimizations applied across all runs, the apply runs, the reverted runs, and the last `apply_id`
|
|
70
|
-
- Current active trace session (if any)
|
|
71
|
-
|
|
72
|
-
### trace init
|
|
73
|
-
Start a trace session before running a build — or join the active one: `trace init` reuses an unended session started within the last hour (`reused: true`, keeping that session's description) instead of opening a new one. The hook fires automatically on SubagentStop, but calling `trace init` first lets you attach a description to a new session.
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
/pan:optimize trace init --description "building express web server"
|
|
77
|
-
/pan:exec-phase 1
|
|
78
|
-
/pan:learn
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### trace end
|
|
82
|
-
Finalize the current trace session (writes summary stats to session.json).
|
|
83
|
-
|
|
84
|
-
### trace current
|
|
85
|
-
Show the active trace session ID (`optimize trace current` returns only `session_id` and `active`; `trace list` carries each session's event count).
|
|
86
|
-
|
|
87
|
-
### trace list
|
|
88
|
-
List all trace sessions, most recent first.
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
**The circular loop:**
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
┌─────────────────────────────────────────────────────┐
|
|
96
|
-
│ │
|
|
97
|
-
│ /pan:optimize trace init │
|
|
98
|
-
│ ↓ │
|
|
99
|
-
│ /pan:exec-phase N ← agents run, hook traces │
|
|
100
|
-
│ ↓ │
|
|
101
|
-
│ /pan:learn ← analyze + report │
|
|
102
|
-
│ ↓ │
|
|
103
|
-
│ /pan:optimize apply ← record suggestions │
|
|
104
|
-
│ ↓ │
|
|
105
|
-
│ You make the changes ← instructions, tests, code │
|
|
106
|
-
│ ↑ │
|
|
107
|
-
│ └──────────────────────────────────────────┘
|
|
108
|
-
└─────────────────────────────────────────────────────┘
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
Each iteration puts what the last run lacked where the next run's agents read it: fewer repeated errors and gaps.
|
|
112
|
-
|
|
113
|
-
**See also:** `/pan:learn`, `/pan:exec-phase`
|
|
114
|
-
|
|
115
|
-
Follow the workflow at `~/.claude/pan-wizard-core/workflows/optimize.md`. Each subcommand runs `node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize <subcommand> [flags]` — e.g. `optimize apply --report <path>`, `optimize revert --last`, `optimize trace init --description "..."`.
|
package/commands/pan/profile.md
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pan:profile
|
|
3
|
-
group: Session & Progress
|
|
4
|
-
description: Switch model profile for PAN agents (quality/balanced/budget)
|
|
5
|
-
argument-hint: <profile>
|
|
6
|
-
allowed-tools:
|
|
7
|
-
- Read
|
|
8
|
-
- Write
|
|
9
|
-
- Bash
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
<objective>
|
|
13
|
-
Switch the model profile used by PAN agents. Sets the model tier PAN's workflows pass when they spawn an agent (mapped to the detected provider's models), balancing quality vs token spend. `/pan:army` and `pan-conductor` spawn with no model, so the agents they run use their own `model:` pin, else the session model, under every profile.
|
|
14
|
-
|
|
15
|
-
Routes to the profile workflow which handles:
|
|
16
|
-
- Argument validation (quality/balanced/budget)
|
|
17
|
-
- Downgrade confirmation (quality → balanced → budget requires 'yes')
|
|
18
|
-
- Config file creation if missing
|
|
19
|
-
- Profile update in config.json
|
|
20
|
-
- Confirmation with model table display
|
|
21
|
-
</objective>
|
|
22
|
-
|
|
23
|
-
<execution_context>
|
|
24
|
-
@~/.claude/pan-wizard-core/workflows/profile.md
|
|
25
|
-
</execution_context>
|
|
26
|
-
|
|
27
|
-
<process>
|
|
28
|
-
**Follow the profile workflow** from `@~/.claude/pan-wizard-core/workflows/profile.md`.
|
|
29
|
-
|
|
30
|
-
The workflow handles all logic including:
|
|
31
|
-
1. Profile argument validation
|
|
32
|
-
2. Config file ensuring
|
|
33
|
-
3. Config reading and updating
|
|
34
|
-
4. Model table generation from MODEL_PROFILES
|
|
35
|
-
5. Cost estimation display (relative cost multiplier per profile)
|
|
36
|
-
6. Confirmation display
|
|
37
|
-
</process>
|
|
38
|
-
|
|
39
|
-
<tier_decision_tree>
|
|
40
|
-
**Capability-aware routing** (shipped v2.10.0 — E-7). `resolveModel` can adjust the profile's tier per call from three hints — context estimate, whether the task needs extended thinking, and whether prompt cache is warm — but only when the caller passes them (`resolve-model <agent> --metadata '{…}'`). No shipped workflow, command or agent passes them, so the tree and the quick guide below describe what a caller's hints would do.
|
|
41
|
-
|
|
42
|
-
The decision order `resolveModel` applies after the baseline profile pick:
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
Baseline tier (from MODEL_PROFILES[agent][profile])
|
|
46
|
-
│
|
|
47
|
-
▼
|
|
48
|
-
┌─────────────────────────────────────────────┐
|
|
49
|
-
│ context_estimate > 700K tokens? │── yes ──▶ force reasoning (widest ctx tier)
|
|
50
|
-
└─────────────────────────────────────────────┘
|
|
51
|
-
│ no
|
|
52
|
-
▼
|
|
53
|
-
┌─────────────────────────────────────────────┐
|
|
54
|
-
│ needs_thinking AND tier == fast? │── yes ──▶ upgrade fast → mid
|
|
55
|
-
└─────────────────────────────────────────────┘
|
|
56
|
-
│ no
|
|
57
|
-
▼
|
|
58
|
-
┌─────────────────────────────────────────────┐
|
|
59
|
-
│ cache_warm AND !needs_thinking │── yes ──▶ downgrade mid → fast
|
|
60
|
-
│ AND context_estimate < 50K AND tier == mid │
|
|
61
|
-
└─────────────────────────────────────────────┘
|
|
62
|
-
│ no
|
|
63
|
-
▼
|
|
64
|
-
Final tier → provider-native model name
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
**Quick guide:**
|
|
68
|
-
- Heavy verification (plan-checker, verifier, integration-checker, reviewer, debugger): `needs_thinking: true` — baseline upgrades fast→mid.
|
|
69
|
-
- Whole-repo context estimates above the large-context threshold (`context_estimate > 700K` tokens — `LARGE_CONTEXT_TOKEN_THRESHOLD`): forced to reasoning, which inherits the model you launched with. Note the direction: `/pan:map-codebase` picks `single-shot` **at or below** 700K and `sharded` above it, so the repos that trip this rule are the ones the mapper is already sharding.
|
|
70
|
-
- Routine exec tasks with project.md cached: `cache_warm + small ctx` — mid gets downgraded to fast for a cost win.
|
|
71
|
-
- All rules are additive to the `quality` / `balanced` / `budget` profile you pick here — profile sets the floor, capability hints adjust upward or downward within that floor's band.
|
|
72
|
-
|
|
73
|
-
**Inspecting routing:** use `pan-tools resolve-model <agent> --metadata '{"context_estimate":900000,"needs_thinking":true}'` to see what tier a given hint set resolves to.
|
|
74
|
-
|
|
75
|
-
**Effort dimension (2026-06):** `resolve-model` also returns an `effort` level (`low`/`medium`/`high`/`xhigh`) per agent — the within-model reasoning-depth dial on current models. Profiles modulate it: `budget` steps each agent's base effort down one level (floor `low`); `quality`/`balanced` keep the base. Per-agent override: `.planning/config.json` → `"effort_overrides": { "pan-verifier": "xhigh" }`.
|
|
76
|
-
</tier_decision_tree>
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pan:research-phase
|
|
3
|
-
group: Phase Lifecycle
|
|
4
|
-
description: Research how to implement a phase (standalone - usually use /pan:plan-phase instead)
|
|
5
|
-
argument-hint: "<phase>"
|
|
6
|
-
allowed-tools:
|
|
7
|
-
- Read
|
|
8
|
-
- Bash
|
|
9
|
-
- Task
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
<objective>
|
|
13
|
-
Research how to implement a phase. Spawns pan-phase-researcher agent with phase context.
|
|
14
|
-
|
|
15
|
-
**Note:** This is a standalone research command. For most workflows, use `/pan:plan-phase` which integrates research automatically.
|
|
16
|
-
|
|
17
|
-
**Use this command when:**
|
|
18
|
-
- You want to research without planning yet
|
|
19
|
-
- You want to re-research after planning is complete
|
|
20
|
-
- You need to investigate before deciding if a phase is feasible
|
|
21
|
-
|
|
22
|
-
**Orchestrator role:** Parse phase, validate against roadmap, check existing research, gather context, spawn researcher agent, present results.
|
|
23
|
-
|
|
24
|
-
**Why subagent:** Research burns context fast (WebSearch, Context7 queries, source verification). A fresh context window for investigation. Main context stays lean for user interaction.
|
|
25
|
-
</objective>
|
|
26
|
-
|
|
27
|
-
<context>
|
|
28
|
-
Phase number: $ARGUMENTS (required)
|
|
29
|
-
|
|
30
|
-
Normalize phase input in step 1 before any directory lookups.
|
|
31
|
-
</context>
|
|
32
|
-
|
|
33
|
-
<process>
|
|
34
|
-
|
|
35
|
-
## 0. Initialize Context
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init phase-op "$ARGUMENTS")
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Extract from init JSON: `phase_dir`, `padded_phase`, `phase_slug`, `phase_number`, `phase_name`, `phase_found`, `commit_docs`, `has_research`, `state_path`, `requirements_path`, `context_path`, `research_path`. `phase_dir` is null when the phase is in the roadmap but has no directory yet: create it (`mkdir -p ".planning/phases/${padded_phase}-${phase_slug}"`) and use that path as `phase_dir`, as discuss-phase does.
|
|
42
|
-
|
|
43
|
-
Resolve researcher model:
|
|
44
|
-
```bash
|
|
45
|
-
RESEARCHER_MODEL=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs resolve-model pan-phase-researcher --raw)
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## 1. Validate Phase
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
PHASE_INFO=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "${phase_number}")
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
**If `found` is false:** Error and exit. **If `found` is true:** Extract `phase_number`, `phase_name`, `goal` from JSON.
|
|
55
|
-
|
|
56
|
-
## 2. Check Existing Research
|
|
57
|
-
|
|
58
|
-
Use `has_research` and `research_path` from INIT.
|
|
59
|
-
|
|
60
|
-
**If exists:** Offer: 1) Update research, 2) View existing (`research_path`), 3) Skip. Wait for response.
|
|
61
|
-
|
|
62
|
-
**If doesn't exist:** Continue.
|
|
63
|
-
|
|
64
|
-
## 3. Gather Phase Context
|
|
65
|
-
|
|
66
|
-
Write this phase's roadmap slice (its section, its dependencies' goals and its requirement lines), then use paths from INIT (do not inline file contents in orchestrator context):
|
|
67
|
-
```bash
|
|
68
|
-
SLICE_PATH=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap slice "${phase_number}" --write --raw)
|
|
69
|
-
```
|
|
70
|
-
- `slice_path` (from the command above; `requirements_path` if it is empty)
|
|
71
|
-
- `context_path`
|
|
72
|
-
- `state_path`
|
|
73
|
-
|
|
74
|
-
Present summary with phase description and what files the researcher will load.
|
|
75
|
-
|
|
76
|
-
## 4. Spawn pan-phase-researcher Agent
|
|
77
|
-
|
|
78
|
-
Research mode: the prompt below names `ecosystem`; pan-phase-researcher defines no modes, so treat it as context, not a switch.
|
|
79
|
-
|
|
80
|
-
```markdown
|
|
81
|
-
<research_type>
|
|
82
|
-
Phase Research — investigating HOW to implement a specific phase well.
|
|
83
|
-
</research_type>
|
|
84
|
-
|
|
85
|
-
<key_insight>
|
|
86
|
-
The question is NOT "which library should I use?"
|
|
87
|
-
|
|
88
|
-
The question is: "What do I not know that I don't know?"
|
|
89
|
-
|
|
90
|
-
For this phase, discover:
|
|
91
|
-
- What's the established architecture pattern?
|
|
92
|
-
- What libraries form the standard stack?
|
|
93
|
-
- What problems do people commonly hit?
|
|
94
|
-
- What's SOTA vs what Claude's training thinks is SOTA?
|
|
95
|
-
- What should NOT be hand-rolled?
|
|
96
|
-
</key_insight>
|
|
97
|
-
|
|
98
|
-
<objective>
|
|
99
|
-
Research implementation approach for Phase {phase_number}: {phase_name}
|
|
100
|
-
Mode: ecosystem
|
|
101
|
-
</objective>
|
|
102
|
-
|
|
103
|
-
<files_to_read>
|
|
104
|
-
- {slice_path} (This phase's roadmap and requirements)
|
|
105
|
-
- {context_path} (Phase context from discuss-phase, if exists)
|
|
106
|
-
- {state_path} (Prior project decisions and blockers)
|
|
107
|
-
</files_to_read>
|
|
108
|
-
|
|
109
|
-
<additional_context>
|
|
110
|
-
**Phase description:** {phase_description}
|
|
111
|
-
</additional_context>
|
|
112
|
-
|
|
113
|
-
<downstream_consumer>
|
|
114
|
-
Your research.md will be loaded by `/pan:plan-phase` which uses specific sections:
|
|
115
|
-
- `## Standard Stack` → Plans use these libraries
|
|
116
|
-
- `## Architecture Patterns` → Task structure follows these
|
|
117
|
-
- `## Don't Hand-Roll` → Tasks NEVER build custom solutions for listed problems
|
|
118
|
-
- `## Common Pitfalls` → Verification steps check for these
|
|
119
|
-
- `## Code Examples` → Task actions reference these patterns
|
|
120
|
-
|
|
121
|
-
Be prescriptive, not exploratory. "Use X" not "Consider X or Y."
|
|
122
|
-
</downstream_consumer>
|
|
123
|
-
|
|
124
|
-
<quality_gate>
|
|
125
|
-
Before declaring complete, verify:
|
|
126
|
-
- [ ] All domains investigated (not just some)
|
|
127
|
-
- [ ] Negative claims verified with official docs
|
|
128
|
-
- [ ] Multiple sources for critical claims
|
|
129
|
-
- [ ] Confidence levels assigned honestly
|
|
130
|
-
- [ ] Section names match what plan-phase expects
|
|
131
|
-
</quality_gate>
|
|
132
|
-
|
|
133
|
-
<output>
|
|
134
|
-
Write to: {phase_dir}/{padded_phase}-research.md
|
|
135
|
-
</output>
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
```
|
|
139
|
-
Task(
|
|
140
|
-
prompt=filled_prompt,
|
|
141
|
-
subagent_type="pan-phase-researcher",
|
|
142
|
-
model="{researcher_model}",
|
|
143
|
-
description="Research Phase {phase}"
|
|
144
|
-
)
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
## 5. Handle Agent Return
|
|
148
|
-
|
|
149
|
-
**`## RESEARCH COMPLETE`:** Display summary, offer: Plan phase, Dig deeper, Review full, Done.
|
|
150
|
-
|
|
151
|
-
**`## RESEARCH BLOCKED`:** Show the blocker and what was attempted, offer: Provide context (then spawn a continuation, step 6), Skip research, Abort.
|
|
152
|
-
|
|
153
|
-
## 6. Spawn Continuation Agent
|
|
154
|
-
|
|
155
|
-
```markdown
|
|
156
|
-
<objective>
|
|
157
|
-
Continue research for Phase {phase_number}: {phase_name}
|
|
158
|
-
</objective>
|
|
159
|
-
|
|
160
|
-
<prior_state>
|
|
161
|
-
<files_to_read>
|
|
162
|
-
- {phase_dir}/{padded_phase}-research.md (Existing research)
|
|
163
|
-
</files_to_read>
|
|
164
|
-
</prior_state>
|
|
165
|
-
|
|
166
|
-
<checkpoint_response>
|
|
167
|
-
**Type:** {checkpoint_type}
|
|
168
|
-
**Response:** {user_response}
|
|
169
|
-
</checkpoint_response>
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
```
|
|
173
|
-
Task(
|
|
174
|
-
prompt=continuation_prompt,
|
|
175
|
-
subagent_type="pan-phase-researcher",
|
|
176
|
-
model="{researcher_model}",
|
|
177
|
-
description="Continue research Phase {phase}"
|
|
178
|
-
)
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
</process>
|
|
182
|
-
|
|
183
|
-
<success_criteria>
|
|
184
|
-
- [ ] Phase validated against roadmap
|
|
185
|
-
- [ ] Existing research checked
|
|
186
|
-
- [ ] pan-phase-researcher spawned with context
|
|
187
|
-
- [ ] Checkpoints handled correctly
|
|
188
|
-
- [ ] User knows next steps
|
|
189
|
-
</success_criteria>
|