maestro-flow 0.5.42 → 0.5.43

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 (323) hide show
  1. package/.agents/skills/domain-add/SKILL.md +3 -0
  2. package/.agents/skills/learn-decompose/SKILL.md +7 -4
  3. package/.agents/skills/learn-follow/SKILL.md +4 -2
  4. package/.agents/skills/learn-investigate/SKILL.md +8 -6
  5. package/.agents/skills/learn-second-opinion/SKILL.md +6 -3
  6. package/.agents/skills/maestro/SKILL.md +1 -1
  7. package/.agents/skills/maestro-amend/SKILL.md +1 -1
  8. package/.agents/skills/maestro-analyze/SKILL.md +1 -1
  9. package/.agents/skills/maestro-blueprint/SKILL.md +1 -1
  10. package/.agents/skills/maestro-brainstorm/SKILL.md +4 -1
  11. package/.agents/skills/maestro-collab/SKILL.md +6 -2
  12. package/.agents/skills/maestro-companion/SKILL.md +4 -1
  13. package/.agents/skills/maestro-composer/SKILL.md +4 -2
  14. package/.agents/skills/maestro-execute/SKILL.md +26 -8
  15. package/.agents/skills/maestro-fork/SKILL.md +4 -3
  16. package/.agents/skills/maestro-grill/SKILL.md +1 -1
  17. package/.agents/skills/maestro-guard/SKILL.md +2 -2
  18. package/.agents/skills/maestro-impeccable/SKILL.md +2 -1
  19. package/.agents/skills/maestro-init/SKILL.md +1 -1
  20. package/.agents/skills/maestro-merge/SKILL.md +12 -1
  21. package/.agents/skills/maestro-milestone-audit/SKILL.md +1 -0
  22. package/.agents/skills/maestro-milestone-complete/SKILL.md +8 -3
  23. package/.agents/skills/maestro-milestone-release/SKILL.md +8 -4
  24. package/.agents/skills/maestro-overlay/SKILL.md +9 -0
  25. package/.agents/skills/maestro-plan/SKILL.md +1 -0
  26. package/.agents/skills/maestro-player/SKILL.md +2 -2
  27. package/.agents/skills/maestro-quick/SKILL.md +5 -3
  28. package/.agents/skills/maestro-ralph/SKILL.md +8 -8
  29. package/.agents/skills/maestro-ralph-cli/SKILL.md +665 -0
  30. package/.agents/skills/maestro-ralph-cli-execute/SKILL.md +239 -0
  31. package/.agents/skills/maestro-ralph-execute/SKILL.md +127 -11
  32. package/.agents/skills/maestro-roadmap/SKILL.md +1 -1
  33. package/.agents/skills/maestro-swarm-workflow/SKILL.md +16 -14
  34. package/.agents/skills/maestro-tools-register/SKILL.md +16 -1
  35. package/.agents/skills/maestro-ui-codify/SKILL.md +11 -1
  36. package/.agents/skills/maestro-universal-workflow/SKILL.md +28 -5
  37. package/.agents/skills/maestro-update/SKILL.md +10 -7
  38. package/.agents/skills/manage-codebase-rebuild/SKILL.md +5 -1
  39. package/.agents/skills/manage-drift-realign/SKILL.md +6 -2
  40. package/.agents/skills/manage-harvest/SKILL.md +4 -1
  41. package/.agents/skills/manage-issue-discover/SKILL.md +1 -0
  42. package/.agents/skills/manage-kg-extractors/SKILL.md +5 -1
  43. package/.agents/skills/manage-knowhow-capture/SKILL.md +1 -0
  44. package/.agents/skills/manage-knowledge-audit/SKILL.md +3 -0
  45. package/.agents/skills/manage-wiki/SKILL.md +1 -0
  46. package/.agents/skills/odyssey-debug/SKILL.md +2 -1
  47. package/.agents/skills/odyssey-improve/SKILL.md +2 -2
  48. package/.agents/skills/odyssey-planex/SKILL.md +8 -7
  49. package/.agents/skills/odyssey-review-test-fix/SKILL.md +4 -1
  50. package/.agents/skills/odyssey-ui/SKILL.md +4 -4
  51. package/.agents/skills/quality-auto-test/SKILL.md +11 -1
  52. package/.agents/skills/quality-debug/SKILL.md +16 -2
  53. package/.agents/skills/quality-retrospective/SKILL.md +9 -1
  54. package/.agents/skills/quality-review/SKILL.md +8 -0
  55. package/.agents/skills/quality-sync/SKILL.md +2 -2
  56. package/.agents/skills/quality-test/SKILL.md +9 -1
  57. package/.agents/skills/security-audit/SKILL.md +14 -4
  58. package/.agents/skills/spec-add/SKILL.md +5 -2
  59. package/.agents/skills/spec-load/SKILL.md +1 -1
  60. package/.agents/skills/spec-remove/SKILL.md +1 -1
  61. package/.agents/skills/spec-setup/SKILL.md +3 -0
  62. package/.agy/skills/domain-add/SKILL.md +3 -0
  63. package/.agy/skills/learn-decompose/SKILL.md +7 -4
  64. package/.agy/skills/learn-follow/SKILL.md +4 -2
  65. package/.agy/skills/learn-investigate/SKILL.md +8 -6
  66. package/.agy/skills/learn-second-opinion/SKILL.md +6 -3
  67. package/.agy/skills/maestro/SKILL.md +1 -1
  68. package/.agy/skills/maestro-amend/SKILL.md +1 -1
  69. package/.agy/skills/maestro-analyze/SKILL.md +1 -1
  70. package/.agy/skills/maestro-blueprint/SKILL.md +1 -1
  71. package/.agy/skills/maestro-brainstorm/SKILL.md +4 -1
  72. package/.agy/skills/maestro-collab/SKILL.md +6 -2
  73. package/.agy/skills/maestro-companion/SKILL.md +4 -1
  74. package/.agy/skills/maestro-composer/SKILL.md +4 -2
  75. package/.agy/skills/maestro-execute/SKILL.md +26 -8
  76. package/.agy/skills/maestro-fork/SKILL.md +4 -3
  77. package/.agy/skills/maestro-grill/SKILL.md +1 -1
  78. package/.agy/skills/maestro-guard/SKILL.md +2 -2
  79. package/.agy/skills/maestro-impeccable/SKILL.md +2 -1
  80. package/.agy/skills/maestro-init/SKILL.md +1 -1
  81. package/.agy/skills/maestro-merge/SKILL.md +12 -1
  82. package/.agy/skills/maestro-milestone-audit/SKILL.md +1 -0
  83. package/.agy/skills/maestro-milestone-complete/SKILL.md +8 -3
  84. package/.agy/skills/maestro-milestone-release/SKILL.md +8 -4
  85. package/.agy/skills/maestro-overlay/SKILL.md +9 -0
  86. package/.agy/skills/maestro-plan/SKILL.md +1 -0
  87. package/.agy/skills/maestro-player/SKILL.md +2 -2
  88. package/.agy/skills/maestro-quick/SKILL.md +5 -3
  89. package/.agy/skills/maestro-ralph/SKILL.md +8 -8
  90. package/.agy/skills/maestro-ralph-cli/SKILL.md +661 -0
  91. package/.agy/skills/maestro-ralph-cli-execute/SKILL.md +235 -0
  92. package/.agy/skills/maestro-ralph-execute/SKILL.md +127 -11
  93. package/.agy/skills/maestro-roadmap/SKILL.md +1 -1
  94. package/.agy/skills/maestro-swarm-workflow/SKILL.md +16 -14
  95. package/.agy/skills/maestro-tools-register/SKILL.md +16 -1
  96. package/.agy/skills/maestro-ui-codify/SKILL.md +11 -1
  97. package/.agy/skills/maestro-universal-workflow/SKILL.md +28 -5
  98. package/.agy/skills/maestro-update/SKILL.md +10 -7
  99. package/.agy/skills/manage-codebase-rebuild/SKILL.md +5 -1
  100. package/.agy/skills/manage-drift-realign/SKILL.md +6 -2
  101. package/.agy/skills/manage-harvest/SKILL.md +4 -1
  102. package/.agy/skills/manage-issue-discover/SKILL.md +1 -0
  103. package/.agy/skills/manage-kg-extractors/SKILL.md +5 -1
  104. package/.agy/skills/manage-knowhow-capture/SKILL.md +1 -0
  105. package/.agy/skills/manage-knowledge-audit/SKILL.md +3 -0
  106. package/.agy/skills/manage-wiki/SKILL.md +1 -0
  107. package/.agy/skills/odyssey-debug/SKILL.md +2 -1
  108. package/.agy/skills/odyssey-improve/SKILL.md +2 -2
  109. package/.agy/skills/odyssey-planex/SKILL.md +8 -7
  110. package/.agy/skills/odyssey-review-test-fix/SKILL.md +4 -1
  111. package/.agy/skills/odyssey-ui/SKILL.md +4 -4
  112. package/.agy/skills/quality-auto-test/SKILL.md +11 -1
  113. package/.agy/skills/quality-debug/SKILL.md +16 -2
  114. package/.agy/skills/quality-retrospective/SKILL.md +9 -1
  115. package/.agy/skills/quality-review/SKILL.md +8 -0
  116. package/.agy/skills/quality-sync/SKILL.md +2 -2
  117. package/.agy/skills/quality-test/SKILL.md +9 -1
  118. package/.agy/skills/security-audit/SKILL.md +14 -4
  119. package/.agy/skills/spec-add/SKILL.md +5 -2
  120. package/.agy/skills/spec-load/SKILL.md +1 -1
  121. package/.agy/skills/spec-remove/SKILL.md +1 -1
  122. package/.agy/skills/spec-setup/SKILL.md +3 -0
  123. package/.claude/commands/domain-add.md +3 -0
  124. package/.claude/commands/learn-decompose.md +7 -4
  125. package/.claude/commands/learn-follow.md +4 -2
  126. package/.claude/commands/learn-investigate.md +8 -6
  127. package/.claude/commands/learn-second-opinion.md +6 -3
  128. package/.claude/commands/maestro-amend.md +1 -1
  129. package/.claude/commands/maestro-analyze.md +1 -1
  130. package/.claude/commands/maestro-blueprint.md +1 -1
  131. package/.claude/commands/maestro-brainstorm.md +4 -1
  132. package/.claude/commands/maestro-collab.md +6 -2
  133. package/.claude/commands/maestro-companion.md +4 -1
  134. package/.claude/commands/maestro-composer.md +4 -2
  135. package/.claude/commands/maestro-execute.md +26 -8
  136. package/.claude/commands/maestro-fork.md +4 -3
  137. package/.claude/commands/maestro-grill.md +1 -1
  138. package/.claude/commands/maestro-guard.md +2 -2
  139. package/.claude/commands/maestro-impeccable.md +2 -1
  140. package/.claude/commands/maestro-init.md +1 -1
  141. package/.claude/commands/maestro-merge.md +12 -1
  142. package/.claude/commands/maestro-milestone-audit.md +1 -0
  143. package/.claude/commands/maestro-milestone-complete.md +8 -3
  144. package/.claude/commands/maestro-milestone-release.md +8 -4
  145. package/.claude/commands/maestro-overlay.md +9 -0
  146. package/.claude/commands/maestro-plan.md +1 -0
  147. package/.claude/commands/maestro-player.md +2 -2
  148. package/.claude/commands/maestro-quick.md +5 -3
  149. package/.claude/commands/maestro-ralph-cli-execute.md +237 -0
  150. package/.claude/commands/maestro-ralph-cli.md +663 -0
  151. package/.claude/commands/maestro-ralph-execute.md +127 -11
  152. package/.claude/commands/maestro-ralph.md +8 -8
  153. package/.claude/commands/maestro-roadmap.md +1 -1
  154. package/.claude/commands/maestro-swarm-workflow.md +16 -14
  155. package/.claude/commands/maestro-tools-register.md +16 -1
  156. package/.claude/commands/maestro-ui-codify.md +11 -1
  157. package/.claude/commands/maestro-universal-workflow.md +28 -5
  158. package/.claude/commands/maestro-update.md +10 -7
  159. package/.claude/commands/maestro.md +1 -1
  160. package/.claude/commands/manage-codebase-rebuild.md +5 -1
  161. package/.claude/commands/manage-drift-realign.md +6 -2
  162. package/.claude/commands/manage-harvest.md +4 -1
  163. package/.claude/commands/manage-issue-discover.md +1 -0
  164. package/.claude/commands/manage-kg-extractors.md +5 -1
  165. package/.claude/commands/manage-knowhow-capture.md +1 -0
  166. package/.claude/commands/manage-knowledge-audit.md +3 -0
  167. package/.claude/commands/manage-wiki.md +1 -0
  168. package/.claude/commands/odyssey-debug.md +2 -1
  169. package/.claude/commands/odyssey-improve.md +2 -2
  170. package/.claude/commands/odyssey-planex.md +8 -7
  171. package/.claude/commands/odyssey-review-test-fix.md +4 -1
  172. package/.claude/commands/odyssey-ui.md +4 -4
  173. package/.claude/commands/quality-auto-test.md +11 -1
  174. package/.claude/commands/quality-debug.md +16 -2
  175. package/.claude/commands/quality-retrospective.md +9 -1
  176. package/.claude/commands/quality-review.md +8 -0
  177. package/.claude/commands/quality-sync.md +2 -2
  178. package/.claude/commands/quality-test.md +9 -1
  179. package/.claude/commands/security-audit.md +14 -4
  180. package/.claude/commands/spec-add.md +5 -2
  181. package/.claude/commands/spec-load.md +1 -1
  182. package/.claude/commands/spec-remove.md +1 -1
  183. package/.claude/commands/spec-setup.md +3 -0
  184. package/.codex/skills/codify-to-knowhow/SKILL.md +27 -15
  185. package/.codex/skills/domain-add/SKILL.md +5 -3
  186. package/.codex/skills/learn-decompose/SKILL.md +22 -4
  187. package/.codex/skills/learn-follow/SKILL.md +12 -6
  188. package/.codex/skills/learn-investigate/SKILL.md +11 -6
  189. package/.codex/skills/learn-retro/SKILL.md +12 -6
  190. package/.codex/skills/learn-second-opinion/SKILL.md +11 -3
  191. package/.codex/skills/maestro/SKILL.md +19 -13
  192. package/.codex/skills/maestro-amend/SKILL.md +10 -2
  193. package/.codex/skills/maestro-analyze/SKILL.md +7 -1
  194. package/.codex/skills/maestro-blueprint/SKILL.md +1 -1
  195. package/.codex/skills/maestro-brainstorm/SKILL.md +11 -8
  196. package/.codex/skills/maestro-collab/SKILL.md +5 -5
  197. package/.codex/skills/maestro-companion/SKILL.md +4 -1
  198. package/.codex/skills/maestro-composer/SKILL.md +6 -3
  199. package/.codex/skills/maestro-execute/SKILL.md +11 -8
  200. package/.codex/skills/maestro-fork/SKILL.md +4 -3
  201. package/.codex/skills/maestro-grill/SKILL.md +1 -1
  202. package/.codex/skills/maestro-guard/SKILL.md +1 -1
  203. package/.codex/skills/maestro-impeccable/SKILL.md +5 -5
  204. package/.codex/skills/maestro-init/SKILL.md +3 -2
  205. package/.codex/skills/maestro-milestone-audit/SKILL.md +21 -9
  206. package/.codex/skills/maestro-milestone-complete/SKILL.md +3 -3
  207. package/.codex/skills/maestro-milestone-release/SKILL.md +18 -1
  208. package/.codex/skills/maestro-next/SKILL.md +11 -10
  209. package/.codex/skills/maestro-overlay/SKILL.md +16 -6
  210. package/.codex/skills/maestro-player/SKILL.md +11 -5
  211. package/.codex/skills/maestro-quick/SKILL.md +2 -2
  212. package/.codex/skills/maestro-ralph/SKILL.md +44 -31
  213. package/.codex/skills/maestro-ralph-cli/SKILL.md +394 -0
  214. package/.codex/skills/maestro-ralph-cli-execute/SKILL.md +146 -0
  215. package/.codex/skills/maestro-ralph-execute/SKILL.md +105 -24
  216. package/.codex/skills/maestro-roadmap/SKILL.md +8 -2
  217. package/.codex/skills/maestro-tools-execute/SKILL.md +8 -4
  218. package/.codex/skills/maestro-tools-register/SKILL.md +10 -6
  219. package/.codex/skills/maestro-ui-codify/SKILL.md +14 -9
  220. package/.codex/skills/manage-codebase-rebuild/SKILL.md +36 -14
  221. package/.codex/skills/manage-codebase-refresh/SKILL.md +1 -1
  222. package/.codex/skills/manage-drift-realign/SKILL.md +15 -12
  223. package/.codex/skills/manage-harvest/SKILL.md +1 -1
  224. package/.codex/skills/manage-issue/SKILL.md +8 -4
  225. package/.codex/skills/manage-issue-discover/SKILL.md +15 -14
  226. package/.codex/skills/manage-knowhow/SKILL.md +3 -2
  227. package/.codex/skills/manage-knowhow-capture/SKILL.md +4 -3
  228. package/.codex/skills/manage-learn/SKILL.md +2 -2
  229. package/.codex/skills/odyssey-debug/SKILL.md +12 -7
  230. package/.codex/skills/odyssey-improve/SKILL.md +11 -6
  231. package/.codex/skills/odyssey-planex/SKILL.md +14 -8
  232. package/.codex/skills/odyssey-review-test-fix/SKILL.md +12 -7
  233. package/.codex/skills/odyssey-ui/SKILL.md +10 -5
  234. package/.codex/skills/quality-auto-test/SKILL.md +13 -5
  235. package/.codex/skills/quality-debug/SKILL.md +18 -11
  236. package/.codex/skills/quality-refactor/SKILL.md +4 -4
  237. package/.codex/skills/quality-retrospective/SKILL.md +5 -6
  238. package/.codex/skills/quality-review/SKILL.md +18 -11
  239. package/.codex/skills/quality-sync/SKILL.md +2 -2
  240. package/.codex/skills/quality-test/SKILL.md +7 -5
  241. package/.codex/skills/security-audit/SKILL.md +7 -5
  242. package/.codex/skills/spec-add/SKILL.md +9 -7
  243. package/.codex/skills/spec-load/SKILL.md +3 -2
  244. package/.codex/skills/spec-map/SKILL.md +10 -1
  245. package/.codex/skills/spec-remove/SKILL.md +3 -2
  246. package/.codex/skills/team-coordinate/SKILL.md +10 -4
  247. package/.codex/skills/team-lifecycle-v4/SKILL.md +33 -26
  248. package/.codex/skills/team-quality-assurance/SKILL.md +43 -0
  249. package/.codex/skills/team-review/SKILL.md +50 -6
  250. package/.codex/skills/team-tech-debt/SKILL.md +53 -7
  251. package/.codex/skills/team-testing/SKILL.md +50 -2
  252. package/.codex/skills/wiki-connect/SKILL.md +3 -1
  253. package/.codex/skills/wiki-digest/SKILL.md +6 -4
  254. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.d.ts +16 -0
  255. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +419 -44
  256. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -1
  257. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +43 -5
  258. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  259. package/dashboard/dist-server/src/graph/kg/db/types.d.ts +3 -0
  260. package/dashboard/dist-server/src/graph/kg/embedding/code-embedding.d.ts +46 -0
  261. package/dashboard/dist-server/src/graph/kg/embedding/code-embedding.js +329 -0
  262. package/dashboard/dist-server/src/graph/kg/embedding/code-embedding.js.map +1 -0
  263. package/dashboard/dist-server/src/graph/kg/embedding/index.d.ts +2 -0
  264. package/dashboard/dist-server/src/graph/kg/embedding/index.js +3 -0
  265. package/dashboard/dist-server/src/graph/kg/embedding/index.js.map +1 -0
  266. package/dashboard/dist-server/src/graph/kg/engine.d.ts +19 -1
  267. package/dashboard/dist-server/src/graph/kg/engine.js +71 -1
  268. package/dashboard/dist-server/src/graph/kg/engine.js.map +1 -1
  269. package/dashboard/dist-server/src/graph/kg/query/scoring.d.ts +5 -0
  270. package/dashboard/dist-server/src/graph/kg/query/scoring.js +85 -1
  271. package/dashboard/dist-server/src/graph/kg/query/scoring.js.map +1 -1
  272. package/dashboard/dist-server/src/graph/kg/query/search.d.ts +7 -0
  273. package/dashboard/dist-server/src/graph/kg/query/search.js +117 -1
  274. package/dashboard/dist-server/src/graph/kg/query/search.js.map +1 -1
  275. package/dashboard/dist-server/src/graph/kg/surface/mcp-tools.js +49 -0
  276. package/dashboard/dist-server/src/graph/kg/surface/mcp-tools.js.map +1 -1
  277. package/dashboard/dist-server/src/hooks/kg-sync-hook.js +3 -0
  278. package/dashboard/dist-server/src/hooks/kg-sync-hook.js.map +1 -1
  279. package/dist/src/core/plugin-bridge.d.ts.map +1 -1
  280. package/dist/src/core/plugin-bridge.js +17 -0
  281. package/dist/src/core/plugin-bridge.js.map +1 -1
  282. package/dist/src/graph/kg/db/types.d.ts +3 -0
  283. package/dist/src/graph/kg/db/types.d.ts.map +1 -1
  284. package/dist/src/graph/kg/embedding/code-embedding.d.ts +47 -0
  285. package/dist/src/graph/kg/embedding/code-embedding.d.ts.map +1 -0
  286. package/dist/src/graph/kg/embedding/code-embedding.js +329 -0
  287. package/dist/src/graph/kg/embedding/code-embedding.js.map +1 -0
  288. package/dist/src/graph/kg/embedding/index.d.ts +3 -0
  289. package/dist/src/graph/kg/embedding/index.d.ts.map +1 -0
  290. package/dist/src/graph/kg/embedding/index.js +3 -0
  291. package/dist/src/graph/kg/embedding/index.js.map +1 -0
  292. package/dist/src/graph/kg/engine.d.ts +19 -1
  293. package/dist/src/graph/kg/engine.d.ts.map +1 -1
  294. package/dist/src/graph/kg/engine.js +71 -1
  295. package/dist/src/graph/kg/engine.js.map +1 -1
  296. package/dist/src/graph/kg/query/scoring.d.ts +5 -0
  297. package/dist/src/graph/kg/query/scoring.d.ts.map +1 -1
  298. package/dist/src/graph/kg/query/scoring.js +85 -1
  299. package/dist/src/graph/kg/query/scoring.js.map +1 -1
  300. package/dist/src/graph/kg/query/search.d.ts +7 -0
  301. package/dist/src/graph/kg/query/search.d.ts.map +1 -1
  302. package/dist/src/graph/kg/query/search.js +117 -1
  303. package/dist/src/graph/kg/query/search.js.map +1 -1
  304. package/dist/src/graph/kg/surface/mcp-tools.d.ts.map +1 -1
  305. package/dist/src/graph/kg/surface/mcp-tools.js +49 -0
  306. package/dist/src/graph/kg/surface/mcp-tools.js.map +1 -1
  307. package/dist/src/hooks/kg-sync-hook.d.ts.map +1 -1
  308. package/dist/src/hooks/kg-sync-hook.js +3 -0
  309. package/dist/src/hooks/kg-sync-hook.js.map +1 -1
  310. package/dist/src/tools/code-semantic-search.d.ts +10 -0
  311. package/dist/src/tools/code-semantic-search.d.ts.map +1 -0
  312. package/dist/src/tools/code-semantic-search.js +81 -0
  313. package/dist/src/tools/code-semantic-search.js.map +1 -0
  314. package/dist/src/tools/index.d.ts.map +1 -1
  315. package/dist/src/tools/index.js +4 -0
  316. package/dist/src/tools/index.js.map +1 -1
  317. package/dist/src/tools/wiki-search.d.ts +13 -0
  318. package/dist/src/tools/wiki-search.d.ts.map +1 -0
  319. package/dist/src/tools/wiki-search.js +114 -0
  320. package/dist/src/tools/wiki-search.js.map +1 -0
  321. package/dist/src/utils/update-notices.js +12 -0
  322. package/dist/src/utils/update-notices.js.map +1 -1
  323. package/package.json +4 -1
