maestro-flow 0.5.46 → 0.5.48

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 (336) hide show
  1. package/.agents/agents/ralph-executor.md +14 -24
  2. package/.agents/skills/domain-add/SKILL.md +9 -0
  3. package/.agents/skills/learn-decompose/SKILL.md +12 -0
  4. package/.agents/skills/learn-follow/SKILL.md +41 -0
  5. package/.agents/skills/learn-investigate/SKILL.md +14 -0
  6. package/.agents/skills/learn-second-opinion/SKILL.md +14 -0
  7. package/.agents/skills/maestro-amend/SKILL.md +11 -0
  8. package/.agents/skills/maestro-analyze/SKILL.md +13 -13
  9. package/.agents/skills/maestro-companion/SKILL.md +11 -0
  10. package/.agents/skills/maestro-composer/SKILL.md +12 -1
  11. package/.agents/skills/maestro-guard/SKILL.md +25 -0
  12. package/.agents/skills/maestro-help/SKILL.md +2 -0
  13. package/.agents/skills/maestro-help/index/catalog.json +7 -7
  14. package/.agents/skills/maestro-init/SKILL.md +29 -1
  15. package/.agents/skills/maestro-milestone-audit/SKILL.md +2 -2
  16. package/.agents/skills/maestro-milestone-release/SKILL.md +1 -1
  17. package/.agents/skills/maestro-next/SKILL.md +2 -2
  18. package/.agents/skills/maestro-overlay/SKILL.md +11 -0
  19. package/.agents/skills/maestro-plan/SKILL.md +31 -9
  20. package/.agents/skills/maestro-player/SKILL.md +11 -0
  21. package/.agents/skills/maestro-quick/SKILL.md +29 -0
  22. package/.agents/skills/maestro-ralph-v2/SKILL.md +26 -50
  23. package/.agents/skills/maestro-roadmap/SKILL.md +2 -2
  24. package/.agents/skills/maestro-swarm-workflow/SKILL.md +25 -0
  25. package/.agents/skills/maestro-tools-execute/SKILL.md +29 -0
  26. package/.agents/skills/maestro-tools-register/SKILL.md +29 -0
  27. package/.agents/skills/maestro-ui-codify/SKILL.md +11 -0
  28. package/.agents/skills/maestro-universal-workflow/SKILL.md +59 -0
  29. package/.agents/skills/maestro-update/SKILL.md +38 -0
  30. package/.agents/skills/manage-codebase-rebuild/SKILL.md +29 -0
  31. package/.agents/skills/manage-drift-realign/SKILL.md +12 -0
  32. package/.agents/skills/manage-harvest/SKILL.md +30 -6
  33. package/.agents/skills/manage-issue/SKILL.md +23 -0
  34. package/.agents/skills/manage-issue-discover/SKILL.md +28 -0
  35. package/.agents/skills/manage-kg-extractors/SKILL.md +27 -1
  36. package/.agents/skills/manage-knowhow/SKILL.md +26 -0
  37. package/.agents/skills/manage-knowhow-capture/SKILL.md +24 -0
  38. package/.agents/skills/manage-knowledge-audit/SKILL.md +13 -0
  39. package/.agents/skills/manage-status/SKILL.md +22 -0
  40. package/.agents/skills/manage-wiki/SKILL.md +28 -0
  41. package/.agents/skills/odyssey-improve/SKILL.md +50 -0
  42. package/.agents/skills/odyssey-planex/SKILL.md +46 -0
  43. package/.agents/skills/odyssey-review-test-fix/SKILL.md +50 -0
  44. package/.agents/skills/odyssey-ui/SKILL.md +50 -0
  45. package/.agents/skills/quality-auto-test/SKILL.md +13 -1
  46. package/.agents/skills/quality-debug/SKILL.md +11 -0
  47. package/.agents/skills/quality-refactor/SKILL.md +11 -0
  48. package/.agents/skills/quality-retrospective/SKILL.md +11 -0
  49. package/.agents/skills/quality-review/SKILL.md +11 -0
  50. package/.agents/skills/quality-sync/SKILL.md +10 -0
  51. package/.agents/skills/quality-test/SKILL.md +12 -0
  52. package/.agents/skills/security-audit/SKILL.md +11 -0
  53. package/.agents/skills/spec-add/SKILL.md +27 -0
  54. package/.agents/skills/spec-load/SKILL.md +25 -0
  55. package/.agents/skills/spec-remove/SKILL.md +26 -0
  56. package/.agents/skills/spec-setup/SKILL.md +30 -0
  57. package/.agy/agents/ralph-executor.md +14 -23
  58. package/.agy/skills/domain-add/SKILL.md +9 -0
  59. package/.agy/skills/learn-decompose/SKILL.md +12 -0
  60. package/.agy/skills/learn-follow/SKILL.md +41 -0
  61. package/.agy/skills/learn-investigate/SKILL.md +14 -0
  62. package/.agy/skills/learn-second-opinion/SKILL.md +14 -0
  63. package/.agy/skills/maestro-amend/SKILL.md +11 -0
  64. package/.agy/skills/maestro-analyze/SKILL.md +13 -13
  65. package/.agy/skills/maestro-companion/SKILL.md +11 -0
  66. package/.agy/skills/maestro-composer/SKILL.md +12 -1
  67. package/.agy/skills/maestro-guard/SKILL.md +25 -0
  68. package/.agy/skills/maestro-help/SKILL.md +2 -0
  69. package/.agy/skills/maestro-help/index/catalog.json +7 -7
  70. package/.agy/skills/maestro-init/SKILL.md +29 -1
  71. package/.agy/skills/maestro-milestone-audit/SKILL.md +2 -2
  72. package/.agy/skills/maestro-milestone-release/SKILL.md +1 -1
  73. package/.agy/skills/maestro-next/SKILL.md +2 -2
  74. package/.agy/skills/maestro-overlay/SKILL.md +11 -0
  75. package/.agy/skills/maestro-plan/SKILL.md +31 -9
  76. package/.agy/skills/maestro-player/SKILL.md +11 -0
  77. package/.agy/skills/maestro-quick/SKILL.md +29 -0
  78. package/.agy/skills/maestro-ralph-v2/SKILL.md +26 -50
  79. package/.agy/skills/maestro-roadmap/SKILL.md +2 -2
  80. package/.agy/skills/maestro-swarm-workflow/SKILL.md +25 -0
  81. package/.agy/skills/maestro-tools-execute/SKILL.md +29 -0
  82. package/.agy/skills/maestro-tools-register/SKILL.md +29 -0
  83. package/.agy/skills/maestro-ui-codify/SKILL.md +11 -0
  84. package/.agy/skills/maestro-universal-workflow/SKILL.md +59 -0
  85. package/.agy/skills/maestro-update/SKILL.md +38 -0
  86. package/.agy/skills/manage-codebase-rebuild/SKILL.md +29 -0
  87. package/.agy/skills/manage-drift-realign/SKILL.md +12 -0
  88. package/.agy/skills/manage-harvest/SKILL.md +30 -6
  89. package/.agy/skills/manage-issue/SKILL.md +23 -0
  90. package/.agy/skills/manage-issue-discover/SKILL.md +28 -0
  91. package/.agy/skills/manage-kg-extractors/SKILL.md +27 -1
  92. package/.agy/skills/manage-knowhow/SKILL.md +26 -0
  93. package/.agy/skills/manage-knowhow-capture/SKILL.md +24 -0
  94. package/.agy/skills/manage-knowledge-audit/SKILL.md +13 -0
  95. package/.agy/skills/manage-status/SKILL.md +22 -0
  96. package/.agy/skills/manage-wiki/SKILL.md +28 -0
  97. package/.agy/skills/odyssey-improve/SKILL.md +50 -0
  98. package/.agy/skills/odyssey-planex/SKILL.md +46 -0
  99. package/.agy/skills/odyssey-review-test-fix/SKILL.md +50 -0
  100. package/.agy/skills/odyssey-ui/SKILL.md +50 -0
  101. package/.agy/skills/quality-auto-test/SKILL.md +13 -1
  102. package/.agy/skills/quality-debug/SKILL.md +11 -0
  103. package/.agy/skills/quality-refactor/SKILL.md +11 -0
  104. package/.agy/skills/quality-retrospective/SKILL.md +11 -0
  105. package/.agy/skills/quality-review/SKILL.md +11 -0
  106. package/.agy/skills/quality-sync/SKILL.md +10 -0
  107. package/.agy/skills/quality-test/SKILL.md +12 -0
  108. package/.agy/skills/security-audit/SKILL.md +11 -0
  109. package/.agy/skills/spec-add/SKILL.md +27 -0
  110. package/.agy/skills/spec-load/SKILL.md +25 -0
  111. package/.agy/skills/spec-remove/SKILL.md +26 -0
  112. package/.agy/skills/spec-setup/SKILL.md +30 -0
  113. package/.claude/agents/ralph-executor.md +14 -24
  114. package/.claude/commands/domain-add.md +9 -0
  115. package/.claude/commands/learn-decompose.md +12 -0
  116. package/.claude/commands/learn-follow.md +41 -0
  117. package/.claude/commands/learn-investigate.md +14 -0
  118. package/.claude/commands/learn-second-opinion.md +14 -0
  119. package/.claude/commands/maestro-amend.md +11 -0
  120. package/.claude/commands/maestro-analyze.md +13 -13
  121. package/.claude/commands/maestro-companion.md +11 -0
  122. package/.claude/commands/maestro-composer.md +12 -1
  123. package/.claude/commands/maestro-guard.md +25 -0
  124. package/.claude/commands/maestro-init.md +29 -1
  125. package/.claude/commands/maestro-milestone-audit.md +2 -2
  126. package/.claude/commands/maestro-milestone-release.md +1 -1
  127. package/.claude/commands/maestro-next.md +2 -2
  128. package/.claude/commands/maestro-overlay.md +11 -0
  129. package/.claude/commands/maestro-plan.md +31 -9
  130. package/.claude/commands/maestro-player.md +11 -0
  131. package/.claude/commands/maestro-quick.md +29 -0
  132. package/.claude/commands/maestro-ralph-v2.md +26 -50
  133. package/.claude/commands/maestro-roadmap.md +2 -2
  134. package/.claude/commands/maestro-swarm-workflow.md +25 -0
  135. package/.claude/commands/maestro-tools-execute.md +29 -0
  136. package/.claude/commands/maestro-tools-register.md +29 -0
  137. package/.claude/commands/maestro-ui-codify.md +11 -0
  138. package/.claude/commands/maestro-universal-workflow.md +59 -0
  139. package/.claude/commands/maestro-update.md +38 -0
  140. package/.claude/commands/manage-codebase-rebuild.md +29 -0
  141. package/.claude/commands/manage-drift-realign.md +12 -0
  142. package/.claude/commands/manage-harvest.md +30 -6
  143. package/.claude/commands/manage-issue-discover.md +28 -0
  144. package/.claude/commands/manage-issue.md +23 -0
  145. package/.claude/commands/manage-kg-extractors.md +27 -1
  146. package/.claude/commands/manage-knowhow-capture.md +24 -0
  147. package/.claude/commands/manage-knowhow.md +26 -0
  148. package/.claude/commands/manage-knowledge-audit.md +13 -0
  149. package/.claude/commands/manage-status.md +22 -0
  150. package/.claude/commands/manage-wiki.md +28 -0
  151. package/.claude/commands/odyssey-improve.md +50 -0
  152. package/.claude/commands/odyssey-planex.md +46 -0
  153. package/.claude/commands/odyssey-review-test-fix.md +50 -0
  154. package/.claude/commands/odyssey-ui.md +50 -0
  155. package/.claude/commands/quality-auto-test.md +13 -1
  156. package/.claude/commands/quality-debug.md +11 -0
  157. package/.claude/commands/quality-refactor.md +11 -0
  158. package/.claude/commands/quality-retrospective.md +11 -0
  159. package/.claude/commands/quality-review.md +11 -0
  160. package/.claude/commands/quality-sync.md +10 -0
  161. package/.claude/commands/quality-test.md +12 -0
  162. package/.claude/commands/security-audit.md +11 -0
  163. package/.claude/commands/spec-add.md +27 -0
  164. package/.claude/commands/spec-load.md +25 -0
  165. package/.claude/commands/spec-remove.md +26 -0
  166. package/.claude/commands/spec-setup.md +30 -0
  167. package/.claude/skills/maestro-help/SKILL.md +2 -0
  168. package/.claude/skills/maestro-help/index/catalog.json +7 -7
  169. package/.codex/skills/codify-to-knowhow/SKILL.md +2 -0
  170. package/.codex/skills/domain-add/SKILL.md +26 -0
  171. package/.codex/skills/domain-discover/SKILL.md +46 -0
  172. package/.codex/skills/domain-list/SKILL.md +29 -0
  173. package/.codex/skills/learn-decompose/SKILL.md +2 -0
  174. package/.codex/skills/learn-follow/SKILL.md +34 -0
  175. package/.codex/skills/learn-investigate/SKILL.md +33 -0
  176. package/.codex/skills/learn-retro/SKILL.md +33 -0
  177. package/.codex/skills/learn-second-opinion/SKILL.md +30 -0
  178. package/.codex/skills/maestro/SKILL.md +6 -5
  179. package/.codex/skills/maestro-amend/SKILL.md +11 -0
  180. package/.codex/skills/maestro-analyze/SKILL.md +13 -18
  181. package/.codex/skills/maestro-companion/SKILL.md +11 -0
  182. package/.codex/skills/maestro-composer/SKILL.md +11 -0
  183. package/.codex/skills/maestro-guard/SKILL.md +25 -0
  184. package/.codex/skills/maestro-help/SKILL.md +2 -0
  185. package/.codex/skills/maestro-help/catalog.json +7 -7
  186. package/.codex/skills/maestro-init/SKILL.md +16 -0
  187. package/.codex/skills/maestro-learn/SKILL.md +2 -0
  188. package/.codex/skills/maestro-next/SKILL.md +2 -2
  189. package/.codex/skills/maestro-overlay/SKILL.md +1 -0
  190. package/.codex/skills/maestro-plan/SKILL.md +13 -16
  191. package/.codex/skills/maestro-player/SKILL.md +2 -0
  192. package/.codex/skills/maestro-quick/SKILL.md +17 -0
  193. package/.codex/skills/maestro-ralph/SKILL.md +11 -11
  194. package/.codex/skills/maestro-ralph-execute/SKILL.md +8 -8
  195. package/.codex/skills/maestro-tools-execute/SKILL.md +31 -0
  196. package/.codex/skills/maestro-tools-register/SKILL.md +29 -0
  197. package/.codex/skills/maestro-ui-codify/SKILL.md +2 -0
  198. package/.codex/skills/maestro-update/SKILL.md +38 -0
  199. package/.codex/skills/manage-codebase-rebuild/SKILL.md +2 -0
  200. package/.codex/skills/manage-codebase-refresh/SKILL.md +11 -0
  201. package/.codex/skills/manage-drift-realign/SKILL.md +2 -0
  202. package/.codex/skills/manage-harvest/SKILL.md +30 -8
  203. package/.codex/skills/manage-issue/SKILL.md +24 -0
  204. package/.codex/skills/manage-issue-discover/SKILL.md +2 -0
  205. package/.codex/skills/manage-knowhow/SKILL.md +26 -0
  206. package/.codex/skills/manage-knowhow-capture/SKILL.md +23 -0
  207. package/.codex/skills/manage-learn/SKILL.md +2 -0
  208. package/.codex/skills/manage-status/SKILL.md +22 -0
  209. package/.codex/skills/manage-wiki/SKILL.md +28 -0
  210. package/.codex/skills/odyssey-debug/SKILL.md +44 -0
  211. package/.codex/skills/odyssey-improve/SKILL.md +49 -0
  212. package/.codex/skills/odyssey-planex/SKILL.md +44 -0
  213. package/.codex/skills/odyssey-review-test-fix/SKILL.md +48 -0
  214. package/.codex/skills/odyssey-ui/SKILL.md +49 -0
  215. package/.codex/skills/quality-auto-test/SKILL.md +2 -0
  216. package/.codex/skills/quality-debug/SKILL.md +2 -0
  217. package/.codex/skills/quality-refactor/SKILL.md +2 -0
  218. package/.codex/skills/quality-retrospective/SKILL.md +2 -0
  219. package/.codex/skills/quality-review/SKILL.md +2 -0
  220. package/.codex/skills/quality-sync/SKILL.md +24 -0
  221. package/.codex/skills/quality-test/SKILL.md +2 -0
  222. package/.codex/skills/security-audit/SKILL.md +30 -0
  223. package/.codex/skills/spec-add/SKILL.md +28 -0
  224. package/.codex/skills/spec-load/SKILL.md +26 -0
  225. package/.codex/skills/spec-map/SKILL.md +1 -0
  226. package/.codex/skills/spec-remove/SKILL.md +28 -0
  227. package/.codex/skills/spec-setup/SKILL.md +28 -0
  228. package/.codex/skills/wiki-connect/SKILL.md +11 -0
  229. package/.codex/skills/wiki-digest/SKILL.md +11 -0
  230. package/dashboard/dist-server/dashboard/src/server/agents/api-explore-adapter.js +3 -1
  231. package/dashboard/dist-server/dashboard/src/server/agents/api-explore-adapter.js.map +1 -1
  232. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.d.ts +5 -0
  233. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +42 -1
  234. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -1
  235. package/dashboard/dist-server/src/graph/kg/db/queries.d.ts +4 -0
  236. package/dashboard/dist-server/src/graph/kg/db/queries.js +35 -19
  237. package/dashboard/dist-server/src/graph/kg/db/queries.js.map +1 -1
  238. package/dashboard/dist-server/src/graph/kg/embedding/code-embedding.js +2 -0
  239. package/dashboard/dist-server/src/graph/kg/embedding/code-embedding.js.map +1 -1
  240. package/dashboard/dist-server/src/graph/kg/engine.js +5 -1
  241. package/dashboard/dist-server/src/graph/kg/engine.js.map +1 -1
  242. package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js +19 -11
  243. package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js.map +1 -1
  244. package/dashboard/dist-server/src/hooks/kg-sync-hook.js +5 -3
  245. package/dashboard/dist-server/src/hooks/kg-sync-hook.js.map +1 -1
  246. package/dashboard/dist-server/src/hooks/session-context.js +3 -1
  247. package/dashboard/dist-server/src/hooks/session-context.js.map +1 -1
  248. package/dist/src/agents/api-explore/circuit-breaker.d.ts +41 -0
  249. package/dist/src/agents/api-explore/circuit-breaker.d.ts.map +1 -0
  250. package/dist/src/agents/api-explore/circuit-breaker.js +82 -0
  251. package/dist/src/agents/api-explore/circuit-breaker.js.map +1 -0
  252. package/dist/src/agents/api-explore/config.d.ts +15 -34
  253. package/dist/src/agents/api-explore/config.d.ts.map +1 -1
  254. package/dist/src/agents/api-explore/config.js +17 -42
  255. package/dist/src/agents/api-explore/config.js.map +1 -1
  256. package/dist/src/agents/api-explore/index.js +6 -6
  257. package/dist/src/agents/api-explore/index.js.map +1 -1
  258. package/dist/src/agents/api-explore/llm.d.ts +2 -0
  259. package/dist/src/agents/api-explore/llm.d.ts.map +1 -1
  260. package/dist/src/agents/api-explore/llm.js +16 -4
  261. package/dist/src/agents/api-explore/llm.js.map +1 -1
  262. package/dist/src/agents/api-explore/runner.d.ts +5 -0
  263. package/dist/src/agents/api-explore/runner.d.ts.map +1 -1
  264. package/dist/src/agents/api-explore/runner.js +66 -15
  265. package/dist/src/agents/api-explore/runner.js.map +1 -1
  266. package/dist/src/commands/explore.d.ts.map +1 -1
  267. package/dist/src/commands/explore.js +23 -4
  268. package/dist/src/commands/explore.js.map +1 -1
  269. package/dist/src/commands/install.d.ts.map +1 -1
  270. package/dist/src/commands/install.js +62 -28
  271. package/dist/src/commands/install.js.map +1 -1
  272. package/dist/src/commands/moa.d.ts.map +1 -1
  273. package/dist/src/commands/moa.js +18 -3
  274. package/dist/src/commands/moa.js.map +1 -1
  275. package/dist/src/commands/search.d.ts.map +1 -1
  276. package/dist/src/commands/search.js +2 -0
  277. package/dist/src/commands/search.js.map +1 -1
  278. package/dist/src/config/api-config.d.ts +61 -0
  279. package/dist/src/config/api-config.d.ts.map +1 -0
  280. package/dist/src/config/api-config.js +59 -0
  281. package/dist/src/config/api-config.js.map +1 -0
  282. package/dist/src/config/cli-tools-config.d.ts +1 -0
  283. package/dist/src/config/cli-tools-config.d.ts.map +1 -1
  284. package/dist/src/config/cli-tools-config.js +22 -1
  285. package/dist/src/config/cli-tools-config.js.map +1 -1
  286. package/dist/src/graph/kg/db/queries.d.ts +4 -0
  287. package/dist/src/graph/kg/db/queries.d.ts.map +1 -1
  288. package/dist/src/graph/kg/db/queries.js +35 -19
  289. package/dist/src/graph/kg/db/queries.js.map +1 -1
  290. package/dist/src/graph/kg/embedding/code-embedding.d.ts.map +1 -1
  291. package/dist/src/graph/kg/embedding/code-embedding.js +2 -0
  292. package/dist/src/graph/kg/embedding/code-embedding.js.map +1 -1
  293. package/dist/src/graph/kg/engine.d.ts.map +1 -1
  294. package/dist/src/graph/kg/engine.js +5 -1
  295. package/dist/src/graph/kg/engine.js.map +1 -1
  296. package/dist/src/graph/kg/extraction/orchestrator.d.ts.map +1 -1
  297. package/dist/src/graph/kg/extraction/orchestrator.js +19 -11
  298. package/dist/src/graph/kg/extraction/orchestrator.js.map +1 -1
  299. package/dist/src/hooks/kg-sync-hook.d.ts.map +1 -1
  300. package/dist/src/hooks/kg-sync-hook.js +5 -3
  301. package/dist/src/hooks/kg-sync-hook.js.map +1 -1
  302. package/dist/src/hooks/plugins/explore-plugin.d.ts.map +1 -1
  303. package/dist/src/hooks/plugins/explore-plugin.js +3 -2
  304. package/dist/src/hooks/plugins/explore-plugin.js.map +1 -1
  305. package/dist/src/hooks/session-context.js +3 -1
  306. package/dist/src/hooks/session-context.js.map +1 -1
  307. package/dist/src/tui/install-ui/EmbeddingConfig.d.ts +25 -0
  308. package/dist/src/tui/install-ui/EmbeddingConfig.d.ts.map +1 -0
  309. package/dist/src/tui/install-ui/EmbeddingConfig.js +58 -0
  310. package/dist/src/tui/install-ui/EmbeddingConfig.js.map +1 -0
  311. package/dist/src/tui/install-ui/EmbeddingPanel.d.ts +6 -0
  312. package/dist/src/tui/install-ui/EmbeddingPanel.d.ts.map +1 -0
  313. package/dist/src/tui/install-ui/EmbeddingPanel.js +101 -0
  314. package/dist/src/tui/install-ui/EmbeddingPanel.js.map +1 -0
  315. package/dist/src/tui/install-ui/GroupedHub.d.ts +2 -0
  316. package/dist/src/tui/install-ui/GroupedHub.d.ts.map +1 -1
  317. package/dist/src/tui/install-ui/GroupedHub.js +8 -1
  318. package/dist/src/tui/install-ui/GroupedHub.js.map +1 -1
  319. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
  320. package/dist/src/tui/install-ui/InstallFlow.js +4 -2
  321. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
  322. package/dist/src/tui/install-ui/embedding-status.d.ts +12 -0
  323. package/dist/src/tui/install-ui/embedding-status.d.ts.map +1 -0
  324. package/dist/src/tui/install-ui/embedding-status.js +82 -0
  325. package/dist/src/tui/install-ui/embedding-status.js.map +1 -0
  326. package/dist/src/tui/install-ui/useInstallFlowState.d.ts +1 -1
  327. package/dist/src/tui/install-ui/useInstallFlowState.d.ts.map +1 -1
  328. package/dist/src/tui/install-ui/useInstallFlowState.js +52 -2
  329. package/dist/src/tui/install-ui/useInstallFlowState.js.map +1 -1
  330. package/dist/src/tui/shared/tokens.d.ts +1 -1
  331. package/dist/src/tui/shared/tokens.js +1 -1
  332. package/dist/src/utils/update-notices.js +11 -0
  333. package/dist/src/utils/update-notices.js.map +1 -1
  334. package/package.json +1 -1
  335. package/workflows/analyze.md +13 -15
  336. package/workflows/plan.md +33 -21
