@josstei/maestro 1.6.4-rc.1
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/.agents/plugins/marketplace.json +20 -0
- package/CHANGELOG.md +485 -0
- package/EXAMPLES.md +255 -0
- package/GEMINI.md +231 -0
- package/LICENSE +201 -0
- package/QWEN.md +241 -0
- package/README.md +220 -0
- package/agents/accessibility_specialist.md +20 -0
- package/agents/analytics_engineer.md +22 -0
- package/agents/api_designer.md +19 -0
- package/agents/architect.md +19 -0
- package/agents/cloud_architect.md +19 -0
- package/agents/cobol_engineer.md +22 -0
- package/agents/code_reviewer.md +17 -0
- package/agents/coder.md +22 -0
- package/agents/compliance_reviewer.md +19 -0
- package/agents/content_strategist.md +19 -0
- package/agents/copywriter.md +19 -0
- package/agents/data_engineer.md +22 -0
- package/agents/database_administrator.md +21 -0
- package/agents/db2_dba.md +21 -0
- package/agents/debugger.md +19 -0
- package/agents/design_system_engineer.md +22 -0
- package/agents/devops_engineer.md +23 -0
- package/agents/hlasm_assembler_specialist.md +22 -0
- package/agents/i18n_specialist.md +21 -0
- package/agents/ibm_i_specialist.md +22 -0
- package/agents/integration_engineer.md +23 -0
- package/agents/ml_engineer.md +23 -0
- package/agents/mlops_engineer.md +23 -0
- package/agents/mobile_engineer.md +23 -0
- package/agents/observability_engineer.md +23 -0
- package/agents/performance_engineer.md +21 -0
- package/agents/platform_engineer.md +24 -0
- package/agents/product_manager.md +20 -0
- package/agents/prompt_engineer.md +22 -0
- package/agents/refactor.md +22 -0
- package/agents/release_manager.md +22 -0
- package/agents/security_engineer.md +21 -0
- package/agents/seo_specialist.md +21 -0
- package/agents/site_reliability_engineer.md +21 -0
- package/agents/solutions_architect.md +19 -0
- package/agents/technical_writer.md +21 -0
- package/agents/tester.md +23 -0
- package/agents/ux_designer.md +20 -0
- package/agents/zos_sysprog.md +21 -0
- package/bin/maestro-mcp-server.js +10 -0
- package/claude/.claude-plugin/plugin.json +21 -0
- package/claude/.mcp.json +11 -0
- package/claude/README.md +191 -0
- package/claude/agents/accessibility-specialist.md +36 -0
- package/claude/agents/analytics-engineer.md +38 -0
- package/claude/agents/api-designer.md +33 -0
- package/claude/agents/architect.md +33 -0
- package/claude/agents/cloud-architect.md +33 -0
- package/claude/agents/cobol-engineer.md +38 -0
- package/claude/agents/code-reviewer.md +31 -0
- package/claude/agents/coder.md +38 -0
- package/claude/agents/compliance-reviewer.md +33 -0
- package/claude/agents/content-strategist.md +33 -0
- package/claude/agents/copywriter.md +33 -0
- package/claude/agents/data-engineer.md +37 -0
- package/claude/agents/database-administrator.md +37 -0
- package/claude/agents/db2-dba.md +37 -0
- package/claude/agents/debugger.md +32 -0
- package/claude/agents/design-system-engineer.md +38 -0
- package/claude/agents/devops-engineer.md +39 -0
- package/claude/agents/hlasm-assembler-specialist.md +38 -0
- package/claude/agents/i18n-specialist.md +37 -0
- package/claude/agents/ibm-i-specialist.md +38 -0
- package/claude/agents/integration-engineer.md +39 -0
- package/claude/agents/ml-engineer.md +39 -0
- package/claude/agents/mlops-engineer.md +39 -0
- package/claude/agents/mobile-engineer.md +39 -0
- package/claude/agents/observability-engineer.md +39 -0
- package/claude/agents/performance-engineer.md +34 -0
- package/claude/agents/platform-engineer.md +40 -0
- package/claude/agents/product-manager.md +34 -0
- package/claude/agents/prompt-engineer.md +38 -0
- package/claude/agents/refactor.md +38 -0
- package/claude/agents/release-manager.md +38 -0
- package/claude/agents/security-engineer.md +37 -0
- package/claude/agents/seo-specialist.md +37 -0
- package/claude/agents/site-reliability-engineer.md +37 -0
- package/claude/agents/solutions-architect.md +33 -0
- package/claude/agents/technical-writer.md +37 -0
- package/claude/agents/tester.md +39 -0
- package/claude/agents/ux-designer.md +34 -0
- package/claude/agents/zos-sysprog.md +37 -0
- package/claude/hooks/claude-hooks.json +48 -0
- package/claude/mcp/maestro-server.js +9 -0
- package/claude/mcp-config.example.json +9 -0
- package/claude/scripts/adapters/claude-adapter.js +7 -0
- package/claude/scripts/hook-runner.js +8 -0
- package/claude/scripts/policy-enforcer.js +294 -0
- package/claude/skills/a11y-audit/SKILL.md +26 -0
- package/claude/skills/archive/SKILL.md +24 -0
- package/claude/skills/code-review/SKILL.md +7 -0
- package/claude/skills/compliance-check/SKILL.md +26 -0
- package/claude/skills/debug-workflow/SKILL.md +27 -0
- package/claude/skills/delegation/SKILL.md +7 -0
- package/claude/skills/design-dialogue/SKILL.md +7 -0
- package/claude/skills/execute/SKILL.md +38 -0
- package/claude/skills/execution/SKILL.md +7 -0
- package/claude/skills/implementation-planning/SKILL.md +7 -0
- package/claude/skills/orchestrate/SKILL.md +38 -0
- package/claude/skills/perf-check/SKILL.md +26 -0
- package/claude/skills/resume-session/SKILL.md +38 -0
- package/claude/skills/review-code/SKILL.md +27 -0
- package/claude/skills/security-audit/SKILL.md +28 -0
- package/claude/skills/seo-audit/SKILL.md +26 -0
- package/claude/skills/session-management/SKILL.md +7 -0
- package/claude/skills/status/SKILL.md +22 -0
- package/claude/skills/validation/SKILL.md +7 -0
- package/claude/src/agents/accessibility-specialist.md +163 -0
- package/claude/src/agents/analytics-engineer.md +182 -0
- package/claude/src/agents/api-designer.md +124 -0
- package/claude/src/agents/architect.md +120 -0
- package/claude/src/agents/cloud-architect.md +134 -0
- package/claude/src/agents/cobol-engineer.md +127 -0
- package/claude/src/agents/code-reviewer.md +123 -0
- package/claude/src/agents/coder.md +132 -0
- package/claude/src/agents/compliance-reviewer.md +219 -0
- package/claude/src/agents/content-strategist.md +111 -0
- package/claude/src/agents/copywriter.md +113 -0
- package/claude/src/agents/data-engineer.md +130 -0
- package/claude/src/agents/database-administrator.md +126 -0
- package/claude/src/agents/db2-dba.md +124 -0
- package/claude/src/agents/debugger.md +133 -0
- package/claude/src/agents/design-system-engineer.md +258 -0
- package/claude/src/agents/devops-engineer.md +138 -0
- package/claude/src/agents/hlasm-assembler-specialist.md +134 -0
- package/claude/src/agents/i18n-specialist.md +241 -0
- package/claude/src/agents/ibm-i-specialist.md +132 -0
- package/claude/src/agents/integration-engineer.md +133 -0
- package/claude/src/agents/ml-engineer.md +115 -0
- package/claude/src/agents/mlops-engineer.md +116 -0
- package/claude/src/agents/mobile-engineer.md +115 -0
- package/claude/src/agents/observability-engineer.md +133 -0
- package/claude/src/agents/performance-engineer.md +139 -0
- package/claude/src/agents/platform-engineer.md +129 -0
- package/claude/src/agents/product-manager.md +170 -0
- package/claude/src/agents/prompt-engineer.md +129 -0
- package/claude/src/agents/refactor.md +138 -0
- package/claude/src/agents/release-manager.md +132 -0
- package/claude/src/agents/security-engineer.md +143 -0
- package/claude/src/agents/seo-specialist.md +129 -0
- package/claude/src/agents/site-reliability-engineer.md +131 -0
- package/claude/src/agents/solutions-architect.md +137 -0
- package/claude/src/agents/technical-writer.md +129 -0
- package/claude/src/agents/tester.md +135 -0
- package/claude/src/agents/ux-designer.md +168 -0
- package/claude/src/agents/zos-sysprog.md +134 -0
- package/claude/src/config/setting-resolver.js +32 -0
- package/claude/src/core/agent-registry.js +67 -0
- package/claude/src/core/canonical-source.js +39 -0
- package/claude/src/core/env-file-parser.js +82 -0
- package/claude/src/core/feature-blocks.js +34 -0
- package/claude/src/core/logger.js +12 -0
- package/claude/src/core/markdown-state.js +36 -0
- package/claude/src/core/policy-rules.js +32 -0
- package/claude/src/core/project-root-resolver.js +184 -0
- package/claude/src/core/stdin-reader.js +77 -0
- package/claude/src/core/version.js +50 -0
- package/claude/src/entry-points/core-command-registry.js +37 -0
- package/claude/src/entry-points/preamble-builders.js +54 -0
- package/claude/src/entry-points/registry.js +199 -0
- package/claude/src/entry-points/templates/claude-core-command.md.tmpl +38 -0
- package/claude/src/entry-points/templates/claude-skill.md.tmpl +18 -0
- package/claude/src/entry-points/templates/codex-core-command.md.tmpl +16 -0
- package/claude/src/entry-points/templates/codex-skill.md.tmpl +11 -0
- package/claude/src/entry-points/templates/gemini-command.toml.tmpl +17 -0
- package/claude/src/entry-points/templates/gemini-core-command.toml.tmpl +30 -0
- package/claude/src/generated/agent-registry.json +630 -0
- package/claude/src/generated/hook-registry.json +18 -0
- package/claude/src/generated/resource-registry.json +16 -0
- package/claude/src/hooks/logic/after-agent-logic.js +54 -0
- package/claude/src/hooks/logic/before-agent-logic.js +57 -0
- package/claude/src/hooks/logic/hook-state.js +127 -0
- package/claude/src/hooks/logic/session-end-logic.js +17 -0
- package/claude/src/hooks/logic/session-start-logic.js +25 -0
- package/claude/src/lib/discovery/index.js +172 -0
- package/claude/src/lib/errors/index.js +104 -0
- package/claude/src/lib/framework-detection.js +50 -0
- package/claude/src/lib/frontmatter/index.js +262 -0
- package/claude/src/lib/io/index.js +96 -0
- package/claude/src/lib/naming/index.js +94 -0
- package/claude/src/lib/validation/index.js +124 -0
- package/claude/src/lib/yaml-emit.js +38 -0
- package/claude/src/mcp/content/provider.js +68 -0
- package/claude/src/mcp/content/runtime-content.js +188 -0
- package/claude/src/mcp/contracts/cache-path-rejector.js +39 -0
- package/claude/src/mcp/contracts/downstream-context.js +106 -0
- package/claude/src/mcp/contracts/plan-schema.js +148 -0
- package/claude/src/mcp/contracts/workspace-marker.js +61 -0
- package/claude/src/mcp/core/create-server.js +76 -0
- package/claude/src/mcp/core/line-reader.js +35 -0
- package/claude/src/mcp/core/project-root-cache.js +120 -0
- package/claude/src/mcp/core/protocol-dispatcher.js +274 -0
- package/claude/src/mcp/core/recovery-hints.js +43 -0
- package/claude/src/mcp/core/tool-outcome.js +77 -0
- package/claude/src/mcp/core/tool-registry.js +82 -0
- package/claude/src/mcp/handlers/assess-task-complexity.js +108 -0
- package/claude/src/mcp/handlers/blocker-parser.js +34 -0
- package/claude/src/mcp/handlers/design-gate.js +393 -0
- package/claude/src/mcp/handlers/get-agent.js +54 -0
- package/claude/src/mcp/handlers/get-runtime-context.js +49 -0
- package/claude/src/mcp/handlers/get-skill-content.js +51 -0
- package/claude/src/mcp/handlers/initialize-workspace.js +45 -0
- package/claude/src/mcp/handlers/reconciliation.js +224 -0
- package/claude/src/mcp/handlers/resolve-settings.js +39 -0
- package/claude/src/mcp/handlers/session-state-core.js +108 -0
- package/claude/src/mcp/handlers/session-state-tools.js +562 -0
- package/claude/src/mcp/handlers/validate-plan.js +76 -0
- package/claude/src/mcp/maestro-server.js +122 -0
- package/claude/src/mcp/runtime/runtime-config-map.js +70 -0
- package/claude/src/mcp/tool-packs/content/index.js +80 -0
- package/claude/src/mcp/tool-packs/contracts.js +30 -0
- package/claude/src/mcp/tool-packs/index.js +15 -0
- package/claude/src/mcp/tool-packs/session/index.js +243 -0
- package/claude/src/mcp/tool-packs/workspace/index.js +98 -0
- package/claude/src/mcp/utils/extension-root.js +31 -0
- package/claude/src/mcp/validation/agent-checker.js +81 -0
- package/claude/src/mcp/validation/dag-checker.js +214 -0
- package/claude/src/mcp/validation/file-overlap-checker.js +63 -0
- package/claude/src/mcp/validation/schema-checker.js +108 -0
- package/claude/src/platforms/claude/runtime-config.js +60 -0
- package/claude/src/platforms/shared/adapters/claude-adapter.js +36 -0
- package/claude/src/platforms/shared/adapters/conventions.js +29 -0
- package/claude/src/platforms/shared/adapters/exit-codes.js +6 -0
- package/claude/src/platforms/shared/adapters/factory.js +40 -0
- package/claude/src/platforms/shared/agent-names.js +10 -0
- package/claude/src/platforms/shared/hook-runner.js +52 -0
- package/claude/src/references/architecture.md +139 -0
- package/claude/src/references/orchestration-steps.md +193 -0
- package/claude/src/skills/shared/code-review/SKILL.md +145 -0
- package/claude/src/skills/shared/delegation/SKILL.md +370 -0
- package/claude/src/skills/shared/delegation/protocols/agent-base-protocol.md +145 -0
- package/claude/src/skills/shared/delegation/protocols/filesystem-safety-protocol.md +31 -0
- package/claude/src/skills/shared/design-dialogue/SKILL.md +284 -0
- package/claude/src/skills/shared/execution/SKILL.md +258 -0
- package/claude/src/skills/shared/implementation-planning/SKILL.md +303 -0
- package/claude/src/skills/shared/session-management/SKILL.md +314 -0
- package/claude/src/skills/shared/validation/SKILL.md +204 -0
- package/claude/src/state/session-state.js +113 -0
- package/claude/src/templates/design-document.md +95 -0
- package/claude/src/templates/implementation-plan.md +86 -0
- package/claude/src/templates/session-state.md +68 -0
- package/claude/src/version.json +3 -0
- package/commands/maestro/a11y-audit.toml +22 -0
- package/commands/maestro/archive.toml +23 -0
- package/commands/maestro/compliance-check.toml +22 -0
- package/commands/maestro/debug.toml +23 -0
- package/commands/maestro/execute.toml +30 -0
- package/commands/maestro/orchestrate.toml +30 -0
- package/commands/maestro/perf-check.toml +22 -0
- package/commands/maestro/resume.toml +38 -0
- package/commands/maestro/review.toml +23 -0
- package/commands/maestro/security-audit.toml +24 -0
- package/commands/maestro/seo-audit.toml +22 -0
- package/commands/maestro/status.toml +21 -0
- package/docs/architecture.md +310 -0
- package/docs/cicd.md +647 -0
- package/docs/flow.md +255 -0
- package/docs/maestro-cheatsheet.md +199 -0
- package/docs/overview.md +141 -0
- package/docs/runtime-claude.md +190 -0
- package/docs/runtime-codex.md +197 -0
- package/docs/runtime-gemini.md +170 -0
- package/docs/runtime-qwen.md +147 -0
- package/docs/usage.md +312 -0
- package/gemini-extension.json +55 -0
- package/hooks/adapters/gemini-adapter.js +2 -0
- package/hooks/adapters/qwen-adapter.js +2 -0
- package/hooks/hook-runner.js +3 -0
- package/hooks/hooks.json +56 -0
- package/mcp/maestro-server.js +4 -0
- package/package.json +93 -0
- package/plugins/maestro/.app.json +3 -0
- package/plugins/maestro/.codex-plugin/plugin.json +41 -0
- package/plugins/maestro/.mcp.json +16 -0
- package/plugins/maestro/README.md +57 -0
- package/plugins/maestro/references/runtime-guide.md +125 -0
- package/plugins/maestro/skills/a11y-audit/SKILL.md +16 -0
- package/plugins/maestro/skills/archive/SKILL.md +16 -0
- package/plugins/maestro/skills/code-review/SKILL.md +6 -0
- package/plugins/maestro/skills/compliance-check/SKILL.md +16 -0
- package/plugins/maestro/skills/debug-workflow/SKILL.md +16 -0
- package/plugins/maestro/skills/delegation/SKILL.md +6 -0
- package/plugins/maestro/skills/design-dialogue/SKILL.md +6 -0
- package/plugins/maestro/skills/execute/SKILL.md +16 -0
- package/plugins/maestro/skills/execution/SKILL.md +6 -0
- package/plugins/maestro/skills/implementation-planning/SKILL.md +6 -0
- package/plugins/maestro/skills/orchestrate/SKILL.md +16 -0
- package/plugins/maestro/skills/perf-check/SKILL.md +16 -0
- package/plugins/maestro/skills/resume-session/SKILL.md +16 -0
- package/plugins/maestro/skills/review-code/SKILL.md +16 -0
- package/plugins/maestro/skills/security-audit/SKILL.md +16 -0
- package/plugins/maestro/skills/seo-audit/SKILL.md +16 -0
- package/plugins/maestro/skills/session-management/SKILL.md +6 -0
- package/plugins/maestro/skills/status/SKILL.md +14 -0
- package/plugins/maestro/skills/validation/SKILL.md +6 -0
- package/plugins/maestro/src/agents/accessibility-specialist.md +163 -0
- package/plugins/maestro/src/agents/analytics-engineer.md +182 -0
- package/plugins/maestro/src/agents/api-designer.md +124 -0
- package/plugins/maestro/src/agents/architect.md +120 -0
- package/plugins/maestro/src/agents/cloud-architect.md +134 -0
- package/plugins/maestro/src/agents/cobol-engineer.md +127 -0
- package/plugins/maestro/src/agents/code-reviewer.md +123 -0
- package/plugins/maestro/src/agents/coder.md +132 -0
- package/plugins/maestro/src/agents/compliance-reviewer.md +219 -0
- package/plugins/maestro/src/agents/content-strategist.md +111 -0
- package/plugins/maestro/src/agents/copywriter.md +113 -0
- package/plugins/maestro/src/agents/data-engineer.md +130 -0
- package/plugins/maestro/src/agents/database-administrator.md +126 -0
- package/plugins/maestro/src/agents/db2-dba.md +124 -0
- package/plugins/maestro/src/agents/debugger.md +133 -0
- package/plugins/maestro/src/agents/design-system-engineer.md +258 -0
- package/plugins/maestro/src/agents/devops-engineer.md +138 -0
- package/plugins/maestro/src/agents/hlasm-assembler-specialist.md +134 -0
- package/plugins/maestro/src/agents/i18n-specialist.md +241 -0
- package/plugins/maestro/src/agents/ibm-i-specialist.md +132 -0
- package/plugins/maestro/src/agents/integration-engineer.md +133 -0
- package/plugins/maestro/src/agents/ml-engineer.md +115 -0
- package/plugins/maestro/src/agents/mlops-engineer.md +116 -0
- package/plugins/maestro/src/agents/mobile-engineer.md +115 -0
- package/plugins/maestro/src/agents/observability-engineer.md +133 -0
- package/plugins/maestro/src/agents/performance-engineer.md +139 -0
- package/plugins/maestro/src/agents/platform-engineer.md +129 -0
- package/plugins/maestro/src/agents/product-manager.md +170 -0
- package/plugins/maestro/src/agents/prompt-engineer.md +129 -0
- package/plugins/maestro/src/agents/refactor.md +138 -0
- package/plugins/maestro/src/agents/release-manager.md +132 -0
- package/plugins/maestro/src/agents/security-engineer.md +143 -0
- package/plugins/maestro/src/agents/seo-specialist.md +129 -0
- package/plugins/maestro/src/agents/site-reliability-engineer.md +131 -0
- package/plugins/maestro/src/agents/solutions-architect.md +137 -0
- package/plugins/maestro/src/agents/technical-writer.md +129 -0
- package/plugins/maestro/src/agents/tester.md +135 -0
- package/plugins/maestro/src/agents/ux-designer.md +168 -0
- package/plugins/maestro/src/agents/zos-sysprog.md +134 -0
- package/plugins/maestro/src/config/setting-resolver.js +32 -0
- package/plugins/maestro/src/core/agent-registry.js +67 -0
- package/plugins/maestro/src/core/canonical-source.js +39 -0
- package/plugins/maestro/src/core/env-file-parser.js +82 -0
- package/plugins/maestro/src/core/feature-blocks.js +34 -0
- package/plugins/maestro/src/core/logger.js +12 -0
- package/plugins/maestro/src/core/markdown-state.js +36 -0
- package/plugins/maestro/src/core/policy-rules.js +32 -0
- package/plugins/maestro/src/core/project-root-resolver.js +184 -0
- package/plugins/maestro/src/core/stdin-reader.js +77 -0
- package/plugins/maestro/src/core/version.js +50 -0
- package/plugins/maestro/src/entry-points/core-command-registry.js +37 -0
- package/plugins/maestro/src/entry-points/preamble-builders.js +54 -0
- package/plugins/maestro/src/entry-points/registry.js +199 -0
- package/plugins/maestro/src/entry-points/templates/claude-core-command.md.tmpl +38 -0
- package/plugins/maestro/src/entry-points/templates/claude-skill.md.tmpl +18 -0
- package/plugins/maestro/src/entry-points/templates/codex-core-command.md.tmpl +16 -0
- package/plugins/maestro/src/entry-points/templates/codex-skill.md.tmpl +11 -0
- package/plugins/maestro/src/entry-points/templates/gemini-command.toml.tmpl +17 -0
- package/plugins/maestro/src/entry-points/templates/gemini-core-command.toml.tmpl +30 -0
- package/plugins/maestro/src/generated/agent-registry.json +630 -0
- package/plugins/maestro/src/generated/hook-registry.json +18 -0
- package/plugins/maestro/src/generated/resource-registry.json +16 -0
- package/plugins/maestro/src/hooks/logic/after-agent-logic.js +54 -0
- package/plugins/maestro/src/hooks/logic/before-agent-logic.js +57 -0
- package/plugins/maestro/src/hooks/logic/hook-state.js +127 -0
- package/plugins/maestro/src/hooks/logic/session-end-logic.js +17 -0
- package/plugins/maestro/src/hooks/logic/session-start-logic.js +25 -0
- package/plugins/maestro/src/lib/discovery/index.js +172 -0
- package/plugins/maestro/src/lib/errors/index.js +104 -0
- package/plugins/maestro/src/lib/framework-detection.js +50 -0
- package/plugins/maestro/src/lib/frontmatter/index.js +262 -0
- package/plugins/maestro/src/lib/io/index.js +96 -0
- package/plugins/maestro/src/lib/naming/index.js +94 -0
- package/plugins/maestro/src/lib/validation/index.js +124 -0
- package/plugins/maestro/src/lib/yaml-emit.js +38 -0
- package/plugins/maestro/src/mcp/content/provider.js +68 -0
- package/plugins/maestro/src/mcp/content/runtime-content.js +188 -0
- package/plugins/maestro/src/mcp/contracts/cache-path-rejector.js +39 -0
- package/plugins/maestro/src/mcp/contracts/downstream-context.js +106 -0
- package/plugins/maestro/src/mcp/contracts/plan-schema.js +148 -0
- package/plugins/maestro/src/mcp/contracts/workspace-marker.js +61 -0
- package/plugins/maestro/src/mcp/core/create-server.js +76 -0
- package/plugins/maestro/src/mcp/core/line-reader.js +35 -0
- package/plugins/maestro/src/mcp/core/project-root-cache.js +120 -0
- package/plugins/maestro/src/mcp/core/protocol-dispatcher.js +274 -0
- package/plugins/maestro/src/mcp/core/recovery-hints.js +43 -0
- package/plugins/maestro/src/mcp/core/tool-outcome.js +77 -0
- package/plugins/maestro/src/mcp/core/tool-registry.js +82 -0
- package/plugins/maestro/src/mcp/handlers/assess-task-complexity.js +108 -0
- package/plugins/maestro/src/mcp/handlers/blocker-parser.js +34 -0
- package/plugins/maestro/src/mcp/handlers/design-gate.js +393 -0
- package/plugins/maestro/src/mcp/handlers/get-agent.js +54 -0
- package/plugins/maestro/src/mcp/handlers/get-runtime-context.js +49 -0
- package/plugins/maestro/src/mcp/handlers/get-skill-content.js +51 -0
- package/plugins/maestro/src/mcp/handlers/initialize-workspace.js +45 -0
- package/plugins/maestro/src/mcp/handlers/reconciliation.js +224 -0
- package/plugins/maestro/src/mcp/handlers/resolve-settings.js +39 -0
- package/plugins/maestro/src/mcp/handlers/session-state-core.js +108 -0
- package/plugins/maestro/src/mcp/handlers/session-state-tools.js +562 -0
- package/plugins/maestro/src/mcp/handlers/validate-plan.js +76 -0
- package/plugins/maestro/src/mcp/maestro-server.js +122 -0
- package/plugins/maestro/src/mcp/runtime/runtime-config-map.js +70 -0
- package/plugins/maestro/src/mcp/tool-packs/content/index.js +80 -0
- package/plugins/maestro/src/mcp/tool-packs/contracts.js +30 -0
- package/plugins/maestro/src/mcp/tool-packs/index.js +15 -0
- package/plugins/maestro/src/mcp/tool-packs/session/index.js +243 -0
- package/plugins/maestro/src/mcp/tool-packs/workspace/index.js +98 -0
- package/plugins/maestro/src/mcp/utils/extension-root.js +31 -0
- package/plugins/maestro/src/mcp/validation/agent-checker.js +81 -0
- package/plugins/maestro/src/mcp/validation/dag-checker.js +214 -0
- package/plugins/maestro/src/mcp/validation/file-overlap-checker.js +63 -0
- package/plugins/maestro/src/mcp/validation/schema-checker.js +108 -0
- package/plugins/maestro/src/platforms/codex/runtime-config.js +58 -0
- package/plugins/maestro/src/platforms/shared/adapters/conventions.js +29 -0
- package/plugins/maestro/src/platforms/shared/adapters/exit-codes.js +6 -0
- package/plugins/maestro/src/platforms/shared/adapters/factory.js +40 -0
- package/plugins/maestro/src/platforms/shared/agent-names.js +10 -0
- package/plugins/maestro/src/platforms/shared/hook-runner.js +52 -0
- package/plugins/maestro/src/references/architecture.md +139 -0
- package/plugins/maestro/src/references/orchestration-steps.md +193 -0
- package/plugins/maestro/src/skills/shared/code-review/SKILL.md +145 -0
- package/plugins/maestro/src/skills/shared/delegation/SKILL.md +370 -0
- package/plugins/maestro/src/skills/shared/delegation/protocols/agent-base-protocol.md +145 -0
- package/plugins/maestro/src/skills/shared/delegation/protocols/filesystem-safety-protocol.md +31 -0
- package/plugins/maestro/src/skills/shared/design-dialogue/SKILL.md +284 -0
- package/plugins/maestro/src/skills/shared/execution/SKILL.md +258 -0
- package/plugins/maestro/src/skills/shared/implementation-planning/SKILL.md +303 -0
- package/plugins/maestro/src/skills/shared/session-management/SKILL.md +314 -0
- package/plugins/maestro/src/skills/shared/validation/SKILL.md +204 -0
- package/plugins/maestro/src/state/session-state.js +113 -0
- package/plugins/maestro/src/templates/design-document.md +95 -0
- package/plugins/maestro/src/templates/implementation-plan.md +86 -0
- package/plugins/maestro/src/templates/session-state.md +68 -0
- package/plugins/maestro/src/version.json +3 -0
- package/policies/maestro.toml +44 -0
- package/qwen/agents/accessibility_specialist.md +18 -0
- package/qwen/agents/analytics_engineer.md +20 -0
- package/qwen/agents/api_designer.md +17 -0
- package/qwen/agents/architect.md +17 -0
- package/qwen/agents/cloud_architect.md +17 -0
- package/qwen/agents/cobol_engineer.md +20 -0
- package/qwen/agents/code_reviewer.md +15 -0
- package/qwen/agents/coder.md +20 -0
- package/qwen/agents/compliance_reviewer.md +17 -0
- package/qwen/agents/content_strategist.md +17 -0
- package/qwen/agents/copywriter.md +17 -0
- package/qwen/agents/data_engineer.md +20 -0
- package/qwen/agents/database_administrator.md +19 -0
- package/qwen/agents/db2_dba.md +19 -0
- package/qwen/agents/debugger.md +17 -0
- package/qwen/agents/design_system_engineer.md +20 -0
- package/qwen/agents/devops_engineer.md +21 -0
- package/qwen/agents/hlasm_assembler_specialist.md +20 -0
- package/qwen/agents/i18n_specialist.md +19 -0
- package/qwen/agents/ibm_i_specialist.md +20 -0
- package/qwen/agents/integration_engineer.md +21 -0
- package/qwen/agents/ml_engineer.md +21 -0
- package/qwen/agents/mlops_engineer.md +21 -0
- package/qwen/agents/mobile_engineer.md +21 -0
- package/qwen/agents/observability_engineer.md +21 -0
- package/qwen/agents/performance_engineer.md +19 -0
- package/qwen/agents/platform_engineer.md +22 -0
- package/qwen/agents/product_manager.md +18 -0
- package/qwen/agents/prompt_engineer.md +20 -0
- package/qwen/agents/refactor.md +20 -0
- package/qwen/agents/release_manager.md +20 -0
- package/qwen/agents/security_engineer.md +19 -0
- package/qwen/agents/seo_specialist.md +19 -0
- package/qwen/agents/site_reliability_engineer.md +19 -0
- package/qwen/agents/solutions_architect.md +17 -0
- package/qwen/agents/technical_writer.md +19 -0
- package/qwen/agents/tester.md +21 -0
- package/qwen/agents/ux_designer.md +18 -0
- package/qwen/agents/zos_sysprog.md +19 -0
- package/qwen/hooks.json +56 -0
- package/qwen-extension.json +55 -0
- package/scripts/check-layer-boundaries.js +74 -0
- package/scripts/generate.js +155 -0
- package/scripts/install-codex-plugin.js +167 -0
- package/scripts/install-git-hooks.js +43 -0
- package/scripts/npm-publish-idempotent.js +150 -0
- package/scripts/package-release-artifacts.js +156 -0
- package/scripts/release-artifact-manifest.js +378 -0
- package/scripts/release-version-metadata.js +129 -0
- package/scripts/update-versions.js +33 -0
- package/scripts/verify-npm-pack.js +85 -0
- package/scripts/verify-release-artifacts.js +95 -0
- package/src/agents/accessibility-specialist.md +163 -0
- package/src/agents/analytics-engineer.md +182 -0
- package/src/agents/api-designer.md +124 -0
- package/src/agents/architect.md +120 -0
- package/src/agents/cloud-architect.md +134 -0
- package/src/agents/cobol-engineer.md +127 -0
- package/src/agents/code-reviewer.md +123 -0
- package/src/agents/coder.md +132 -0
- package/src/agents/compliance-reviewer.md +219 -0
- package/src/agents/content-strategist.md +111 -0
- package/src/agents/copywriter.md +113 -0
- package/src/agents/data-engineer.md +130 -0
- package/src/agents/database-administrator.md +126 -0
- package/src/agents/db2-dba.md +124 -0
- package/src/agents/debugger.md +133 -0
- package/src/agents/design-system-engineer.md +258 -0
- package/src/agents/devops-engineer.md +138 -0
- package/src/agents/hlasm-assembler-specialist.md +134 -0
- package/src/agents/i18n-specialist.md +241 -0
- package/src/agents/ibm-i-specialist.md +132 -0
- package/src/agents/integration-engineer.md +133 -0
- package/src/agents/ml-engineer.md +115 -0
- package/src/agents/mlops-engineer.md +116 -0
- package/src/agents/mobile-engineer.md +115 -0
- package/src/agents/observability-engineer.md +133 -0
- package/src/agents/performance-engineer.md +139 -0
- package/src/agents/platform-engineer.md +129 -0
- package/src/agents/product-manager.md +170 -0
- package/src/agents/prompt-engineer.md +129 -0
- package/src/agents/refactor.md +138 -0
- package/src/agents/release-manager.md +132 -0
- package/src/agents/security-engineer.md +143 -0
- package/src/agents/seo-specialist.md +129 -0
- package/src/agents/site-reliability-engineer.md +131 -0
- package/src/agents/solutions-architect.md +137 -0
- package/src/agents/technical-writer.md +129 -0
- package/src/agents/tester.md +135 -0
- package/src/agents/ux-designer.md +168 -0
- package/src/agents/zos-sysprog.md +134 -0
- package/src/config/setting-resolver.js +32 -0
- package/src/core/agent-registry.js +67 -0
- package/src/core/canonical-source.js +39 -0
- package/src/core/env-file-parser.js +82 -0
- package/src/core/feature-blocks.js +34 -0
- package/src/core/logger.js +12 -0
- package/src/core/markdown-state.js +36 -0
- package/src/core/policy-rules.js +32 -0
- package/src/core/project-root-resolver.js +184 -0
- package/src/core/stdin-reader.js +77 -0
- package/src/core/version.js +50 -0
- package/src/entry-points/core-command-registry.js +37 -0
- package/src/entry-points/preamble-builders.js +54 -0
- package/src/entry-points/registry.js +199 -0
- package/src/entry-points/templates/claude-core-command.md.tmpl +38 -0
- package/src/entry-points/templates/claude-skill.md.tmpl +18 -0
- package/src/entry-points/templates/codex-core-command.md.tmpl +16 -0
- package/src/entry-points/templates/codex-skill.md.tmpl +11 -0
- package/src/entry-points/templates/gemini-command.toml.tmpl +17 -0
- package/src/entry-points/templates/gemini-core-command.toml.tmpl +30 -0
- package/src/generated/agent-registry.json +630 -0
- package/src/generated/hook-registry.json +18 -0
- package/src/generated/resource-registry.json +16 -0
- package/src/generator/entry-point-expander.js +182 -0
- package/src/generator/file-writer.js +167 -0
- package/src/generator/generation-session.js +62 -0
- package/src/generator/manifest-curator.js +31 -0
- package/src/generator/manifest-expander.js +256 -0
- package/src/generator/payload-builder.js +217 -0
- package/src/generator/registry-scanner.js +130 -0
- package/src/generator/stale-pruner.js +101 -0
- package/src/hooks/logic/after-agent-logic.js +54 -0
- package/src/hooks/logic/before-agent-logic.js +57 -0
- package/src/hooks/logic/hook-state.js +127 -0
- package/src/hooks/logic/session-end-logic.js +17 -0
- package/src/hooks/logic/session-start-logic.js +25 -0
- package/src/lib/discovery/index.js +172 -0
- package/src/lib/errors/index.js +104 -0
- package/src/lib/framework-detection.js +50 -0
- package/src/lib/frontmatter/index.js +262 -0
- package/src/lib/io/index.js +96 -0
- package/src/lib/naming/index.js +94 -0
- package/src/lib/validation/index.js +124 -0
- package/src/lib/yaml-emit.js +38 -0
- package/src/manifest.js +11 -0
- package/src/mcp/content/provider.js +68 -0
- package/src/mcp/content/runtime-content.js +188 -0
- package/src/mcp/contracts/cache-path-rejector.js +39 -0
- package/src/mcp/contracts/downstream-context.js +106 -0
- package/src/mcp/contracts/plan-schema.js +148 -0
- package/src/mcp/contracts/workspace-marker.js +61 -0
- package/src/mcp/core/create-server.js +76 -0
- package/src/mcp/core/line-reader.js +35 -0
- package/src/mcp/core/project-root-cache.js +120 -0
- package/src/mcp/core/protocol-dispatcher.js +274 -0
- package/src/mcp/core/recovery-hints.js +43 -0
- package/src/mcp/core/tool-outcome.js +77 -0
- package/src/mcp/core/tool-registry.js +82 -0
- package/src/mcp/handlers/assess-task-complexity.js +108 -0
- package/src/mcp/handlers/blocker-parser.js +34 -0
- package/src/mcp/handlers/design-gate.js +393 -0
- package/src/mcp/handlers/get-agent.js +54 -0
- package/src/mcp/handlers/get-runtime-context.js +49 -0
- package/src/mcp/handlers/get-skill-content.js +51 -0
- package/src/mcp/handlers/initialize-workspace.js +45 -0
- package/src/mcp/handlers/reconciliation.js +224 -0
- package/src/mcp/handlers/resolve-settings.js +39 -0
- package/src/mcp/handlers/session-state-core.js +108 -0
- package/src/mcp/handlers/session-state-tools.js +562 -0
- package/src/mcp/handlers/validate-plan.js +76 -0
- package/src/mcp/maestro-server.js +122 -0
- package/src/mcp/runtime/runtime-config-map.js +70 -0
- package/src/mcp/tool-packs/content/index.js +80 -0
- package/src/mcp/tool-packs/contracts.js +30 -0
- package/src/mcp/tool-packs/index.js +15 -0
- package/src/mcp/tool-packs/session/index.js +243 -0
- package/src/mcp/tool-packs/workspace/index.js +98 -0
- package/src/mcp/utils/extension-root.js +31 -0
- package/src/mcp/validation/agent-checker.js +81 -0
- package/src/mcp/validation/dag-checker.js +214 -0
- package/src/mcp/validation/file-overlap-checker.js +63 -0
- package/src/mcp/validation/schema-checker.js +108 -0
- package/src/platforms/claude/metadata.js +96 -0
- package/src/platforms/claude/runtime-config.js +60 -0
- package/src/platforms/codex/metadata.js +107 -0
- package/src/platforms/codex/runtime-config.js +58 -0
- package/src/platforms/gemini/metadata.js +27 -0
- package/src/platforms/gemini/runtime-config.js +62 -0
- package/src/platforms/metadata-shared.js +131 -0
- package/src/platforms/metadata.js +29 -0
- package/src/platforms/qwen/metadata.js +27 -0
- package/src/platforms/qwen/runtime-config.js +62 -0
- package/src/platforms/shared/adapters/claude-adapter.js +36 -0
- package/src/platforms/shared/adapters/conventions.js +29 -0
- package/src/platforms/shared/adapters/exit-codes.js +6 -0
- package/src/platforms/shared/adapters/factory.js +40 -0
- package/src/platforms/shared/adapters/gemini-adapter.js +34 -0
- package/src/platforms/shared/adapters/qwen-adapter.js +93 -0
- package/src/platforms/shared/agent-names.js +10 -0
- package/src/platforms/shared/hook-runner.js +52 -0
- package/src/references/architecture.md +139 -0
- package/src/references/orchestration-steps.md +193 -0
- package/src/scripts/ensure-workspace.js +14 -0
- package/src/scripts/read-active-session.js +26 -0
- package/src/scripts/read-setting.js +18 -0
- package/src/scripts/read-state.js +17 -0
- package/src/scripts/write-state.js +22 -0
- package/src/skills/shared/code-review/SKILL.md +145 -0
- package/src/skills/shared/delegation/SKILL.md +370 -0
- package/src/skills/shared/delegation/protocols/agent-base-protocol.md +145 -0
- package/src/skills/shared/delegation/protocols/filesystem-safety-protocol.md +31 -0
- package/src/skills/shared/design-dialogue/SKILL.md +284 -0
- package/src/skills/shared/execution/SKILL.md +258 -0
- package/src/skills/shared/implementation-planning/SKILL.md +303 -0
- package/src/skills/shared/session-management/SKILL.md +314 -0
- package/src/skills/shared/validation/SKILL.md +204 -0
- package/src/state/session-state.js +113 -0
- package/src/templates/design-document.md +95 -0
- package/src/templates/implementation-plan.md +86 -0
- package/src/templates/session-state.md +68 -0
- package/src/transforms/agent-stub.js +29 -0
- package/src/transforms/extract-examples.js +63 -0
- package/src/transforms/index.js +35 -0
- package/src/transforms/parse-frontmatter.js +23 -0
- package/src/transforms/rebuild-frontmatter.js +147 -0
- package/src/transforms/skill-discovery-stub.js +27 -0
- package/src/transforms/skill-metadata.js +14 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: implementation-planning
|
|
3
|
+
description: Generates detailed implementation plans from finalized designs
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Implementation Planning Skill
|
|
7
|
+
|
|
8
|
+
**Standard workflow only.** If `task_complexity` is `simple` and workflow mode is Express, do not activate this skill. Simple tasks use the Express workflow, which does not activate implementation-planning. Return to the Express Workflow section.
|
|
9
|
+
|
|
10
|
+
Activate this skill during Phase 2 of Maestro orchestration, after the design document has been approved. This skill provides the methodology for generating detailed, actionable implementation plans that map directly to subagent assignments.
|
|
11
|
+
|
|
12
|
+
## Codebase Grounding
|
|
13
|
+
|
|
14
|
+
Do not generate an implementation plan from guesses about the repository.
|
|
15
|
+
|
|
16
|
+
Use the built-in `codebase_investigator` before phase decomposition when:
|
|
17
|
+
- The task modifies an existing codebase
|
|
18
|
+
- File ownership, integration points, or validation commands are still unclear after reading the approved design
|
|
19
|
+
- Parallelization decisions depend on understanding current module boundaries or likely file overlap
|
|
20
|
+
|
|
21
|
+
Ask the investigator for:
|
|
22
|
+
- The modules and files most likely to change
|
|
23
|
+
- Existing architectural boundaries and conventions the plan must preserve
|
|
24
|
+
- Integration seams, dependencies, and shared ownership hotspots
|
|
25
|
+
- Validation commands and test entry points already used by the project
|
|
26
|
+
- Parallelization or conflict risks that should prevent batching
|
|
27
|
+
|
|
28
|
+
Skip the investigator only for greenfield tasks, documentation-only work, or plans where the current turn already established the relevant repo structure from direct reads.
|
|
29
|
+
|
|
30
|
+
Reuse investigator findings directly in the implementation plan:
|
|
31
|
+
- File inventories should reflect real candidate paths, not placeholders
|
|
32
|
+
- Validation criteria should prefer repo-native commands the investigator surfaced
|
|
33
|
+
- Parallel batches should account for actual ownership overlap and conflict risk
|
|
34
|
+
|
|
35
|
+
## Plan Generation Methodology
|
|
36
|
+
|
|
37
|
+
### Input Analysis
|
|
38
|
+
Before generating the plan, thoroughly analyze the approved design document for:
|
|
39
|
+
- Read `task_complexity` from the approved design document's frontmatter. Apply phase count guidance and domain analysis scaling accordingly. Record `task_complexity` in implementation plan frontmatter.
|
|
40
|
+
- Components and their responsibilities
|
|
41
|
+
- Interfaces and contracts between components
|
|
42
|
+
- Data models and their relationships
|
|
43
|
+
- External dependencies and integrations
|
|
44
|
+
- Technology stack decisions
|
|
45
|
+
- Quality requirements that influence implementation order
|
|
46
|
+
|
|
47
|
+
### Phase Decomposition
|
|
48
|
+
|
|
49
|
+
Break the implementation into phases following these principles:
|
|
50
|
+
|
|
51
|
+
1. **Foundation First**: Infrastructure, configuration, and shared types/interfaces come first
|
|
52
|
+
2. **Dependencies Flow Downward**: A phase can only depend on phases with lower IDs
|
|
53
|
+
3. **Single Responsibility**: Each phase delivers a cohesive unit of functionality
|
|
54
|
+
4. **Agent Alignment**: Each phase maps to one or two agent specializations
|
|
55
|
+
5. **Agent Capability Match**: Verify the assigned agent's tool tier supports the phase deliverables (see compatibility check below)
|
|
56
|
+
6. **Testability**: Each phase should be independently validatable
|
|
57
|
+
|
|
58
|
+
### Phase Ordering Strategy
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
Layer 1: Foundation (types, interfaces, configuration)
|
|
62
|
+
|
|
|
63
|
+
Layer 2: Core Domain (business logic, data models)
|
|
64
|
+
|
|
|
65
|
+
Layer 3: Infrastructure (database, external services, API layer)
|
|
66
|
+
|
|
|
67
|
+
Layer 4: Integration (connecting components, middleware)
|
|
68
|
+
|
|
|
69
|
+
Layer 5: Quality (testing, security review, performance)
|
|
70
|
+
|
|
|
71
|
+
Layer 6: Documentation & Polish
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Agent-Deliverable Compatibility Check
|
|
75
|
+
|
|
76
|
+
Before finalizing agent assignments, verify each phase's agent can deliver its requirements:
|
|
77
|
+
|
|
78
|
+
| Phase Deliverable | Required Tier | Compatible Agents |
|
|
79
|
+
|-------------------|--------------|-------------------|
|
|
80
|
+
| Creates/modifies files | Full Access or Read+Write | coder, data-engineer, devops-engineer, tester, refactor, design-system-engineer, i18n-specialist, analytics-engineer, technical-writer, product-manager, ux-designer, copywriter |
|
|
81
|
+
| Runs shell commands | Full Access or Read+Shell | coder, data-engineer, devops-engineer, tester, refactor, design-system-engineer, i18n-specialist, analytics-engineer, debugger, performance-engineer, security-engineer, seo-specialist, accessibility-specialist |
|
|
82
|
+
| Analysis/review only | Any tier | All agents |
|
|
83
|
+
|
|
84
|
+
<HARD-GATE>
|
|
85
|
+
Read-Only agents (architect, api-designer, code-reviewer, content-strategist, compliance-reviewer)
|
|
86
|
+
CANNOT be assigned to phases that create or modify files. If a phase requires file creation
|
|
87
|
+
and domain expertise from a Read-Only agent, split it: the Read-Only agent produces a spec
|
|
88
|
+
or analysis, then a write-capable agent (typically coder) implements the files based on that output.
|
|
89
|
+
</HARD-GATE>
|
|
90
|
+
|
|
91
|
+
### Phase Count Guidance
|
|
92
|
+
|
|
93
|
+
Scale decomposition granularity to `task_complexity` (read from design document frontmatter):
|
|
94
|
+
- **simple**: 1-3 phases. Prefer single-phase execution when feasible. Combine foundation + implementation. Skip separate documentation/polish phases.
|
|
95
|
+
- **medium**: 3-5 phases. Use the layer model but combine Quality and Documentation into the final implementation phase where practical.
|
|
96
|
+
- **complex**: No phase count cap. Full layer decomposition strategy applies.
|
|
97
|
+
|
|
98
|
+
### Parallelization Identification
|
|
99
|
+
|
|
100
|
+
Phases can run in parallel when:
|
|
101
|
+
- They have no shared file dependencies (no overlapping files_created or files_modified)
|
|
102
|
+
- They are at the same dependency depth (same layer)
|
|
103
|
+
- They do not share data model ownership
|
|
104
|
+
- Their validation can run independently
|
|
105
|
+
|
|
106
|
+
Mark parallel-eligible phases with `parallel: true` and group them into execution batches.
|
|
107
|
+
|
|
108
|
+
## Implementation Detail Requirements
|
|
109
|
+
|
|
110
|
+
### Per-Phase Specification
|
|
111
|
+
|
|
112
|
+
Each phase in the plan must include:
|
|
113
|
+
|
|
114
|
+
#### Objective
|
|
115
|
+
A clear, measurable statement of what this phase delivers.
|
|
116
|
+
|
|
117
|
+
#### Agent Assignment
|
|
118
|
+
Which agent(s) execute this phase, with rationale for selection.
|
|
119
|
+
|
|
120
|
+
#### Files to Create
|
|
121
|
+
For each new file:
|
|
122
|
+
- Full relative path from project root
|
|
123
|
+
- Purpose and responsibility
|
|
124
|
+
- Key interfaces, classes, or functions to define
|
|
125
|
+
- Complete type signatures for public APIs
|
|
126
|
+
|
|
127
|
+
#### Files to Modify
|
|
128
|
+
For each existing file:
|
|
129
|
+
- Full relative path from project root
|
|
130
|
+
- Specific changes required and why
|
|
131
|
+
- Expected before/after for critical sections
|
|
132
|
+
|
|
133
|
+
#### Implementation Details
|
|
134
|
+
|
|
135
|
+
Provide sufficient detail for the assigned agent to execute without ambiguity:
|
|
136
|
+
- Interface definitions with complete type signatures
|
|
137
|
+
- Base class contracts with abstract method signatures
|
|
138
|
+
- Dependency injection patterns and registration points
|
|
139
|
+
- Error handling strategy (error types, propagation, recovery)
|
|
140
|
+
- Configuration requirements (environment variables, config files)
|
|
141
|
+
|
|
142
|
+
#### Validation Criteria
|
|
143
|
+
Specific commands to run and expected outcomes:
|
|
144
|
+
- Build/compile commands
|
|
145
|
+
- Lint/format checks
|
|
146
|
+
- Unit test commands
|
|
147
|
+
- Integration test commands (if applicable)
|
|
148
|
+
- Manual verification steps (if applicable)
|
|
149
|
+
|
|
150
|
+
#### Dependencies
|
|
151
|
+
- `blocked_by`: Phase IDs that must complete before this phase starts
|
|
152
|
+
- `blocks`: Phase IDs that cannot start until this phase completes
|
|
153
|
+
|
|
154
|
+
### Dependency Minimization
|
|
155
|
+
|
|
156
|
+
List only **direct** blockers in `blocked_by`. Do not include transitive dependencies — they inflate dependency depth and prevent parallelism.
|
|
157
|
+
|
|
158
|
+
Anti-pattern (over-specified):
|
|
159
|
+
- Phase 2: blocked_by: [1]
|
|
160
|
+
- Phase 3: blocked_by: [1, 2] — Phase 1 is redundant, already reachable via Phase 2
|
|
161
|
+
- Phase 4: blocked_by: [1, 2, 3] — Phases 1, 2 are redundant
|
|
162
|
+
|
|
163
|
+
Result: depths 0, 1, 2, 3 — zero parallel phases.
|
|
164
|
+
|
|
165
|
+
Correct (minimized):
|
|
166
|
+
- Phase 2: blocked_by: [1]
|
|
167
|
+
- Phase 3: blocked_by: [1] — Only needs Phase 1 output, not Phase 2
|
|
168
|
+
- Phase 4: blocked_by: [2, 3] — Needs both done
|
|
169
|
+
|
|
170
|
+
Result: depths 0, 1, 2 — Phases 2 and 3 run in parallel at depth 1.
|
|
171
|
+
|
|
172
|
+
Ask for each dependency: "Does this phase truly need the output of that specific phase, or is it transitively covered?"
|
|
173
|
+
|
|
174
|
+
If `validate_plan` is available, review its `parallelization_profile` and `redundant_dependency` warnings before presenting the plan. Revise `blocked_by` to eliminate redundancies when possible.
|
|
175
|
+
|
|
176
|
+
## Agent Assignment Criteria
|
|
177
|
+
|
|
178
|
+
### Matching Tasks to Agents
|
|
179
|
+
|
|
180
|
+
| Task Domain | Primary Agent | Secondary Agent | Rationale |
|
|
181
|
+
|-------------|--------------|-----------------|-----------|
|
|
182
|
+
| System design, architecture | `architect` | - | Read-only analysis, design expertise |
|
|
183
|
+
| API contracts, endpoints | `api-designer` | `coder` | Design then implement |
|
|
184
|
+
| Feature implementation | `coder` | - | Full implementation access |
|
|
185
|
+
| Code quality review | `code-reviewer` | - | Read-only verification |
|
|
186
|
+
| Database schema, queries | `data-engineer` | - | Schema + implementation |
|
|
187
|
+
| Bug investigation | `debugger` | - | Read + shell for investigation |
|
|
188
|
+
| CI/CD, infrastructure | `devops-engineer` | - | Full DevOps access |
|
|
189
|
+
| Performance analysis | `performance-engineer` | - | Read + shell for profiling |
|
|
190
|
+
| Code restructuring | `refactor` | - | Write + shell access (for validation) |
|
|
191
|
+
| Security assessment | `security-engineer` | - | Read + shell for scanning |
|
|
192
|
+
| Test creation | `tester` | - | Full test implementation |
|
|
193
|
+
| Documentation | `technical-writer` | - | Write access for docs |
|
|
194
|
+
| Technical SEO audit | `seo-specialist` | - | Read + shell + web search |
|
|
195
|
+
| Marketing copy, content | `copywriter` | - | Read/write |
|
|
196
|
+
| Content planning | `content-strategist` | - | Read + web search/fetch |
|
|
197
|
+
| UX design, user flows | `ux-designer` | - | Read/write + web search |
|
|
198
|
+
| WCAG compliance audit | `accessibility-specialist` | - | Read + shell + web search |
|
|
199
|
+
| Requirements, product | `product-manager` | - | Read/write + web search |
|
|
200
|
+
| Tracking, analytics | `analytics-engineer` | `coder` | Implement then instrument |
|
|
201
|
+
| Internationalization | `i18n-specialist` | `coder` | Implement then localize |
|
|
202
|
+
| Design tokens, theming | `design-system-engineer` | `coder` | Tokens then consume |
|
|
203
|
+
| Legal, regulatory | `compliance-reviewer` | - | Read + web search/fetch |
|
|
204
|
+
|
|
205
|
+
### Assignment Rules
|
|
206
|
+
1. Match the primary task domain to the agent specialization
|
|
207
|
+
2. Consider tool requirements — does the task need shell access? Write access?
|
|
208
|
+
3. For parallel phases, assign non-overlapping file ownership to each agent
|
|
209
|
+
4. Prefer single-agent phases for clarity; use multi-agent only when distinct specializations are needed
|
|
210
|
+
5. Never assign more files to an agent than it can handle within its `max_turns` limit
|
|
211
|
+
|
|
212
|
+
### Token Budget Estimation
|
|
213
|
+
Estimate token consumption per phase based on:
|
|
214
|
+
- Number of files to read (input tokens)
|
|
215
|
+
- Complexity of output expected (output tokens)
|
|
216
|
+
- Agent's max_turns limit as upper bound
|
|
217
|
+
- Historical averages: ~500 input tokens per file read, ~200 output tokens per file written
|
|
218
|
+
|
|
219
|
+
### Cost Estimation
|
|
220
|
+
|
|
221
|
+
#### Per-Phase Cost Factors
|
|
222
|
+
- **Model tier**: Pro agents (~$0.01/1K input, ~$0.04/1K output) vs Flash agents (~$0.001/1K input, ~$0.004/1K output)
|
|
223
|
+
- **Input complexity**: Number of files read, average file size, context from previous phases
|
|
224
|
+
- **Output complexity**: Lines of code generated, number of files created/modified
|
|
225
|
+
- **Retry budget**: Add 50% buffer per phase for potential retries (max 2 retries)
|
|
226
|
+
|
|
227
|
+
#### Estimation Formula
|
|
228
|
+
```
|
|
229
|
+
Phase Cost = (input_tokens × input_rate + output_tokens × output_rate) × retry_multiplier
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Where:
|
|
233
|
+
- `input_tokens` = files_to_read × 500 + context_tokens
|
|
234
|
+
- `output_tokens` = files_to_write × 200 + validation_output
|
|
235
|
+
- `retry_multiplier` = 1.5 (accounts for up to 2 retries)
|
|
236
|
+
|
|
237
|
+
#### Plan-Level Cost Summary
|
|
238
|
+
Include this table in every implementation plan:
|
|
239
|
+
|
|
240
|
+
| Phase | Agent | Model | Est. Input | Est. Output | Est. Cost |
|
|
241
|
+
|-------|-------|-------|-----------|------------|----------|
|
|
242
|
+
| 1 | [agent] | [model] | [tokens] | [tokens] | [$X.XX] |
|
|
243
|
+
| ... | ... | ... | ... | ... | ... |
|
|
244
|
+
| **Total** | | | **[sum]** | **[sum]** | **[$X.XX]** |
|
|
245
|
+
|
|
246
|
+
## Plan Document Generation
|
|
247
|
+
|
|
248
|
+
### Output Location
|
|
249
|
+
|
|
250
|
+
The write path depends on whether your runtime provides a Plan Mode surface (check `get_runtime_context`, loaded at session start, step 0).
|
|
251
|
+
|
|
252
|
+
- **Plan Mode active**: Some runtimes restrict writes to a temporary staging directory during Plan Mode. Write the plan there first, then copy to the permanent location after approval. Call `exit_plan_mode` with the plan path to present the plan for user approval.
|
|
253
|
+
- **Plan Mode not active or not available**: Write the implementation plan directly to the project's plans directory.
|
|
254
|
+
|
|
255
|
+
Permanent location: `<state_dir>/plans/YYYY-MM-DD-<topic-slug>-impl-plan.md` (where `<state_dir>` resolves from `MAESTRO_STATE_DIR`, default `docs/maestro`).
|
|
256
|
+
|
|
257
|
+
If your runtime does not provide a Plan Mode transition, track planning progress using the plan-update mechanism from your runtime context, write directly to the final location, and use the user-prompt tool from runtime context for the approval gate.
|
|
258
|
+
|
|
259
|
+
### Document Structure
|
|
260
|
+
Use the `implementation-plan` template loaded via `get_skill_content`.
|
|
261
|
+
|
|
262
|
+
### Required Sections
|
|
263
|
+
|
|
264
|
+
1. **Plan Overview**: Summary of total phases, agents involved, estimated effort
|
|
265
|
+
2. **Dependency Graph**: Visual representation showing phase dependencies and parallel opportunities
|
|
266
|
+
3. **Execution Strategy Table**: Stage-by-stage breakdown with agent assignments and execution mode
|
|
267
|
+
4. **Phase Details**: Full specification for each phase (objective, agent, files, details, validation, dependencies)
|
|
268
|
+
5. **File Inventory**: Complete table mapping every file to its phase and purpose
|
|
269
|
+
6. **Risk Classification**: Per-phase risk assessment (LOW/MEDIUM/HIGH) with rationale
|
|
270
|
+
7. **Execution Profile**: Summary of parallel vs sequential characteristics to inform mode selection:
|
|
271
|
+
```
|
|
272
|
+
Execution Profile:
|
|
273
|
+
- Total phases: [N]
|
|
274
|
+
- Parallelizable phases: [M] (in [B] batches)
|
|
275
|
+
- Sequential-only phases: [S]
|
|
276
|
+
- Estimated parallel wall time: [time estimate based on batch execution]
|
|
277
|
+
- Estimated sequential wall time: [time estimate based on serial execution]
|
|
278
|
+
|
|
279
|
+
Note: Native parallel execution currently runs agents in autonomous mode.
|
|
280
|
+
All tool calls are auto-approved without user confirmation.
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Completion Criteria
|
|
284
|
+
The implementation plan is complete when:
|
|
285
|
+
- Every component from the design document maps to at least one phase
|
|
286
|
+
- All phase dependencies are acyclic (no circular dependencies)
|
|
287
|
+
- Parallel opportunities are identified and marked
|
|
288
|
+
- Each phase has clear validation criteria
|
|
289
|
+
- File ownership is non-overlapping for parallel phases
|
|
290
|
+
- The user has given explicit approval of the complete plan
|
|
291
|
+
|
|
292
|
+
Before presenting the plan for approval, check whether `validate_plan` appears in your available tools. If it does, call it with the plan structure and `task_complexity` to verify phase count constraints, file ownership, acyclic dependencies, and agent validity. If it does not, self-check against the phase count limits above.
|
|
293
|
+
|
|
294
|
+
### Post-Generation
|
|
295
|
+
After writing the implementation plan:
|
|
296
|
+
1. Confirm the file path to the user
|
|
297
|
+
2. Present the dependency graph and execution strategy
|
|
298
|
+
3. Highlight parallel execution opportunities
|
|
299
|
+
4. Provide token budget estimates
|
|
300
|
+
5. If your runtime provides Plan Mode, call `exit_plan_mode` with the plan path to present the plan for user approval. If Plan Mode is not available, present the completed plan for user approval using the user-prompt tool from runtime context.
|
|
301
|
+
6. Ensure the approved plan is at `<state_dir>/plans/YYYY-MM-DD-<slug>-impl-plan.md` as the permanent project reference (copy from the staging directory if Plan Mode was used)
|
|
302
|
+
7. Ask if the user is ready to proceed to execution (Phase 3)
|
|
303
|
+
8. Upon approval, create the session state file via the session-management skill
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: session-management
|
|
3
|
+
description: Manages orchestration session state, tracking, and resumption
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Session Management Skill
|
|
7
|
+
|
|
8
|
+
Activate this skill for all session state operations during Maestro orchestration. This skill defines the protocols for creating, updating, resuming, and archiving orchestration sessions.
|
|
9
|
+
|
|
10
|
+
## State Access Protocol
|
|
11
|
+
|
|
12
|
+
When MCP state tools are available, prefer them for state operations:
|
|
13
|
+
- **Preferred**: MCP tools (`initialize_workspace`, `create_session`, `update_session`, `transition_phase`, `get_session_status`, `archive_session`) — structured I/O, atomic operations.
|
|
14
|
+
- **Fallback**: `write_file`/`replace` directly on state files — when MCP tools are not in the available tool list.
|
|
15
|
+
- **Legacy**: Shell scripts (`write-state.js`, `read-state.js`) — remain available but are not the recommended path.
|
|
16
|
+
|
|
17
|
+
Detection: check whether MCP state tools appear in your available tools. If they do, use them. If they do not, use `write_file`/`replace`.
|
|
18
|
+
|
|
19
|
+
## Hook-Level Session State
|
|
20
|
+
|
|
21
|
+
Maestro hooks maintain a separate, transient state directory at `/tmp/maestro-hooks/<session-id>/` that is distinct from orchestration state in `<MAESTRO_STATE_DIR>`:
|
|
22
|
+
|
|
23
|
+
| Concern | Orchestration State | Hook State |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| Location | `<MAESTRO_STATE_DIR>/state/` | `/tmp/maestro-hooks/<session-id>/` (Unix) or `<os.tmpdir()>/maestro-hooks/<session-id>/` (Windows) |
|
|
26
|
+
| Lifecycle | Created in Phase 2, archived in Phase 4 | Directory created by the session-start hook when an active session exists; active-agent file written by the pre-delegation hook and cleared by the post-delegation hook; stale directories pruned by both session-start and pre-delegation hooks |
|
|
27
|
+
| Contents | Session metadata, phase tracking, token usage, file manifests | Active agent tracking file (`active-agent`) |
|
|
28
|
+
| Persistence | Survives session restarts (supports `/maestro:resume`) | Ephemeral — lost on session end or system reboot |
|
|
29
|
+
| Managed by | Orchestrator via session-management skill | The runtime's pre-delegation and post-delegation hooks |
|
|
30
|
+
|
|
31
|
+
The pre-delegation hook prunes stale hook state directories older than 2 hours to prevent accumulation from abnormal session terminations.
|
|
32
|
+
|
|
33
|
+
The orchestrator does not read or write hook-level state directly. It interacts only with `<MAESTRO_STATE_DIR>` paths. The two state systems are independent and serve different concerns.
|
|
34
|
+
|
|
35
|
+
## Session Creation Protocol
|
|
36
|
+
|
|
37
|
+
### When to Create
|
|
38
|
+
For Standard workflow, create a new session when beginning Phase 2 (Team Assembly & Planning) of orchestration, after the design document has been approved. For Express workflow, create a session after the structured brief is approved (see Express Workflow section in the orchestrator template).
|
|
39
|
+
|
|
40
|
+
### Session ID Format
|
|
41
|
+
`YYYY-MM-DD-<topic-slug>`
|
|
42
|
+
|
|
43
|
+
Where:
|
|
44
|
+
- `YYYY-MM-DD` is the orchestration start date
|
|
45
|
+
- `<topic-slug>` is a lowercase, hyphenated summary matching the design document topic
|
|
46
|
+
|
|
47
|
+
### File Location
|
|
48
|
+
`<MAESTRO_STATE_DIR>/state/active-session.md`
|
|
49
|
+
|
|
50
|
+
All state paths in this skill use `<MAESTRO_STATE_DIR>` as their base directory (default: `docs/maestro`). In procedural steps, `<state_dir>` represents the resolved value of this variable.
|
|
51
|
+
|
|
52
|
+
### State File Access
|
|
53
|
+
|
|
54
|
+
Both `read_file` and `write_file` work on state paths inside `<MAESTRO_STATE_DIR>`. The runtime's file-access configuration makes state paths accessible.
|
|
55
|
+
|
|
56
|
+
Use the runtime's bundled `scripts/` directory for these helper commands so they still work when the extension is installed outside the workspace root.
|
|
57
|
+
|
|
58
|
+
**Reading state files:**
|
|
59
|
+
Use `read_file` directly. The `read-state.js` script remains available as an alternative for TOML shell blocks that inject state before the model's first turn:
|
|
60
|
+
|
|
61
|
+
`run_shell_command`: `node <runtime-script-root>/read-state.js <relative-path>`
|
|
62
|
+
|
|
63
|
+
**Writing state files:**
|
|
64
|
+
Use `write_file` directly. When content must be piped from a shell command, use the atomic write script:
|
|
65
|
+
|
|
66
|
+
`run_shell_command`: `echo '...' | node <runtime-script-root>/write-state.js <relative-path>`
|
|
67
|
+
|
|
68
|
+
**Rules:**
|
|
69
|
+
- The `write-state.js` script writes atomically (temp file + rename) to prevent partial writes
|
|
70
|
+
- Both scripts validate against absolute paths and path traversal
|
|
71
|
+
|
|
72
|
+
### Initialization Steps
|
|
73
|
+
1. Resolve state directory from `MAESTRO_STATE_DIR`
|
|
74
|
+
2. Create `<state_dir>/state/` directory if it does not exist (defense-in-depth fallback — workspace readiness startup check is the primary mechanism)
|
|
75
|
+
3. Verify no existing `active-session.md` — if one exists, alert the user and offer to archive or resume
|
|
76
|
+
4. Generate session state using the `session-state` template loaded via `get_skill_content`
|
|
77
|
+
5. Initialize all phases as `pending`
|
|
78
|
+
6. Set overall status to `in_progress`
|
|
79
|
+
7. Set `current_phase` to 1
|
|
80
|
+
8. Record design document and implementation plan paths
|
|
81
|
+
9. Initialize empty token_usage, file manifests, downstream_context, and errors sections
|
|
82
|
+
|
|
83
|
+
### Initial State Template
|
|
84
|
+
|
|
85
|
+
```yaml
|
|
86
|
+
---
|
|
87
|
+
session_id: "<YYYY-MM-DD-topic-slug>"
|
|
88
|
+
task: "<user's original task description>"
|
|
89
|
+
created: "<ISO 8601 timestamp>"
|
|
90
|
+
updated: "<ISO 8601 timestamp>"
|
|
91
|
+
status: "in_progress"
|
|
92
|
+
workflow_mode: "<standard|express>"
|
|
93
|
+
design_document: "<state_dir>/plans/<design-doc-filename>"
|
|
94
|
+
implementation_plan: "<state_dir>/plans/<impl-plan-filename>"
|
|
95
|
+
current_phase: 1
|
|
96
|
+
total_phases: <integer from impl plan>
|
|
97
|
+
execution_mode: null
|
|
98
|
+
execution_backend: null
|
|
99
|
+
task_complexity: null
|
|
100
|
+
|
|
101
|
+
token_usage:
|
|
102
|
+
total_input: 0
|
|
103
|
+
total_output: 0
|
|
104
|
+
total_cached: 0
|
|
105
|
+
by_agent: {}
|
|
106
|
+
|
|
107
|
+
phases:
|
|
108
|
+
- id: 1
|
|
109
|
+
name: "<phase name from impl plan>"
|
|
110
|
+
status: "pending"
|
|
111
|
+
agents: []
|
|
112
|
+
parallel: false
|
|
113
|
+
started: null
|
|
114
|
+
completed: null
|
|
115
|
+
blocked_by: []
|
|
116
|
+
files_created: []
|
|
117
|
+
files_modified: []
|
|
118
|
+
files_deleted: []
|
|
119
|
+
downstream_context:
|
|
120
|
+
key_interfaces_introduced: []
|
|
121
|
+
patterns_established: []
|
|
122
|
+
integration_points: []
|
|
123
|
+
assumptions: []
|
|
124
|
+
warnings: []
|
|
125
|
+
errors: []
|
|
126
|
+
retry_count: 0
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
# <Topic> Orchestration Log
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Include `task_complexity` (from design document frontmatter) in the session state. Place after `execution_backend`, before `token_usage`. Default: `null`.
|
|
133
|
+
|
|
134
|
+
## State Update Protocol
|
|
135
|
+
|
|
136
|
+
### Update Triggers
|
|
137
|
+
Update session state on every meaningful state change:
|
|
138
|
+
- Phase status transitions
|
|
139
|
+
- File manifest changes
|
|
140
|
+
- Downstream context extraction from completed phases
|
|
141
|
+
- Error occurrences
|
|
142
|
+
- Token usage increments
|
|
143
|
+
- Phase completion or failure
|
|
144
|
+
|
|
145
|
+
### Update Rules
|
|
146
|
+
|
|
147
|
+
1. **Timestamp**: Update `updated` field on every state change
|
|
148
|
+
2. **Phase Status**: Transition phase status following valid transitions:
|
|
149
|
+
- `pending` -> `in_progress`
|
|
150
|
+
- `in_progress` -> `completed`
|
|
151
|
+
- `in_progress` -> `failed`
|
|
152
|
+
- `failed` -> `in_progress` (retry)
|
|
153
|
+
- `pending` -> `skipped` (user decision only)
|
|
154
|
+
3. **Current Phase**: Update `current_phase` to the ID of the currently executing phase
|
|
155
|
+
4. **File Manifest**: Append to `files_created`, `files_modified`, or `files_deleted` as subagents report changes
|
|
156
|
+
5. **Downstream Context**: Persist parsed Handoff Report Part 2 fields into phase `downstream_context`
|
|
157
|
+
6. **Token Usage**: Aggregate token counts from subagent responses into both `total_*` and `by_agent` sections
|
|
158
|
+
7. **Error Recording**: Append to phase `errors` array with complete metadata
|
|
159
|
+
|
|
160
|
+
### Error Recording Format
|
|
161
|
+
|
|
162
|
+
```yaml
|
|
163
|
+
errors:
|
|
164
|
+
- agent: "<agent-name>"
|
|
165
|
+
timestamp: "<ISO 8601>"
|
|
166
|
+
type: "<validation|timeout|file_conflict|runtime|dependency>"
|
|
167
|
+
message: "<full error description>"
|
|
168
|
+
resolution: "<what was done to resolve, or 'pending'>"
|
|
169
|
+
resolved: false
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Retry Tracking
|
|
173
|
+
- Increment `retry_count` on each retry attempt
|
|
174
|
+
- Maximum 2 retries per phase before escalating to user
|
|
175
|
+
- Record each retry as a separate error entry with resolution details
|
|
176
|
+
|
|
177
|
+
### Markdown Body Updates
|
|
178
|
+
After updating YAML frontmatter, append to the Markdown body:
|
|
179
|
+
|
|
180
|
+
```markdown
|
|
181
|
+
## Phase N: <Phase Name> <status indicator>
|
|
182
|
+
|
|
183
|
+
### <Agent Name> Output
|
|
184
|
+
[Summary of agent output or full content]
|
|
185
|
+
|
|
186
|
+
### Files Changed
|
|
187
|
+
- Created: [list]
|
|
188
|
+
- Modified: [list]
|
|
189
|
+
|
|
190
|
+
### Downstream Context
|
|
191
|
+
- Key Interfaces Introduced: [list]
|
|
192
|
+
- Patterns Established: [list]
|
|
193
|
+
- Integration Points: [list]
|
|
194
|
+
- Assumptions: [list]
|
|
195
|
+
- Warnings: [list]
|
|
196
|
+
|
|
197
|
+
### Validation Result
|
|
198
|
+
[Pass/Fail with details]
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Status indicators:
|
|
202
|
+
- Completed: checkmark
|
|
203
|
+
- In Progress: circle
|
|
204
|
+
- Failed: cross
|
|
205
|
+
- Pending: square
|
|
206
|
+
- Skipped: dash
|
|
207
|
+
|
|
208
|
+
## Archive Protocol
|
|
209
|
+
|
|
210
|
+
### When to Archive
|
|
211
|
+
Archive session state when:
|
|
212
|
+
- All phases are completed successfully AND `MAESTRO_AUTO_ARCHIVE` is `true` (default)
|
|
213
|
+
- User explicitly requests archival (regardless of `MAESTRO_AUTO_ARCHIVE` setting)
|
|
214
|
+
- User starts a new orchestration (previous session must be archived first, regardless of setting)
|
|
215
|
+
|
|
216
|
+
When `MAESTRO_AUTO_ARCHIVE` is `false`, prompt the user after successful completion: "Session complete. Auto-archive is disabled. Would you like to archive this session?"
|
|
217
|
+
|
|
218
|
+
### Archive Steps
|
|
219
|
+
If `archive_session` appears in your available tools, use it — a single call handles all archival:
|
|
220
|
+
|
|
221
|
+
1. Call `archive_session` with the session ID. The MCP tool atomically:
|
|
222
|
+
- Updates session status to `completed`
|
|
223
|
+
- Moves `active-session.md` to `<state_dir>/state/archive/<session-id>.md`
|
|
224
|
+
- Moves design document to `<state_dir>/plans/archive/` (if it exists and is non-null)
|
|
225
|
+
- Moves implementation plan to `<state_dir>/plans/archive/` (if it exists and is non-null)
|
|
226
|
+
2. Confirm archival to user with summary of what was archived (use the `archived_files` array in the response)
|
|
227
|
+
|
|
228
|
+
If `archive_session` is not available, fall back to manual file operations:
|
|
229
|
+
1. Create `<state_dir>/plans/archive/` directory if it does not exist
|
|
230
|
+
2. Create `<state_dir>/state/archive/` directory if it does not exist
|
|
231
|
+
3. **MOVE** (not copy) design document from `<state_dir>/plans/` to `<state_dir>/plans/archive/` — the original MUST be deleted. Use the shell-command tool from runtime context with `mv` or read+write+delete. Do NOT leave the file in both locations. **Skip this step if `design_document` is `null` (Express sessions).**
|
|
232
|
+
4. **MOVE** (not copy) implementation plan from `<state_dir>/plans/` to `<state_dir>/plans/archive/` — same: delete the original. **Skip this step if `implementation_plan` is `null` (Express sessions).**
|
|
233
|
+
5. Update session state `status` to `completed`
|
|
234
|
+
6. Update `updated` timestamp
|
|
235
|
+
7. **MOVE** (not copy) `active-session.md` from `<state_dir>/state/` to `<state_dir>/state/archive/<session-id>.md` — delete the original.
|
|
236
|
+
8. Confirm archival to user with summary of what was archived
|
|
237
|
+
|
|
238
|
+
### Archive Verification
|
|
239
|
+
After archival, verify ALL of the following (archive is incomplete if any check fails):
|
|
240
|
+
- No `active-session.md` exists in `<state_dir>/state/`
|
|
241
|
+
- No plan files remain in `<state_dir>/plans/` (only the `archive/` subdirectory should be present)
|
|
242
|
+
- Archived files are readable at their new locations in `archive/`
|
|
243
|
+
- If files still exist in the original locations, delete them now — the archive step used copy instead of move
|
|
244
|
+
|
|
245
|
+
## Resume Protocol
|
|
246
|
+
|
|
247
|
+
### When to Resume
|
|
248
|
+
Resume is triggered by the `/maestro:resume` command or when `/maestro:orchestrate` detects an existing active session.
|
|
249
|
+
|
|
250
|
+
### Resume Steps
|
|
251
|
+
|
|
252
|
+
1. **Read State**: If session state was already injected into the prompt (e.g., via `/maestro:resume`), use that injected content instead of calling `get_session_status`. Otherwise, if `get_session_status` appears in your available tools, call it to read the active session. Otherwise, read state via `run_shell_command`: `node <runtime-script-root>/read-active-session.js` (resolves `MAESTRO_STATE_DIR` internally)
|
|
253
|
+
2. **Parse Frontmatter**: Extract YAML frontmatter for session metadata
|
|
254
|
+
3. **Identify Position**: Determine:
|
|
255
|
+
- Last completed phase (highest ID with `status: completed`)
|
|
256
|
+
- Current active phase (first phase with `status: in_progress` or `pending`)
|
|
257
|
+
- Any failed phases with unresolved errors
|
|
258
|
+
4. **Check Errors**: Identify unresolved errors from previous execution
|
|
259
|
+
5. **Present Summary**: Display status summary to user using the resume format defined in the orchestrator instructions
|
|
260
|
+
6. **Handle Errors**: If unresolved errors exist:
|
|
261
|
+
- Present each error with context
|
|
262
|
+
- Offer options: retry, skip, abort, or adjust parameters
|
|
263
|
+
- Wait for user guidance before proceeding
|
|
264
|
+
7. **Continue Execution**: Resume from the first pending or failed phase
|
|
265
|
+
8. **Update State**: Mark resumed phase as `in_progress` and update timestamps
|
|
266
|
+
|
|
267
|
+
### Express Resume Branch
|
|
268
|
+
|
|
269
|
+
When resuming a session with `workflow_mode: "express"` (read from session state via `get_session_status`), follow the Express workflow's resume protocol instead of the standard resume steps above:
|
|
270
|
+
|
|
271
|
+
- If phase status is `pending`: re-generate and present the structured brief for approval. On approval, proceed to delegation.
|
|
272
|
+
- If phase status is `in_progress`: the implementing agent was interrupted. Re-delegate with the same scope. Use the `agents` array to identify which agent was running.
|
|
273
|
+
- If phase status is `completed` but session status is `in_progress`: code review or archival was interrupted. Run the code review step, then archive.
|
|
274
|
+
|
|
275
|
+
Express sessions have a single phase. The phase status combined with the `agents` array contents determines the resume position.
|
|
276
|
+
|
|
277
|
+
### Conflict Detection
|
|
278
|
+
When resuming, check for potential conflicts:
|
|
279
|
+
- Files that were partially modified (phase started but not completed)
|
|
280
|
+
- External modifications to files in the manifest since last session
|
|
281
|
+
- Changes to the implementation plan since last execution
|
|
282
|
+
|
|
283
|
+
Report any detected conflicts to the user before proceeding.
|
|
284
|
+
|
|
285
|
+
## Token Usage Tracking
|
|
286
|
+
|
|
287
|
+
### Collection
|
|
288
|
+
After each subagent invocation, record:
|
|
289
|
+
- Input tokens consumed
|
|
290
|
+
- Output tokens generated
|
|
291
|
+
- Cached tokens used (if available)
|
|
292
|
+
|
|
293
|
+
### Aggregation
|
|
294
|
+
Maintain two levels of aggregation:
|
|
295
|
+
1. **Total**: Sum across all agents and phases
|
|
296
|
+
2. **By Agent**: Per-agent totals across all their invocations
|
|
297
|
+
|
|
298
|
+
### Format
|
|
299
|
+
|
|
300
|
+
```yaml
|
|
301
|
+
token_usage:
|
|
302
|
+
total_input: 15000
|
|
303
|
+
total_output: 8000
|
|
304
|
+
total_cached: 3000
|
|
305
|
+
by_agent:
|
|
306
|
+
coder:
|
|
307
|
+
input: 8000
|
|
308
|
+
output: 4000
|
|
309
|
+
cached: 2000
|
|
310
|
+
tester:
|
|
311
|
+
input: 7000
|
|
312
|
+
output: 4000
|
|
313
|
+
cached: 1000
|
|
314
|
+
```
|