@@ -0,0 +1,235 @@
1
+ ---
2
+ name: maestro-ralph-cli-execute
3
+ description: Skill execution wrapper for delegate — execute skill, return structured result
4
+ argument-hint: --session <id> | <skill-name> [args...]
5
+ allowed-tools:
6
+ - ask_question
7
+ - grep_search
8
+ - replace_file_content
9
+ - run_command
10
+ - view_file
11
+ - write_to_file
12
+ ---
13
+ <purpose>
14
+ Thin execution wrapper for CLI delegation.
15
+
16
+ Job: receive session ID (or skill name + args) → load via `maestro ralph next` → execute the skill → scan artifacts → output structured `---RESULT---` block.
17
+
18
+ This command does NOT manage sessions, compose prompts, make decisions, or call `maestro ralph complete`. Completion 由 orchestrator (`/maestro-ralph-cli`) 负责:orchestrator 解析 `---RESULT---` 块后调用 `maestro ralph complete N --status <STATUS> --summary <SUMMARY> [--evidence ...] [--decisions ...] [--caveats ...] [--deferred ...]`,清 `active_step_index`。
19
+ </purpose>
20
+
21
+ <context>
22
+ $ARGUMENTS — `--session <id>` (session mode) 或 `<skill-name> [args...]` (direct mode)
23
+
24
+ **Parse:**
25
+ ```
26
+ --session <id> → session_id (session mode: skill 由 ralph next 从 status.json 解析,无需传 skill name)
27
+ First token → skill_name (direct mode only, e.g., maestro-plan, maestro-execute)
28
+ Remaining → skill_args (direct mode only)
29
+ ```
30
+
31
+ `<execution_context>` 块由 ralph-cli delegation prompt 注入于 `$ARGUMENTS` 之前,含 intent、boundary、goals 等,透传给 skill。
32
+ </context>
33
+
34
+ <invariants>
35
+ 1. **Execute exactly one skill** — session mode 由 `ralph next` 解析,direct mode 由 skill_name 确定;执行一次即返回
36
+ 2. **Structured output** — always end with `---RESULT---` / `---END---` block
37
+ 3. **No session management** — never create/modify sessions, make decisions, or call `maestro ralph complete`(completion 由 orchestrator 负责)
38
+ 4. **No self-invocation** — execute once and return
39
+ 5. **Artifact scanning** — after skill execution, scan for produced artifacts
40
+ 6. **Required reading 由 CLI 负责** — session mode 下 `ralph next` 自动展开 + 加载 `<required_reading>`,缺失 → exit 1(E007),cli-execute 不手动处理
41
+ 7. **Deferred reading 只记录** — `<deferred_reading>` 路径由 CLI 记录到 `step.load.deferred_files`,执行阶段按需 Read,不提前批量读取
42
+ 8. **并发保护** — 同一 session 最多一个 step 持 `active_step_index`;`ralph next` exit 3 表示冲突,不静默推进
43
+ 9. **STATUS 枚举受限** — 仅 `DONE | DONE_WITH_CONCERNS | NEEDS_RETRY | BLOCKED`;`NEEDS_CONTEXT` 已废除
44
+ 10. **CLI 输出禁止截断** — `maestro ralph next` 的 stdout 必须全量捕获,严禁 `| head`/`| tail` 等截断管道
45
+ </invariants>
46
+
47
+ <state_machine>
48
+
49
+ <states>
50
+ S_PARSE — 解析 skill name + args PERSIST: —
51
+ S_EXECUTE — 执行 skill PERSIST: —
52
+ S_SCAN — 扫描产物 + 提取信号 PERSIST: —
53
+ S_OUTPUT — 输出结构化结果 PERSIST: —
54
+ </states>
55
+
56
+ <transitions>
57
+ S_PARSE → S_EXECUTE DO: A_PARSE_ARGS
58
+ S_EXECUTE → S_SCAN DO: A_EXECUTE_SKILL
59
+ S_SCAN → S_OUTPUT DO: A_SCAN_ARTIFACTS
60
+ S_OUTPUT → END DO: A_OUTPUT_RESULT
61
+ </transitions>
62
+
63
+ <actions>
64
+
65
+ ### A_PARSE_ARGS
66
+
67
+ 1. Parse `--session <id>` → `session_id`(session mode)
68
+ 2. 无 `--session` → extract `skill_name`(first token)and `skill_args`(remaining)为 direct mode
69
+ 3. Parse `<execution_context>` block from delegation prompt if present:
70
+ ```
71
+ intent, phase, boundary_contract, active_goals, execution_criteria
72
+ ```
73
+
74
+ ### A_EXECUTE_SKILL
75
+
76
+ 1. If `session_id` present → `run_command("maestro ralph next --session {session_id}")` — CLI loads skill + required_reading, returns prompt
77
+ - **必须全量捕获 stdout,严禁 `| head`/`| tail` 等任何截断管道**(stdout 含完整 skill prompt,截断会导致执行内容不完整)
78
+ - Exit 0 → 按 stdout 内联执行(stdout 含 CLI 拼接好的完整 prompt + session_anchor)
79
+ - Exit 1 → required_reading 缺失或 schema 错误 → set `status = "BLOCKED"`, skip to S_OUTPUT, SUMMARY 引用 CLI stderr
80
+ - Exit 2 → 无 pending step(已全部完成)→ set `status = "DONE"`, SUMMARY = "所有 step 已完成", skip to S_OUTPUT
81
+ - Exit 3 → active_step_index 冲突(另一进程占用)→ set `status = "BLOCKED"`, SUMMARY = "并发冲突", skip to S_OUTPUT
82
+ 2. If no session → `Skill({ skill: skill_name, args: skill_args })` — direct skill call
83
+ 3. **Goal context**: `ralph next` CLI 输出的 session_anchor 已含 goal context(`ralph_protocol_version >= "2"`),无需额外注入
84
+ 4. **Deferred reading**: `ralph next` 将 `<deferred_reading>` 路径记录到 `step.load.deferred_files`,执行阶段按需 Read
85
+ 5. **Inline execution** — 按 stdout 内容执行 skill 逻辑;执行完成后进入 S_SCAN
86
+ 6. Track execution: note start time, watch for errors
87
+
88
+ ### A_SCAN_ARTIFACTS
89
+
90
+ After skill execution, scan for produced artifacts:
91
+
92
+ | Pattern | Stage signal |
93
+ |---------|-------------|
94
+ | `conclusions.json` | `analysis_dir` |
95
+ | `TASK-*.json` | `plan_dir` |
96
+ | `verification.json` | `scratch_dir` |
97
+ | `review.json` | review stage |
98
+ | `test-results.json`, `uat.md` | test stage |
99
+ | `grill-report.md` | `grill_id` |
100
+ | `.brainstorming/*` | `brainstorm_dir` |
101
+
102
+ Use `Glob` to find files created/modified during execution.
103
+
104
+ Extract signals from output:
105
+ - Artifact IDs: `ANL-xxx`, `PLN-xxx`, `BLP-xxx`
106
+ - Path signals: `scratch_dir:`, `plan_dir:`
107
+ - Phase signals: `PHASE: N`
108
+
109
+ ### A_OUTPUT_RESULT
110
+
111
+ Output structured result block.
112
+
113
+ ```
114
+ ---RESULT---
115
+ STATUS: DONE|DONE_WITH_CONCERNS|NEEDS_RETRY|BLOCKED
116
+ SUMMARY: <动词开头,≤100 字的执行总结>
117
+ ARTIFACTS: <逗号分隔的产物路径>
118
+ EVIDENCE: <验证产物路径,如 verification.json、uat.md、e2e-results.json>
119
+ DECISIONS: <本步做出的关键决策,分号分隔>
120
+ CAVEATS: <后续步骤需注意的事项;DONE_WITH_CONCERNS 时同时作为 concerns>
121
+ DEFERRED: <推迟到后续的工作项,分号分隔>
122
+ SIGNALS: <key=value 对,分号分隔,如 plan_dir=.workflow/scratch/PLN-xxx;phase=2>
123
+ ---END---
124
+ ```
125
+
126
+ **Rules:**
127
+ - STATUS 必填,从执行结果推断(仅 4 个合法值,NEEDS_CONTEXT 已废除)
128
+ - SUMMARY 必填(DONE/DONE_WITH_CONCERNS 时为 MUST),动词开头
129
+ - ARTIFACTS 列出所有新增/修改的产物文件路径
130
+ - EVIDENCE 为 SHOULD,列出验证产物路径
131
+ - DECISIONS/CAVEATS/DEFERRED 为 SHOULD,有则填
132
+ - SIGNALS 提取 A_SCAN_ARTIFACTS 发现的 key=value 对
133
+
134
+ **SIGNALS→context 映射:**
135
+
136
+ | Signal key | 写入 status.json 字段 |
137
+ |------------|----------------------|
138
+ | `analysis_dir` | `context.analysis_dir` |
139
+ | `plan_dir` | `context.plan_dir` |
140
+ | `scratch_dir` | `context.scratch_dir` |
141
+ | `grill_id` | `context.grill_id` |
142
+ | `brainstorm_dir` | `context.brainstorm_dir` |
143
+ | `blueprint_dir` | `context.blueprint_dir` |
144
+ | `ANL-xxx` | `session.analyze_macro_id` |
145
+ | `BLP-xxx` | `session.blueprint_id` |
146
+ | `phase` | `session.context.phase` |
147
+
148
+ **Stage-specific SUMMARY 提取指引:**
149
+
150
+ | Stage | SUMMARY 应包含 | EVIDENCE 来源 |
151
+ |-------|---------------|---------------|
152
+ | analyze | scope_verdict + key_findings 数量 + 依赖图摘要 | `conclusions.json` |
153
+ | plan | TASK-*.json 数量 + 主要模块 + 波次划分 | — |
154
+ | execute | 修改文件数 + verification passed/failed | `verification.json` |
155
+ | review | verdict + findings 数量 + severity 分布 | `review.json` |
156
+ | test | pass/fail 统计 | `uat.md`, `test-results.json` |
157
+ | debug | root cause + 修复内容 | — |
158
+ | grill | 核心质疑点数量 + 术语表 | `grill-report.md` |
159
+ | brainstorm | 候选方案数量 + 推荐方案 | — |
160
+
161
+ **STATUS determination:**
162
+ - Skill 正常完成 + 有产物 → `DONE`
163
+ - 完成但有 warnings/concerns → `DONE_WITH_CONCERNS`
164
+ - 执行出错但可重试 → `NEEDS_RETRY`
165
+ - 执行出错且无法重试 → `BLOCKED`
166
+
167
+ </actions>
168
+
169
+ </state_machine>
170
+
171
+ <appendix>
172
+
173
+ ### Output Example
174
+
175
+ ```
176
+ ---RESULT---
177
+ STATUS: DONE
178
+ SUMMARY: 生成 8 个 task 覆盖认证模块 3 个子系统,wave 1 含 5 个独立 task
179
+ ARTIFACTS: .workflow/scratch/PLN-20260628/TASK-001.json,.workflow/scratch/PLN-20260628/TASK-002.json,.workflow/scratch/PLN-20260628/plan.json
180
+ EVIDENCE:
181
+ DECISIONS: 选择 wave 模式分 2 波执行;JWT 和 session 分离为独立 task
182
+ CAVEATS: 模块 X 的外部 API 尚未确认,TASK-003 可能需调整
183
+ DEFERRED: 性能基准测试留到 review 后
184
+ SIGNALS: plan_dir=.workflow/scratch/PLN-20260628;PLN-xxx=PLN-20260628
185
+ ---END---
186
+ ```
187
+
188
+ ### Error Output
189
+
190
+ ```
191
+ ---RESULT---
192
+ STATUS: BLOCKED
193
+ SUMMARY: maestro-plan 执行失败:required_reading 文件 analyze-guide.md 缺失
194
+ ARTIFACTS:
195
+ EVIDENCE:
196
+ DECISIONS:
197
+ CAVEATS:
198
+ DEFERRED:
199
+ SIGNALS:
200
+ ---END---
201
+ ```
202
+
203
+ ### Error Codes
204
+
205
+ | Code | Exit | Severity | Description | STATUS |
206
+ |------|------|----------|-------------|--------|
207
+ | E006 | 1 | error | command_path 缺失/不可达 | BLOCKED |
208
+ | E007 | 1 | error | required_reading 引用文件缺失 | BLOCKED |
209
+ | E008 | 1 | error | active_step_index 与 complete idx 不匹配 | BLOCKED |
210
+ | E009 | 1 | error | step.status ≠ running(重复 complete 或非法跳跃)| BLOCKED |
211
+ | E010 | 1 | error | status.json schema 损坏 | BLOCKED |
212
+ | — | 2 | info | 无 pending step(全部已完成)| DONE |
213
+ | — | 3 | error | active_step_index 并发冲突 | BLOCKED |
214
+ | W001 | 0 | warning | Step completed with concerns | DONE_WITH_CONCERNS |
215
+
216
+ ### Success Criteria
217
+
218
+ - [ ] Session mode 只需 `--session <id>`,skill 由 `ralph next` 从 status.json 解析
219
+ - [ ] Direct mode 解析 `skill_name` + `skill_args`
220
+ - [ ] Session mode 通过 `maestro ralph next --session {id}` 加载;stdout 全量捕获,禁止截断管道
221
+ - [ ] Exit codes 完整处理:0→执行,1→BLOCKED,2→DONE,3→BLOCKED
222
+ - [ ] Execute via `maestro ralph next` (session mode) or `Skill()` (direct mode)
223
+ - [ ] Scan artifacts after execution using Glob
224
+ - [ ] Extract artifact IDs and path signals from output
225
+ - [ ] Always output `---RESULT---` / `---END---` block
226
+ - [ ] STATUS 仅 4 个合法值:DONE / DONE_WITH_CONCERNS / NEEDS_RETRY / BLOCKED
227
+ - [ ] SUMMARY 在 DONE/DONE_WITH_CONCERNS 时为 MUST(动词开头,≤100 字)
228
+ - [ ] EVIDENCE 字段列出验证产物路径
229
+ - [ ] SIGNALS 含 stage-specific key=value 对(参照 SIGNALS→context 映射表)
230
+ - [ ] Stage-specific SUMMARY 提取指引(analyze→scope_verdict,plan→TASK 数量 等)
231
+ - [ ] No session management, no self-invocation, no decisions, no `ralph complete`
232
+ - [ ] Deferred reading 按需 Read,不提前批量读取
233
+
234
+ </appendix>
235
+ </output>
@@ -59,7 +59,9 @@ HARD RULES:
59
59
  <states>