@@ -38,8 +38,18 @@ $ARGUMENTS — none for interactive mode, or `-y` with `@file` reference for aut
38
38
 
39
39
  **Load project state if exists:**
40
40
  Check for `.workflow/state.json` -- loads context if project already initialized.
41
+
42
+ **Output boundary**: ALL file writes MUST target `.workflow/` (project.md, state.json, config.json, specs/) only. NEVER modify source code or files outside `.workflow/`.
41
43
  </context>
42
44
 
45
+ <invariants>
46
+ 1. **Idempotent init** — re-running init on an already-initialized project MUST detect existing `.workflow/` and warn (E002); NEVER silently overwrite existing state
47
+ 2. **Scope guard** — init MUST only make initialization decisions; NEVER prejudge roadmap structure, plan scope, or implementation details
48
+ 3. **All artifacts required** — init MUST NOT report completion until project.md, state.json, and config.json all exist; missing artifacts MUST be created before exit
49
+ 4. **Template-driven** — deferred templates (project.md, state.json, config.json) MUST be read from `~/.maestro/templates/` and customized; NEVER generate from scratch without template
50
+ 5. **Interview writes back** — all interactive decisions MUST be written to project.md/config.json before proceeding to research or completion; NEVER leave decisions unrecorded
51
+ </invariants>
52
+
43
53
  <interview_protocol>
