@josstei/maestro 1.6.4-nightly.20260430

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.
Files changed (655) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/CHANGELOG.md +486 -0
  3. package/EXAMPLES.md +255 -0
  4. package/GEMINI.md +251 -0
  5. package/LICENSE +201 -0
  6. package/QWEN.md +274 -0
  7. package/README.md +220 -0
  8. package/agents/accessibility_specialist.md +20 -0
  9. package/agents/analytics_engineer.md +22 -0
  10. package/agents/api_designer.md +19 -0
  11. package/agents/architect.md +19 -0
  12. package/agents/cloud_architect.md +19 -0
  13. package/agents/cobol_engineer.md +22 -0
  14. package/agents/code_reviewer.md +17 -0
  15. package/agents/coder.md +22 -0
  16. package/agents/compliance_reviewer.md +19 -0
  17. package/agents/content_strategist.md +19 -0
  18. package/agents/copywriter.md +19 -0
  19. package/agents/data_engineer.md +22 -0
  20. package/agents/database_administrator.md +21 -0
  21. package/agents/db2_dba.md +21 -0
  22. package/agents/debugger.md +19 -0
  23. package/agents/design_system_engineer.md +22 -0
  24. package/agents/devops_engineer.md +23 -0
  25. package/agents/hlasm_assembler_specialist.md +22 -0
  26. package/agents/i18n_specialist.md +21 -0
  27. package/agents/ibm_i_specialist.md +22 -0
  28. package/agents/integration_engineer.md +23 -0
  29. package/agents/ml_engineer.md +23 -0
  30. package/agents/mlops_engineer.md +23 -0
  31. package/agents/mobile_engineer.md +23 -0
  32. package/agents/observability_engineer.md +23 -0
  33. package/agents/performance_engineer.md +21 -0
  34. package/agents/platform_engineer.md +24 -0
  35. package/agents/product_manager.md +20 -0
  36. package/agents/prompt_engineer.md +22 -0
  37. package/agents/refactor.md +22 -0
  38. package/agents/release_manager.md +22 -0
  39. package/agents/security_engineer.md +21 -0
  40. package/agents/seo_specialist.md +21 -0
  41. package/agents/site_reliability_engineer.md +21 -0
  42. package/agents/solutions_architect.md +19 -0
  43. package/agents/technical_writer.md +21 -0
  44. package/agents/tester.md +23 -0
  45. package/agents/ux_designer.md +20 -0
  46. package/agents/zos_sysprog.md +21 -0
  47. package/bin/maestro-mcp-server.js +10 -0
  48. package/claude/.claude-plugin/plugin.json +21 -0
  49. package/claude/.mcp.json +11 -0
  50. package/claude/README.md +191 -0
  51. package/claude/agents/accessibility-specialist.md +36 -0
  52. package/claude/agents/analytics-engineer.md +38 -0
  53. package/claude/agents/api-designer.md +33 -0
  54. package/claude/agents/architect.md +33 -0
  55. package/claude/agents/cloud-architect.md +33 -0
  56. package/claude/agents/cobol-engineer.md +38 -0
  57. package/claude/agents/code-reviewer.md +31 -0
  58. package/claude/agents/coder.md +38 -0
  59. package/claude/agents/compliance-reviewer.md +33 -0
  60. package/claude/agents/content-strategist.md +33 -0
  61. package/claude/agents/copywriter.md +33 -0
  62. package/claude/agents/data-engineer.md +37 -0
  63. package/claude/agents/database-administrator.md +37 -0
  64. package/claude/agents/db2-dba.md +37 -0
  65. package/claude/agents/debugger.md +32 -0
  66. package/claude/agents/design-system-engineer.md +38 -0
  67. package/claude/agents/devops-engineer.md +39 -0
  68. package/claude/agents/hlasm-assembler-specialist.md +38 -0
  69. package/claude/agents/i18n-specialist.md +37 -0
  70. package/claude/agents/ibm-i-specialist.md +38 -0
  71. package/claude/agents/integration-engineer.md +39 -0
  72. package/claude/agents/ml-engineer.md +39 -0
  73. package/claude/agents/mlops-engineer.md +39 -0
  74. package/claude/agents/mobile-engineer.md +39 -0
  75. package/claude/agents/observability-engineer.md +39 -0
  76. package/claude/agents/performance-engineer.md +34 -0
  77. package/claude/agents/platform-engineer.md +40 -0
  78. package/claude/agents/product-manager.md +34 -0
  79. package/claude/agents/prompt-engineer.md +38 -0
  80. package/claude/agents/refactor.md +38 -0
  81. package/claude/agents/release-manager.md +38 -0
  82. package/claude/agents/security-engineer.md +37 -0
  83. package/claude/agents/seo-specialist.md +37 -0
  84. package/claude/agents/site-reliability-engineer.md +37 -0
  85. package/claude/agents/solutions-architect.md +33 -0
  86. package/claude/agents/technical-writer.md +37 -0
  87. package/claude/agents/tester.md +39 -0
  88. package/claude/agents/ux-designer.md +34 -0
  89. package/claude/agents/zos-sysprog.md +37 -0
  90. package/claude/hooks/claude-hooks.json +48 -0
  91. package/claude/mcp/maestro-server.js +9 -0
  92. package/claude/mcp-config.example.json +9 -0
  93. package/claude/scripts/adapters/claude-adapter.js +7 -0
  94. package/claude/scripts/hook-runner.js +8 -0
  95. package/claude/scripts/policy-enforcer.js +294 -0
  96. package/claude/skills/a11y-audit/SKILL.md +26 -0
  97. package/claude/skills/archive/SKILL.md +24 -0
  98. package/claude/skills/code-review/SKILL.md +7 -0
  99. package/claude/skills/compliance-check/SKILL.md +26 -0
  100. package/claude/skills/debug-workflow/SKILL.md +27 -0
  101. package/claude/skills/delegation/SKILL.md +7 -0
  102. package/claude/skills/design-dialogue/SKILL.md +7 -0
  103. package/claude/skills/execute/SKILL.md +38 -0
  104. package/claude/skills/execution/SKILL.md +7 -0
  105. package/claude/skills/implementation-planning/SKILL.md +7 -0
  106. package/claude/skills/orchestrate/SKILL.md +38 -0
  107. package/claude/skills/perf-check/SKILL.md +26 -0
  108. package/claude/skills/resume-session/SKILL.md +38 -0
  109. package/claude/skills/review-code/SKILL.md +27 -0
  110. package/claude/skills/security-audit/SKILL.md +28 -0
  111. package/claude/skills/seo-audit/SKILL.md +26 -0
  112. package/claude/skills/session-management/SKILL.md +7 -0
  113. package/claude/skills/status/SKILL.md +22 -0
  114. package/claude/skills/validation/SKILL.md +7 -0
  115. package/claude/src/agents/accessibility-specialist.md +163 -0
  116. package/claude/src/agents/analytics-engineer.md +182 -0
  117. package/claude/src/agents/api-designer.md +124 -0
  118. package/claude/src/agents/architect.md +120 -0
  119. package/claude/src/agents/cloud-architect.md +134 -0
  120. package/claude/src/agents/cobol-engineer.md +127 -0
  121. package/claude/src/agents/code-reviewer.md +123 -0
  122. package/claude/src/agents/coder.md +132 -0
  123. package/claude/src/agents/compliance-reviewer.md +219 -0
  124. package/claude/src/agents/content-strategist.md +111 -0
  125. package/claude/src/agents/copywriter.md +113 -0
  126. package/claude/src/agents/data-engineer.md +130 -0
  127. package/claude/src/agents/database-administrator.md +126 -0
  128. package/claude/src/agents/db2-dba.md +124 -0
  129. package/claude/src/agents/debugger.md +133 -0
  130. package/claude/src/agents/design-system-engineer.md +258 -0
  131. package/claude/src/agents/devops-engineer.md +138 -0
  132. package/claude/src/agents/hlasm-assembler-specialist.md +134 -0
  133. package/claude/src/agents/i18n-specialist.md +241 -0
  134. package/claude/src/agents/ibm-i-specialist.md +132 -0
  135. package/claude/src/agents/integration-engineer.md +133 -0
  136. package/claude/src/agents/ml-engineer.md +115 -0
  137. package/claude/src/agents/mlops-engineer.md +116 -0
  138. package/claude/src/agents/mobile-engineer.md +115 -0
  139. package/claude/src/agents/observability-engineer.md +133 -0
  140. package/claude/src/agents/performance-engineer.md +139 -0
  141. package/claude/src/agents/platform-engineer.md +129 -0
  142. package/claude/src/agents/product-manager.md +170 -0
  143. package/claude/src/agents/prompt-engineer.md +129 -0
  144. package/claude/src/agents/refactor.md +138 -0
  145. package/claude/src/agents/release-manager.md +132 -0
  146. package/claude/src/agents/security-engineer.md +143 -0
  147. package/claude/src/agents/seo-specialist.md +129 -0
  148. package/claude/src/agents/site-reliability-engineer.md +131 -0
  149. package/claude/src/agents/solutions-architect.md +137 -0
  150. package/claude/src/agents/technical-writer.md +129 -0
  151. package/claude/src/agents/tester.md +135 -0
  152. package/claude/src/agents/ux-designer.md +168 -0
  153. package/claude/src/agents/zos-sysprog.md +134 -0
  154. package/claude/src/config/setting-resolver.js +32 -0
  155. package/claude/src/core/agent-registry.js +67 -0
  156. package/claude/src/core/canonical-source.js +39 -0
  157. package/claude/src/core/env-file-parser.js +82 -0
  158. package/claude/src/core/feature-blocks.js +34 -0
  159. package/claude/src/core/logger.js +12 -0
  160. package/claude/src/core/markdown-state.js +36 -0
  161. package/claude/src/core/policy-rules.js +32 -0
  162. package/claude/src/core/project-root-resolver.js +184 -0
  163. package/claude/src/core/stdin-reader.js +77 -0
  164. package/claude/src/core/version.js +50 -0
  165. package/claude/src/entry-points/core-command-registry.js +37 -0
  166. package/claude/src/entry-points/preamble-builders.js +54 -0
  167. package/claude/src/entry-points/registry.js +199 -0
  168. package/claude/src/entry-points/templates/claude-core-command.md.tmpl +38 -0
  169. package/claude/src/entry-points/templates/claude-skill.md.tmpl +18 -0
  170. package/claude/src/entry-points/templates/codex-core-command.md.tmpl +16 -0
  171. package/claude/src/entry-points/templates/codex-skill.md.tmpl +11 -0
  172. package/claude/src/entry-points/templates/gemini-command.toml.tmpl +17 -0
  173. package/claude/src/entry-points/templates/gemini-core-command.toml.tmpl +30 -0
  174. package/claude/src/generated/agent-registry.json +630 -0
  175. package/claude/src/generated/hook-registry.json +18 -0
  176. package/claude/src/generated/resource-registry.json +16 -0
  177. package/claude/src/hooks/logic/after-agent-logic.js +54 -0
  178. package/claude/src/hooks/logic/before-agent-logic.js +57 -0
  179. package/claude/src/hooks/logic/hook-state.js +127 -0
  180. package/claude/src/hooks/logic/session-end-logic.js +17 -0
  181. package/claude/src/hooks/logic/session-start-logic.js +25 -0
  182. package/claude/src/lib/discovery/index.js +172 -0
  183. package/claude/src/lib/errors/index.js +104 -0
  184. package/claude/src/lib/framework-detection.js +50 -0
  185. package/claude/src/lib/frontmatter/index.js +262 -0
  186. package/claude/src/lib/io/index.js +96 -0
  187. package/claude/src/lib/naming/index.js +94 -0
  188. package/claude/src/lib/validation/index.js +124 -0
  189. package/claude/src/lib/yaml-emit.js +38 -0
  190. package/claude/src/mcp/content/provider.js +68 -0
  191. package/claude/src/mcp/content/runtime-content.js +188 -0
  192. package/claude/src/mcp/contracts/cache-path-rejector.js +39 -0
  193. package/claude/src/mcp/contracts/downstream-context.js +106 -0
  194. package/claude/src/mcp/contracts/plan-schema.js +148 -0
  195. package/claude/src/mcp/contracts/workspace-marker.js +61 -0
  196. package/claude/src/mcp/core/create-server.js +76 -0
  197. package/claude/src/mcp/core/line-reader.js +35 -0
  198. package/claude/src/mcp/core/project-root-cache.js +120 -0
  199. package/claude/src/mcp/core/protocol-dispatcher.js +274 -0
  200. package/claude/src/mcp/core/recovery-hints.js +43 -0
  201. package/claude/src/mcp/core/tool-outcome.js +77 -0
  202. package/claude/src/mcp/core/tool-registry.js +82 -0
  203. package/claude/src/mcp/handlers/assess-task-complexity.js +108 -0
  204. package/claude/src/mcp/handlers/blocker-parser.js +34 -0
  205. package/claude/src/mcp/handlers/design-gate.js +393 -0
  206. package/claude/src/mcp/handlers/get-agent.js +54 -0
  207. package/claude/src/mcp/handlers/get-runtime-context.js +49 -0
  208. package/claude/src/mcp/handlers/get-skill-content.js +51 -0
  209. package/claude/src/mcp/handlers/initialize-workspace.js +45 -0
  210. package/claude/src/mcp/handlers/reconciliation.js +224 -0
  211. package/claude/src/mcp/handlers/resolve-settings.js +39 -0
  212. package/claude/src/mcp/handlers/session-state-core.js +108 -0
  213. package/claude/src/mcp/handlers/session-state-tools.js +562 -0
  214. package/claude/src/mcp/handlers/validate-plan.js +76 -0
  215. package/claude/src/mcp/maestro-server.js +122 -0
  216. package/claude/src/mcp/runtime/runtime-config-map.js +70 -0
  217. package/claude/src/mcp/tool-packs/content/index.js +80 -0
  218. package/claude/src/mcp/tool-packs/contracts.js +30 -0
  219. package/claude/src/mcp/tool-packs/index.js +15 -0
  220. package/claude/src/mcp/tool-packs/session/index.js +243 -0
  221. package/claude/src/mcp/tool-packs/workspace/index.js +98 -0
  222. package/claude/src/mcp/utils/extension-root.js +31 -0
  223. package/claude/src/mcp/validation/agent-checker.js +81 -0
  224. package/claude/src/mcp/validation/dag-checker.js +214 -0
  225. package/claude/src/mcp/validation/file-overlap-checker.js +63 -0
  226. package/claude/src/mcp/validation/schema-checker.js +108 -0
  227. package/claude/src/platforms/claude/runtime-config.js +60 -0
  228. package/claude/src/platforms/shared/adapters/claude-adapter.js +36 -0
  229. package/claude/src/platforms/shared/adapters/conventions.js +29 -0
  230. package/claude/src/platforms/shared/adapters/exit-codes.js +6 -0
  231. package/claude/src/platforms/shared/adapters/factory.js +40 -0
  232. package/claude/src/platforms/shared/agent-names.js +15 -0
  233. package/claude/src/platforms/shared/hook-runner.js +52 -0
  234. package/claude/src/references/architecture.md +139 -0
  235. package/claude/src/references/orchestration-steps.md +193 -0
  236. package/claude/src/skills/shared/code-review/SKILL.md +145 -0
  237. package/claude/src/skills/shared/delegation/SKILL.md +387 -0
  238. package/claude/src/skills/shared/delegation/protocols/agent-base-protocol.md +145 -0
  239. package/claude/src/skills/shared/delegation/protocols/filesystem-safety-protocol.md +31 -0
  240. package/claude/src/skills/shared/design-dialogue/SKILL.md +284 -0
  241. package/claude/src/skills/shared/execution/SKILL.md +258 -0
  242. package/claude/src/skills/shared/implementation-planning/SKILL.md +307 -0
  243. package/claude/src/skills/shared/session-management/SKILL.md +314 -0
  244. package/claude/src/skills/shared/validation/SKILL.md +204 -0
  245. package/claude/src/state/session-state.js +113 -0
  246. package/claude/src/templates/design-document.md +95 -0
  247. package/claude/src/templates/implementation-plan.md +86 -0
  248. package/claude/src/templates/session-state.md +68 -0
  249. package/claude/src/version.json +3 -0
  250. package/commands/maestro/a11y-audit.toml +22 -0
  251. package/commands/maestro/archive.toml +23 -0
  252. package/commands/maestro/compliance-check.toml +22 -0
  253. package/commands/maestro/debug.toml +23 -0
  254. package/commands/maestro/execute.toml +30 -0
  255. package/commands/maestro/orchestrate.toml +30 -0
  256. package/commands/maestro/perf-check.toml +22 -0
  257. package/commands/maestro/resume.toml +38 -0
  258. package/commands/maestro/review.toml +23 -0
  259. package/commands/maestro/security-audit.toml +24 -0
  260. package/commands/maestro/seo-audit.toml +22 -0
  261. package/commands/maestro/status.toml +21 -0
  262. package/docs/architecture.md +323 -0
  263. package/docs/cicd.md +658 -0
  264. package/docs/flow.md +266 -0
  265. package/docs/maestro-cheatsheet.md +207 -0
  266. package/docs/overview.md +141 -0
  267. package/docs/runtime-claude.md +190 -0
  268. package/docs/runtime-codex.md +197 -0
  269. package/docs/runtime-gemini.md +173 -0
  270. package/docs/runtime-qwen.md +150 -0
  271. package/docs/usage.md +315 -0
  272. package/gemini-extension.json +56 -0
  273. package/hooks/adapters/gemini-adapter.js +2 -0
  274. package/hooks/adapters/qwen-adapter.js +2 -0
  275. package/hooks/hook-runner.js +3 -0
  276. package/hooks/hooks.json +56 -0
  277. package/mcp/maestro-server.js +4 -0
  278. package/package.json +93 -0
  279. package/plugins/maestro/.app.json +3 -0
  280. package/plugins/maestro/.codex-plugin/plugin.json +41 -0
  281. package/plugins/maestro/.mcp.json +16 -0
  282. package/plugins/maestro/README.md +57 -0
  283. package/plugins/maestro/references/runtime-guide.md +125 -0
  284. package/plugins/maestro/skills/a11y-audit/SKILL.md +16 -0
  285. package/plugins/maestro/skills/archive/SKILL.md +16 -0
  286. package/plugins/maestro/skills/code-review/SKILL.md +6 -0
  287. package/plugins/maestro/skills/compliance-check/SKILL.md +16 -0
  288. package/plugins/maestro/skills/debug-workflow/SKILL.md +16 -0
  289. package/plugins/maestro/skills/delegation/SKILL.md +6 -0
  290. package/plugins/maestro/skills/design-dialogue/SKILL.md +6 -0
  291. package/plugins/maestro/skills/execute/SKILL.md +16 -0
  292. package/plugins/maestro/skills/execution/SKILL.md +6 -0
  293. package/plugins/maestro/skills/implementation-planning/SKILL.md +6 -0
  294. package/plugins/maestro/skills/orchestrate/SKILL.md +16 -0
  295. package/plugins/maestro/skills/perf-check/SKILL.md +16 -0
  296. package/plugins/maestro/skills/resume-session/SKILL.md +16 -0
  297. package/plugins/maestro/skills/review-code/SKILL.md +16 -0
  298. package/plugins/maestro/skills/security-audit/SKILL.md +16 -0
  299. package/plugins/maestro/skills/seo-audit/SKILL.md +16 -0
  300. package/plugins/maestro/skills/session-management/SKILL.md +6 -0
  301. package/plugins/maestro/skills/status/SKILL.md +14 -0
  302. package/plugins/maestro/skills/validation/SKILL.md +6 -0
  303. package/plugins/maestro/src/agents/accessibility-specialist.md +163 -0
  304. package/plugins/maestro/src/agents/analytics-engineer.md +182 -0
  305. package/plugins/maestro/src/agents/api-designer.md +124 -0
  306. package/plugins/maestro/src/agents/architect.md +120 -0
  307. package/plugins/maestro/src/agents/cloud-architect.md +134 -0
  308. package/plugins/maestro/src/agents/cobol-engineer.md +127 -0
  309. package/plugins/maestro/src/agents/code-reviewer.md +123 -0
  310. package/plugins/maestro/src/agents/coder.md +132 -0
  311. package/plugins/maestro/src/agents/compliance-reviewer.md +219 -0
  312. package/plugins/maestro/src/agents/content-strategist.md +111 -0
  313. package/plugins/maestro/src/agents/copywriter.md +113 -0
  314. package/plugins/maestro/src/agents/data-engineer.md +130 -0
  315. package/plugins/maestro/src/agents/database-administrator.md +126 -0
  316. package/plugins/maestro/src/agents/db2-dba.md +124 -0
  317. package/plugins/maestro/src/agents/debugger.md +133 -0
  318. package/plugins/maestro/src/agents/design-system-engineer.md +258 -0
  319. package/plugins/maestro/src/agents/devops-engineer.md +138 -0
  320. package/plugins/maestro/src/agents/hlasm-assembler-specialist.md +134 -0
  321. package/plugins/maestro/src/agents/i18n-specialist.md +241 -0
  322. package/plugins/maestro/src/agents/ibm-i-specialist.md +132 -0
  323. package/plugins/maestro/src/agents/integration-engineer.md +133 -0
  324. package/plugins/maestro/src/agents/ml-engineer.md +115 -0
  325. package/plugins/maestro/src/agents/mlops-engineer.md +116 -0
  326. package/plugins/maestro/src/agents/mobile-engineer.md +115 -0
  327. package/plugins/maestro/src/agents/observability-engineer.md +133 -0
  328. package/plugins/maestro/src/agents/performance-engineer.md +139 -0
  329. package/plugins/maestro/src/agents/platform-engineer.md +129 -0
  330. package/plugins/maestro/src/agents/product-manager.md +170 -0
  331. package/plugins/maestro/src/agents/prompt-engineer.md +129 -0
  332. package/plugins/maestro/src/agents/refactor.md +138 -0
  333. package/plugins/maestro/src/agents/release-manager.md +132 -0
  334. package/plugins/maestro/src/agents/security-engineer.md +143 -0
  335. package/plugins/maestro/src/agents/seo-specialist.md +129 -0
  336. package/plugins/maestro/src/agents/site-reliability-engineer.md +131 -0
  337. package/plugins/maestro/src/agents/solutions-architect.md +137 -0
  338. package/plugins/maestro/src/agents/technical-writer.md +129 -0
  339. package/plugins/maestro/src/agents/tester.md +135 -0
  340. package/plugins/maestro/src/agents/ux-designer.md +168 -0
  341. package/plugins/maestro/src/agents/zos-sysprog.md +134 -0
  342. package/plugins/maestro/src/config/setting-resolver.js +32 -0
  343. package/plugins/maestro/src/core/agent-registry.js +67 -0
  344. package/plugins/maestro/src/core/canonical-source.js +39 -0
  345. package/plugins/maestro/src/core/env-file-parser.js +82 -0
  346. package/plugins/maestro/src/core/feature-blocks.js +34 -0
  347. package/plugins/maestro/src/core/logger.js +12 -0
  348. package/plugins/maestro/src/core/markdown-state.js +36 -0
  349. package/plugins/maestro/src/core/policy-rules.js +32 -0
  350. package/plugins/maestro/src/core/project-root-resolver.js +184 -0
  351. package/plugins/maestro/src/core/stdin-reader.js +77 -0
  352. package/plugins/maestro/src/core/version.js +50 -0
  353. package/plugins/maestro/src/entry-points/core-command-registry.js +37 -0
  354. package/plugins/maestro/src/entry-points/preamble-builders.js +54 -0
  355. package/plugins/maestro/src/entry-points/registry.js +199 -0
  356. package/plugins/maestro/src/entry-points/templates/claude-core-command.md.tmpl +38 -0
  357. package/plugins/maestro/src/entry-points/templates/claude-skill.md.tmpl +18 -0
  358. package/plugins/maestro/src/entry-points/templates/codex-core-command.md.tmpl +16 -0
  359. package/plugins/maestro/src/entry-points/templates/codex-skill.md.tmpl +11 -0
  360. package/plugins/maestro/src/entry-points/templates/gemini-command.toml.tmpl +17 -0
  361. package/plugins/maestro/src/entry-points/templates/gemini-core-command.toml.tmpl +30 -0
  362. package/plugins/maestro/src/generated/agent-registry.json +630 -0
  363. package/plugins/maestro/src/generated/hook-registry.json +18 -0
  364. package/plugins/maestro/src/generated/resource-registry.json +16 -0
  365. package/plugins/maestro/src/hooks/logic/after-agent-logic.js +54 -0
  366. package/plugins/maestro/src/hooks/logic/before-agent-logic.js +57 -0
  367. package/plugins/maestro/src/hooks/logic/hook-state.js +127 -0
  368. package/plugins/maestro/src/hooks/logic/session-end-logic.js +17 -0
  369. package/plugins/maestro/src/hooks/logic/session-start-logic.js +25 -0
  370. package/plugins/maestro/src/lib/discovery/index.js +172 -0
  371. package/plugins/maestro/src/lib/errors/index.js +104 -0
  372. package/plugins/maestro/src/lib/framework-detection.js +50 -0
  373. package/plugins/maestro/src/lib/frontmatter/index.js +262 -0
  374. package/plugins/maestro/src/lib/io/index.js +96 -0
  375. package/plugins/maestro/src/lib/naming/index.js +94 -0
  376. package/plugins/maestro/src/lib/validation/index.js +124 -0
  377. package/plugins/maestro/src/lib/yaml-emit.js +38 -0
  378. package/plugins/maestro/src/mcp/content/provider.js +68 -0
  379. package/plugins/maestro/src/mcp/content/runtime-content.js +188 -0
  380. package/plugins/maestro/src/mcp/contracts/cache-path-rejector.js +39 -0
  381. package/plugins/maestro/src/mcp/contracts/downstream-context.js +106 -0
  382. package/plugins/maestro/src/mcp/contracts/plan-schema.js +148 -0
  383. package/plugins/maestro/src/mcp/contracts/workspace-marker.js +61 -0
  384. package/plugins/maestro/src/mcp/core/create-server.js +76 -0
  385. package/plugins/maestro/src/mcp/core/line-reader.js +35 -0
  386. package/plugins/maestro/src/mcp/core/project-root-cache.js +120 -0
  387. package/plugins/maestro/src/mcp/core/protocol-dispatcher.js +274 -0
  388. package/plugins/maestro/src/mcp/core/recovery-hints.js +43 -0
  389. package/plugins/maestro/src/mcp/core/tool-outcome.js +77 -0
  390. package/plugins/maestro/src/mcp/core/tool-registry.js +82 -0
  391. package/plugins/maestro/src/mcp/handlers/assess-task-complexity.js +108 -0
  392. package/plugins/maestro/src/mcp/handlers/blocker-parser.js +34 -0
  393. package/plugins/maestro/src/mcp/handlers/design-gate.js +393 -0
  394. package/plugins/maestro/src/mcp/handlers/get-agent.js +54 -0
  395. package/plugins/maestro/src/mcp/handlers/get-runtime-context.js +49 -0
  396. package/plugins/maestro/src/mcp/handlers/get-skill-content.js +51 -0
  397. package/plugins/maestro/src/mcp/handlers/initialize-workspace.js +45 -0
  398. package/plugins/maestro/src/mcp/handlers/reconciliation.js +224 -0
  399. package/plugins/maestro/src/mcp/handlers/resolve-settings.js +39 -0
  400. package/plugins/maestro/src/mcp/handlers/session-state-core.js +108 -0
  401. package/plugins/maestro/src/mcp/handlers/session-state-tools.js +562 -0
  402. package/plugins/maestro/src/mcp/handlers/validate-plan.js +76 -0
  403. package/plugins/maestro/src/mcp/maestro-server.js +122 -0
  404. package/plugins/maestro/src/mcp/runtime/runtime-config-map.js +70 -0
  405. package/plugins/maestro/src/mcp/tool-packs/content/index.js +80 -0
  406. package/plugins/maestro/src/mcp/tool-packs/contracts.js +30 -0
  407. package/plugins/maestro/src/mcp/tool-packs/index.js +15 -0
  408. package/plugins/maestro/src/mcp/tool-packs/session/index.js +243 -0
  409. package/plugins/maestro/src/mcp/tool-packs/workspace/index.js +98 -0
  410. package/plugins/maestro/src/mcp/utils/extension-root.js +31 -0
  411. package/plugins/maestro/src/mcp/validation/agent-checker.js +81 -0
  412. package/plugins/maestro/src/mcp/validation/dag-checker.js +214 -0
  413. package/plugins/maestro/src/mcp/validation/file-overlap-checker.js +63 -0
  414. package/plugins/maestro/src/mcp/validation/schema-checker.js +108 -0
  415. package/plugins/maestro/src/platforms/codex/runtime-config.js +58 -0
  416. package/plugins/maestro/src/platforms/shared/adapters/conventions.js +29 -0
  417. package/plugins/maestro/src/platforms/shared/adapters/exit-codes.js +6 -0
  418. package/plugins/maestro/src/platforms/shared/adapters/factory.js +40 -0
  419. package/plugins/maestro/src/platforms/shared/agent-names.js +15 -0
  420. package/plugins/maestro/src/platforms/shared/hook-runner.js +52 -0
  421. package/plugins/maestro/src/references/architecture.md +139 -0
  422. package/plugins/maestro/src/references/orchestration-steps.md +193 -0
  423. package/plugins/maestro/src/skills/shared/code-review/SKILL.md +145 -0
  424. package/plugins/maestro/src/skills/shared/delegation/SKILL.md +387 -0
  425. package/plugins/maestro/src/skills/shared/delegation/protocols/agent-base-protocol.md +145 -0
  426. package/plugins/maestro/src/skills/shared/delegation/protocols/filesystem-safety-protocol.md +31 -0
  427. package/plugins/maestro/src/skills/shared/design-dialogue/SKILL.md +284 -0
  428. package/plugins/maestro/src/skills/shared/execution/SKILL.md +258 -0
  429. package/plugins/maestro/src/skills/shared/implementation-planning/SKILL.md +307 -0
  430. package/plugins/maestro/src/skills/shared/session-management/SKILL.md +314 -0
  431. package/plugins/maestro/src/skills/shared/validation/SKILL.md +204 -0
  432. package/plugins/maestro/src/state/session-state.js +113 -0
  433. package/plugins/maestro/src/templates/design-document.md +95 -0
  434. package/plugins/maestro/src/templates/implementation-plan.md +86 -0
  435. package/plugins/maestro/src/templates/session-state.md +68 -0
  436. package/plugins/maestro/src/version.json +3 -0
  437. package/policies/maestro.toml +44 -0
  438. package/qwen/agents/accessibility_specialist.md +18 -0
  439. package/qwen/agents/analytics_engineer.md +20 -0
  440. package/qwen/agents/api_designer.md +17 -0
  441. package/qwen/agents/architect.md +17 -0
  442. package/qwen/agents/cloud_architect.md +17 -0
  443. package/qwen/agents/cobol_engineer.md +20 -0
  444. package/qwen/agents/code_reviewer.md +15 -0
  445. package/qwen/agents/coder.md +20 -0
  446. package/qwen/agents/compliance_reviewer.md +17 -0
  447. package/qwen/agents/content_strategist.md +17 -0
  448. package/qwen/agents/copywriter.md +17 -0
  449. package/qwen/agents/data_engineer.md +20 -0
  450. package/qwen/agents/database_administrator.md +19 -0
  451. package/qwen/agents/db2_dba.md +19 -0
  452. package/qwen/agents/debugger.md +17 -0
  453. package/qwen/agents/design_system_engineer.md +20 -0
  454. package/qwen/agents/devops_engineer.md +21 -0
  455. package/qwen/agents/hlasm_assembler_specialist.md +20 -0
  456. package/qwen/agents/i18n_specialist.md +19 -0
  457. package/qwen/agents/ibm_i_specialist.md +20 -0
  458. package/qwen/agents/integration_engineer.md +21 -0
  459. package/qwen/agents/ml_engineer.md +21 -0
  460. package/qwen/agents/mlops_engineer.md +21 -0
  461. package/qwen/agents/mobile_engineer.md +21 -0
  462. package/qwen/agents/observability_engineer.md +21 -0
  463. package/qwen/agents/performance_engineer.md +19 -0
  464. package/qwen/agents/platform_engineer.md +22 -0
  465. package/qwen/agents/product_manager.md +18 -0
  466. package/qwen/agents/prompt_engineer.md +20 -0
  467. package/qwen/agents/refactor.md +20 -0
  468. package/qwen/agents/release_manager.md +20 -0
  469. package/qwen/agents/security_engineer.md +19 -0
  470. package/qwen/agents/seo_specialist.md +19 -0
  471. package/qwen/agents/site_reliability_engineer.md +19 -0
  472. package/qwen/agents/solutions_architect.md +17 -0
  473. package/qwen/agents/technical_writer.md +19 -0
  474. package/qwen/agents/tester.md +21 -0
  475. package/qwen/agents/ux_designer.md +18 -0
  476. package/qwen/agents/zos_sysprog.md +19 -0
  477. package/qwen/hooks.json +56 -0
  478. package/qwen-extension.json +56 -0
  479. package/scripts/check-layer-boundaries.js +74 -0
  480. package/scripts/generate.js +155 -0
  481. package/scripts/install-codex-plugin.js +167 -0
  482. package/scripts/install-git-hooks.js +43 -0
  483. package/scripts/npm-publish-idempotent.js +338 -0
  484. package/scripts/package-release-artifacts.js +156 -0
  485. package/scripts/release-artifact-manifest.js +378 -0
  486. package/scripts/release-version-metadata.js +129 -0
  487. package/scripts/update-versions.js +33 -0
  488. package/scripts/verify-npm-pack.js +85 -0
  489. package/scripts/verify-release-artifacts.js +95 -0
  490. package/src/agents/accessibility-specialist.md +163 -0
  491. package/src/agents/analytics-engineer.md +182 -0
  492. package/src/agents/api-designer.md +124 -0
  493. package/src/agents/architect.md +120 -0
  494. package/src/agents/cloud-architect.md +134 -0
  495. package/src/agents/cobol-engineer.md +127 -0
  496. package/src/agents/code-reviewer.md +123 -0
  497. package/src/agents/coder.md +132 -0
  498. package/src/agents/compliance-reviewer.md +219 -0
  499. package/src/agents/content-strategist.md +111 -0
  500. package/src/agents/copywriter.md +113 -0
  501. package/src/agents/data-engineer.md +130 -0
  502. package/src/agents/database-administrator.md +126 -0
  503. package/src/agents/db2-dba.md +124 -0
  504. package/src/agents/debugger.md +133 -0
  505. package/src/agents/design-system-engineer.md +258 -0
  506. package/src/agents/devops-engineer.md +138 -0
  507. package/src/agents/hlasm-assembler-specialist.md +134 -0
  508. package/src/agents/i18n-specialist.md +241 -0
  509. package/src/agents/ibm-i-specialist.md +132 -0
  510. package/src/agents/integration-engineer.md +133 -0
  511. package/src/agents/ml-engineer.md +115 -0
  512. package/src/agents/mlops-engineer.md +116 -0
  513. package/src/agents/mobile-engineer.md +115 -0
  514. package/src/agents/observability-engineer.md +133 -0
  515. package/src/agents/performance-engineer.md +139 -0
  516. package/src/agents/platform-engineer.md +129 -0
  517. package/src/agents/product-manager.md +170 -0
  518. package/src/agents/prompt-engineer.md +129 -0
  519. package/src/agents/refactor.md +138 -0
  520. package/src/agents/release-manager.md +132 -0
  521. package/src/agents/security-engineer.md +143 -0
  522. package/src/agents/seo-specialist.md +129 -0
  523. package/src/agents/site-reliability-engineer.md +131 -0
  524. package/src/agents/solutions-architect.md +137 -0
  525. package/src/agents/technical-writer.md +129 -0
  526. package/src/agents/tester.md +135 -0
  527. package/src/agents/ux-designer.md +168 -0
  528. package/src/agents/zos-sysprog.md +134 -0
  529. package/src/config/setting-resolver.js +32 -0
  530. package/src/core/agent-registry.js +67 -0
  531. package/src/core/canonical-source.js +39 -0
  532. package/src/core/env-file-parser.js +82 -0
  533. package/src/core/feature-blocks.js +34 -0
  534. package/src/core/logger.js +12 -0
  535. package/src/core/markdown-state.js +36 -0
  536. package/src/core/policy-rules.js +32 -0
  537. package/src/core/project-root-resolver.js +184 -0
  538. package/src/core/stdin-reader.js +77 -0
  539. package/src/core/version.js +50 -0
  540. package/src/entry-points/core-command-registry.js +37 -0
  541. package/src/entry-points/preamble-builders.js +54 -0
  542. package/src/entry-points/registry.js +199 -0
  543. package/src/entry-points/templates/claude-core-command.md.tmpl +38 -0
  544. package/src/entry-points/templates/claude-skill.md.tmpl +18 -0
  545. package/src/entry-points/templates/codex-core-command.md.tmpl +16 -0
  546. package/src/entry-points/templates/codex-skill.md.tmpl +11 -0
  547. package/src/entry-points/templates/gemini-command.toml.tmpl +17 -0
  548. package/src/entry-points/templates/gemini-core-command.toml.tmpl +30 -0
  549. package/src/generated/agent-registry.json +630 -0
  550. package/src/generated/hook-registry.json +18 -0
  551. package/src/generated/resource-registry.json +16 -0
  552. package/src/generator/entry-point-expander.js +182 -0
  553. package/src/generator/file-writer.js +167 -0
  554. package/src/generator/generation-session.js +62 -0
  555. package/src/generator/manifest-curator.js +31 -0
  556. package/src/generator/manifest-expander.js +256 -0
  557. package/src/generator/payload-builder.js +217 -0
  558. package/src/generator/registry-scanner.js +130 -0
  559. package/src/generator/stale-pruner.js +101 -0
  560. package/src/hooks/logic/after-agent-logic.js +54 -0
  561. package/src/hooks/logic/before-agent-logic.js +57 -0
  562. package/src/hooks/logic/hook-state.js +127 -0
  563. package/src/hooks/logic/session-end-logic.js +17 -0
  564. package/src/hooks/logic/session-start-logic.js +25 -0
  565. package/src/lib/discovery/index.js +172 -0
  566. package/src/lib/errors/index.js +104 -0
  567. package/src/lib/framework-detection.js +50 -0
  568. package/src/lib/frontmatter/index.js +262 -0
  569. package/src/lib/io/index.js +96 -0
  570. package/src/lib/naming/index.js +94 -0
  571. package/src/lib/validation/index.js +124 -0
  572. package/src/lib/yaml-emit.js +38 -0
  573. package/src/manifest.js +11 -0
  574. package/src/mcp/content/provider.js +68 -0
  575. package/src/mcp/content/runtime-content.js +188 -0
  576. package/src/mcp/contracts/cache-path-rejector.js +39 -0
  577. package/src/mcp/contracts/downstream-context.js +106 -0
  578. package/src/mcp/contracts/plan-schema.js +148 -0
  579. package/src/mcp/contracts/workspace-marker.js +61 -0
  580. package/src/mcp/core/create-server.js +76 -0
  581. package/src/mcp/core/line-reader.js +35 -0
  582. package/src/mcp/core/project-root-cache.js +120 -0
  583. package/src/mcp/core/protocol-dispatcher.js +274 -0
  584. package/src/mcp/core/recovery-hints.js +43 -0
  585. package/src/mcp/core/tool-outcome.js +77 -0
  586. package/src/mcp/core/tool-registry.js +82 -0
  587. package/src/mcp/handlers/assess-task-complexity.js +108 -0
  588. package/src/mcp/handlers/blocker-parser.js +34 -0
  589. package/src/mcp/handlers/design-gate.js +393 -0
  590. package/src/mcp/handlers/get-agent.js +54 -0
  591. package/src/mcp/handlers/get-runtime-context.js +49 -0
  592. package/src/mcp/handlers/get-skill-content.js +51 -0
  593. package/src/mcp/handlers/initialize-workspace.js +45 -0
  594. package/src/mcp/handlers/reconciliation.js +224 -0
  595. package/src/mcp/handlers/resolve-settings.js +39 -0
  596. package/src/mcp/handlers/session-state-core.js +108 -0
  597. package/src/mcp/handlers/session-state-tools.js +562 -0
  598. package/src/mcp/handlers/validate-plan.js +76 -0
  599. package/src/mcp/maestro-server.js +122 -0
  600. package/src/mcp/runtime/runtime-config-map.js +70 -0
  601. package/src/mcp/tool-packs/content/index.js +80 -0
  602. package/src/mcp/tool-packs/contracts.js +30 -0
  603. package/src/mcp/tool-packs/index.js +15 -0
  604. package/src/mcp/tool-packs/session/index.js +243 -0
  605. package/src/mcp/tool-packs/workspace/index.js +98 -0
  606. package/src/mcp/utils/extension-root.js +31 -0
  607. package/src/mcp/validation/agent-checker.js +81 -0
  608. package/src/mcp/validation/dag-checker.js +214 -0
  609. package/src/mcp/validation/file-overlap-checker.js +63 -0
  610. package/src/mcp/validation/schema-checker.js +108 -0
  611. package/src/platforms/claude/metadata.js +96 -0
  612. package/src/platforms/claude/runtime-config.js +60 -0
  613. package/src/platforms/codex/metadata.js +107 -0
  614. package/src/platforms/codex/runtime-config.js +58 -0
  615. package/src/platforms/gemini/metadata.js +27 -0
  616. package/src/platforms/gemini/runtime-config.js +62 -0
  617. package/src/platforms/metadata-shared.js +133 -0
  618. package/src/platforms/metadata.js +29 -0
  619. package/src/platforms/qwen/metadata.js +27 -0
  620. package/src/platforms/qwen/runtime-config.js +62 -0
  621. package/src/platforms/shared/adapters/claude-adapter.js +36 -0
  622. package/src/platforms/shared/adapters/conventions.js +29 -0
  623. package/src/platforms/shared/adapters/exit-codes.js +6 -0
  624. package/src/platforms/shared/adapters/factory.js +40 -0
  625. package/src/platforms/shared/adapters/gemini-adapter.js +34 -0
  626. package/src/platforms/shared/adapters/qwen-adapter.js +93 -0
  627. package/src/platforms/shared/agent-names.js +15 -0
  628. package/src/platforms/shared/hook-runner.js +52 -0
  629. package/src/references/architecture.md +139 -0
  630. package/src/references/orchestration-steps.md +193 -0
  631. package/src/scripts/ensure-workspace.js +14 -0
  632. package/src/scripts/read-active-session.js +26 -0
  633. package/src/scripts/read-setting.js +18 -0
  634. package/src/scripts/read-state.js +17 -0
  635. package/src/scripts/write-state.js +22 -0
  636. package/src/skills/shared/code-review/SKILL.md +145 -0
  637. package/src/skills/shared/delegation/SKILL.md +387 -0
  638. package/src/skills/shared/delegation/protocols/agent-base-protocol.md +145 -0
  639. package/src/skills/shared/delegation/protocols/filesystem-safety-protocol.md +31 -0
  640. package/src/skills/shared/design-dialogue/SKILL.md +284 -0
  641. package/src/skills/shared/execution/SKILL.md +258 -0
  642. package/src/skills/shared/implementation-planning/SKILL.md +307 -0
  643. package/src/skills/shared/session-management/SKILL.md +314 -0
  644. package/src/skills/shared/validation/SKILL.md +204 -0
  645. package/src/state/session-state.js +113 -0
  646. package/src/templates/design-document.md +95 -0
  647. package/src/templates/implementation-plan.md +86 -0
  648. package/src/templates/session-state.md +68 -0
  649. package/src/transforms/agent-stub.js +29 -0
  650. package/src/transforms/extract-examples.js +63 -0
  651. package/src/transforms/index.js +35 -0
  652. package/src/transforms/parse-frontmatter.js +23 -0
  653. package/src/transforms/rebuild-frontmatter.js +147 -0
  654. package/src/transforms/skill-discovery-stub.js +27 -0
  655. package/src/transforms/skill-metadata.js +14 -0