60
60
  S_LOCATE — 定位 session + 找下一个 pending step PERSIST: —
61
61
  S_RESOLVE_ARGS — 解析占位符 + 丰富参数 PERSIST: step.args (enriched)
62
+ S_LOAD_CONTEXT — 加载前序产出 + 发现 PERSIST: —
62
63
  S_EXECUTE — 执行当前 step PERSIST: step.status = "running", session.current_step
64
+ S_POST_ANALYZE — 产物 vs 目标偏离分析 PERSIST: step.drift_score, step.drift_correction
63
65
  S_POST_EXEC — 标记完成 + 传播上下文 PERSIST: step.completion_*, step.status, session.context
64
66
  S_HANDLE_FAIL — 处理失败 PERSIST: step.status, session.status
65
67
  S_COMPLETE — 所有 step 完成 PERSIST: session.status = "completed"
@@ -74,18 +76,28 @@ S_LOCATE:
74
76
  → S_FALLBACK WHEN: no running session
75
77
 
76
78
  S_RESOLVE_ARGS:
77
- S_EXECUTE DO: A_RESOLVE_ARGS
79
+ S_LOAD_CONTEXT DO: A_RESOLVE_ARGS
80
+
81
+ S_LOAD_CONTEXT:
82
+ → S_EXECUTE DO: A_LOAD_STEP_CONTEXT
78
83
 