44
54
  Follows @~/.maestro/workflows/interview-mechanics.md standard.
45
55
 
@@ -52,6 +62,24 @@ Follows @~/.maestro/workflows/interview-mechanics.md standard.
52
62
  </interview_protocol>
53
63
 
54
64
  <execution>
65
+
66
+ ### Phase Gates (MANDATORY, BLOCKING)
67
+
68
+ **GATE 1: Pre-flight → Interview**
69
+ - REQUIRED: `.workflow/` existence check completed.
70
+ - REQUIRED: `--from` source validated (if provided).
71
+ - BLOCKED if: E002 (greenfield conflict with existing `.workflow/`) unresolved.
72
+
73
+ **GATE 2: Interview → Research**
74
+ - REQUIRED: All interview decisions recorded in project.md and config.json.
75
+ - REQUIRED: `.workflow/` directory created with initial structure.
76
+ - BLOCKED if: interview decisions not yet written to files.
77
+
78
+ **GATE 3: Research → Completion**
79
+ - REQUIRED: All 3 required artifacts exist (project.md, state.json, config.json).
80
+ - REQUIRED: `.workflow/specs/` initialized.
81
+ - BLOCKED if: any artifact missing — write it before reporting completion.
82
+
55
83
  ### Pre-flight
56
84
 
