@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,145 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review
|
|
3
|
+
description: Standalone code review methodology for structured, severity-classified code assessment
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Review Skill
|
|
7
|
+
|
|
8
|
+
Activate this skill when performing standalone code reviews via the runtime-specific Maestro review entrypoint or during orchestration quality gates (post-phase checks and final completion gate). This skill provides the methodology for scoping, executing, and reporting code reviews.
|
|
9
|
+
|
|
10
|
+
## Scope Detection Protocol
|
|
11
|
+
|
|
12
|
+
Determine review scope using the following priority order:
|
|
13
|
+
|
|
14
|
+
1. **User-specified paths**: If the user provides file paths or glob patterns, expand glob patterns using the `glob` tool to resolve them to concrete file paths before delegating to the `code-reviewer` agent
|
|
15
|
+
2. **Staged changes**: If `git diff --staged` produces output, review staged changes
|
|
16
|
+
3. **Last commit diff**: If no staged changes exist, review the last commit via `git diff HEAD~1`
|
|
17
|
+
4. **Fallback**: If none of the above yield content, ask the user to specify scope
|
|
18
|
+
|
|
19
|
+
Always confirm the detected scope with the user before proceeding.
|
|
20
|
+
|
|
21
|
+
If scope is provided as file paths and a git diff is empty for some paths (for example, new unstaged files), include those files' current contents directly in review context so they are still reviewed.
|
|
22
|
+
|
|
23
|
+
## Review Orchestration
|
|
24
|
+
|
|
25
|
+
### Delegation Flow
|
|
26
|
+
|
|
27
|
+
1. Detect review scope using the protocol above
|
|
28
|
+
2. Gather the full diff content for the detected scope, and include current file contents when diff content is unavailable for scoped files
|
|
29
|
+
3. Delegate to the `code-reviewer` agent with:
|
|
30
|
+
- The full diff content
|
|
31
|
+
- File paths involved
|
|
32
|
+
- Any user-provided focus areas or concerns
|
|
33
|
+
4. Process the agent's Task Report
|
|
34
|
+
5. Present findings to the user in the structured output format below
|
|
35
|
+
|
|
36
|
+
### Context Enrichment
|
|
37
|
+
|
|
38
|
+
When delegating to the `code-reviewer` agent, include:
|
|
39
|
+
- The diff content (not just file names)
|
|
40
|
+
- Surrounding context for modified sections (10 lines before/after when available)
|
|
41
|
+
- Project language and framework information (detected from package.json, Cargo.toml, go.mod, etc.)
|
|
42
|
+
|
|
43
|
+
## Severity Classification
|
|
44
|
+
|
|
45
|
+
### Critical
|
|
46
|
+
Issues that could cause security vulnerabilities, data loss, or system crashes:
|
|
47
|
+
- SQL/NoSQL injection vectors
|
|
48
|
+
- Authentication/authorization bypasses
|
|
49
|
+
- Unvalidated user input at system boundaries
|
|
50
|
+
- Resource leaks (unclosed connections, file handles)
|
|
51
|
+
- Race conditions with data corruption potential
|
|
52
|
+
|
|
53
|
+
### Major
|
|
54
|
+
Issues that cause bugs, design flaws, or significant maintainability problems:
|
|
55
|
+
- Logic errors in business rules
|
|
56
|
+
- Missing error handling on external calls
|
|
57
|
+
- SOLID principle violations that impact extensibility
|
|
58
|
+
- Incorrect API contracts or type mismatches
|
|
59
|
+
- Missing null/undefined checks on external data
|
|
60
|
+
|
|
61
|
+
### Minor
|
|
62
|
+
Issues related to style, naming, or minor convention violations:
|
|
63
|
+
- Naming inconsistencies
|
|
64
|
+
- Code style deviations from project conventions
|
|
65
|
+
- Suboptimal but correct implementations
|
|
66
|
+
- Missing type annotations where inference is insufficient
|
|
67
|
+
|
|
68
|
+
### Suggestion
|
|
69
|
+
Optional improvements that enhance readability or maintainability:
|
|
70
|
+
- Alternative patterns that improve clarity
|
|
71
|
+
- Performance optimizations with marginal impact
|
|
72
|
+
- Structural improvements for future extensibility
|
|
73
|
+
|
|
74
|
+
## Output Format
|
|
75
|
+
|
|
76
|
+
Present findings in a structured table followed by a summary:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
## Code Review Results
|
|
80
|
+
|
|
81
|
+
**Scope**: [description of what was reviewed]
|
|
82
|
+
**Files Reviewed**: [count]
|
|
83
|
+
**Total Findings**: [count by severity]
|
|
84
|
+
|
|
85
|
+
### Findings
|
|
86
|
+
|
|
87
|
+
| # | Severity | File | Line | Description | Suggested Fix |
|
|
88
|
+
|---|----------|------|------|-------------|---------------|
|
|
89
|
+
| 1 | Critical | path/to/file.ts | 42 | [description] | [fix] |
|
|
90
|
+
| 2 | Major | path/to/file.ts | 87 | [description] | [fix] |
|
|
91
|
+
|
|
92
|
+
### Summary
|
|
93
|
+
|
|
94
|
+
[1-2 paragraph summary of overall code quality, patterns observed, and priority actions]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Verification Rule
|
|
98
|
+
|
|
99
|
+
Every finding **must**:
|
|
100
|
+
- Reference a specific file and line number
|
|
101
|
+
- Be verified against the actual code (not assumed from patterns)
|
|
102
|
+
- Include a concrete suggested fix or action
|
|
103
|
+
- Be classified with a severity that matches the classification criteria above
|
|
104
|
+
|
|
105
|
+
Do NOT report:
|
|
106
|
+
- Speculative issues based on assumptions about runtime behavior
|
|
107
|
+
- Style preferences not established by the project's conventions
|
|
108
|
+
- Issues in code outside the review scope
|
|
109
|
+
|
|
110
|
+
## Review Scope Calibration
|
|
111
|
+
|
|
112
|
+
Calibrate the depth and focus of review based on the type of change being reviewed:
|
|
113
|
+
|
|
114
|
+
### Calibration Rules
|
|
115
|
+
- **New files**: Full review across all dimensions — architecture fit, pattern compliance, security, naming conventions, error handling, testability, dependency direction
|
|
116
|
+
- **Modified files (behavior change)**: Focus on the diff — correctness of new behavior, regression risk, contract compliance with existing interfaces, edge case handling in new code paths
|
|
117
|
+
- **Modified files (refactoring)**: Focus on behavior preservation — verify same inputs produce same outputs, no unintended side effects introduced, no behavior changes disguised as refactoring
|
|
118
|
+
- **Deleted files**: Dependency verification — confirm no remaining code imports from, references, or depends on the deleted files. Check for orphaned tests that tested the deleted code.
|
|
119
|
+
- **Configuration changes**: Environment impact assessment — does this change affect production? Staging? Local development? All environments? Are there secrets or credentials involved?
|
|
120
|
+
|
|
121
|
+
### Application
|
|
122
|
+
When reviewing a diff that contains multiple change types (new files + modifications + deletions), apply the appropriate calibration to each file independently. Do not apply "new file" depth to a file that only had a minor modification.
|
|
123
|
+
|
|
124
|
+
## Finding Deduplication Protocol
|
|
125
|
+
|
|
126
|
+
When reviewing multiple files, identify and consolidate findings that share the same root cause.
|
|
127
|
+
|
|
128
|
+
### Deduplication Rules
|
|
129
|
+
- If the same pattern violation appears in 3+ files, report it **once** as a systemic finding with the list of all affected locations — not as N separate findings
|
|
130
|
+
- A systemic finding includes: the pattern being violated, why it matters, the full list of affected file:line locations, and a single remediation recommendation that addresses all instances
|
|
131
|
+
- Unique findings (appearing in only 1-2 files) are reported individually as normal
|
|
132
|
+
|
|
133
|
+
### Deduplication Format
|
|
134
|
+
```
|
|
135
|
+
### Systemic Finding: [Pattern Violation Name]
|
|
136
|
+
- **Severity**: [Critical | Major | Minor | Suggestion]
|
|
137
|
+
- **Description**: [What the pattern violation is and why it matters]
|
|
138
|
+
- **Affected Locations**:
|
|
139
|
+
- `path/to/file1.ext:line` — [brief context]
|
|
140
|
+
- `path/to/file2.ext:line` — [brief context]
|
|
141
|
+
- `path/to/file3.ext:line` — [brief context]
|
|
142
|
+
- **Remediation**: [Single recommendation that addresses all instances]
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
This produces cleaner, more actionable review output by surfacing systemic issues as patterns rather than repeating the same finding across multiple files.
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: delegation
|
|
3
|
+
description: Agent delegation best practices for constructing effective subagent prompts with proper scoping
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Delegation Skill
|
|
7
|
+
|
|
8
|
+
Activate this skill when delegating work to subagents during orchestration execution. This skill provides the templates, rules, and patterns for constructing effective delegation prompts that produce consistent, high-quality results.
|
|
9
|
+
|
|
10
|
+
## Protocol Injection
|
|
11
|
+
|
|
12
|
+
Before constructing any delegation prompt, inject the shared agent base protocol:
|
|
13
|
+
|
|
14
|
+
### Injection Steps
|
|
15
|
+
1. Load `agent-base-protocol` via `get_skill_content`
|
|
16
|
+
2. Load `filesystem-safety-protocol` via `get_skill_content`
|
|
17
|
+
3. Prepend both protocols to the delegation prompt (base protocol first, then filesystem safety) — these appear before the task-specific content
|
|
18
|
+
4. For each phase listed in the current phase's `blocked_by`, read `phases[].downstream_context` from session state and include it in the prompt
|
|
19
|
+
5. If any required `downstream_context` is missing, include an explicit placeholder noting the missing dependency context (never omit silently)
|
|
20
|
+
|
|
21
|
+
The injected protocol ensures every agent follows consistent pre-work procedures and output formatting regardless of their specialization.
|
|
22
|
+
|
|
23
|
+
### Context Chain Construction
|
|
24
|
+
|
|
25
|
+
Every delegation prompt must include a context chain that connects the current phase to prior work:
|
|
26
|
+
|
|
27
|
+
**Phase Context**: Include Downstream Context blocks from all completed phases that the current phase depends on (identified via `blocked_by` relationships in the implementation plan and sourced from session state `phases[].downstream_context`):
|
|
28
|
+
```
|
|
29
|
+
Context from completed phases:
|
|
30
|
+
- Phase [N] ([agent]): [Downstream Context summary]
|
|
31
|
+
- Interfaces introduced: [list with file locations]
|
|
32
|
+
- Patterns established: [list]
|
|
33
|
+
- Integration points: [specific files, functions, endpoints]
|
|
34
|
+
- Warnings: [list]
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Accumulated Patterns**: Naming conventions, directory organization patterns, and architectural decisions established by earlier phases. This ensures phase 5 does not contradict patterns set in phase 2.
|
|
38
|
+
|
|
39
|
+
**File Manifest**: Complete list of files created or modified in prior phases, so the agent knows what already exists and can import from or extend those files.
|
|
40
|
+
|
|
41
|
+
**Missing Context Fallback**: If a blocked dependency has no stored downstream context, include a visible placeholder entry in the prompt:
|
|
42
|
+
`- Phase [N] ([agent]): Downstream Context missing in session state — verify dependency output before implementation`
|
|
43
|
+
|
|
44
|
+
### Downstream Consumer Declaration
|
|
45
|
+
|
|
46
|
+
Every delegation prompt must declare who will consume the agent's output:
|
|
47
|
+
```
|
|
48
|
+
Your output will be consumed by: [downstream agent name(s)] who need [specific information they require]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
This primes the agent to structure their Downstream Context section for maximum utility to the next agent in the chain.
|
|
52
|
+
|
|
53
|
+
## Settings Override Application
|
|
54
|
+
|
|
55
|
+
Before constructing any delegation prompt, resolve configurable parameters:
|
|
56
|
+
|
|
57
|
+
1. Read the agent's base definition frontmatter (`temperature`, `max_turns`, `timeout_mins`, `tools`)
|
|
58
|
+
2. Do not invent Maestro-level model, temperature, turn, or timeout overrides. Native delegation uses agent frontmatter defaults plus any runtime-level agent configuration already active in the session.
|
|
59
|
+
3. Include only task-relevant execution context in the prompt metadata
|
|
60
|
+
4. If the agent appears in `MAESTRO_DISABLED_AGENTS`, do not construct a delegation prompt — report to the orchestrator that the agent is disabled
|
|
61
|
+
|
|
62
|
+
## Delegation Prompt Template
|
|
63
|
+
|
|
64
|
+
Every delegation to a subagent must follow this structure:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Task: [One-line description of what to accomplish]
|
|
68
|
+
|
|
69
|
+
Progress: Phase [N] of [M]: [Phase Name]
|
|
70
|
+
|
|
71
|
+
Files to modify:
|
|
72
|
+
- /absolute/path/to/file1.ext: [Specific change required]
|
|
73
|
+
- /absolute/path/to/file2.ext: [Specific change required]
|
|
74
|
+
|
|
75
|
+
Files to create:
|
|
76
|
+
- /absolute/path/to/new-file.ext: [Purpose and key contents]
|
|
77
|
+
|
|
78
|
+
Deliverables:
|
|
79
|
+
- [Concrete output 1]
|
|
80
|
+
- [Concrete output 2]
|
|
81
|
+
|
|
82
|
+
Validation: [command to run after completion, e.g., "npm run lint && npm run test"]
|
|
83
|
+
|
|
84
|
+
Context:
|
|
85
|
+
[Relevant information from the design document or previous phases]
|
|
86
|
+
|
|
87
|
+
Do NOT:
|
|
88
|
+
- [Explicit exclusion 1]
|
|
89
|
+
- [Explicit exclusion 2]
|
|
90
|
+
- Modify any files not listed above
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Scope Boundary Rules
|
|
94
|
+
|
|
95
|
+
### Absolute Paths
|
|
96
|
+
Always provide absolute file paths in delegation prompts. Never use relative paths or expect agents to search for files.
|
|
97
|
+
|
|
98
|
+
### Specific Deliverables
|
|
99
|
+
Define exactly what the agent should produce. Vague instructions like "implement the feature" lead to inconsistent results. Instead: "Create UserService class with createUser(), getUserById(), and deleteUser() methods implementing the IUserService interface."
|
|
100
|
+
|
|
101
|
+
### Validation Criteria
|
|
102
|
+
Include the exact command(s) to run after completion. The agent should run these and report results. Examples:
|
|
103
|
+
- `npm run lint && npm run test`
|
|
104
|
+
- `cargo build && cargo test`
|
|
105
|
+
- `go vet ./... && go test ./...`
|
|
106
|
+
- `python -m pytest tests/`
|
|
107
|
+
|
|
108
|
+
### No Interactive Commands in Delegation Prompts
|
|
109
|
+
Never include interactive CLI commands in delegation prompts. Subagents run autonomously without user input. Interactive commands will hang indefinitely.
|
|
110
|
+
|
|
111
|
+
<ANTI-PATTERN>
|
|
112
|
+
WRONG — Delegation prompt includes interactive scaffolding:
|
|
113
|
+
"Run `npx create-next-app@latest . --typescript --tailwind`"
|
|
114
|
+
"Run `npm init` to create package.json"
|
|
115
|
+
|
|
116
|
+
CORRECT — Delegation prompt specifies direct file creation:
|
|
117
|
+
"Create package.json with the following content: ..."
|
|
118
|
+
"Create tsconfig.json, tailwind.config.ts, and src/app/layout.tsx directly"
|
|
119
|
+
</ANTI-PATTERN>
|
|
120
|
+
|
|
121
|
+
### Exclusions
|
|
122
|
+
Explicitly state what the agent must NOT do:
|
|
123
|
+
- Files it must not modify
|
|
124
|
+
- Dependencies it must not add
|
|
125
|
+
- Patterns it must not introduce
|
|
126
|
+
- Scope it must not exceed
|
|
127
|
+
|
|
128
|
+
## Agent Selection Guide
|
|
129
|
+
|
|
130
|
+
| Task Domain | Agent | Key Capability |
|
|
131
|
+
|-------------|-------|---------------|
|
|
132
|
+
| System architecture, component design | `architect` | Read-only analysis, architecture patterns |
|
|
133
|
+
| API contracts, endpoint design | `api-designer` | Read-only, REST/GraphQL expertise |
|
|
134
|
+
| Feature implementation, coding | `coder` | Full read/write/shell access |
|
|
135
|
+
| Code quality assessment | `code-reviewer` | Read-only, verified findings |
|
|
136
|
+
| Database schema, queries, ETL | `data-engineer` | Full read/write/shell access |
|
|
137
|
+
| Bug investigation, root cause | `debugger` | Read + shell for investigation |
|
|
138
|
+
| CI/CD, infrastructure, deployment | `devops-engineer` | Full read/write/shell access |
|
|
139
|
+
| Performance analysis, profiling | `performance-engineer` | Read + shell for profiling |
|
|
140
|
+
| Code restructuring, modernization | `refactor` | Read/write/shell, skill activation |
|
|
141
|
+
| Security assessment, vulnerability | `security-engineer` | Read + shell for scanning |
|
|
142
|
+
| Test creation, TDD, coverage | `tester` | Full read/write/shell access |
|
|
143
|
+
| Documentation, READMEs, guides | `technical-writer` | Read/write, no shell |
|
|
144
|
+
| Technical SEO auditing | `seo-specialist` | Read + shell + web search/fetch |
|
|
145
|
+
| Marketing copy, content writing | `copywriter` | Read/write |
|
|
146
|
+
| Content planning, strategy | `content-strategist` | Read + web search/fetch |
|
|
147
|
+
| User experience design | `ux-designer` | Read/write + web search |
|
|
148
|
+
| WCAG compliance auditing | `accessibility-specialist` | Read + shell + web search |
|
|
149
|
+
| Requirements, product strategy | `product-manager` | Read/write + web search |
|
|
150
|
+
| Tracking, measurement | `analytics-engineer` | Full read/write/shell access |
|
|
151
|
+
| Internationalization | `i18n-specialist` | Full read/write/shell access |
|
|
152
|
+
| Design tokens, theming | `design-system-engineer` | Full read/write/shell access |
|
|
153
|
+
| Legal, regulatory compliance | `compliance-reviewer` | Read + web search/fetch |
|
|
154
|
+
|
|
155
|
+
## Agent Tool Dispatch Contract
|
|
156
|
+
|
|
157
|
+
Delegate to the assigned agent using the dispatch pattern from `get_runtime_context` (loaded at session start, step 0). Every Maestro agent in the Agent Roster carries its frontmatter configuration:
|
|
158
|
+
|
|
159
|
+
- `temperature`: Controls output determinism (e.g., coder uses 0.2 for precise code)
|
|
160
|
+
- `max_turns`: Prevents runaway sessions (e.g., 25 turns for implementation agents)
|
|
161
|
+
- `tools`: Restricts the agent to its authorized tool surface (e.g., read-only agents cannot use file-writing tools)
|
|
162
|
+
- Body: Contains the agent's specialized methodology and decision frameworks
|
|
163
|
+
|
|
164
|
+
Using a generic/default agent tool bypasses all of this — it uses default temperature, has no turn limit, no tool restrictions, and no specialized methodology. Never use a generic agent tool for Maestro phase delegations.
|
|
165
|
+
|
|
166
|
+
Every delegation must include the required header fields:
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
Agent: <agent_name>
|
|
170
|
+
Phase: <id>/<total>
|
|
171
|
+
Batch: <batch_id> (or "single" for sequential)
|
|
172
|
+
Session: <session_id>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Sequential dispatch**: Invoke the agent using your runtime's dispatch mechanism with the full delegation prompt.
|
|
176
|
+
|
|
177
|
+
**Parallel dispatch**: Emit contiguous agent dispatch calls in a single turn for all agents in the ready batch. Each call includes the same header format with the shared batch ID.
|
|
178
|
+
|
|
179
|
+
Call `get_agent` with the agent name (as it appears in the implementation plan or Agent Roster) to load the agent methodology body, declared tool restrictions, and the runtime-specific `tool_name`. Use the returned `tool_name` as the dispatch target when invoking the agent tool. Runtime-local agent files remain registration stubs only; do not rely on them for the full methodology body.
|
|
180
|
+
|
|
181
|
+
## Parallel Delegation
|
|
182
|
+
|
|
183
|
+
Parallel delegation uses the runtime's native subagent scheduler. The orchestrator emits contiguous agent tool calls inside a single turn; it does not write prompt files, spawn subprocesses, or call shell-based dispatch helpers.
|
|
184
|
+
|
|
185
|
+
### Native Batch Construction
|
|
186
|
+
|
|
187
|
+
For each agent in a ready batch:
|
|
188
|
+
|
|
189
|
+
1. Build a full delegation prompt using the same template as sequential delegation
|
|
190
|
+
2. Include the required header:
|
|
191
|
+
- `Agent: <agent_name>`
|
|
192
|
+
- `Phase: <id>/<total>`
|
|
193
|
+
- `Batch: <batch_id>`
|
|
194
|
+
- `Session: <session_id>`
|
|
195
|
+
3. Keep prompts self-contained with explicit files, deliverables, validation commands, exclusions, and dependency context
|
|
196
|
+
4. Emit only contiguous agent tool calls for the current batch turn — no shell commands, file writes, or narration between them
|
|
197
|
+
|
|
198
|
+
Native parallel batches may pause if an agent asks a follow-up question. Scope prompts tightly enough that questions are rare.
|
|
199
|
+
|
|
200
|
+
### Tool Restriction Enforcement
|
|
201
|
+
|
|
202
|
+
Maestro enforces tool permissions at two levels:
|
|
203
|
+
|
|
204
|
+
**Level 1: Native enforcement (primary)**
|
|
205
|
+
|
|
206
|
+
Tool permissions are enforced natively via each agent's registered frontmatter stub. Use the `tools` array returned by `get_agent` when you mirror that restriction in the prompt. This works for both sequential and parallel delegation.
|
|
207
|
+
|
|
208
|
+
**Level 2: Prompt-based enforcement (defense-in-depth)**
|
|
209
|
+
|
|
210
|
+
Native tool permissions remain the primary boundary. As defense-in-depth, every delegation prompt should still include an explicit tool restriction block so the agent sees its allowed surface in plain language.
|
|
211
|
+
|
|
212
|
+
1. Agent Base Protocol (load `agent-base-protocol` via `get_skill_content`)
|
|
213
|
+
2. Filesystem Safety Protocol (load `filesystem-safety-protocol` via `get_skill_content`)
|
|
214
|
+
3. **TOOL RESTRICTIONS block (immediately here, before any task content)**
|
|
215
|
+
4. **FILE WRITING RULES block (immediately after tool restrictions)**
|
|
216
|
+
5. Context chain from prior phases
|
|
217
|
+
6. Task-specific instructions
|
|
218
|
+
7. Scope boundaries and prohibitions
|
|
219
|
+
|
|
220
|
+
The tool restriction block template:
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
TOOL RESTRICTIONS (MANDATORY):
|
|
224
|
+
You are authorized to use ONLY the following tools: [list from agent frontmatter].
|
|
225
|
+
Do NOT use any tools not listed above. Specifically:
|
|
226
|
+
- Do NOT use `write_file` or `replace` unless explicitly authorized above
|
|
227
|
+
- Do NOT use `run_shell_command` unless explicitly authorized above
|
|
228
|
+
- Do NOT create, modify, or delete files unless authorized above
|
|
229
|
+
Violation of these restrictions constitutes a security boundary breach.
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Populate the tool list from the `tools` array returned by `get_agent` for the delegated agent.
|
|
233
|
+
|
|
234
|
+
The file writing rules block template:
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
FILE WRITING RULES (MANDATORY):
|
|
238
|
+
Use ONLY `write_file` to create files and `replace` to modify files.
|
|
239
|
+
Do NOT use `run_shell_command` with cat, echo, printf, heredocs, or shell redirection (>, >>) to write file content.
|
|
240
|
+
Shell interpretation corrupts YAML, Markdown, and special characters. This rule has NO exceptions.
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
This block reinforces the Agent Base Protocol's File Writing Rule directly in every delegation prompt, ensuring agents see the prohibition even if they skim the injected protocols.
|
|
244
|
+
|
|
245
|
+
### Non-Overlapping File Ownership
|
|
246
|
+
When delegating to multiple agents in parallel, ensure no two agents are assigned the same file. Each file must have exactly one owner in a parallel batch.
|
|
247
|
+
|
|
248
|
+
### Batch Completion Gates
|
|
249
|
+
All agents in a parallel batch must complete before:
|
|
250
|
+
- The next batch of phases begins
|
|
251
|
+
- Shared/container files are updated
|
|
252
|
+
- Validation checkpoints run
|
|
253
|
+
- The orchestrator creates a git commit for the batch
|
|
254
|
+
|
|
255
|
+
### Conflict Prevention
|
|
256
|
+
- Assign non-overlapping file sets to each agent
|
|
257
|
+
- Reserve shared files (barrel exports, configuration, dependency manifests) for a single agent or a post-batch update step
|
|
258
|
+
- If two phases must modify the same file, they cannot run in parallel — execute them sequentially
|
|
259
|
+
- Parallel agents must NOT create git commits — the orchestrator commits after validating the batch
|
|
260
|
+
|
|
261
|
+
## Hook Integration
|
|
262
|
+
|
|
263
|
+
Maestro hooks fire at agent boundaries during delegation, providing context injection and output validation. Understanding hook behavior is essential for constructing correct delegation prompts.
|
|
264
|
+
|
|
265
|
+
### Agent Tracking
|
|
266
|
+
|
|
267
|
+
Before each agent dispatch, a hook tracks which agent is currently executing:
|
|
268
|
+
|
|
269
|
+
- Preferred signal: the required `Agent: <agent_name>` header in the delegation prompt
|
|
270
|
+
- Legacy fallbacks: `MAESTRO_CURRENT_AGENT` from the environment, then regex-based detection of patterns like `delegate to <agent>` or `@<agent>`
|
|
271
|
+
|
|
272
|
+
The detected agent name is persisted to `/tmp/maestro-hooks/<session-id>/active-agent` and cleared by the post-delegation hook on every allowed response (both successful validation and retry allow-through). On deny (malformed output), the active agent is preserved to enable re-validation on retry.
|
|
273
|
+
|
|
274
|
+
### Session Context Injection
|
|
275
|
+
|
|
276
|
+
When an active orchestration session exists, the pre-delegation hook parses `<MAESTRO_STATE_DIR>/state/active-session.md` and injects a compact context line into the agent's turn:
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
Active session: current_phase=3, status=in_progress
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
This gives delegated agents awareness of where they sit in the orchestration workflow without requiring explicit context in every delegation prompt. The injection is automatic and requires no action from the orchestrator.
|
|
283
|
+
|
|
284
|
+
### Handoff Format Enforcement
|
|
285
|
+
|
|
286
|
+
After completion, the post-delegation hook validates that every subagent response contains both required handoff sections:
|
|
287
|
+
|
|
288
|
+
- `## Task Report` (or `# Task Report`)
|
|
289
|
+
- `## Downstream Context` (or `# Downstream Context`)
|
|
290
|
+
|
|
291
|
+
If either heading is missing:
|
|
292
|
+
|
|
293
|
+
1. **First failure**: The hook blocks the response and requests a retry with a diagnostic message specifying which section is missing.
|
|
294
|
+
2. **Second failure** (`stop_hook_active=true`, mapped to `stopHookActive` in JS): The hook allows the malformed response through to prevent infinite retry loops, logging a warning.
|
|
295
|
+
|
|
296
|
+
This enforcement is the runtime complement to the Output Handoff Contract defined in the agent-base-protocol. Delegation prompts do not need to re-state the retry mechanism — the hook handles it transparently.
|
|
297
|
+
|
|
298
|
+
**Exception**: The TechLead/orchestrator agent is excluded from validation. Only delegated subagents are subject to format enforcement.
|
|
299
|
+
|
|
300
|
+
## Delegation Constraints (per runtime)
|
|
301
|
+
|
|
302
|
+
Read `delegation.constraints` from `get_runtime_context` before constructing any agent dispatch. Apply constraints to the dispatch:
|
|
303
|
+
|
|
304
|
+
- `fork_full_context_incompatible_with`: list of field names. If the runtime is invoking a fork-style delegation with full-history inheritance, do NOT pass any of these fields. For Codex, this means omitting `agent_type`, `model`, and `reasoning_effort` whenever `fork_context: true` or `fork_turns: "all"` is used.
|
|
305
|
+
- `result_surface: "synchronous"`: the parent receives the child's full text response in the dispatch return value. Parse the Task Report and Downstream Context directly from that text.
|
|
306
|
+
- `result_surface: "deferred"`: the parent receives only identifiers. The parent MUST poll for completion (`wait_agent` or equivalent) with a bounded timeout. On timeout or empty return, invoke the Recovery Protocol in the execution skill.
|
|
307
|
+
- `child_cannot_prompt_user: true`: child agents cannot call the user-prompt tool. All user questions must surface through the Blocker Protocol below.
|
|
308
|
+
|
|
309
|
+
## Blocker Protocol (child-agent question surfacing)
|
|
310
|
+
|
|
311
|
+
**MANDATORY** when `delegation.constraints.child_cannot_prompt_user` is true (Codex today). **RECOMMENDED** uniformly so the orchestrator remains the single approval point across runtimes.
|
|
312
|
+
|
|
313
|
+
Every agent's Task Report may include a `## Blockers` section, placed between `## Task Report` and `## Downstream Context`:
|
|
314
|
+
|
|
315
|
+
## Blockers
|
|
316
|
+
- BLOCKER: [question the agent cannot resolve]
|
|
317
|
+
Context: [why this question arose]
|
|
318
|
+
Required to proceed: [what answer unlocks continuation]
|
|
319
|
+
|
|
320
|
+
When parsing an agent response:
|
|
321
|
+
|
|
322
|
+
1. If `## Blockers` is present and non-empty, do NOT call `transition_phase`. Keep the phase `in_progress`.
|
|
323
|
+
2. Aggregate blockers across the batch (if parallel).
|
|
324
|
+
3. Ask the user via the runtime's user-prompt tool.
|
|
325
|
+
4. Re-delegate the phase with the answer added to the Context block. The agent re-tries with the new information.
|
|
326
|
+
5. On the next return, re-parse and proceed.
|
|
327
|
+
|
|
328
|
+
An agent that returns neither a handoff nor a blocker is considered incomplete. Invoke the Recovery Protocol in the execution skill.
|
|
329
|
+
|
|
330
|
+
## Validation Criteria Templates
|
|
331
|
+
|
|
332
|
+
### For Implementation Agents (`coder`, `data-engineer`, `devops-engineer`)
|
|
333
|
+
```
|
|
334
|
+
Validation: [build command] && [lint command] && [test command]
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### For Refactoring Agents (`refactor`)
|
|
338
|
+
```
|
|
339
|
+
Validation: [build command] && [test command]
|
|
340
|
+
Verify: No behavior changes — all existing tests must still pass
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### For Test Agents (`tester`)
|
|
344
|
+
```
|
|
345
|
+
Validation: [test command]
|
|
346
|
+
Verify: All new tests pass, report coverage metrics
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### For Assessment Agents (`architect`, `api-designer`, `code-reviewer`, `debugger`, `performance-engineer`, `security-engineer`, `seo-specialist`, `accessibility-specialist`, `content-strategist`, `compliance-reviewer`)
|
|
350
|
+
```
|
|
351
|
+
Validation: N/A (assessment-only — no write tools)
|
|
352
|
+
Verify: Findings reference specific files and line numbers
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### For Documentation Agents (`technical-writer`, `copywriter`)
|
|
356
|
+
```
|
|
357
|
+
Validation: Verify all links resolve, code examples are syntactically valid
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### For Design and Product Agents (`ux-designer`, `product-manager`)
|
|
361
|
+
```
|
|
362
|
+
Validation: N/A (design and requirements artifacts)
|
|
363
|
+
Verify: Deliverables reference user needs and acceptance criteria
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### For Implementation Specialists (`analytics-engineer`, `i18n-specialist`, `design-system-engineer`)
|
|
367
|
+
```
|
|
368
|
+
Validation: [build command] && [lint command] && [test command]
|
|
369
|
+
Verify: Domain-specific integration validated (tracking fires, locales render, tokens apply)
|
|
370
|
+
```
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Agent Base Protocol
|
|
2
|
+
|
|
3
|
+
This protocol is injected into every delegation prompt by the delegation skill. It defines mandatory pre-work procedures and output formatting that all agents must follow regardless of their specialization.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## CRITICAL: File Writing Rule
|
|
8
|
+
|
|
9
|
+
ALWAYS use `write_file` for creating files and `replace` for modifying files.
|
|
10
|
+
|
|
11
|
+
NEVER use `run_shell_command` to write file content. This includes:
|
|
12
|
+
- `cat`, `cat >>`, `cat << EOF`
|
|
13
|
+
- `echo`, `printf`
|
|
14
|
+
- Heredocs (`<< EOF`, `<< 'EOF'`)
|
|
15
|
+
- Any shell redirection for content (`>`, `>>`)
|
|
16
|
+
|
|
17
|
+
Shell interpretation corrupts YAML frontmatter, Markdown syntax, backticks, brackets, and special characters. This rule has NO exceptions.
|
|
18
|
+
|
|
19
|
+
If `write_file` is not in your authorized tool list, you cannot create files. Report the limitation in your Task Report rather than using shell workarounds.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## CRITICAL: No Interactive Commands
|
|
24
|
+
|
|
25
|
+
You run autonomously without user input. NEVER use commands that require interactive stdin:
|
|
26
|
+
- `npx create-*` (scaffolding wizards)
|
|
27
|
+
- `npm init` (without `-y`)
|
|
28
|
+
- `git rebase -i` (interactive rebase)
|
|
29
|
+
- Any CLI tool that prompts for user choices
|
|
30
|
+
|
|
31
|
+
If a task requires project scaffolding, create the files directly via `write_file` instead of using interactive generators. If you need a `package.json`, write it. If you need a config file, write it. Do not rely on CLI wizards.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Pre-Flight Protocol
|
|
36
|
+
|
|
37
|
+
Execute these three steps in order before beginning any task work. Do not skip steps. Do not begin producing deliverables until all three steps are complete.
|
|
38
|
+
|
|
39
|
+
### Step 1 — Anchor to Project Reality
|
|
40
|
+
|
|
41
|
+
Before producing any output:
|
|
42
|
+
|
|
43
|
+
- Read every file listed in the delegation prompt in full — do not scan or skim
|
|
44
|
+
- Identify the language, framework, and runtime from project configuration files (`package.json`, `go.mod`, `Cargo.toml`, `pyproject.toml`, `pom.xml`, `build.gradle`, `Gemfile`, `*.csproj`)
|
|
45
|
+
- Detect existing patterns in the codebase: naming conventions, directory structure, error handling style, dependency injection approach, test framework and conventions
|
|
46
|
+
- Record these observations as internal working context — every subsequent decision must be consistent with what you found
|
|
47
|
+
|
|
48
|
+
### Step 2 — Scope Verification
|
|
49
|
+
|
|
50
|
+
Before starting work, confirm:
|
|
51
|
+
|
|
52
|
+
- Files listed for modification in the delegation prompt exist
|
|
53
|
+
- Files listed for creation have existing parent directories
|
|
54
|
+
- The task objective is achievable within your tool permissions — if not, report the limitation immediately rather than attempting workarounds
|
|
55
|
+
- The task does not duplicate or conflict with work described as completed in the progress context
|
|
56
|
+
- No files outside the delegation prompt's explicit file list will be touched
|
|
57
|
+
|
|
58
|
+
If any verification fails, report the issue in your Task Report and stop. Do not improvise around scope or permission constraints.
|
|
59
|
+
|
|
60
|
+
### Step 3 — Convention Extraction
|
|
61
|
+
|
|
62
|
+
Identify and match the project's established conventions:
|
|
63
|
+
|
|
64
|
+
- **Naming**: How are files, classes, functions, and variables named? Match exactly. Do not introduce alternative conventions.
|
|
65
|
+
- **Structure**: How is code organized across directories? What types of code go where? Follow the existing grain.
|
|
66
|
+
- **Patterns**: What architectural patterns are already in use (repositories, services, controllers, middleware, etc.)? Extend them — do not introduce competing patterns for the same concern.
|
|
67
|
+
- **Error handling**: How does this project handle errors (custom error classes, result types, try/catch conventions)? Use the same approach.
|
|
68
|
+
- **Testing**: What test framework, naming conventions, and organization patterns are used? Follow them exactly.
|
|
69
|
+
|
|
70
|
+
If any convention is ambiguous or no precedent exists, default to the most common pattern observed across the codebase. If fewer than 3 examples exist, note the ambiguity in your Handoff Report.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Output Handoff Contract
|
|
75
|
+
|
|
76
|
+
Every agent must conclude with a **Handoff Report** containing two parts. This replaces the basic Task Report with a format designed for downstream consumption.
|
|
77
|
+
|
|
78
|
+
### Part 1 — Task Report
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
## Task Report
|
|
82
|
+
- **Status**: success | partial | failure
|
|
83
|
+
- **Objective Achieved**: [One sentence restating the task objective and whether it was fully met]
|
|
84
|
+
- **Files Created**: [Absolute paths with one-line purpose each, or "none"]
|
|
85
|
+
- **Files Modified**: [Absolute paths with one-line summary of what changed and why, or "none"]
|
|
86
|
+
- **Files Deleted**: [Absolute paths with rationale, or "none"]
|
|
87
|
+
- **Decisions Made**: [Choices made that were not explicitly specified in the delegation prompt, with rationale for each, or "none"]
|
|
88
|
+
- **Validation**: pass | fail | skipped
|
|
89
|
+
- **Validation Output**: [Command output or "N/A"]
|
|
90
|
+
- **Errors**: [List with type, description, and resolution status, or "none"]
|
|
91
|
+
- **Scope Deviations**: [Anything asked but not completed, or additional necessary work discovered but not performed, or "none"]
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Part 2 — Downstream Context
|
|
95
|
+
|
|
96
|
+
Populate this section when your output feeds into subsequent phases. Read-only agents populate this with findings structured as actionable items.
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
## Downstream Context
|
|
100
|
+
- **Key Interfaces Introduced**: [Type signatures and file locations, or "none"]
|
|
101
|
+
- **Patterns Established**: [New patterns that downstream agents must follow for consistency, or "none"]
|
|
102
|
+
- **Integration Points**: [Where and how downstream work should connect to this output — specific files, functions, endpoints, or "none"]
|
|
103
|
+
- **Assumptions**: [Anything assumed that downstream agents should verify, or "none"]
|
|
104
|
+
- **Warnings**: [Gotchas, edge cases, or fragile areas downstream agents should be aware of, or "none"]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Rules
|
|
108
|
+
|
|
109
|
+
- Part 2 is mandatory when the phase has downstream dependencies (phases that list this phase in their `blocked_by`)
|
|
110
|
+
- Part 2 may be omitted only when the phase has no downstream dependencies AND is the final phase
|
|
111
|
+
- The orchestrator extracts Downstream Context from completed phases and includes relevant sections in subsequent delegation prompts, creating an information chain
|
|
112
|
+
- Be specific in Downstream Context — reference exact file paths, function names, and type signatures rather than general descriptions
|
|
113
|
+
|
|
114
|
+
### Canonical Shape for `transition_phase`
|
|
115
|
+
|
|
116
|
+
When the orchestrator translates your Markdown Downstream Context into the `downstream_context` argument of `transition_phase`, the server enforces a fixed shape:
|
|
117
|
+
|
|
118
|
+
- The object keys are exactly `key_interfaces_introduced`, `patterns_established`, `integration_points`, `assumptions`, `warnings` (snake_case). Other keys are dropped.
|
|
119
|
+
- Each value is either a string or an array of strings. The server normalizes strings to single-element arrays.
|
|
120
|
+
- The tokens `"none"`, `"n/a"`, `"not applicable"`, and empty strings are treated as absent.
|
|
121
|
+
- A phase that produced files but whose normalized context has no non-empty field is rejected with `HANDOFF_INCOMPLETE` — the orchestrator must re-request a populated handoff.
|
|
122
|
+
|
|
123
|
+
Prefer arrays when you have multiple discrete items so each item is preserved verbatim in session state.
|
|
124
|
+
|
|
125
|
+
### Hook Enforcement
|
|
126
|
+
|
|
127
|
+
The hooks system validates this contract at runtime. After every agent turn, the post-delegation hook checks for both `## Task Report` and `## Downstream Context` headings in the response:
|
|
128
|
+
|
|
129
|
+
- **Missing either heading on first attempt**: The hook blocks the response and returns a retry request specifying which section is absent. The agent must re-produce the complete handoff report.
|
|
130
|
+
- **Missing either heading on retry**: The hook allows the response through to prevent infinite loops, but logs a warning. The orchestrator receives the malformed output and must handle the missing context.
|
|
131
|
+
|
|
132
|
+
Always include both headings, even when Part 2 fields are all "none". Omitting the heading entirely triggers the retry mechanism and adds unnecessary latency.
|
|
133
|
+
|
|
134
|
+
## Blockers
|
|
135
|
+
|
|
136
|
+
If you cannot proceed because a user decision is required, emit a `## Blockers` section in your handoff, placed between `## Task Report` and `## Downstream Context`:
|
|
137
|
+
|
|
138
|
+
## Blockers
|
|
139
|
+
- BLOCKER: [your question]
|
|
140
|
+
Context: [why this arose; what you tried]
|
|
141
|
+
Required to proceed: [the specific answer you need]
|
|
142
|
+
|
|
143
|
+
Do NOT call a user-prompt tool yourself. The orchestrator will collect blockers, ask the user, and re-delegate the phase with the answer supplied in your next delegation Context.
|
|
144
|
+
|
|
145
|
+
A handoff that lists blockers does NOT count as phase completion. Your phase stays `in_progress` until you return again without blockers.
|