79
84
  S_EXECUTE:
80
85
  → END WHEN: step.decision != null DO: A_EXEC_DECISION
81
- S_POST_EXEC WHEN: step.decision == null + ralph complete invoked with DONE|DONE_WITH_CONCERNS DO: A_EXEC_STEP
82
- → S_HANDLE_FAIL WHEN: step.decision == null + ralph next exit≠0 OR ralph complete with NEEDS_RETRY|BLOCKED DO: A_EXEC_STEP
86
+ S_POST_ANALYZE WHEN: step.decision == null + execution succeeded (DONE|DONE_WITH_CONCERNS) DO: A_EXEC_STEP
87
+ → S_HANDLE_FAIL WHEN: step.decision == null + ralph next exit=1 OR ralph complete with NEEDS_RETRY|BLOCKED DO: A_EXEC_STEP
88
+ → S_HANDLE_FAIL WHEN: step.decision == null + ralph next exit=3 (concurrency conflict) DO: A_HANDLE_CONCURRENCY
89
+
90
+ S_POST_ANALYZE:
91
+ → S_POST_EXEC WHEN: drift_score == ALIGNED|MINOR_DRIFT DO: A_POST_ANALYZE_DRIFT
92
+ → S_EXECUTE WHEN: drift_score == MAJOR_DRIFT + not retried DO: A_POST_ANALYZE_DRIFT (re-execute with correction)
93
+ → S_POST_EXEC WHEN: drift_score == MAJOR_DRIFT + retried DO: A_POST_ANALYZE_DRIFT (proceed with caveats)
83
94
 