57
85
  1. Check if `.workflow/` already exists — if so, load state and warn (E002 for greenfield conflicts)
@@ -104,7 +132,7 @@ Status verdicts:
104
132
  | Condition | Suggestion |
105
133
  |-----------|-----------|
106
134
  | Roadmap needed (default light) | `/maestro-roadmap <requirement>` |
107
- | Full spec package + roadmap | `/maestro-roadmap --mode full <idea>` |
135
+ | Full spec package | `/maestro-blueprint <idea>` |
108
136
  | Explore ideas first | `/maestro-brainstorm <topic>` |
109
137
  | View project dashboard | `/manage-status` |
110
138
  | Quick ad-hoc task | `/maestro-quick <task>` |
@@ -56,7 +56,7 @@ Audit checklist steps (phase coverage, ad-hoc completeness, execution completene
56
56
 
57
57
  **GATE 1: Load → Phase Coverage Check**
58
58
  - REQUIRED: state.json loaded with artifacts[] filtered by target milestone.
59
- - REQUIRED: Milestone phases identified from roadmap (standard) or milestone_obj.phases (adhoc).
59
+ - REQUIRED: Milestone phases identified from the PLN artifact's plan.json (standard) or milestone_obj.phases (adhoc). Phase coverage is verified from the PLN artifact's plan.json, not from roadmap.
60
60
  - BLOCKED if no execute artifacts found: error E003.
61
61
 
62
62
  **GATE 2: Phase Coverage → Integration Check**
@@ -116,7 +116,7 @@ Status verdicts:
116
116
  </error_codes>
117
117
 
118
118
  <success_criteria>
119
- - [ ] All phases in milestone identified from roadmap (standard) or milestone_obj.phases (adhoc)
119
+ - [ ] All phases in milestone identified from the PLN artifact's plan.json (standard) or milestone_obj.phases (adhoc)
120
120
  - [ ] Artifact chains verified: ANL→PLN→EXC per phase (standard) or PLN→EXC exists (adhoc)
121
121
  - [ ] Ad-hoc artifacts checked for completion
122
122
  - [ ] Integration check completed (shared interfaces, data contracts)
@@ -111,7 +111,7 @@ Status verdicts:
111
111
 
112
112
  | Condition | Suggestion |
113
113
  |-----------|-----------|
114
- | Release successful, starting next milestone | `/maestro-plan {next_phase}` |
114
+ | Release successful, starting next milestone | `/maestro-plan {next_milestone}` |
115
115
  | Want to view project dashboard | `/manage-status` |
116
116
  </completion>
117
117
 
@@ -105,8 +105,8 @@ ls -la .workflow/.maestro/ 2>/dev/null | head -5 # 进行中的 session
105
105
  | 无 `.workflow/` + 有源码 | init | `maestro-init` |
106
106
  | 有 state.json,无 roadmap,无 milestones | analyze-macro | `maestro-analyze` (宏观调研) |
107
107
  | 有 macro analyze artifact,无 roadmap | roadmap | `maestro-roadmap` |
108
- | 有 roadmap,未启动 phase | analyze | `maestro-analyze {phase}` |
109
- | 最新 artifact = analyze | plan | `maestro-plan {phase}` |
108
+ | 有 roadmap,未启动 phase | analyze | `maestro-analyze {milestone}` |
109
+ | 最新 artifact = analyze | plan | `maestro-plan {milestone}` |
110
110
  | 最新 artifact = plan | execute | `maestro-execute {phase}` |
111
111
  | 最新 artifact = execute | review | `quality-review {phase}` |
112
112
  | review verdict=PASS | test-gen | `quality-auto-test {phase}` |
@@ -34,8 +34,19 @@ Turn natural-language instructions into command overlays — JSON patch files th
34
34
  **Management** — listing and removing overlays is handled by `maestro overlay list` (ink TUI with interactive delete). This skill focuses solely on creation.
35
35
 
36
36
  **Available sections** (for `section:` in patches): `purpose`, `required_reading`, `deferred_reading`, `context`, `execution`, `error_codes`, `success_criteria`.
37
+
38
+ **Output boundary**: ALL file writes MUST target `~/.maestro/overlays/` (overlay JSON + docs) only. Command file patching is handled by `maestro overlay add` — this skill NEVER modifies `.claude/commands/*.md` directly.
37
39
  </context>
38
40
 
41
+ <invariants>
42
+ 1. **Non-invasive** — overlays MUST use hashed HTML-comment markers for injection; NEVER edit command file content directly outside the overlay system
43
+ 2. **Idempotent** — re-running `maestro overlay apply` with the same overlay JSON MUST produce no file changes
44
+ 3. **Creation only** — this skill MUST only create overlays; listing and removal are handled by `maestro overlay list` (ink TUI)
45
+ 4. **Pristine source preferred** — injection point analysis MUST read from `$PKG_ROOT/.claude/commands/` (untouched originals) first, fall back to `~/.claude/commands/` only if pristine unavailable
46
+ 5. **User approval before write** — overlay JSON MUST be shown and approved via AskUserQuestion before writing to disk; NEVER auto-install without confirmation
47
+ 6. **Chain skip option mandatory** — if a skill chain is configured, the injected content MUST include a "Skip" option in AskUserQuestion; NEVER force the user into a chain
48
+ </invariants>
49
+
39
50
  <execution>
40
51
  ### 1. Parse user intent
41
52
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: maestro-plan
3
- description: Use when creating, revising, or verifying an execution plan for a phase or task
4
- argument-hint: "[phase] [--collab] [--spec SPEC-xxx] [-y] [--gaps] [--tdd] [--dir <path>] [--from <source>] [--revise [instructions]] [--check <plan-dir>]"
3
+ description: Use when creating, revising, or verifying an execution plan for a milestone or task
4
+ argument-hint: "[milestone] [--spec SPEC-xxx] [-y] [--gaps] [--tdd] [--dir <path>] [--from <source>] [--revise [instructions]] [--check <plan-dir>]"
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Write
@@ -29,9 +29,9 @@ Produces plan.json + TASK files; registers PLN artifact in state.json.
29
29
  </deferred_reading>
30
30
 
31
31
  <context>
32
- $ARGUMENTS — phase number, or no args for milestone-wide planning, with optional flags.
32
+ $ARGUMENTS — milestone number, or no args for current milestone, with optional flags.
33
33
 
34
- Scope routing, base flags (`--collab`, `--spec`, `-y`, `--gaps`, `--dir`), output directory format, and artifact registration are defined in workflow plan.md.
34
+ Scope routing, base flags (`--spec`, `-y`, `--gaps`, `--dir`), output directory format, and artifact registration are defined in workflow plan.md.
35
35
 
36
36
  **Command-level flags** (extensions beyond workflow base):
37
37
  - `--from <source>`: Load upstream context directly (bypasses roadmap requirement):
@@ -46,8 +46,8 @@ Scope routing, base flags (`--collab`, `--spec`, `-y`, `--gaps`, `--dir`), outpu
46
46
  1. `--from analyze:ANL-xxx` → uses analyze conclusions.implementation_scope directly
47
47
  2. `--from blueprint:BLP-xxx` → uses blueprint requirements + architecture
48
48
  3. `--dir <path>` → explicit context directory (unchanged)
49
- 4. Numeric arg → scope = "phase", resolve from roadmap (unchanged)
50
- 5. No args + roadmap → scope = "milestone" (unchanged)
49
+ 4. Numeric arg → scope = "milestone", resolve from roadmap
50
+ 5. No args + roadmap → scope = "current_milestone"
51
51
  6. No args + no roadmap → search state.json for latest analyze artifact, fallback standalone
52
52
 
53
53
  **Ad-hoc milestone (D-008):** When scope resolves to "standalone" via the standard standalone resolution (no `--from` source), and `current_milestone == null`, plan auto-creates an adhoc milestone (`type: "adhoc"`) in state.json before proceeding. This ensures downstream milestone-audit/complete have a valid milestone context. See workflow plan.md § "Ad-hoc Milestone Auto-Creation".
@@ -69,6 +69,28 @@ If exit code is 1, present warnings and ask whether to proceed.
69
69
 
70
70
  Follow '~/.maestro/workflows/plan.md' completely.
71
71
 
72
+ ### Plan Agent Model
73
+
74
+ Plan automatically selects agent mode based on milestone scope:
75
+
76
+ **Single agent mode** (default):
77
+ - Milestone involves ≤3 modules
78
+ - 1 workflow-planner agent, max 8 TASK JSON output
79
+ - Directly produces plan.json
80
+
81
+ **2+1 agent mode** (auto-triggered):
82
+ - Milestone involves >3 modules
83
+ - 2 parallel workflow-planner agents, each scoped to 2-3 modules
84
+ - Each agent produces max 8 TASK JSON (total max 16)
85
+ - +1 synthesis agent:
86
+ - Merges TASK JSON from both agents
87
+ - DAG analysis: dependency correctness, cycle detection, cross-module conflicts
88
+ - Terminology consistency check
89
+ - Wave ordering optimization
90
+ - Produces unified plan.json
91
+
92
+ Module count is derived from milestone phase definitions and analyze upstream context.
93
+
72
94
  ### Phase Gates (MANDATORY, BLOCKING — Create mode only)
73
95
 
74
96
  **GATE P1 → P2: Context Collection → Clarification**
@@ -113,7 +135,7 @@ Follow workflow plan.md § "Revise Mode" and § "Check Mode" respectively. These
113
135
 
114
136
  ```
115
137
  === PLAN READY ===
116
- Phase: {phase_name}
138
+ Milestone: {milestone_name}
117
139
  Tasks: {task_count} tasks in {wave_count} waves
118
140
  Check: {checker_status} (iteration {check_count}/{max_checks})
119
141
  Collision: {collision_status}
@@ -143,13 +165,13 @@ Status verdicts:
143
165
  |-----------|-----------|
144
166
  | Plan confirmed for execution | `/maestro-execute` |
145
167
  | Plan confirmed, specific directory | `/maestro-execute --dir {dir}` |
146
- | Re-plan with modifications | `/maestro-plan {phase}` |
168
+ | Re-plan with modifications | `/maestro-plan {milestone}` |
147
169
  </completion>
148
170
 
149
171
  <error_codes>
150
172
  | Code | Severity | Condition | Recovery |
151
173
  |------|----------|-----------|----------|
152
- | E001 | error | No args and no roadmap (cannot determine scope) | Provide phase number or topic, or create roadmap |
174
+ | E001 | error | No args and no roadmap (cannot determine scope) | Provide milestone number or topic, or create roadmap |
153
175
  | E003 | error | --gaps requires prior verification/issues to exist | Run maestro-execute first (verification is built-in) |
154
176
  | E004 | error | No plan found to revise (--revise without target) | Use --dir to specify plan, or create plan first |
155
177
  | E005 | error | Plan directory not found (--check) | Check path, use --dir |
@@ -67,8 +67,19 @@ $ARGUMENTS — template slug/path, or flags.
67
67
  "last_checkpoint": null
68
68
  }
69
69
  ```
70
+
71
+ **Output boundary**: ALL file writes MUST target `.workflow/.maestro/player-*/` (session status.json + step outputs) only. Template files (`~/.maestro/templates/workflows/`) are read-only. NEVER modify source code or `.claude/commands/` files.
70
72
  </context>
71
73
 
74
+ <invariants>
75
+ 1. **Resume-safe** — status.json MUST be updated after every step change; an interrupted session MUST be resumable from the last checkpoint via `-c`
76
+ 2. **One step at a time** — execution loop MUST process steps sequentially in topological order; parallel steps share a batch index but NEVER run concurrently within the player
77
+ 3. **CLI nodes async** — cli-type nodes MUST use `Bash(run_in_background: true)` + STOP pattern; NEVER block the main thread on delegate execution
78
+ 4. **Templates read-only** — player MUST NOT modify template JSON files; runtime state belongs in status.json only
79
+ 5. **Failure requires user decision** — on step failure without explicit `on_fail`, player MUST prompt via AskUserQuestion (Retry/Skip/Abort); NEVER silently skip or auto-abort
80
+ 6. **Reference resolution at runtime** — `{N-xxx.field}` and `{prev_*}` references MUST be resolved at execution time from status.json step results, NEVER pre-resolved during init
81
+ </invariants>
82
+
72
83
  <state_machine>
73
84
 
74
85
  <states>
@@ -39,9 +39,38 @@ Parse for:
39
39
  - Browse: `maestro search --category coding`
40
40
  - Load task-relevant entries: `maestro load --type knowhow --id <id1> [id2...]`
41
41
  3. All are optional — proceed without if unavailable.
42
+
43
+ **Output boundary**: ALL file writes MUST target `.workflow/scratch/` (task directory, plan.json, summaries) and modified source files as defined in plan.json tasks. State.json scratch entry is implicit workflow tracking.
42
44
  </context>
43
45
 
46
+ <invariants>
47
+ 1. **Atomic commits** — each task execution MUST produce a commit with only the files modified by that task; NEVER stage unrelated files
48
+ 2. **Evidence-based summaries** — task summaries MUST include concrete evidence (files changed, tests run, commands executed); NEVER accept "task completed successfully" as a summary
49
+ 3. **Plan before execute** — plan.json MUST be written before any task execution begins; NEVER skip planning even for single-task workflows
50
+ 4. **Scratch isolation** — all workflow artifacts MUST live under `.workflow/scratch/{task-dir}/`; NEVER write workflow metadata outside this directory
51
+ 5. **Commit confirmation** — staged files and commit message MUST be shown via AskUserQuestion before committing (unless `-y`); NEVER auto-commit without user awareness
52
+ </invariants>
53
+
44
54
  <execution>
55
+
56
+ ### Phase Gates (MANDATORY, BLOCKING)
57
+
58
+ **GATE 1: Setup → Planning**
59
+ - REQUIRED: Task description parsed and scratch directory created.
60
+ - REQUIRED: Coding specs loaded (optional but attempted).
61
+ - BLOCKED if: no task description (E001) or scratch directory creation failed (E002).
62
+
63
+ **GATE 2: Planning → Execution**
64
+ - REQUIRED: plan.json written with task definitions.
65
+ - REQUIRED: --discuss decisions extracted and recorded (if flag set).
66
+ - BLOCKED if: plan.json missing or empty.
67
+
68
+ **GATE 3: Execution → Completion**
69
+ - REQUIRED: All tasks executed with `.summaries/TASK-*-summary.md` written per task.
70
+ - REQUIRED: Each summary contains concrete evidence of completion.
71
+ - REQUIRED: --full verification passed (if flag set).
72
+ - BLOCKED if: any task summary missing or lacking evidence.
73
+
45
74
  Follow '~/.maestro/workflows/quick.md' completely.
46
75
 
47
76
  ### Artifact Verification (before completion)
@@ -43,13 +43,13 @@ Remaining → intent (amend_mode 时为 change_request)
43
43
  </context>
44
44
 
45
45
  <invariants>
46
- 1. **Ralph-v2 owns the full loop** — locate step → resolve args → load context → dispatch agent → wait for SendMessagereceive → extract signals → drift → complete,全部在本命令内完成
47
- 2. **One agent per step** — 每个执行 step 派发一个 named executor agent,agent 通过 SendMessage 回传结果,主流程解析结果后决定下一步
48
- 3. **Agent is a thin wrapper** — executor agent 调 `ralph next` 获取 skill prompt 并执行,通过 SendMessage 回传输出;arg resolution、context loading、signal extraction、drift analysis、ralph complete 均由主流程完成
49
- 4. **Dual dispatch model** — 执行 Agent 与评估 Agent 使用不同派发模式:
50
- - **执行 Agent**(A_STEP_DISPATCH):`Agent({name: "exe-xxx"})` named mailbox teammate,支持内部多 agent 编排,通过 `SendMessage({to: "main"})` 回传结果
51
- - **评估 Agent**(A_AGENT_EVALUATE / A_AGENT_GOAL_AUDIT / A_AGENT_REGROUND):`Agent()` 不传 `name` — 同步阻塞,直接返回结果(评估 agent 只读不需要多 agent)
52
- - `agent_exec_name` 既用于 display/日志,也作为执行 Agent 的 `name` 参数
46
+ 1. **Ralph-v2 owns the full loop** — locate step → resolve args → load context → dispatch agent → wait for task-notification → extract signals → drift → complete,全部在本命令内完成
47
+ 2. **One agent per step** — 每个执行 step 派发一个 unnamed executor agent,结果通过 task-notification `<result>` 回传,主流程解析结果后决定下一步
48
+ 3. **Agent is a thin wrapper** — executor agent 调 `ralph next` 获取 skill prompt 并执行,返回输出文本;arg resolution、context loading、signal extraction、drift analysis、ralph complete 均由主流程完成
49
+ 4. **Unified unnamed dispatch** — 执行 Agent 和评估 Agent 均使用 unnamed Agent(),结果通过 task-notification `<result>` 回传:
50
+ - **执行 Agent**(A_STEP_DISPATCH):`Agent()` 不传 name executor 内部编排也用 unnamed Agent(子结果自动回流 executor,嵌套套娃模型)
51
+ - **评估 Agent**(A_AGENT_EVALUATE / A_AGENT_GOAL_AUDIT / A_AGENT_REGROUND):同样 `Agent()` 不传 name
52
+ - `agent_exec_name` 仅用于 display/日志标识,不作为 Agent name 参数
53
53
  5. **主流程调 `ralph complete`** — 每个 step 完成后由主流程调 `maestro ralph complete`,非 agent 上报
54
54
  6. **Decision evaluation inline** — decision 节点不 handoff,通过 Agent 或 CLI delegate 在本循环内评估
55
55
  7. **CLI delegation for evaluation only** — CLI delegate(`maestro delegate --mode analysis`)仅限评估环节;执行仍通过 executor Agent 完成
@@ -89,8 +89,7 @@ S_CONFIRM — 用户确认
89
89
 
90
90
  S_STEP_LOCATE — 找下一个 pending step PERSIST: —
91
91
  S_STEP_RESOLVE — 解析占位符 + 丰富参数 PERSIST: step.args (enriched)
92
- S_STEP_DISPATCH — 组装上下文 + 派发 named executor agent PERSIST: step.agent_exec_name, step.status = "running"
93
- S_STEP_WAIT_MSG — 等待 executor 的 SendMessage 回传 PERSIST: —
92
+ S_STEP_DISPATCH — 组装上下文 + 派发 unnamed executor agent PERSIST: step.agent_exec_name, step.status = "running"
94
93
  S_STEP_ANALYZE — 提取信号 + 组装 completion 参数 PERSIST: —
95
94
  S_STEP_DRIFT — 产物 vs 目标偏离分析 PERSIST: step.drift_score
96
95
  S_STEP_COMPLETE — 调 `ralph complete` 上报 PERSIST: step.completion_*
@@ -145,12 +144,8 @@ S_STEP_RESOLVE:
145
144
  → S_STEP_DISPATCH DO: A_STEP_RESOLVE_ARGS
146
145
 
147
146
  S_STEP_DISPATCH:
148
- S_STEP_WAIT_MSG WHEN: executor dispatched DO: A_STEP_DISPATCH
149
-
150
- S_STEP_WAIT_MSG:
151
- → S_STEP_ANALYZE WHEN: received agent-message with EXECUTOR_OUTPUT DO: A_STEP_RECEIVE
152
- → S_HANDLE_FAIL WHEN: received agent-message with status=ERROR DO: A_STEP_RECEIVE
153
- → S_HANDLE_FAIL WHEN: executor idle without SendMessage(崩溃检测) DO: mark BLOCKED
147
+ S_STEP_ANALYZE WHEN: task-notification status=completed DO: A_STEP_DISPATCH
148
+ → S_HANDLE_FAIL WHEN: task-notification status=failed DO: mark BLOCKED
154
149
 
155
150
  S_STEP_ANALYZE:
156
151
  → S_STEP_DRIFT WHEN: STATUS == DONE|DONE_WITH_CONCERNS DO: A_STEP_EXTRACT
@@ -330,17 +325,15 @@ Execution criteria: {session.execution_criteria joined by '; '}
330
325
  | debug | `dbg` |
331
326
  | Other | `run` |
332
327
 
333
- **4. Dispatch(named mailbox executor):**
328
+ **4. Dispatch(unnamed executor):**
334
329
 
335
- > 执行 Agent 使用 `name` 参数派发为 named mailbox teammate,支持内部多 agent 编排。executor 通过 `SendMessage({to: "main"})` 回传执行结果。`resolved_agent_name` 同时用于 display 和 Agent `name` 参数。
330
+ > 执行 Agent 不传 name,结果通过 task-notification `<result>` 自动回传主流程。executor 内部编排也用 unnamed Agent(子结果自动回流 executor,嵌套套娃模型)。
336
331
 
337
332
  ```
338
333
  Agent({
339
- name: "{resolved_agent_name}",
340
334
  subagent_type: "ralph-executor",
341
- description: "执行 step {index}: {step.skill}",
335
+ description: "执行 step {index}: {step.skill} [{resolved_agent_name}]",
342
336
  prompt: `Session: {session_id}
343
- Agent name: {resolved_agent_name}
344
337
 
345
338
  {goal_context 块,仅 protocol < 2 时}
346
339
 
@@ -349,24 +342,11 @@ Agent name: {resolved_agent_name}
349
342
  })