@@ -0,0 +1,258 @@
1
+ ---
2
+ name: execution
3
+ description: Phase execution methodology for orchestration workflows with error handling and completion protocols
4
+ ---
5
+
6
+ # Execution Skill
7
+
8
+ Activate this skill during Phase 3 (Execution) of Maestro orchestration. This skill defines how Maestro executes implementation phases through native subagent delegation.
9
+
10
+ ## Execution Mode Gate
11
+
12
+ ### Step 0 — Express bypass (early return)
13
+
14
+ If `workflow_mode` is `express` in the current session, STOP HERE. Do not proceed
15
+ to the execution mode gate. Do not prompt the user. Do not resolve execution mode.
16
+ Express always dispatches sequentially. Return to the Express Workflow and continue
17
+ from the delegation step.
18
+
19
+ <HARD-GATE>
20
+ This gate MUST resolve before ANY delegation proceeds. Do not skip it. Do not defer it. Do not begin delegating to subagents until execution_mode is recorded in session state. If you reach a delegation step and execution_mode is not set, STOP and return here.
21
+ </HARD-GATE>
22
+
23
+ ### Step 1 — Read the configured mode
24
+
25
+ Read `MAESTRO_EXECUTION_MODE` (default: `ask`).
26
+
27
+ - If `parallel`: call `update_session` with `{ execution_mode: 'parallel', execution_backend: 'native' }` to record in session state. Skip to delegation.
28
+ - If `sequential`: call `update_session` with `{ execution_mode: 'sequential', execution_backend: 'native' }` to record in session state. Skip to delegation.
29
+ - If `ask`: proceed to Step 2.
30
+
31
+ ### Step 2 — Analyze the implementation plan
32
+
33
+ Before prompting the user, analyze the approved plan to generate a recommendation:
34
+
35
+ 1. Count total phases in the plan
36
+ 2. Count phases marked `parallel: true` (parallelizable phases)
37
+ 3. Count distinct parallel batches (groups of parallelizable phases at the same dependency depth)
38
+ 4. Count sequential-only phases (phases with `blocked_by` dependencies that prevent parallelization)
39
+ 5. Cross-check file ownership across all phases. If any two phases share a file in their `files` arrays, those phases CANNOT be parallel-eligible — subtract them from the parallelizable count. Report each overlap as an Overlapping-file Warning in the prompt.
40
+
41
+ 6. If `validate_plan` was called during planning and returned a `parallelization_profile`, use its `parallel_eligible` and `effective_batches` counts as the authoritative source for items 1-5 above. These are computed from actual dependency depths and override any manual flag-based counts. If `parallelization_profile` is not available, use the counts from items 1-5 as-is.
42
+
43
+ Record these counts — they feed into the prompt.
44
+
45
+ ### Step 3 — Determine the recommendation
46
+
47
+ - If parallelizable phases ≤ 1 → auto-select **sequential**. Call `update_session` with `{ execution_mode: 'sequential', execution_backend: 'native' }`. Inform the user: "All phases are sequential — no parallel batches available." Skip to delegation. Do NOT prompt with a choice. Do NOT call `ask_user`. Do NOT present options. (Parallelism requires at least 2 phases at the same dependency depth; a single parallel-eligible phase has nothing to batch with.)
48
+
49
+ <ANTI-PATTERN>
50
+ WRONG — 1 parallel-eligible phase but user still prompted:
51
+ Parallel-eligible Phases: 1
52
+ → Presented choice: "Sequential (Recommended)" / "Parallel"
53
+
54
+ When parallelizable phases ≤ 1, there is NO choice to make. Auto-select sequential
55
+ and skip directly to delegation. Do not show a picker.
56
+ </ANTI-PATTERN>
57
+
58
+ - If parallelizable phases > 50% of total phases → recommend **parallel**
59
+ - If parallelizable phases ≤ 50% but > 1 → recommend **sequential** (limited benefit)
60
+ - The recommended option appears first in the `ask_user` options list with "(Recommended)" appended to its label. The non-recommended option MUST NOT include "(Recommended)" in its label.
61
+
62
+ ### Step 4 — Prompt the user
63
+
64
+ Call `ask_user` with `type: 'choice'` using exactly one of these option sets:
65
+
66
+ **When recommending parallel:**
67
+ options:
68
+ - label: "Parallel (Recommended)"
69
+ description: "Spawn child agents for each ready batch where file ownership does not overlap."
70
+ - label: "Sequential (High Precision)"
71
+ description: "Spawn one child agent at a time in dependency order."
72
+
73
+ **When recommending sequential:**
74
+ options:
75
+ - label: "Sequential (Recommended)"
76
+ description: "Spawn one child agent at a time in dependency order."
77
+ - label: "Parallel"
78
+ description: "Spawn child agents for each ready batch where file ownership does not overlap."
79
+
80
+ <ANTI-PATTERN>
81
+ WRONG — Both options labeled "(Recommended)":
82
+ options:
83
+ - label: "Parallel (Recommended)"
84
+ - label: "Sequential (High Precision) (Recommended)"
85
+
86
+ Only ONE option receives the "(Recommended)" suffix. Never both.
87
+ </ANTI-PATTERN>
88
+
89
+ Prompt the user for a choice using the user-prompt tool from runtime context. Replace `[N]`, `[M]`, and `[B]` with actual counts from Step 2. The prompt should convey the execution mode analysis and offer two options as described above.
90
+ ### Step 5 — Record and proceed
91
+
92
+ 1. Call `update_session` with the selected `execution_mode` and `execution_backend: native`
93
+ 2. The tool atomically persists both fields
94
+ 3. Use the selected mode for the remainder of the session unless the user changes it
95
+
96
+ ### Mode-specific behavior
97
+
98
+ - If `parallel` is selected and a ready batch has only one phase, execute it sequentially
99
+ - If `sequential` is selected, preserve plan order even when phases are parallel-safe
100
+
101
+ ### Safety fallback
102
+
103
+ If `execution_mode` is not present in session state at the point where delegation is about to begin, STOP. Do not default to sequential. Return to this gate and resolve it. This catches any edge case where the gate was skipped.
104
+
105
+ ## State File Access
106
+
107
+ When MCP state tools (`get_session_status`, `update_session`, `transition_phase`) are available, prefer them for state operations. They provide structured I/O and atomic transitions.
108
+
109
+ When MCP tools are not available, state lives inside `<MAESTRO_STATE_DIR>` and is accessible through `read_file` and `write_file`.
110
+
111
+ Helper scripts remain available for shell-injected command prompts:
112
+
113
+ ```bash
114
+ node <runtime-script-root>/read-state.js <relative-path>
115
+ node <runtime-script-root>/read-active-session.js
116
+ ```
117
+
118
+ ## Hook Lifecycle During Execution
119
+
120
+ Hooks fire automatically at agent boundaries. The orchestrator does not invoke them directly.
121
+
122
+ The hooks system tracks which agent is currently executing. Before each agent dispatch, a hook resolves the active agent identity from the required `Agent:` header first, then falls back to legacy env/regex detection, and injects compact session context. After completion, a hook validates that the response contains both `Task Report` and `Downstream Context`; it requests one retry on the first malformed response.
123
+
124
+ The hook state directory under `${MAESTRO_HOOKS_DIR:-<os.tmpdir()>/maestro-hooks-<uid>}/<session-id>/` is transient and separate from orchestration state.
125
+
126
+ ## Sequential Execution Protocol
127
+
128
+ For a sequential phase:
129
+
130
+ 1. Verify all `blocked_by` dependencies are completed
131
+ 2. Mark the phase `in_progress`
132
+ 3. Update `current_phase`
133
+ 4. Set `current_batch: null`
134
+ 5. Update the progress-tracking tool (use the tool names from `get_runtime_context`) before delegation
135
+ 6. Delegate to the assigned agent with the required header and full context
136
+ 7. Parse the returned handoff
137
+ 8. Update session state
138
+ 9. Mark the phase `completed` or `failed`
139
+ 10. Update the progress-tracking tool after the state update
140
+
141
+ ## Native Parallel Execution Protocol
142
+
143
+ Use native parallel execution only for sibling phases at the same dependency depth with non-overlapping file ownership.
144
+
145
+ ### Batch Rules
146
+
147
+ 1. Verify all blocking phases for every phase in the batch are completed
148
+ 2. Slice the ready batch into the current dispatch chunk using `MAESTRO_MAX_CONCURRENT`
149
+ 3. Mark only the current chunk phases `in_progress`
150
+ 4. Set `current_batch` in session state for that chunk
151
+ 5. Write one in-progress todo item for the chunk
152
+ 6. In the next turn, emit only agent tool calls for that chunk
153
+ 7. Do not mix shell commands, validation commands, file writes, or narration between those agent calls
154
+ 8. `MAESTRO_MAX_CONCURRENT=0` means emit the entire ready batch in one turn
155
+
156
+ ### Native Constraints
157
+
158
+ - The runtime only parallelizes contiguous agent calls in one turn
159
+ - Native subagents currently run without user approval gates
160
+ - `ask_user` remains available; a batch may pause while waiting for user input
161
+ - If execution is interrupted, restart unfinished `in_progress` phases on resume instead of attempting to restore in-flight subagent interactions
162
+
163
+ ## Progress Context
164
+
165
+ Include the following in every delegation query body:
166
+
167
+ ```text
168
+ Progress: Phase [N] of [M]: [Phase Name]
169
+ Session: [session_id]
170
+ ```
171
+
172
+ For native parallel batches, also include the batch identifier in the required header:
173
+
174
+ ```text
175
+ Agent: <agent_name>
176
+ Phase: <id>/<total>
177
+ Batch: <batch_id>
178
+ Session: <session_id>
179
+ ```
180
+
181
+ ## Error Handling Protocol
182
+
183
+ Record all errors in session state with:
184
+
185
+ - `agent`
186
+ - `timestamp`
187
+ - `type`
188
+ - `message`
189
+ - `resolution`
190
+
191
+ ### Retry Logic
192
+
193
+ - Maximum retries per phase: `MAESTRO_MAX_RETRIES` (default `2`)
194
+ - First failure: analyze, adjust context/scope, retry automatically
195
+ - Subsequent failures up to the limit: continue retrying with clearer constraints
196
+ - Limit exceeded: mark the phase `failed` and escalate to the user
197
+
198
+ Increment `retry_count` on each retry.
199
+
200
+ ### Recovery Protocol
201
+
202
+ When a subagent terminates early, times out, returns malformed output, or when `delegation.constraints.result_surface` is `deferred` and the agent's text cannot be retrieved:
203
+
204
+ 1. **Poll**: For deferred-result runtimes (Codex), call the runtime's wait tool (`wait_agent` equivalent) with a bounded timeout. For synchronous runtimes, the initial dispatch return IS the result.
205
+ 2. **Detect drift**: Call `scan_phase_changes(session_id, phase_id)`. If the returned `candidates.created` or `candidates.modified` arrays are non-empty, the agent produced filesystem output without a handoff.
206
+ 3. **Ask the user to confirm**: Using the runtime's user-prompt tool, present the scan candidates and ask the user to confirm which files belong to this phase. For a parallel batch, include the `planned_files` from each phase's session state to assist attribution. If the scan surfaces files beyond any phase's `planned_files`, raise a blocker and surface the ambiguity to the user rather than silently attributing.
207
+ 4. **Reconcile**: Call `reconcile_phase(session_id, phase_id, files_created, files_modified, files_deleted, downstream_context, reason)` with the user-confirmed manifest. This clears `requires_reconciliation`.
208
+ 5. **Retry or advance**: If the user chose to retry the agent, re-delegate with the original scope plus the scan results as context. If the user accepted the work as delivered, advance to the next phase.
209
+
210
+ Record all recovery events in session state with `{agent, timestamp, type: 'recovery', resolution: 'retry'|'reconciled'|'aborted'}`.
211
+
212
+ ### File Conflict Handling
213
+
214
+ When a subagent reports a file conflict:
215
+
216
+ 1. Stop execution immediately
217
+ 2. Record the conflicting files and phases
218
+ 3. Do not attempt automatic merge resolution
219
+ 4. Ask the user how to proceed
220
+
221
+ ## Subagent Output Processing
222
+
223
+ Native subagent results are wrapped. Do not assume the handoff begins at byte 0.
224
+
225
+ ### Parsing Rules
226
+
227
+ 1. Locate `## Task Report` (or `# Task Report`) inside the returned text
228
+ 2. Locate `## Downstream Context` (or `# Downstream Context`) inside the returned text
229
+ 3. Parse:
230
+ - status
231
+ - files created / modified / deleted
232
+ - downstream context fields
233
+ - validation result
234
+ - reported errors
235
+ 4. Persist the full raw output plus the parsed fields into session state
236
+
237
+ ### State Update Sequence
238
+
239
+ After processing each handoff:
240
+
241
+ 1. Update the phase file manifests
242
+ 2. Update `downstream_context`
243
+ 3. Append any errors
244
+ 4. Aggregate token usage
245
+ 5. If validation passed, mark the phase `completed`
246
+ 6. If validation failed, trigger retry logic
247
+ 7. Update `updated`
248
+ 8. Advance or clear `current_batch` as each chunk finishes
249
+
250
+ ## Completion Protocol
251
+
252
+ When all phases are completed:
253
+
254
+ 1. Verify there are no `failed` or `pending` phases
255
+ 2. Confirm plan deliverables are accounted for
256
+ 3. Run the final code-review gate for non-documentation changes
257
+ 4. Archive the session through `session-management`
258
+ 5. Present a final summary with deliverables, files changed, token usage, deviations, and review status
@@ -0,0 +1,307 @@
1
+ ---
2
+ name: implementation-planning
3
+ description: Generates detailed implementation plans from finalized designs
4
+ ---
5
+
6
+ # Implementation Planning Skill
7
+
8
+ **Standard workflow only.** If `task_complexity` is `simple` and workflow mode is Express, do not activate this skill. Simple tasks use the Express workflow, which does not activate implementation-planning. Return to the Express Workflow section.
9
+
10
+ Activate this skill during Phase 2 of Maestro orchestration, after the design document has been approved. This skill provides the methodology for generating detailed, actionable implementation plans that map directly to subagent assignments.
11
+
12
+ ## Codebase Grounding
13
+
14
+ Do not generate an implementation plan from guesses about the repository.
15
+
16
+ Use the built-in `codebase_investigator` before phase decomposition when:
17
+ - The task modifies an existing codebase
18
+ - File ownership, integration points, or validation commands are still unclear after reading the approved design
19
+ - Parallelization decisions depend on understanding current module boundaries or likely file overlap
20
+
21
+ Ask the investigator for:
22
+ - The modules and files most likely to change
23
+ - Existing architectural boundaries and conventions the plan must preserve
24
+ - Integration seams, dependencies, and shared ownership hotspots
25
+ - Validation commands and test entry points already used by the project
26
+ - Parallelization or conflict risks that should prevent batching
27
+
28
+ Skip the investigator only for greenfield tasks, documentation-only work, or plans where the current turn already established the relevant repo structure from direct reads.
29
+
30
+ Reuse investigator findings directly in the implementation plan:
31
+ - File inventories should reflect real candidate paths, not placeholders
32
+ - Validation criteria should prefer repo-native commands the investigator surfaced
33
+ - Parallel batches should account for actual ownership overlap and conflict risk
34
+
35
+ ## Plan Generation Methodology
36
+
37
+ ### Input Analysis
38
+ Before generating the plan, thoroughly analyze the approved design document for:
39
+ - Read `task_complexity` from the approved design document's frontmatter. Apply phase count guidance and domain analysis scaling accordingly. Record `task_complexity` in implementation plan frontmatter.
40
+ - Components and their responsibilities
41
+ - Interfaces and contracts between components
42
+ - Data models and their relationships
43
+ - External dependencies and integrations
44
+ - Technology stack decisions
45
+ - Quality requirements that influence implementation order
46
+
47
+ ### Phase Decomposition
48
+
49
+ Break the implementation into phases following these principles:
50
+
51
+ 1. **Foundation First**: Infrastructure, configuration, and shared types/interfaces come first
52
+ 2. **Dependencies Flow Downward**: A phase can only depend on phases with lower IDs
53
+ 3. **Single Responsibility**: Each phase delivers a cohesive unit of functionality
54
+ 4. **Agent Alignment**: Each phase maps to one or two agent specializations
55
+ 5. **Agent Capability Match**: Verify the assigned agent's tool tier supports the phase deliverables (see compatibility check below)
56
+ 6. **Testability**: Each phase should be independently validatable
57
+
58
+ ### Phase Ordering Strategy
59
+
60
+ ```
61
+ Layer 1: Foundation (types, interfaces, configuration)
62
+ |
63
+ Layer 2: Core Domain (business logic, data models)
64
+ |
65
+ Layer 3: Infrastructure (database, external services, API layer)
66
+ |
67
+ Layer 4: Integration (connecting components, middleware)
68
+ |
69
+ Layer 5: Quality (testing, security review, performance)
70
+ |
71
+ Layer 6: Documentation & Polish
72
+ ```
73
+
74
+ ### Agent-Deliverable Compatibility Check
75
+
76
+ Before finalizing agent assignments, verify each phase's agent can deliver its requirements:
77
+
78
+ | Phase Deliverable | Required Tier | Compatible Agents |
79
+ |-------------------|--------------|-------------------|
80
+ | Creates/modifies files | Full Access or Read+Write | analytics-engineer, cobol-engineer, coder, copywriter, data-engineer, design-system-engineer, devops-engineer, hlasm-assembler-specialist, i18n-specialist, ibm-i-specialist, integration-engineer, ml-engineer, mlops-engineer, mobile-engineer, observability-engineer, platform-engineer, product-manager, prompt-engineer, refactor, release-manager, technical-writer, tester, ux-designer |
81
+ | Runs shell commands | Full Access or Read+Shell | accessibility-specialist, analytics-engineer, cobol-engineer, coder, data-engineer, database-administrator, db2-dba, debugger, design-system-engineer, devops-engineer, hlasm-assembler-specialist, i18n-specialist, ibm-i-specialist, integration-engineer, ml-engineer, mlops-engineer, mobile-engineer, observability-engineer, performance-engineer, platform-engineer, refactor, security-engineer, seo-specialist, site-reliability-engineer, tester, zos-sysprog |
82
+ | Analysis/review only | Any tier | All agents |
83
+
84
+ <HARD-GATE>
85
+ Read-Only agents (architect, api-designer, cloud-architect, code-reviewer, compliance-reviewer, content-strategist, solutions-architect)
86
+ CANNOT be assigned to phases that create or modify files. If a phase requires file creation
87
+ and domain expertise from a Read-Only agent, split it: the Read-Only agent produces a spec
88
+ or analysis, then a write-capable agent (typically coder) implements the files based on that output.
89
+ </HARD-GATE>
90
+
91
+ ### Phase Count Guidance
92
+
93
+ Scale decomposition granularity to `task_complexity` (read from design document frontmatter):
94
+ - **simple**: 1-3 phases. Prefer single-phase execution when feasible. Combine foundation + implementation. Skip separate documentation/polish phases.
95
+ - **medium**: 3-5 phases. Use the layer model but combine Quality and Documentation into the final implementation phase where practical.
96
+ - **complex**: No phase count cap. Full layer decomposition strategy applies.
97
+
98
+ ### Parallelization Identification
99
+
100
+ Phases can run in parallel when:
101
+ - They have no shared file dependencies (no overlapping files_created or files_modified)
102
+ - They are at the same dependency depth (same layer)
103
+ - They do not share data model ownership
104
+ - Their validation can run independently
105
+
106
+ Mark parallel-eligible phases with `parallel: true` and group them into execution batches.
107
+
108
+ ## Implementation Detail Requirements
109
+
110
+ ### Per-Phase Specification
111
+
112
+ Each phase in the plan must include:
113
+
114
+ #### Objective
115
+ A clear, measurable statement of what this phase delivers.
116
+
117
+ #### Agent Assignment
118
+ Which agent(s) execute this phase, with rationale for selection.
119
+
120
+ #### Files to Create
121
+ For each new file:
122
+ - Full relative path from project root
123
+ - Purpose and responsibility
124
+ - Key interfaces, classes, or functions to define
125
+ - Complete type signatures for public APIs
126
+
127
+ #### Files to Modify
128
+ For each existing file:
129
+ - Full relative path from project root
130
+ - Specific changes required and why
131
+ - Expected before/after for critical sections
132
+
133
+ #### Implementation Details
134
+
135
+ Provide sufficient detail for the assigned agent to execute without ambiguity:
136
+ - Interface definitions with complete type signatures
137
+ - Base class contracts with abstract method signatures
138
+ - Dependency injection patterns and registration points
139
+ - Error handling strategy (error types, propagation, recovery)
140
+ - Configuration requirements (environment variables, config files)
141
+
142
+ #### Validation Criteria
143
+ Specific commands to run and expected outcomes:
144
+ - Build/compile commands
145
+ - Lint/format checks
146
+ - Unit test commands
147
+ - Integration test commands (if applicable)
148
+ - Manual verification steps (if applicable)
149
+
150
+ #### Dependencies
151
+ - `blocked_by`: Phase IDs that must complete before this phase starts
152
+ - `blocks`: Phase IDs that cannot start until this phase completes
153
+
154
+ ### Dependency Minimization
155
+
156
+ List only **direct** blockers in `blocked_by`. Do not include transitive dependencies — they inflate dependency depth and prevent parallelism.
157
+
158
+ Anti-pattern (over-specified):
159
+ - Phase 2: blocked_by: [1]
160
+ - Phase 3: blocked_by: [1, 2] — Phase 1 is redundant, already reachable via Phase 2
161
+ - Phase 4: blocked_by: [1, 2, 3] — Phases 1, 2 are redundant
162
+
163
+ Result: depths 0, 1, 2, 3 — zero parallel phases.
164
+
165
+ Correct (minimized):
166
+ - Phase 2: blocked_by: [1]
167
+ - Phase 3: blocked_by: [1] — Only needs Phase 1 output, not Phase 2
168
+ - Phase 4: blocked_by: [2, 3] — Needs both done
169
+
170
+ Result: depths 0, 1, 2 — Phases 2 and 3 run in parallel at depth 1.
171
+
172
+ Ask for each dependency: "Does this phase truly need the output of that specific phase, or is it transitively covered?"
173
+
174
+ If `validate_plan` is available, review its `parallelization_profile` and `redundant_dependency` warnings before presenting the plan. Revise `blocked_by` to eliminate redundancies when possible.
175
+
176
+ ## Agent Assignment Criteria
177
+
178
+ ### Matching Tasks to Agents
179
+
180
+ | Task Domain | Primary Agent | Secondary Agent | Rationale |
181
+ |-------------|--------------|-----------------|-----------|
182
+ | System design, architecture | `architect` | - | Read-only analysis, design expertise |
183
+ | Cloud architecture, multi-region topology | `cloud-architect` | `devops-engineer` | Architecture first, implementation second |
184
+ | Enterprise integration architecture | `solutions-architect` | `integration-engineer` | Cross-team design before implementation |
185
+ | API contracts, endpoints | `api-designer` | `coder` | Design then implement |
186
+ | Feature implementation | `coder` | - | Full implementation access |
187
+ | Code quality review | `code-reviewer` | - | Read-only verification |
188
+ | Database schema, queries | `data-engineer` | - | Schema + implementation |
189
+ | RDBMS tuning, indexes, migration safety | `database-administrator` | `data-engineer` | DBA analysis before schema/code changes |
190
+ | DB2 administration | `db2-dba` | `data-engineer` | DB2-specific operations and design |
191
+ | Bug investigation | `debugger` | - | Read + shell for investigation |
192
+ | CI/CD, infrastructure | `devops-engineer` | - | Full DevOps access |
193
+ | Internal platforms, paved paths | `platform-engineer` | `devops-engineer` | Platform conventions and implementation |
194
+ | B2B integrations, ETL, message brokers | `integration-engineer` | - | Full integration implementation |
195
+ | SLOs, runbooks, reliability | `site-reliability-engineer` | `observability-engineer` | Reliability assessment plus telemetry implementation |
196
+ | Observability, metrics, traces | `observability-engineer` | - | Full telemetry implementation |
197
+ | Performance analysis | `performance-engineer` | - | Read + shell for profiling |
198
+ | Code restructuring | `refactor` | - | Write + shell access (for validation) |
199
+ | Security assessment | `security-engineer` | - | Read + shell for scanning |
200
+ | Test creation | `tester` | - | Full test implementation |
201
+ | Documentation | `technical-writer` | - | Write access for docs |
202
+ | Release notes, changelogs, rollout | `release-manager` | - | Write access for release artifacts |
203
+ | Technical SEO audit | `seo-specialist` | - | Read + shell + web search |
204
+ | Marketing copy, content | `copywriter` | - | Read/write |
205
+ | Content planning | `content-strategist` | - | Read + web search/fetch |
206
+ | UX design, user flows | `ux-designer` | - | Read/write + web search |
207
+ | WCAG compliance audit | `accessibility-specialist` | - | Read + shell + web search |
208
+ | Requirements, product | `product-manager` | - | Read/write + web search |
209
+ | Tracking, analytics | `analytics-engineer` | `coder` | Implement then instrument |
210
+ | Internationalization | `i18n-specialist` | `coder` | Implement then localize |
211
+ | Design tokens, theming | `design-system-engineer` | `coder` | Tokens then consume |
212
+ | Legal, regulatory | `compliance-reviewer` | - | Read + web search/fetch |
213
+ | Mobile platform work | `mobile-engineer` | `tester` | Mobile implementation plus validation |
214
+ | Model training, inference integration | `ml-engineer` | `tester` | ML implementation plus evaluation |
215
+ | Model registry, drift, model CI/CD | `mlops-engineer` | `devops-engineer` | Model operations and deployment |
216
+ | Prompt design, few-shot, RAG tuning | `prompt-engineer` | `coder` | Prompt spec before integration |
217
+ | Mainframe COBOL, JCL, CICS/IMS | `cobol-engineer` | `tester` | Mainframe implementation and validation |
218
+ | IBM HLASM for z/OS | `hlasm-assembler-specialist` | - | Assembly implementation |
219
+ | IBM i RPG/CL, DB2 for i | `ibm-i-specialist` | - | IBM i implementation |
220
+ | z/OS systems programming, JCL, RACF | `zos-sysprog` | `security-engineer` | System-level analysis and controls |
221
+
222
+ ### Assignment Rules
223
+ 1. Match the primary task domain to the agent specialization
224
+ 2. Consider tool requirements — does the task need shell access? Write access?
225
+ 3. For parallel phases, assign non-overlapping file ownership to each agent
226
+ 4. Prefer single-agent phases for clarity; use multi-agent only when distinct specializations are needed
227
+ 5. Never assign more files to an agent than it can handle within its `max_turns` limit
228
+
229
+ ### Token Budget Estimation
230
+ Estimate token consumption per phase based on:
231
+ - Number of files to read (input tokens)
232
+ - Complexity of output expected (output tokens)
233
+ - Agent's max_turns limit as upper bound
234
+ - Historical averages: ~500 input tokens per file read, ~200 output tokens per file written
235
+
236
+ ### Resource Estimation
237
+
238
+ Do not invent provider pricing or model tiers. Agent model selection is runtime-owned through agent frontmatter and runtime configuration. Estimate execution size in stable, codebase-derived terms instead:
239
+
240
+ - **Input complexity**: number of files likely to be read, average file size, and prior-phase context
241
+ - **Output complexity**: number of files created or modified, validation output volume, and expected handoff detail
242
+ - **Retry budget**: note phases likely to need retries because of broad file ownership, external dependencies, or uncertain validation
243
+
244
+ Include a lightweight plan-level resource summary when useful:
245
+
246
+ | Phase | Agent | Est. Files Read | Est. Files Written | Retry Risk | Notes |
247
+ |-------|-------|-----------------|--------------------|------------|-------|
248
+ | 1 | [agent] | [N] | [N] | LOW/MEDIUM/HIGH | [why] |
249
+
250
+ ## Plan Document Generation
251
+
252
+ ### Output Location
253
+
254
+ The write path depends on whether your runtime provides a Plan Mode surface (check `get_runtime_context`, loaded at session start, step 0).
255
+
256
+ - **Plan Mode active**: Some runtimes restrict writes to a temporary staging directory during Plan Mode. Write the plan there first, then copy to the permanent location after approval. Call `exit_plan_mode` with the plan path to present the plan for user approval.
257
+ - **Plan Mode not active or not available**: Write the implementation plan directly to the project's plans directory.
258
+
259
+ Permanent location: `<state_dir>/plans/YYYY-MM-DD-<topic-slug>-impl-plan.md` (where `<state_dir>` resolves from `MAESTRO_STATE_DIR`, default `docs/maestro`).
260
+
261
+ If your runtime does not provide a Plan Mode transition, track planning progress using the plan-update mechanism from your runtime context, write directly to the final location, and use the user-prompt tool from runtime context for the approval gate.
262
+
263
+ ### Document Structure
264
+ Use the `implementation-plan` template loaded via `get_skill_content`.
265
+
266
+ ### Required Sections
267
+
268
+ 1. **Plan Overview**: Summary of total phases, agents involved, estimated effort
269
+ 2. **Dependency Graph**: Visual representation showing phase dependencies and parallel opportunities
270
+ 3. **Execution Strategy Table**: Stage-by-stage breakdown with agent assignments and execution mode
271
+ 4. **Phase Details**: Full specification for each phase (objective, agent, files, details, validation, dependencies)
272
+ 5. **File Inventory**: Complete table mapping every file to its phase and purpose
273
+ 6. **Risk Classification**: Per-phase risk assessment (LOW/MEDIUM/HIGH) with rationale
274
+ 7. **Execution Profile**: Summary of parallel vs sequential characteristics to inform mode selection:
275
+ ```
276
+ Execution Profile:
277
+ - Total phases: [N]
278
+ - Parallelizable phases: [M] (in [B] batches)
279
+ - Sequential-only phases: [S]
280
+ - Estimated parallel wall time: [time estimate based on batch execution]
281
+ - Estimated sequential wall time: [time estimate based on serial execution]
282
+
283
+ Note: Native parallel execution currently runs agents in autonomous mode.
284
+ All tool calls are auto-approved without user confirmation.
285
+ ```
286
+
287
+ ### Completion Criteria
288
+ The implementation plan is complete when:
289
+ - Every component from the design document maps to at least one phase
290
+ - All phase dependencies are acyclic (no circular dependencies)
291
+ - Parallel opportunities are identified and marked
292
+ - Each phase has clear validation criteria
293
+ - File ownership is non-overlapping for parallel phases
294
+ - The user has given explicit approval of the complete plan
295
+
296
+ Before presenting the plan for approval, check whether `validate_plan` appears in your available tools. If it does, call it with the plan structure and `task_complexity` to verify phase count constraints, file ownership, acyclic dependencies, and agent validity. If it does not, self-check against the phase count limits above.
297
+
298
+ ### Post-Generation
299
+ After writing the implementation plan:
300
+ 1. Confirm the file path to the user
301
+ 2. Present the dependency graph and execution strategy
302
+ 3. Highlight parallel execution opportunities
303
+ 4. Provide resource estimates when useful
304
+ 5. If your runtime provides Plan Mode, call `exit_plan_mode` with the plan path to present the plan for user approval. If Plan Mode is not available, present the completed plan for user approval using the user-prompt tool from runtime context.
305
+ 6. Ensure the approved plan is at `<state_dir>/plans/YYYY-MM-DD-<slug>-impl-plan.md` as the permanent project reference (copy from the staging directory if Plan Mode was used)
306
+ 7. Ask if the user is ready to proceed to execution (Phase 3)
307
+ 8. Upon approval, create the session state file via the session-management skill