84
95
  S_POST_EXEC:
85
96
  → S_LOCATE DO: run_command("maestro ralph complete ...") + Skill("maestro-ralph-execute")
86
97
  NOTE: CLI 已写完 completion_*, status, active_step_index;无需额外写盘
87
98
 
88
99
  S_HANDLE_FAIL:
100
+ → S_LOCATE WHEN: exit code 3 (concurrency conflict) DO: A_HANDLE_CONCURRENCY (wait 3s + retry)
89
101
  → S_LOCATE WHEN: auto + not retried DO: A_RETRY
90
102
  → END WHEN: auto + retried DO: A_PAUSE_SESSION
91
103
  → S_LOCATE WHEN: interactive + user selects retry DO: A_RETRY
@@ -171,6 +183,27 @@ if goal:
171
183
 
172
184
  Write enriched args + source_artifact_ref back to status.json.
173
185
 
186
+ ### A_LOAD_STEP_CONTEXT
187
+
188
+ 加载前序产出和发现,为 inline execution 注入上下文。
189
+
190
+ 1. **Previous step output** — 读前一 completed step 的 `completion_summary` + `completion_caveats` + `completion_decisions` + `completion_deferred`
191
+ 2. **Artifacts** — 按 `session.context` 中的路径逐个 Read,提取与当前 step 相关的内容:
192
+
193
+ | 当前 stage | 加载什么 | Source |
194
+ |-----------|---------|--------|
195
+ | plan | analysis conclusions + scope_verdict | `{context.analysis_dir}/conclusions.json` |
196
+ | execute | task list + wave assignments | `{context.plan_dir}/TASK-*.json` |
197
+ | review | changed files + verification results | `{context.scratch_dir}/verification.json` |
198
+ | test | review findings | `review.json` |
199
+ | debug | error traces + failing test details | 前一 step 的 `completion_evidence` |
200
+ | brainstorm | grill report | `{context.grill_id}` report |
201
+
202
+ 3. **Explore if needed** — 产物指向代码位置但缺少上下文 → `maestro explore` 补充(仅 execute/debug/test 且有文件路径引用时)
203
+ 4. **Accumulated signals** — 遍历 ALL completed steps → 聚合 caveats + deferred
204
+
205
+ 加载的内容进入会话上下文,后续 inline execution 自动受益。
206
+
174
207
  ### A_EXEC_DECISION