350
343
  ```
351
344
 
352
- 5. Write `step.agent_exec_name` to status.json
345
+ 5. Write `step.agent_exec_name` to status.json(仅日志标识)
353
346
  6. Display: `[{index}/{total}] ⟶ {step.skill} → {resolved_agent_name}`
354
- 7. Agent() 立即返回(named teammate 异步启动)→ 进入 S_STEP_WAIT_MSG 等待 executor 的 SendMessage
355
-
356
- ### A_STEP_RECEIVE
357
-
358
- 从 executor 的 `agent-message` 中提取执行输出。
359
-
360
- 1. 接收到 `<agent-message from="{resolved_agent_name}">` 后,提取 message 内容
361
- 2. 解析 `EXECUTOR_OUTPUT` 格式:
362
- - `status: DONE` → agent_output = message 内容,继续 S_STEP_ANALYZE
363
- - `status: DONE_WITH_CONCERNS` → agent_output = message 内容,继续 S_STEP_ANALYZE
364
- - `status: ERROR` → STATUS=BLOCKED,转 S_HANDLE_FAIL
365
- 3. idle_notification 处理(区分正常等待与崩溃):
366
- - 首次收到 `idle_notification`:executor 可能在等待 worker 回传,正常现象,继续等待
367
- - 连续收到 2 次 `idle_notification` 且中间无 `agent-message`:向 executor 发送 `SendMessage({to: "{resolved_agent_name}", message: "请回报执行状态"})` 询问
368
- - 询问后仍只收到 `idle_notification` 无 `agent-message`:STATUS=BLOCKED,转 S_HANDLE_FAIL
369
- 4. `agent_output` = 提取的 message 内容
347
+ 7. Agent() 返回 agentId 等待 task-notification(status=completed `<result>` 含 executor 输出)
348
+ 8. task-notification 到达后,`agent_output` = `<result>` 内容 → 进入 S_STEP_ANALYZE
349
+ 9. task-notification status=failed → STATUS=BLOCKED,转 S_HANDLE_FAIL
370
350
 
371
351
  ### A_STEP_EXTRACT
372
352
 
@@ -749,10 +729,7 @@ GUARD: 已完成(`status: "done"`)的目标不可 supersede(skip + warn)
749
729
 
750
730
  - **A_RETRY**: `Bash("maestro ralph retry {index}")` — CLI 设 `step.retried = true`, `step.status = "pending"`, 清 `active_step_index`
751
731
  - **A_PAUSE_SESSION**: `ralph complete N --status BLOCKED --reason "..."` — CLI 写 `session.status = "paused"`
752
- - **A_COMPLETE_SESSION**: 校验所有 step `completion_confirmed == true` + `task_decomposition_all_done == true`(若存在),通过后写 `session.status = "completed"`。完成后向所有 idle executor 发送 shutdown_request 清理:
753
- ```
754
- 遍历 steps[].agent_exec_name → SendMessage({to: name, message: {type: "shutdown_request"}})
755
- ```
732
+ - **A_COMPLETE_SESSION**: 校验所有 step `completion_confirmed == true` + `task_decomposition_all_done == true`(若存在),通过后写 `session.status = "completed"`。unnamed executor 执行完自动终止,无需 shutdown 清理
756
733
 
757
734
  </actions>
758
735
 
@@ -884,24 +861,23 @@ E001–E006, W001–W004 适用。Agent 新增:
884
861
 
885
862
  ### Success Criteria
886
863
 
887
- - [ ] ralph-v2 owns full step loop: locate → resolve → dispatch → wait receive → extract → drift → complete → next
888
- - [ ] One agent per step — `Agent({ name, subagent_type: "ralph-executor" })` 每步派发一个 named executor
889
- - [ ] Executor 内调 `maestro ralph next` 获取 skill prompt 并执行,支持内部多 agent 编排
890
- - [ ] Executor 通过 `SendMessage({to: "main"})` 回传 `EXECUTOR_OUTPUT` 格式结果
864
+ - [ ] ralph-v2 owns full step loop: locate → resolve → dispatch → wait task-notification → extract → drift → complete → next
865
+ - [ ] One agent per step — `Agent({ subagent_type: "ralph-executor" })` 每步派发一个 unnamed executor
866
+ - [ ] Executor 内调 `maestro ralph next` 获取 skill prompt 并执行,内部编排用 unnamed Agent(子结果回流 executor)
867
+ - [ ] Executor 结果通过 task-notification `<result>` 自动回传主流程
891
868
  - [ ] 主流程调 `maestro ralph complete` 上报(非 agent 上报)
892
869
  - [ ] 主流程负责 arg resolution、context loading、signal extraction、drift analysis
893
- - [ ] A_STEP_RECEIVE executor agent-message 中提取执行输出
894
- - [ ] Executor 崩溃(idle SendMessage)→ 询问 2 次后 STATUS=BLOCKED,转 S_HANDLE_FAIL
895
- - [ ] Dual dispatch: 执行 Agent 传 `name`(async + SendMessage),评估 Agent 不传 `name`(sync)或 CLI delegate
870
+ - [ ] task-notification status=failed STATUS=BLOCKED,转 S_HANDLE_FAIL
871
+ - [ ] Unified unnamed dispatch: 执行 Agent 和评估 Agent 均不传 name,结果通过 task-notification 回传。CLI delegate 仅限评估环节
896
872
  - [ ] Decision evaluation 支持三种模式:agent(同步)、cli(CLI delegate)、dual(并行交叉验证)
897
873
  - [ ] `evaluate_via` 字段控制评估模式,默认 `"agent"`
898
874
  - [ ] dual 模式合并策略:一致取共识、分歧保守降级、CLI 未返回用 Agent 结果
899
875
  - [ ] Verdict 解析保持 `---VERDICT---` 格式,parse 失败 → fallback fix + parse_failed: true
900
876
  - [ ] decisions.ndjson 追加:source 字段为 `"ralph-v2"`
901
- - [ ] Session schema: `execution_mode: "agent"`,`agent_exec_name`(执行 Agent name + display),含 `artifacts_produced`
877
+ - [ ] Session schema: `execution_mode: "agent"`,`agent_exec_name`(display 标识),含 `artifacts_produced`
902
878
  - [ ] Chain building(S_RESOLVE_PHASE through S_BUILD_CHAIN)自包含执行
903
879
  - [ ] A_STEP_DISPATCH 含前序产出加载(滑动窗口 5 step + accumulated signals + stage-specific artifacts)
904
- - [ ] `agent_exec_name` 含 stage prefix(grl/brn/anm/ana/pln/exe/rev/tst/dbg)——同时用于 Agent name 参数和 display
880
+ - [ ] `agent_exec_name` 含 stage prefix(grl/brn/anm/ana/pln/exe/rev/tst/dbg)——仅用于 display/日志标识
905
881
  - [ ] `--summary` 在 DONE/DONE_WITH_CONCERNS 时为 MUST(动词开头,≤100 字)
906
882
  - [ ] CAVEATS 在 DONE_WITH_CONCERNS 时同时映射 --concerns
907
883
  - [ ] A_STEP_EXTRACT 从 executor 输出提取 artifact IDs、path signals、phase signals
@@ -15,7 +15,7 @@ allowed-tools:
15
15
  <purpose>
16
16
  Generate milestone/phase roadmap from requirements or upstream context. Three modes: create (default), revise (`--revise`), review (`--review`). For formal spec documents, use `/maestro-blueprint`.
17
17
 
18
- Pipeline: brainstorm/blueprint/analyze → **roadmap** → analyze {phase} → plan → execute.
18
+ Pipeline: brainstorm/blueprint/analyze → **roadmap** → analyze {milestone} → plan {milestone} → execute.
19
19
  </purpose>
20
20
 
21
21
  <required_reading>
@@ -60,7 +60,7 @@ Follows @~/.maestro/workflows/interview-mechanics.md standard.
60
60
 
61
61
  **Interaction mode**: convergent menu-driven
62
62
  **Decision tree** (strict order): mode (create / revise / review) → requirement scope (MVP / complete / phased) → decomposition strategy (progressive / direct / auto) → milestone boundaries → phase dependencies and order
63
- **Scope guard**: only roadmap shape; do not pre-resolve intra-phase task breakdown (belongs to plan)
63
+ **Scope guard**: only roadmap shape; do not pre-resolve task breakdown or phase decomposition (belongs to plan)
64
64
  **Writeback target**: .workflow/roadmap.md "Roadmap Decisions" section (create if absent)
65
65
  **Additional skip conditions**: --revise, --review (skip to respective mode)
66
66
  **Exit condition**: on consensus or explicit user signal → finalize Roadmap Decisions section
@@ -43,6 +43,8 @@ Remaining → intent
43
43
  | `wf-plan` | `{ context_dir?, from?, phase?, scope?, specs?, gaps?, quick? }` |
44
44
  | `wf-execute` | `{ plan_dir, specs?, codebase_context?, wiki_context?, auto_commit? }` |
45
45
  | `wf-milestone-audit` | `{ milestone?, is_adhoc? }` |
46
+
47
+ **Output boundary**: ALL file writes MUST target `.workflow/scratch/{YYYYMMDD}-swarm-{script}-{slug}/` (results, ralph-compatible artifacts). When inside a ralph session, writes target the corresponding step's scratch directory. NEVER modify source code, workflow scripts (`~/.maestro/workflows/swarm/`), or `.claude/commands/` files.
46
48
  </context>
47
49
 
48
50
  <state_machine>
@@ -196,6 +198,29 @@ Workflow 返回 JSON 后:
196
198
  6. **结果必须展示** — Workflow 返回后必须向用户展示格式化摘要,不得静默完成
197
199
  </invariants>
198
200
 
201
+ <execution>
202
+
203
+ ### Phase Gates (MANDATORY, BLOCKING)
204
+
205
+ **GATE 1: Parse → Route**
206
+ - REQUIRED: Intent text or `--script` flag parsed successfully.
207
+ - BLOCKED if: no intent and no `--script` (E001).
208
+
209
+ **GATE 2: Route → Context Assembly**
210
+ - REQUIRED: Target script resolved unambiguously (single match or user-selected from candidates).
211
+ - BLOCKED if: ambiguous routing without user resolution (E002).
212
+
213
+ **GATE 3: Context → Dispatch**
214
+ - REQUIRED: Args payload assembled with all required fields for target script.
215
+ - REQUIRED: Script file exists at `~/.maestro/workflows/swarm/{script}.js`.
216
+ - BLOCKED if: script file not found (E003) or required args missing.
217
+
218
+ **GATE 4: Dispatch → Ingest**
219
+ - REQUIRED: Workflow execution completed (success or partial results available).
220
+ - BLOCKED if: Workflow execution failed entirely (E004) — offer `--resume`.
221
+
222
+ </execution>
223
+
199
224
  <appendix>
200
225
 
201
226
  ### 与 Ralph 集成
@@ -35,8 +35,37 @@ $ARGUMENTS — Tool name, keyword, or --category filter
35
35
  Empty arguments enters interactive mode: list all tools for user selection.
36
36
  </context>
37
37
 
38
+ <invariants>
39
+ 1. **Confirmation before execution** — MUST AskUserQuestion before executing tool steps; NEVER auto-execute without user consent
40
+ 2. **Sequential step execution** — steps MUST be executed in defined order; NEVER skip or reorder steps unless user explicitly requests skip
41
+ 3. **Blocker escalation** — step failure MUST be reported to user with retry/skip/abort options; NEVER silently skip failed steps
42
+ 4. **Read-only tool definition** — tool execution MUST NOT modify the tool's knowhow document or spec entry; only the target codebase is modified per tool steps
43
+ 5. **Progress feedback** — each completed step MUST report `[Step N/M] done — <step_name>`; NEVER execute silently
44
+ 6. **Output boundary** — file writes are governed by the individual tool's step definitions. This command itself writes NO files beyond what the loaded tool prescribes
45
+ </invariants>
46
+
38
47
  <execution>
39
48
 
49
+ ### Phase Gates (MANDATORY, BLOCKING)
50
+
51
+ **GATE 1: Parse → Load**
52
+ - REQUIRED: Tool name, keyword, or --category parsed from arguments (or empty for interactive mode).
53
+ - BLOCKED if: invalid category value.
54
+
55
+ **GATE 2: Load → Confirm**
56
+ - REQUIRED: Exactly one tool resolved (direct match or user selection from candidates).
57
+ - REQUIRED: Tool document loaded and steps extracted (ref entries expanded via `maestro load --type knowhow`).
58
+ - BLOCKED if: E001 (no match found), E002 unresolved (multiple matches without user selection).
59
+
60
+ **GATE 3: Confirm → Execute**
61
+ - REQUIRED: User confirmed execution mode via AskUserQuestion (execute as-is / adjust / view only).
62
+ - BLOCKED if: user selects "View only" — display steps and END without execution.
63
+
64
+ **GATE 4: Execute → Report**
65
+ - REQUIRED: All steps attempted (completed, skipped with user approval, or aborted by user).
66
+ - REQUIRED: Results collected for each step (success/skip/fail).
67
+ - BLOCKED if: user chose abort mid-execution — report partial results and END.
68
+
40
69
  ### Step 1: Load Tool
41
70
 
42
71
  **By name**:
@@ -35,8 +35,37 @@ $ARGUMENTS — Intent description
35
35
  ```
