@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,81 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
KNOWN_AGENTS,
|
|
5
|
+
normalizeAgentName,
|
|
6
|
+
getAgentCapability,
|
|
7
|
+
canCreateFiles,
|
|
8
|
+
} = require('../../core/agent-registry');
|
|
9
|
+
|
|
10
|
+
const CREATION_SIGNAL_PATTERNS =
|
|
11
|
+
/\b(implement|create|build|scaffold|write|generate|set\s*up|develop)\b/i;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Verify each phase's declared agent is known to the registry.
|
|
15
|
+
*/
|
|
16
|
+
function checkUnknownAgents(phases) {
|
|
17
|
+
const violations = [];
|
|
18
|
+
for (const phase of phases) {
|
|
19
|
+
const normalizedAgent = normalizeAgentName(phase.agent);
|
|
20
|
+
if (normalizedAgent && !KNOWN_AGENTS.includes(normalizedAgent)) {
|
|
21
|
+
violations.push({
|
|
22
|
+
rule: 'unknown_agent',
|
|
23
|
+
detail: `Phase ${phase.id}: unknown agent "${phase.agent}" (normalized: "${normalizedAgent}")`,
|
|
24
|
+
severity: 'error',
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return violations;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Catch mismatches between an agent's write capability and a phase's
|
|
33
|
+
* file-touching workload. Read-only agents assigned to phases that
|
|
34
|
+
* declare `files` (planning-time), `files_created`, or `files_modified`
|
|
35
|
+
* emit an error; read-only agents assigned to phases whose name hints
|
|
36
|
+
* at creation emit a warning.
|
|
37
|
+
*/
|
|
38
|
+
function checkAgentCapabilities(phases) {
|
|
39
|
+
const violations = [];
|
|
40
|
+
for (const phase of phases) {
|
|
41
|
+
const normalizedAgent = normalizeAgentName(phase.agent);
|
|
42
|
+
if (!normalizedAgent) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const touchesFiles =
|
|
47
|
+
(Array.isArray(phase.files) && phase.files.length > 0) ||
|
|
48
|
+
(Array.isArray(phase.files_created) && phase.files_created.length > 0) ||
|
|
49
|
+
(Array.isArray(phase.files_modified) && phase.files_modified.length > 0);
|
|
50
|
+
|
|
51
|
+
if (touchesFiles && !canCreateFiles(normalizedAgent)) {
|
|
52
|
+
violations.push({
|
|
53
|
+
rule: 'agent_capability_mismatch',
|
|
54
|
+
detail: `Phase ${phase.id}: agent '${phase.agent}' (${getAgentCapability(
|
|
55
|
+
normalizedAgent
|
|
56
|
+
)}) cannot deliver file-creating tasks. Use a write-capable agent (coder, data_engineer, etc.) or split into analysis + implementation phases.`,
|
|
57
|
+
severity: 'error',
|
|
58
|
+
});
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (
|
|
63
|
+
!touchesFiles &&
|
|
64
|
+
getAgentCapability(normalizedAgent) === 'read_only' &&
|
|
65
|
+
phase.name &&
|
|
66
|
+
CREATION_SIGNAL_PATTERNS.test(phase.name)
|
|
67
|
+
) {
|
|
68
|
+
violations.push({
|
|
69
|
+
rule: 'agent_capability_mismatch',
|
|
70
|
+
detail: `Phase ${phase.id}: agent '${phase.agent}' (read_only) assigned to phase '${phase.name}' which may require file creation. Verify this agent can deliver the phase's requirements.`,
|
|
71
|
+
severity: 'warning',
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return violations;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
module.exports = {
|
|
79
|
+
checkUnknownAgents,
|
|
80
|
+
checkAgentCapabilities,
|
|
81
|
+
};
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { StateError } = require('../../lib/errors');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Compute the topological depth (longest incoming dependency chain) for
|
|
7
|
+
* each phase. Throws if a cycle is reached — callers should run cycle
|
|
8
|
+
* detection first.
|
|
9
|
+
*
|
|
10
|
+
* @returns {Record<string|number, number>} phase id -> depth (root phases have depth 0)
|
|
11
|
+
*/
|
|
12
|
+
function computeDepths(phases, phaseById) {
|
|
13
|
+
const depthMap = {};
|
|
14
|
+
|
|
15
|
+
function getDepth(id) {
|
|
16
|
+
if (depthMap[id] !== undefined) {
|
|
17
|
+
return depthMap[id];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const phase = phaseById.get(id);
|
|
21
|
+
if (!phase || !phase.blocked_by || phase.blocked_by.length === 0) {
|
|
22
|
+
depthMap[id] = 0;
|
|
23
|
+
return 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
depthMap[id] = -1;
|
|
27
|
+
const maxBlockerDepth = Math.max(
|
|
28
|
+
...phase.blocked_by.map((blockedPhaseId) => {
|
|
29
|
+
const depth = getDepth(blockedPhaseId);
|
|
30
|
+
if (depth === -1) {
|
|
31
|
+
throw new StateError('computeDepths: unexpected cycle detected');
|
|
32
|
+
}
|
|
33
|
+
return depth;
|
|
34
|
+
})
|
|
35
|
+
);
|
|
36
|
+
depthMap[id] = maxBlockerDepth + 1;
|
|
37
|
+
return depthMap[id];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
for (const phase of phases) {
|
|
41
|
+
getDepth(phase.id);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return depthMap;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Compute the transitive closure of phase dependencies (reachable blockers).
|
|
49
|
+
* Memoized via the optional `memo` parameter so repeated callers share state.
|
|
50
|
+
*/
|
|
51
|
+
function getTransitiveDependencies(phaseId, phaseById, memo = {}) {
|
|
52
|
+
if (memo[phaseId]) {
|
|
53
|
+
return memo[phaseId];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const phase = phaseById.get(phaseId);
|
|
57
|
+
if (!phase || !phase.blocked_by || phase.blocked_by.length === 0) {
|
|
58
|
+
memo[phaseId] = new Set();
|
|
59
|
+
return memo[phaseId];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const result = new Set();
|
|
63
|
+
for (const dependencyId of phase.blocked_by) {
|
|
64
|
+
result.add(dependencyId);
|
|
65
|
+
for (const transitiveDependency of getTransitiveDependencies(
|
|
66
|
+
dependencyId,
|
|
67
|
+
phaseById,
|
|
68
|
+
memo
|
|
69
|
+
)) {
|
|
70
|
+
result.add(transitiveDependency);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
memo[phaseId] = result;
|
|
75
|
+
return result;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Depth-first cycle detection. Emits a single `cyclic_dependency`
|
|
80
|
+
* violation identifying the first phase at which a back-edge was found.
|
|
81
|
+
*/
|
|
82
|
+
function checkCycles(phases, phaseById) {
|
|
83
|
+
const violations = [];
|
|
84
|
+
const visited = new Set();
|
|
85
|
+
const inStack = new Set();
|
|
86
|
+
|
|
87
|
+
function hasCycle(id) {
|
|
88
|
+
if (inStack.has(id)) {
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (visited.has(id)) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
visited.add(id);
|
|
97
|
+
inStack.add(id);
|
|
98
|
+
|
|
99
|
+
const phase = phaseById.get(id);
|
|
100
|
+
if (phase) {
|
|
101
|
+
for (const dependencyId of phase.blocked_by || []) {
|
|
102
|
+
if (hasCycle(dependencyId)) {
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
inStack.delete(id);
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
for (const phase of phases) {
|
|
113
|
+
if (hasCycle(phase.id)) {
|
|
114
|
+
violations.push({
|
|
115
|
+
rule: 'cyclic_dependency',
|
|
116
|
+
detail: `Cycle detected involving phase ${phase.id}`,
|
|
117
|
+
severity: 'error',
|
|
118
|
+
});
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return violations;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Flag a blocked_by edge as redundant when the same blocker is already
|
|
128
|
+
* reachable transitively through a sibling dependency.
|
|
129
|
+
*/
|
|
130
|
+
function checkRedundantDependencies(phases, phaseById) {
|
|
131
|
+
const violations = [];
|
|
132
|
+
const memo = {};
|
|
133
|
+
|
|
134
|
+
for (const phase of phases) {
|
|
135
|
+
if (!phase.blocked_by || phase.blocked_by.length < 2) {
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
for (const dependencyId of phase.blocked_by) {
|
|
140
|
+
const otherDependencies = phase.blocked_by.filter(
|
|
141
|
+
(id) => id !== dependencyId
|
|
142
|
+
);
|
|
143
|
+
let redundant = false;
|
|
144
|
+
|
|
145
|
+
for (const otherDependencyId of otherDependencies) {
|
|
146
|
+
const transitiveDependencies = getTransitiveDependencies(
|
|
147
|
+
otherDependencyId,
|
|
148
|
+
phaseById,
|
|
149
|
+
memo
|
|
150
|
+
);
|
|
151
|
+
if (transitiveDependencies.has(dependencyId)) {
|
|
152
|
+
violations.push({
|
|
153
|
+
rule: 'redundant_dependency',
|
|
154
|
+
detail: `Phase ${phase.id}: dependency on phase ${dependencyId} is redundant (already reachable via phase ${otherDependencyId})`,
|
|
155
|
+
severity: 'warning',
|
|
156
|
+
});
|
|
157
|
+
redundant = true;
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (redundant) {
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return violations;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Build the parallelization profile (depth-based batches, eligible count,
|
|
173
|
+
* maximum batch size) for the plan.
|
|
174
|
+
*/
|
|
175
|
+
function buildParallelizationProfile(phases, phaseById) {
|
|
176
|
+
const depths = computeDepths(phases, phaseById);
|
|
177
|
+
const batches = Object.entries(
|
|
178
|
+
phases.reduce((acc, phase) => {
|
|
179
|
+
const depth = depths[phase.id] || 0;
|
|
180
|
+
acc[depth] = acc[depth] || [];
|
|
181
|
+
acc[depth].push(phase.id);
|
|
182
|
+
return acc;
|
|
183
|
+
}, {})
|
|
184
|
+
)
|
|
185
|
+
.sort(([a], [b]) => Number(a) - Number(b))
|
|
186
|
+
.map(([depth, phaseIds]) => ({
|
|
187
|
+
depth: Number(depth),
|
|
188
|
+
phase_ids: phaseIds,
|
|
189
|
+
}));
|
|
190
|
+
|
|
191
|
+
let parallelEligible = 0;
|
|
192
|
+
for (const batch of batches) {
|
|
193
|
+
if (batch.phase_ids.length > 1) {
|
|
194
|
+
parallelEligible += batch.phase_ids.length;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return {
|
|
199
|
+
total_phases: phases.length,
|
|
200
|
+
depth_map: depths,
|
|
201
|
+
batches,
|
|
202
|
+
max_batch_size: Math.max(...batches.map((batch) => batch.phase_ids.length)),
|
|
203
|
+
parallel_eligible: parallelEligible,
|
|
204
|
+
effective_batches: batches.length,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
module.exports = {
|
|
209
|
+
computeDepths,
|
|
210
|
+
getTransitiveDependencies,
|
|
211
|
+
checkCycles,
|
|
212
|
+
checkRedundantDependencies,
|
|
213
|
+
buildParallelizationProfile,
|
|
214
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Emit `file_overlap` violations when two phases marked `parallel` at
|
|
5
|
+
* the same dependency depth both declare ownership of the same file.
|
|
6
|
+
* Phases at different depths can safely touch the same file because
|
|
7
|
+
* they run sequentially.
|
|
8
|
+
*
|
|
9
|
+
* Ownership is the union of:
|
|
10
|
+
* - `files` — the planning-time manifest (canonical plan input)
|
|
11
|
+
* - `files_created` / `files_modified` — runtime-populated manifests
|
|
12
|
+
* from previous executions of the plan (included for plans that
|
|
13
|
+
* were already executed and are being re-validated against updated
|
|
14
|
+
* rules).
|
|
15
|
+
*/
|
|
16
|
+
function checkFileOverlap(phases, depths) {
|
|
17
|
+
const parallelPhases = phases.filter((phase) => phase.parallel);
|
|
18
|
+
if (parallelPhases.length === 0) {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const violations = [];
|
|
23
|
+
const batchesByDepth = {};
|
|
24
|
+
|
|
25
|
+
for (const phase of parallelPhases) {
|
|
26
|
+
const depth = depths[phase.id] || 0;
|
|
27
|
+
batchesByDepth[depth] = batchesByDepth[depth] || [];
|
|
28
|
+
batchesByDepth[depth].push(phase);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
for (const batch of Object.values(batchesByDepth)) {
|
|
32
|
+
if (batch.length < 2) {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const fileOwners = {};
|
|
37
|
+
for (const phase of batch) {
|
|
38
|
+
const files = [
|
|
39
|
+
...(phase.files || []),
|
|
40
|
+
...(phase.files_created || []),
|
|
41
|
+
...(phase.files_modified || []),
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
for (const file of files) {
|
|
45
|
+
if (fileOwners[file]) {
|
|
46
|
+
violations.push({
|
|
47
|
+
rule: 'file_overlap',
|
|
48
|
+
detail: `Parallel phases ${fileOwners[file]} and ${phase.id} both touch "${file}"`,
|
|
49
|
+
severity: 'error',
|
|
50
|
+
});
|
|
51
|
+
} else {
|
|
52
|
+
fileOwners[file] = phase.id;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return violations;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
module.exports = {
|
|
62
|
+
checkFileOverlap,
|
|
63
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { validatePhases } = require('../contracts/plan-schema');
|
|
4
|
+
|
|
5
|
+
const PHASE_LIMITS = {
|
|
6
|
+
simple: 3,
|
|
7
|
+
medium: 5,
|
|
8
|
+
complex: Infinity,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Lightweight shape validation: guard against non-object plans or
|
|
13
|
+
* missing `phases` arrays so downstream checkers can assume a phase list.
|
|
14
|
+
* Returns a single `invalid_plan` violation when the structure is wrong.
|
|
15
|
+
*/
|
|
16
|
+
function checkPlanShape(plan) {
|
|
17
|
+
if (!plan || typeof plan !== 'object' || !Array.isArray(plan.phases)) {
|
|
18
|
+
return [
|
|
19
|
+
{
|
|
20
|
+
rule: 'invalid_plan',
|
|
21
|
+
detail: 'plan must be an object with a phases array',
|
|
22
|
+
severity: 'error',
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Enforce task-complexity phase budgets: simple<=3, medium<=5, complex unlimited.
|
|
31
|
+
*/
|
|
32
|
+
function checkPhaseCount(phases, taskComplexity) {
|
|
33
|
+
const limit = PHASE_LIMITS[taskComplexity] || Infinity;
|
|
34
|
+
if (phases.length > limit) {
|
|
35
|
+
return [
|
|
36
|
+
{
|
|
37
|
+
rule: 'phase_count',
|
|
38
|
+
detail: `${taskComplexity} tasks allow max ${limit} phases, got ${phases.length}`,
|
|
39
|
+
severity: 'error',
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Flag duplicate phase IDs. Emits one violation per duplicate occurrence
|
|
48
|
+
* (matches the original loop behavior).
|
|
49
|
+
*/
|
|
50
|
+
function checkDuplicateIds(phases) {
|
|
51
|
+
const violations = [];
|
|
52
|
+
const seenIds = new Set();
|
|
53
|
+
for (const phase of phases) {
|
|
54
|
+
if (seenIds.has(phase.id)) {
|
|
55
|
+
violations.push({
|
|
56
|
+
rule: 'duplicate_id',
|
|
57
|
+
detail: `Duplicate phase ID: ${phase.id}`,
|
|
58
|
+
severity: 'error',
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
seenIds.add(phase.id);
|
|
62
|
+
}
|
|
63
|
+
return violations;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Flag blocked_by entries that reference non-existent phase IDs.
|
|
68
|
+
*/
|
|
69
|
+
function checkDanglingDependencies(phases) {
|
|
70
|
+
const violations = [];
|
|
71
|
+
const allIds = new Set(phases.map((phase) => phase.id));
|
|
72
|
+
for (const phase of phases) {
|
|
73
|
+
for (const dependencyId of phase.blocked_by || []) {
|
|
74
|
+
if (!allIds.has(dependencyId)) {
|
|
75
|
+
violations.push({
|
|
76
|
+
rule: 'dangling_dependency',
|
|
77
|
+
detail: `Phase ${phase.id} references non-existent dependency: ${dependencyId}`,
|
|
78
|
+
severity: 'error',
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return violations;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Delegate per-phase field validation to the shared `validatePhases` contract.
|
|
88
|
+
* Maps contract violations to the schema-checker violation shape.
|
|
89
|
+
*/
|
|
90
|
+
function checkPhaseFieldSchema(phases) {
|
|
91
|
+
const result = validatePhases(phases);
|
|
92
|
+
if (result.valid) return [];
|
|
93
|
+
return result.violations.map((violation) => ({
|
|
94
|
+
rule: violation.rule,
|
|
95
|
+
detail: `Phase ${violation.phase_id ?? '?'} field "${violation.field}" ${violation.rule.replace('_', ' ')}`,
|
|
96
|
+
severity: 'error',
|
|
97
|
+
phase_id: violation.phase_id,
|
|
98
|
+
field: violation.field,
|
|
99
|
+
}));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
module.exports = {
|
|
103
|
+
checkPlanShape,
|
|
104
|
+
checkPhaseCount,
|
|
105
|
+
checkDuplicateIds,
|
|
106
|
+
checkDanglingDependencies,
|
|
107
|
+
checkPhaseFieldSchema,
|
|
108
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
name: 'claude',
|
|
3
|
+
outputDir: 'claude/',
|
|
4
|
+
|
|
5
|
+
agentNaming: 'kebab-case',
|
|
6
|
+
|
|
7
|
+
env: {
|
|
8
|
+
extensionPath: 'CLAUDE_PLUGIN_ROOT',
|
|
9
|
+
workspacePath: 'CLAUDE_PROJECT_DIR',
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
content: {
|
|
13
|
+
primary: 'filesystem',
|
|
14
|
+
fallback: 'none',
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
tools: {
|
|
18
|
+
read_file: 'Read',
|
|
19
|
+
list_directory: 'Glob',
|
|
20
|
+
glob: 'Glob',
|
|
21
|
+
grep_search: 'Grep',
|
|
22
|
+
google_web_search: 'WebSearch',
|
|
23
|
+
web_fetch: 'WebFetch',
|
|
24
|
+
write_file: 'Write',
|
|
25
|
+
replace: 'Edit',
|
|
26
|
+
run_shell_command: 'Bash',
|
|
27
|
+
ask_user: 'AskUserQuestion',
|
|
28
|
+
read_many_files: 'Read',
|
|
29
|
+
write_todos: ['TaskCreate', 'TaskUpdate', 'TaskList'],
|
|
30
|
+
activate_skill: 'Skill',
|
|
31
|
+
enter_plan_mode: 'EnterPlanMode',
|
|
32
|
+
exit_plan_mode: 'ExitPlanMode',
|
|
33
|
+
codebase_investigator: 'Agent (Explore) / Grep / Glob',
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
agentFrontmatter: {
|
|
37
|
+
model: 'inherit',
|
|
38
|
+
turnsField: 'maxTurns',
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
delegation: {
|
|
42
|
+
pattern: 'Agent(subagent_type: "maestro:{{agent}}", prompt: "...")',
|
|
43
|
+
constraints: {
|
|
44
|
+
result_surface: 'synchronous',
|
|
45
|
+
child_cannot_prompt_user: false,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
features: {
|
|
50
|
+
exampleBlocks: true,
|
|
51
|
+
claudeStateContract: true,
|
|
52
|
+
scriptBasedStateContract: false,
|
|
53
|
+
codexStateContract: false,
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
paths: {
|
|
57
|
+
skills: '${CLAUDE_PLUGIN_ROOT}/skills/',
|
|
58
|
+
hooks: '${CLAUDE_PLUGIN_ROOT}/scripts/',
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { defineAdapter } = require('./factory');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Claude Code hook I/O adapter.
|
|
7
|
+
* Normalizes Claude Code stdin JSON to the internal context contract
|
|
8
|
+
* and formats internal responses for Claude Code stdout.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
function normalizeInput(raw) {
|
|
12
|
+
return {
|
|
13
|
+
sessionId: raw.session_id || '',
|
|
14
|
+
cwd: raw.cwd || '',
|
|
15
|
+
event: raw.hook_event_name || '',
|
|
16
|
+
agentName: raw.tool_input?.subagent_type || null,
|
|
17
|
+
agentInput: raw.tool_input?.prompt || null,
|
|
18
|
+
agentResult: raw.tool_result || null,
|
|
19
|
+
stopHookActive: false,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function formatOutput(result) {
|
|
24
|
+
return {
|
|
25
|
+
continue: result.action !== 'deny',
|
|
26
|
+
systemMessage: result.message || result.reason || undefined,
|
|
27
|
+
decision: result.action === 'deny' ? 'block' : 'approve',
|
|
28
|
+
reason: result.reason || undefined,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function errorFallback() {
|
|
33
|
+
return { continue: false, decision: 'block' };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module.exports = defineAdapter({ normalizeInput, formatOutput, errorFallback });
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/** @type {string} */
|
|
4
|
+
const ADAPTER_SUFFIX = '-adapter.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Determine whether a filename follows the adapter naming convention.
|
|
8
|
+
* Accepts bare filenames only — paths with directory separators return false.
|
|
9
|
+
* @param {string} filename - Base filename (no directory components)
|
|
10
|
+
* @returns {boolean} True when filename matches the {runtime}-adapter.js pattern
|
|
11
|
+
*/
|
|
12
|
+
function isAdapterFile(filename) {
|
|
13
|
+
return filename.endsWith(ADAPTER_SUFFIX) && !filename.includes('/');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Extract the runtime name from an adapter filename.
|
|
18
|
+
* @param {string} filename - Base filename matching the adapter convention
|
|
19
|
+
* @returns {string|null} Runtime name (e.g. 'claude'), or null if filename
|
|
20
|
+
* does not match the adapter convention
|
|
21
|
+
*/
|
|
22
|
+
function extractRuntime(filename) {
|
|
23
|
+
if (!isAdapterFile(filename)) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return filename.slice(0, -ADAPTER_SUFFIX.length);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
module.exports = { ADAPTER_SUFFIX, isAdapterFile, extractRuntime };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { readBoundedJson } = require('../../../core/stdin-reader');
|
|
4
|
+
const { EXIT_SUCCESS } = require('./exit-codes');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Adapter contract expected by `hook-runner.js`:
|
|
8
|
+
* normalizeInput(raw) -> ctx (runtime stdin -> internal context)
|
|
9
|
+
* formatOutput(result) -> object (internal result -> runtime stdout)
|
|
10
|
+
* errorFallback() -> object (emitted on uncaught adapter errors)
|
|
11
|
+
* readBoundedStdin() -> Promise (parse stdin as JSON, bounded size)
|
|
12
|
+
* getExitCode(result) -> number (process exit code; defaults to 0)
|
|
13
|
+
*
|
|
14
|
+
* `defineAdapter` is a spec-assembler: it validates a caller-provided
|
|
15
|
+
* spec and fills in shared defaults (stdin reader, success-exit fallback)
|
|
16
|
+
* so each runtime adapter only declares its protocol-specific
|
|
17
|
+
* normalize/format/fallback/exit logic. Registry dispatch by runtime
|
|
18
|
+
* name is done separately by `hook-runner.js`.
|
|
19
|
+
*/
|
|
20
|
+
function defineAdapter(spec) {
|
|
21
|
+
if (!spec || typeof spec.normalizeInput !== 'function') {
|
|
22
|
+
throw new TypeError('Adapter spec must provide normalizeInput(raw)');
|
|
23
|
+
}
|
|
24
|
+
if (typeof spec.formatOutput !== 'function') {
|
|
25
|
+
throw new TypeError('Adapter spec must provide formatOutput(result)');
|
|
26
|
+
}
|
|
27
|
+
if (typeof spec.errorFallback !== 'function') {
|
|
28
|
+
throw new TypeError('Adapter spec must provide errorFallback()');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
normalizeInput: spec.normalizeInput,
|
|
33
|
+
formatOutput: spec.formatOutput,
|
|
34
|
+
errorFallback: spec.errorFallback,
|
|
35
|
+
readBoundedStdin: spec.readBoundedStdin || readBoundedJson,
|
|
36
|
+
getExitCode: spec.getExitCode || (() => EXIT_SUCCESS),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
module.exports = { defineAdapter };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
agentNames: [
|
|
3
|
+
'accessibility-specialist', 'analytics-engineer', 'api-designer', 'architect',
|
|
4
|
+
'code-reviewer', 'coder', 'compliance-reviewer', 'content-strategist',
|
|
5
|
+
'copywriter', 'data-engineer', 'debugger', 'design-system-engineer',
|
|
6
|
+
'devops-engineer', 'i18n-specialist', 'performance-engineer', 'product-manager',
|
|
7
|
+
'refactor', 'security-engineer', 'seo-specialist', 'technical-writer',
|
|
8
|
+
'tester', 'ux-designer',
|
|
9
|
+
],
|
|
10
|
+
};
|