175
208
 
176
209
  1. Mark step running, write status.json
@@ -198,22 +231,105 @@ Write enriched args + source_artifact_ref back to status.json.
198
231
  </goal_context>
199
232
  ```
200
233
  3. **Inline execution** — 按 stdout 执行;deferred_reading 按需 Read
201
- 4. **Complete**:
234
+ 4. **Extract step signals** (A_EXTRACT_STEP_SIGNALS) — 执行完成后、调 ralph complete 前,提取结构化信号用于组装 completion 参数和下一步上下文:
235
+
236
+ **4a. Stage-specific signal extraction:**
237
+
238
+ | Stage | 提取什么 | 写入字段 |
239
+ |-------|---------|---------|
240
+ | analyze | `conclusions.json` 的 scope_verdict + key_findings; 依赖图摘要 | `--summary`, `--decisions`, context.analysis_dir |
241
+ | plan | 生成的 TASK-*.json 数量 + 主要模块; 波次划分 | `--summary`, context.plan_dir |
242
+ | execute | 修改的文件列表; verification.json passed/failed; 新 artifact ID | `--summary`, `--evidence`, context.scratch_dir |
243
+ | review | review.json verdict + findings 数量 + severity 分布 | `--summary`, `--decisions` |
244
+ | test | test-results.json pass/fail 统计; uat.md 结果 | `--summary`, `--evidence` |
245
+ | debug | root cause 描述; 修复了什么 | `--summary`, `--decisions` |
246
+ | grill | grill-report.md 核心质疑点; 术语表 | `--summary`, `--caveats`, context.grill_id |
247
+ | brainstorm | 候选方案数量 + 推荐方案 | `--summary`, `--decisions`, context.brainstorm_dir |
248
+
249
+ **4b. Compose completion params:**
250
+
251
+ | Param | 规则 | 组装方法 |
252
+ |-------|------|---------|
253
+ | `--summary` | MUST。动词开头,≤100 字。从 4a 提取的关键产出组合 | `"<动词><做了什么>,<量化结果>"` e.g. `"分析认证模块依赖图,发现 5 处 JWT 内联验证,scope=medium"` |
254
+ | `--decisions` | SHOULD。每条一个架构/技术决策(可多次 `--decisions`) | 从执行过程中做出的非显而易见的选择提取。e.g. `"选择中间件模式而非装饰器"` `"跳过 session 层重构,留给 G2"` |
255
+ | `--caveats` | SHOULD。后续 step 必须知道的约束/风险 | 从执行中发现但不属于本步解决的问题。e.g. `"session 存储层与 JWT 有隐式耦合,execute 阶段需处理"` |
256
+ | `--deferred` | SHOULD。明确推迟到后续的工作(可多次 `--deferred`) | 被主动推迟的项。e.g. `"性能基准测试留到 review 后"` `"错误码国际化不在 scope 内"` |
257
+
258
+ **4c. Context-to-next-step propagation checklist:**
259
+
260
+ | 信号 | 检查 | 传播到 |
261
+ |------|------|--------|
262
+ | PHASE 变更 | 输出含 `PHASE: N` | `session.context.phase` |
263
+ | Artifact ID | 输出含 `ANL-xxx`/`PLN-xxx`/`BLP-xxx` | `session.analyze_macro_id`/`context.plan_dir` 等 |
264
+ | Scratch dir | 输出含 `scratch_dir:` 或 `.workflow/scratch/` 路径 | `session.context.scratch_dir` |
265
+ | Plan dir | plan step 产出目录 | `session.context.plan_dir` |
266
+ | Grill ID | grill step 产出 ID | `session.context.grill_id` |
267
+ | Blueprint ID | blueprint step 产出 `BLP-xxx` | `session.blueprint_id` |
268
+
269
+ 这些信号直接写入 `status.json.context`,下一步的 session_anchor 自动携带。
270
+
271
+ 5. **Complete** — 使用 4b 组装的参数调用:
202
272
  - `run_command("maestro ralph complete N --status DONE --summary \"...\" [--evidence <path>] [--decisions \"...\"] [--caveats \"...\"] [--deferred \"...\"]")`
203
273
  - `run_command("maestro ralph complete N --status DONE_WITH_CONCERNS --summary \"...\" --concerns \"...\"")`
204
274
  - `run_command("maestro ralph retry N")`
205
275
  - `run_command("maestro ralph complete N --status BLOCKED --reason \"...\"")`
206
276
 
207
- | Param | 必填 | 格式 | 示例 |
208
- |-------|------|------|------|
209
- | `--summary` | MUST | 动词开头,≤100 字 | `"实现搜索 API 分页逻辑,新增 3 端点"` |
210
- | `--decisions` | SHOULD(可多次) | 每条一个决策 | `"选择 ELK 布局而非 dagre"` |
211
- | `--caveats` | SHOULD | 后续注意事项 | `"X 模块 e2e 暂未覆盖新端点"` |
212
- | `--deferred` | SHOULD(可多次) | 推迟工作 | `"性能优化留到 review 后"` |
213
- 5. **Propagate context signals** — 关键信号 (`PHASE: N` / `scratch_dir: path` / `BLP-xxx`) 写入 `status.json.context`
277
+ 6. **Propagate context signals** 4c checklist 将关键信号写入 `status.json.context`
214
278
 
215
279
  完成后 S_LOCATE 触发 `view_file(AbsolutePath="<agy-skills-dir>/maestro-ralph-execute/SKILL.md") + execute inline` 自调用。
216
280
 
281
+ ### A_POST_ANALYZE_DRIFT
282
+
283
+ 执行完成后、调 ralph complete 前,分析产物与目标的偏离程度并自动修正。
284
+
285
+ **1. 收集对照基准:**
286
+
287
+ | 基准来源 | 取值 |
288
+ |---------|------|
289
+ | `step.goal_ref` → goal.done_when | 子目标的完成条件 |
290
+ | `session.boundary_contract.definition_of_done` | 全局验收标准 |
291
+ | `session.execution_criteria` | 执行准则 |
292
+ | `session.intent` | 原始意图 |
293
+
294
+ **2. 读产物摘要:**
295
+
296
+ 从 A_EXTRACT_STEP_SIGNALS (step 4a) 已提取的 summary + decisions + artifacts 构建产物画像。
297
+
298
+ **3. 对比评分:**
299
+
300
+ | 维度 | 检查 |
301
+ |------|------|
302
+ | 覆盖度 | 产物是否覆盖了 goal.done_when 的每个条件 |
303
+ | 方向性 | decisions 是否与 intent 和 boundary 一致 |
304
+ | 完整性 | 预期产物类型是否齐全(如 plan 阶段应有 TASK-*.json) |
305
+
306
+ **drift_score:**
307
+ - `ALIGNED` — 全部维度通过
308
+ - `MINOR_DRIFT` — 覆盖度/完整性有小缺口,不影响后续
309
+ - `MAJOR_DRIFT` — 方向性偏离或关键产物缺失
310
+
311
+ **4. 修正动作:**
312
+
313
+ | drift_score | 动作 |
314
+ |-------------|------|
315
+ | ALIGNED | 正常进入 S_POST_EXEC |
316
+ | MINOR_DRIFT | 将偏离项追加到 completion_caveats,正常 complete |
317
+ | MAJOR_DRIFT + 未重试 | 将偏离分析写入 `step.drift_correction`,回到 S_EXECUTE 重跑(A_LOAD_STEP_CONTEXT 自动加载 drift_correction 作为修正上下文) |
318
+ | MAJOR_DRIFT + 已重试 | 将偏离项写入 caveats + concerns,以 DONE_WITH_CONCERNS complete,由后续 decision node 裁决 |
319
+
320
+ **5. 写入:**
321
+ - `step.drift_score` — ALIGNED / MINOR_DRIFT / MAJOR_DRIFT
322
+ - `step.drift_correction` — MAJOR_DRIFT 时的偏离描述 + 修正指引(供重跑时注入)
323
+
324
+ ### A_HANDLE_CONCURRENCY
325
+
326
+ Exit code 3 — `active_step_index` occupied by another process (concurrency conflict).
327
+
328
+ 1. Display: `[{index}] ⚠ Concurrency conflict — active_step_index already held`
329
+ 2. Wait 3 seconds, then re-read `status.json` to check if `active_step_index` has been cleared
330
+ 3. If cleared → return to S_LOCATE (retry the step)
331
+ 4. If still held after 2 attempts → A_PAUSE_SESSION with reason "concurrency conflict unresolved — another process may be holding the lock"
332
+
217
333
  ### A_RETRY
218
334
 
219
335
  1. `run_command("maestro ralph retry N")` — CLI 设 `step.retried = true`, `step.status = "pending"`, `step.completion_confirmed = false`, 清 `active_step_index`
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: maestro-roadmap
3
3
  description: Generate roadmap with milestone/phase structure from requirements or upstream context
4
- argument-hint: <requirement> [-y] [-c] [-m progressive|direct|auto] [--from <source>] [--revise [instructions]] [--review]
4
+ argument-hint: <requirement> [-y] [-c] [-m progressive|direct|auto] [--from <source>] [--from-brainstorm SESSION-ID] [--revise [instructions]] [--review]
5
5
  allowed-tools:
6
6
  - ask_question
7
7
  - define_subagent
@@ -91,20 +91,22 @@ S_FALLBACK:
91
91
 
92
92
  ### A_ROUTE_SCRIPT
93
93
 
94
- Intent-to-script routing(按关键词匹配,--script 优先级最高):
95
-
96
- | Keywords | Script |
97
- |----------|--------|
98
- | 分析 / analyze / 探索 / explore / 架构 / architecture / 复杂度 / 风险 | `wf-analyze` |
99
- | 头脑风暴 / brainstorm / 方案 / 设计 / 评估 / evaluate / 多角度 | `wf-brainstorm` |
100
- | 审查 / review / 代码审查 / code review / 质量 / quality | `wf-review` |
101
- | 验证 / verify / 检查 / check / 反模式 / antipattern | `wf-verify` |
102
- | 拷问 / grill / 压力测试 / stress-test / 挑战 / challenge | `wf-grill` |
103
- | 规划 / plan / 任务分解 / decompose / 分波 / wave | `wf-plan` |
104
- | 执行 / execute / 实现 / implement / 开发 / develop | `wf-execute` |
105
- | 里程碑审计 / milestone-audit / 集成检查 / integration | `wf-milestone-audit` |
106
-
107
- 多命中 ask_question 让用户选择。
94
+ Intent-to-script routing(按关键词匹配,--script 优先级最高)。
95
+
96
+ **Priority ordering** 按下表自上而下匹配,先命中先用。高优先级的具体关键词优先于低优先级的宽泛关键词(如 "grill" > "analyze","verify" > "check"):
97
+
98
+ | Priority | Keywords | Script |
99
+ |----------|----------|--------|
100
+ | 1 | 里程碑审计 / milestone-audit / 集成检查 / integration | `wf-milestone-audit` |
101
+ | 2 | 拷问 / grill / 压力测试 / stress-test / 挑战 / challenge | `wf-grill` |
102
+ | 3 | 验证 / verify / 反模式 / antipattern | `wf-verify` |
103
+ | 4 | 审查 / review / 代码审查 / code review / 质量 / quality | `wf-review` |
104
+ | 5 | 执行 / execute / 实现 / implement / 开发 / develop | `wf-execute` |
105
+ | 6 | 规划 / plan / 任务分解 / decompose / 分波 / wave | `wf-plan` |
106
+ | 7 | 头脑风暴 / brainstorm / 方案 / 评估 / evaluate / 多角度 | `wf-brainstorm` |
107
+ | 8 | 分析 / analyze / 探索 / explore / 架构 / architecture / 复杂度 / 风险 | `wf-analyze` |
108
+
109
+ **Disambiguation**: 多命中(同一优先级内多个关键词匹配不同脚本)→ ask_question 让用户选择。跨优先级命中取高优先级。
108
110
 
109
111
  ### A_ASSEMBLE_CONTEXT
110
112
 
@@ -102,6 +102,21 @@ Use when {timing/trigger condition}.
102
102
  1. Step one ...
103
103
  ```