36
36
  </context>
37
37
 
38
+ <invariants>
39
+ 1. **Schema validation** — tool knowhow document MUST include `tool: true`, `category`, `keywords`, and `summary` in YAML frontmatter; missing fields → reject write
40
+ 2. **No duplicate names** — tool title MUST be unique within its category; duplicate detection → E002 warning with overwrite/optimize confirmation
41
+ 3. **Category required** — every tool MUST declare exactly one category from: coding, test, review, arch, debug; empty category → E003
42
+ 4. **Confirmation gate** — MUST AskUserQuestion before writing knowhow document and spec ref entry; NEVER persist without user confirmation
43
+ 5. **Promote is in-place** — promote mode MUST update existing knowhow frontmatter via `maestro wiki update`; NEVER recreate the document
44
+ 6. **Output boundary** — ALL file writes MUST target .workflow/knowhow/ (tool documents) and .workflow/specs/ (ref entries via maestro spec add) only. NEVER modify source code or files outside these paths
45
+ 7. **Description format** — first line after `### Title` MUST state "Use when ..." (usage timing); this is critical for ref entry summary visibility in spec-load
46
+ </invariants>
47
+
38
48
  <execution>
39
49
 
50
+ ### Phase Gates (MANDATORY, BLOCKING)
51
+
52
+ **GATE 1: Parse → Gather**
53
+ - REQUIRED: Mode determined (extract/generate/optimize/promote) from argument parsing.
54
+ - REQUIRED: For optimize/promote modes, target tool/document exists and is loadable.
55
+ - BLOCKED if: empty args without user response to AskUserQuestion.
56
+
57
+ **GATE 2: Gather → Write**
58
+ - REQUIRED: Tool name, category, and usage timing confirmed.
59
+ - REQUIRED: Steps extracted or generated (extract: ≥1 step, generate: user-confirmed scope).
60
+ - REQUIRED: Inline vs ref mode decided based on step count.
61
+ - REQUIRED: User confirmed via AskUserQuestion (title, category, keywords, summary, step count).
62
+ - BLOCKED if: E001 (.workflow/specs/ not initialized), E003 (no category), user cancels.
63
+
64
+ **GATE 3: Write → Verify**
65
+ - REQUIRED: Knowhow document written with `tool: true` frontmatter (or updated in-place for promote).
66
+ - REQUIRED: Spec ref entry registered (if user confirmed).
67
+ - BLOCKED if: write failed or spec add returned error.
68
+
40
69
  ### Step 1: Intent Detection