104
104
 
105
+ **Confirm before writing** — Use `ask_question` to show the user the planned knowhow document (title, category, keywords, summary, step count) and spec ref entry before persisting:
106
+
107
+ ```
108
+ question: "确认写入以下 knowhow 工具文档?"
109
+ options:
110
+ - label: "确认写入"
111
+ description: "knowhow: {title} (category: {category}, keywords: {keywords}), spec ref entry"
112
+ - label: "修改后写入"
113
+ description: "调整 title/category/keywords 后重新确认"
114
+ - label: "取消"
115
+ description: "不写入任何文件"
116
+ ```
117
+
118
+ User confirms → proceed; user edits → re-gather; user cancels → END.
119
+
105
120
  **Create knowhow tool document** in `.workflow/knowhow/` with `tool: true` in YAML frontmatter:
106
121
  ```yaml
107
122
  ---
@@ -117,7 +132,7 @@ summary: "Use when <timing>. <scope description>"
117
132
  1. Step one ...
118
133
  ```
119
134
 
120
- **Optionally register spec ref entry** for index discoverability:
135
+ **Optionally register spec ref entry** (after user confirmation above) for index discoverability:
121
136
  ```bash
122
137
  maestro spec add <category> "<title>" "Use when <timing>. <scope summary>" --keywords "<csv>" \
123
138
  --description "<one-line summary>" --ref "knowhow/RCP-<slug>.md" --knowhow-type recipe
@@ -3,6 +3,7 @@ name: maestro-ui-codify
3
3
  description: Extract design system from code, generate reference package, persist as knowledge assets
4
4
  argument-hint: <source-path> [--package-name <name>] [--output-dir <path>] [--overwrite]
5
5
  allowed-tools:
6
+ - ask_question
6
7
  - define_subagent
7
8
  - grep_search
8
9
  - invoke_subagent
@@ -64,10 +65,19 @@ The workflow orchestrates 4 phases with deferred loading of phase-specific workf
64
65
  **GATE Phase 3 → Phase 4: Package → Knowhow**
65
66
  - REQUIRED: preview.html + preview.css generated as interactive showcase.
66
67
  - BLOCKED if missing: preview artifacts not generated — knowhow phase needs rendered reference for validation.
68
+ - REQUIRED: ask_question confirmation before proceeding to knowhow generation:
69
+ ```
70
+ question: "Preview 生成完成。是否继续将设计系统持久化为 knowhow 知识资产?"
71
+ options:
72
+ - label: "继续生成 knowhow"
73
+ description: "调用 codify-to-knowhow 写入 AST/DCS assets 和 spec entries"
74
+ - label: "仅保留 preview,跳过 knowhow"
75
+ description: "保留 preview.html + preview.css,不写入知识库"
76
+ ```
67
77
 
68
78
  **GATE Phase 4 → Completion: Knowhow → Done**
69
79
  - REQUIRED: knowhow-manifest.json created with AST/DCS assets and spec entries.
70
- - REQUIRED: codify-to-knowhow called and completed.
80
+ - REQUIRED: codify-to-knowhow called and completed (only after user confirmation at Phase 3→4 gate).
71
81
  - BLOCKED if missing: knowhow-manifest.json absent or codify-to-knowhow not invoked — knowledge assets not persisted.
72
82
 
73
83
  ### Artifact Verification (before completion)
@@ -42,6 +42,7 @@ S_SCAN — 扫描现有 workflow 库匹配 PERSIST: —
42
42
  S_DECIDE — 用户选择:复用现有 / 生成新脚本 PERSIST: —
43
43
  S_DESIGN — 分析任务、设计工作流结构 PERSIST: —
44
44
  S_GENERATE — 生成脚本 → 写入文件 → node --check 验证 PERSIST: uwf-{slug}.js
45
+ S_CONFIRM_EXEC — 确认执行前门控 PERSIST: —
45
46
  S_EXECUTE — 调用 Workflow 工具执行 PERSIST: —
46
47
  S_PERSIST — 保存脚本到 dynamic/ 目录 PERSIST: —
47
48
  </states>
@@ -57,7 +58,7 @@ S_SCAN:
57
58
  → S_DESIGN WHEN: no matches DO: A_SCAN_LIBRARY
58
59
 
59
60
  S_DECIDE:
60
- → S_EXECUTE WHEN: user picks existing script DO:
61
+ → S_EXECUTE WHEN: user picks existing script DO: A_CONFIRM_EXECUTE
61
62
  → S_DESIGN WHEN: user wants new script DO: —
62
63
  → S_DESIGN WHEN: --from specified DO: —
63
64
 
@@ -65,10 +66,15 @@ S_DESIGN:
65
66
  → S_GENERATE DO: A_DESIGN_WORKFLOW
66
67
 
67
68
  S_GENERATE:
68
- S_EXECUTE WHEN: Write + node --check pass AND NOT --dry-run DO: A_GENERATE_SCRIPT
69
- → S_PERSIST WHEN: --dry-run (file already written) DO: A_GENERATE_SCRIPT
70
- → S_GENERATE WHEN: node --check fails (retry ≤2) DO: A_GENERATE_SCRIPT (fix & retry)
71
- → END WHEN: node --check fails after 2 retries DO: report E003
69
+ S_CONFIRM_EXEC WHEN: Write + node --check pass AND NOT --dry-run DO: A_GENERATE_SCRIPT
70
+ → S_PERSIST WHEN: --dry-run (file already written) DO: A_GENERATE_SCRIPT
71
+ → S_GENERATE WHEN: node --check fails (retry ≤2) DO: A_GENERATE_SCRIPT (fix & retry)
72
+ → END WHEN: node --check fails after 2 retries DO: report E003
73
+
74
+ S_CONFIRM_EXEC:
75
+ → S_EXECUTE WHEN: user confirms execution DO: A_CONFIRM_EXECUTE
76
+ → S_PERSIST WHEN: user declines execution DO: —
77
+ → END WHEN: user cancels DO: —
72
78
 
73
79
  S_EXECUTE:
74
80
  → S_PERSIST WHEN: workflow completed DO: A_EXECUTE_WORKFLOW
@@ -283,6 +289,23 @@ run_command({ command: 'node --check "path/to/uwf-{slug}.js"' })
283
289
 
284
290
  验证通过后进入 S_EXECUTE(若非 `--dry-run`)。
285
291
 
292
+ ### A_CONFIRM_EXECUTE
293
+
294
+ Use `ask_question` to confirm before executing the generated or selected script:
295
+
296
+ ```
297
+ question: "脚本已就绪,是否执行?"
298
+ options:
299
+ - label: "执行"
300
+ description: "调用 Workflow 工具运行 {script_name}(预估 {agent_count} 个 agent)"
301
+ - label: "仅保存,不执行"
302
+ description: "保存脚本到 dynamic/ 目录,稍后手动执行"
303
+ - label: "取消"
304
+ description: "不执行也不保存"
305
+ ```
306
+
307
+ User confirms → S_EXECUTE; user declines → S_PERSIST (save only); user cancels → END.
308
+
286
309
  ### A_EXECUTE_WORKFLOW
287
310
 
288
311
  **必须用 scriptPath 调用**(不用 script 内联字符串):
@@ -20,7 +20,7 @@ $ARGUMENTS — optional flags.
20
20
 
21
21
  **Flags:**
22
22
  - `--dry-run` -- Preview migration plan without executing
23
- - `--force` -- Skip confirmation prompts
23
+ - `--force` -- Skip confirmation prompts (intended for CI/automated contexts). Migration diff is still displayed even with `--force` to maintain audit visibility.
24
24
  - `--setup-only` -- Skip schema migration, run only the setup for current version
25
25
 
26
26
  **Version source:** `.workflow/state.json` → `version` field
@@ -68,24 +68,27 @@ IF `--dry-run` → display info and EXIT.
68
68
  ### Step 3: Execute
69
69
 
70
70
  ```