41
70
 
42
71
  Parse $ARGUMENTS to determine mode:
@@ -33,8 +33,19 @@ Flags:
33
33
  - `--package-name <name>`: Package name for reference output (default: auto-generated from source directory)
34
34
  - `--output-dir <path>`: Output directory for reference package (default: `.workflow/reference_style`)
35
35
  - `--overwrite`: Allow overwriting existing package directory
36
+
37
+ **Output boundary**: ALL file writes MUST target the `--output-dir` path (default: `.workflow/reference_style/`) for reference packages, and `.workflow/knowhow/` for knowledge assets (via `codify-to-knowhow`). NEVER modify the source directory being analyzed.
36
38
  </context>
37
39
 
40
+ <invariants>
41
+ 1. **Source read-only** — the source path being analyzed MUST NOT be modified; extraction is purely read-only
42
+ 2. **Phase-sequential loading** — workflow files (ui-codify-extract, ui-codify-package, ui-codify-knowhow) MUST be read only when their phase starts; NEVER load all phases eagerly
43
+ 3. **User confirmation before knowhow** — Phase 3→4 gate MUST present AskUserQuestion before generating knowledge assets; NEVER auto-proceed to knowhow generation
44
+ 4. **Overwrite protection** — existing package directory MUST NOT be overwritten without `--overwrite` flag (E003)
45
+ 5. **Artifact completeness** — all 5 required artifacts MUST exist before reporting completion; NEVER skip artifact verification
46
+ 6. **Token-first extraction** — design-tokens.json MUST be generated before layout-templates.json; layout extraction depends on token foundation
47
+ </invariants>
48
+
38
49
  <execution>