71
- 1. Confirm (unless --force):
71
+ 1. Display migration diff (always — even with --force):
72
+ Show schema changes that will be applied.
73
+
74
+ 2. Confirm (unless --force):
72
75
  ask_question: "Upgrade v{current} → v{target}?"
73
76
  Options: [执行 / 取消]
74
77
 
75
- 2. Create backup:
78
+ 3. Create backup:
76
79
  Bash: cp .workflow/state.json .workflow/state.json.backup-v{current}-{timestamp}
77
80
 
78
- 3. Run schema migration (handles all intermediate steps automatically):
81
+ 4. Run schema migration (handles all intermediate steps automatically):
79
82
  Bash: npx tsx src/migrations/run.ts "$(pwd)" --json
80
83
  Parse result, display changes.
81
84
 
82
- 4. IF failed → display backup restore command → EXIT
85
+ 5. IF failed → display backup restore command → EXIT
83
86
 
84
- 5. Load version-specific setup:
87
+ 6. Load version-specific setup:
85
88
  Read: ~/.maestro/workflows/updates/update-v{target}-setup.md
86
89
  IF exists → follow completely (hooks, deps, knowledge system config)
87
90
 
88
- 6. Display: "v{current} → v{target}: done"
91
+ 7. Display: "v{current} → v{target}: done"
89
92
  ```
90
93
 
91
94
  ### Step 4: Summary
@@ -31,6 +31,8 @@ $ARGUMENTS -- optional flags.
31
31
  - `--force` -- Skip confirmation prompt and proceed directly
32
32
  - `--skip-commit` -- Do not auto-commit after rebuild
33
33
 
34
+ **Confirmation gate:** Unless `--force` is set, prompt the user (ask_question) before executing git commit. Show the list of changed files and proposed commit message. If `--skip-commit` is set, skip the commit entirely.
35
+
34
36
  **Mapper agent assignments (when `--focus` omitted):**
35
37
  | Agent | Focus | Output file |
36
38
  |-------|-------|-------------|
@@ -68,6 +70,7 @@ Follow '~/.maestro/workflows/codebase-rebuild.md' completely.
68
70
  | Code | Severity | Condition | Recovery |
69
71
  |------|----------|-----------|----------|
70
72
  | E001 | error | .workflow/ not initialized | Run maestro-init first to create .workflow/ |
73
+ | E002 | error | All 4 mapper agents failed | Abort rebuild; check agent configuration and retry |
71
74
  | W001 | warning | A mapper agent failed (partial results) | Retry failed mapper or accept partial results |
72
75
  | W002 | warning | `.workflow/codebase/` already exists -- user prompted for rebuild/skip | check_existing |
73
76
  | W003 | warning | KG validation failed (graph written with valid=false) | Review .kg-tmp/ artifacts, re-run KG pipeline |
@@ -77,7 +80,8 @@ Follow '~/.maestro/workflows/codebase-rebuild.md' completely.
77
80
  <success_criteria>
78
81
  - [ ] User confirmed rebuild (or --force used)
79
82
  - [ ] .workflow/codebase/ cleared and rebuilt from scratch (or scoped subset when --focus set)
80
- - [ ] All 4 mapper agents spawned (failures logged as W001)
83
+ - [ ] All 4 mapper agents spawned (all-fail E002; partial fail → W001)
84
+ - [ ] If not --skip-commit: user confirmed git commit (or --force used) before committing
81
85
  - [ ] doc-index.json generated and valid
82
86
  - [ ] All documentation files regenerated
83
87
  - [ ] state.json updated with rebuild timestamp