39
50
  ## 1. Load UI Specs
40
51
 
@@ -33,6 +33,8 @@ Remaining → intent
33
33
  **Library locations:**
34
34
  - Fixed scripts: `~/.maestro/workflows/swarm/wf-*.js`
35
35
  - Dynamic scripts: `~/.maestro/workflows/dynamic/uwf-*.js`
36
+
37
+ **Output boundary**: ALL file writes MUST target `~/.maestro/workflows/dynamic/` (generated scripts) and `.workflow/scratch/{YYYYMMDD}-uwf-*/` (execution results). Fixed scripts at `~/.maestro/workflows/swarm/` are read-only. NEVER modify source code or `.claude/commands/` files.
36
38
  </context>
37
39
 
38
40
  <state_machine>
@@ -509,6 +511,36 @@ Findings: ${digest}
509
511
  12. **无反斜杠路径** — 字符串中路径用正斜杠(`\u`、`\a` 等会被解析为转义序列)
510
512
  </invariants>
511
513
 
514
+ <execution>
515
+
516
+ ### Phase Gates (MANDATORY, BLOCKING)
517
+
518
+ **GATE 1: Parse → Scan**
519
+ - REQUIRED: Intent text or `--from`/`--resume` flag parsed.
520
+ - BLOCKED if: no intent and no flags (E001).
521
+
522
+ **GATE 2: Scan → Design/Execute**
523
+ - REQUIRED: Library scan completed (both `swarm/` and `dynamic/` directories).
524
+ - REQUIRED: User decision if matches found (reuse existing vs generate new).
525
+ - BLOCKED if: scan fails to read script directories.
526
+
527
+ **GATE 3: Design → Generate**
528
+ - REQUIRED: Task decomposition completed with work_items, decision_points, data_flow.
529
+ - REQUIRED: Phase orchestration and adversarial pattern selection determined by depth.
530
+ - BLOCKED if: task cannot be decomposed (E002).
531
+
532
+ **GATE 4: Generate → Execute**
533
+ - REQUIRED: Script written to `~/.maestro/workflows/dynamic/uwf-{slug}.js`.
534
+ - REQUIRED: `node --check` syntax validation passed.
535
+ - REQUIRED: User confirmation via AskUserQuestion (unless resuming).
536
+ - BLOCKED if: syntax validation fails after 2 retries (E003).
537
+
538
+ **GATE 5: Execute → Persist**
539
+ - REQUIRED: Workflow execution completed via `scriptPath` invocation.
540
+ - BLOCKED if: Workflow execution failed (E004) — offer `--resume`.
541
+
542
+ </execution>
543
+
512
544
  <appendix>
513
545
 
514
546
  ### 使用示例
@@ -569,3 +601,30 @@ universal-workflow 扫描时会同时检查 swarm/ 和 dynamic/ 目录,
569
601
  | E005 | 持久化失败 | 展示脚本内容,让用户手动保存 |
570
602
 
571
603
  </appendix>
604
+
605
+ <error_codes>
606
+ | Code | Severity | Condition | Recovery |
607
+ |------|----------|-----------|----------|
608
+ | E001 | error | No intent and no --from/--resume flag | Prompt user for intent text |
609
+ | E002 | error | Task decomposition failed — cannot identify work_items | Require more specific intent description |
610
+ | E003 | error | Generated script syntax error after 2 retries | Show script content + error for manual fix |
611
+ | E004 | error | Workflow execution failed | Show error, offer --resume with runId |
612
+ | E005 | error | Script persistence failed (filesystem write error) | Show script content for manual save |
613
+ | W001 | warning | No matching scripts found in library scan | Proceed directly to S_DESIGN |
614
+ | W002 | warning | Adversarial gate confidence < 50% | Flag low-confidence decision, suggest --depth deep |
615
+ </error_codes>
616
+
617
+ <success_criteria>
618
+ - [ ] Intent parsed and flags extracted (--name, --depth, --dry-run, --from, --resume)
619
+ - [ ] Library scan completed across both swarm/ and dynamic/ directories
620
+ - [ ] User decision captured if matching scripts found (reuse vs generate)
621
+ - [ ] Task decomposition produced: work_items, decision_points, data_flow
622
+ - [ ] Adversarial pattern selected per decision_point according to depth level
623
+ - [ ] Blueprint presented to user with estimated agent count
624
+ - [ ] Script generated as pure JavaScript with all 12 generation rules enforced
625
+ - [ ] `node --check` syntax validation passed
626
+ - [ ] User confirmation obtained before execution (unless --resume)
627
+ - [ ] Workflow executed via scriptPath (not inline script string)
628
+ - [ ] Script persisted to `~/.maestro/workflows/dynamic/uwf-{slug}.js`
629
+ - [ ] Completion summary displayed with reuse/resume commands
630
+ </success_criteria>