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
@@ -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: "[-y|--yes] [--concurrency N] [-c|--continue] \"<phase> [--dir <path>] [--from <source>] [--gaps] [--spec SPEC-xxx] [--collab]\""
3
+ description: Use when creating, revising, or verifying an execution plan for a milestone or task
4
+ argument-hint: "[-y|--yes] [--concurrency N] [-c|--continue] \"<milestone> [--dir <path>] [--from <source>] [--gaps] [--spec SPEC-xxx]\""
5
5
  allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, request_user_input
6
6
  ---
7
7
 
@@ -63,27 +63,24 @@ All mean: **follow the cycle anyway**.
63
63
  </tdd_mode>
64
64
 
65
65
  <context>
66
- $ARGUMENTS — phase number/text and optional flags.
66
+ $ARGUMENTS — milestone number/text and optional flags.
67
67
 
68
- **Flags**: `-y` (auto), `--concurrency N` (default 4), `-c`/`--continue` (resume), `--dir <path>`, `--from <source>` (load upstream context directly: analyze:ANL-xxx, blueprint:BLP-xxx, brainstorm:ID, @file, path), `--gaps` (issue-linked), `--spec SPEC-xxx`, `--collab`, `--revise`, `--check`, `--tdd` (RED-GREEN-REFACTOR task chains)
68
+ **Flags**: `-y` (auto), `--concurrency N` (default 4), `-c`/`--continue` (resume), `--dir <path>`, `--from <source>` (load upstream context directly: analyze:ANL-xxx, blueprint:BLP-xxx, brainstorm:ID, @file, path), `--gaps` (issue-linked), `--spec SPEC-xxx`, `--revise`, `--check`, `--tdd` (RED-GREEN-REFACTOR task chains)
69
+
70
+ > **`--collab` removed**: multi-agent collaborative planning is now automatic — milestones spanning >3 modules auto-trigger a 2+1 agent model (2 parallel planners scoped to 2-3 modules each + 1 synthesis agent that merges, runs DAG/cycle/conflict analysis, and produces a unified plan.json).
69
71
 
70
72
  **Scope routing** (priority, per redesign §5.2):
71
73
  1. `--from analyze:ANL-xxx` → CONTEXT_DIR = ANL artifact path; scope=`standalone`
72
74
  2. `--from blueprint:BLP-xxx` → CONTEXT_DIR = BLP path; scope=`standalone`
73
75
  3. `--dir <path>` → CONTEXT_DIR = path; scope=`standalone`
74
- 4. Numeric arg + roadmap → scope=`phase`; D-007 reverse-lookup milestone via `state.json.milestones[].phase_slugs`
76
+ 4. Numeric arg + roadmap → scope=`milestone`; resolve milestone from roadmap
75
77
  5. No args + roadmap → scope=`milestone` (plans all pending phases in current milestone)
76
78
  6. No args + no roadmap → search `state.json.artifacts[]` for latest `type=="analyze"` (DESC by created_at). Found → scope=`standalone`, CONTEXT_DIR = artifact.path. None → ERROR E001.
77
79
  7. Text arg + no upstream → scope=`adhoc/standalone`
78
80
 
79
- **D-007 milestone reverse lookup** (numeric scope only):
80
- ```
81
- resolve_milestone(phase_number):
82
- for ms in state.json.milestones[]:
83
- if str(phase_number) in ms.phase_slugs: return ms.id
84
- return state.json.current_milestone # fallback
85
- ```
86
- Write resolved milestone into PLN artifact registration and `plan.json.milestone`; NEVER read `current_milestone` directly for phase-scoped runs.
81
+ **Milestone resolution** (numeric scope only):
82
+ target_milestone = specified milestone number
83
+ IF not found in state.json.milestones[]: ERROR
87
84
 
88
85
  **Session**: `.workflow/.csv-wave/{YYYYMMDD}-plan-P{N}-{slug}/`
89
86
  **Scratch**: `.workflow/scratch/{YYYYMMDD}-plan-P{N}-{slug}/` (.task/ subdir)
@@ -139,7 +136,7 @@ S_REGISTER — 注册 PLN artifact、更新 index.json PERSIST: sta
139
136
 
140
137
  <transitions>
141
138
  S_PARSE → S_RESUME WHEN: --continue
142
- S_PARSE → S_CONTEXT WHEN: phase/dir/--from resolved (D-007 reverse lookup for numeric)
139
+ S_PARSE → S_CONTEXT WHEN: milestone/dir/--from resolved
143
140
  S_PARSE → S_CONTEXT WHEN: no args + no roadmap AND latest analyze artifact found in state.json (scope=standalone). Interactive mode: confirm the auto-discovered artifact with user ("Using analyze artifact ANL-xxx from {date}. Proceed?"). -y mode: auto-proceed with log.
144
141
  S_PARSE → ERROR WHEN: no args + no roadmap + no analyze artifact
145
142
 
@@ -253,7 +250,7 @@ Collision detection against same-milestone plans.
253
250
  1. Register PLN artifact in state.json (scope, milestone, phase, depends_on)
254
251
  2. Update index.json with plan metadata
255
252
  3. If --gaps: link TASK files back to issues bidirectionally (task_refs[], task_plan_dir in issues.jsonl)
256
- 4. Display: phase, task count, wave count, check status, confidence
253
+ 4. Display: milestone, task count, wave count, check status, confidence
257
254
  5. **Next-step suggestion** (suggest only, NEVER auto-execute): display recommended next command (e.g., `maestro-execute {phase}`). The user decides whether to proceed.
258
255
 
259
256
  </actions>
@@ -292,7 +289,7 @@ Collision detection against same-milestone plans.
292
289
  - [ ] Pressure pass completed on highest-complexity task
293
290
  - [ ] Collision detection against same-milestone plans (non-blocking)
294
291
  - [ ] Plan-checker passed (or minor issues acknowledged, max 3 iterations)
295
- - [ ] PLN artifact registered in state.json (numeric scope: milestone resolved via D-007 `phase_slugs` reverse lookup, NOT direct `current_milestone` read)
292
+ - [ ] PLN artifact registered in state.json (numeric scope: milestone resolved directly from arg)
296
293
  - [ ] No-args fallback honored: latest analyze artifact auto-discovered when roadmap absent (§5.2 priority 6)
297
294
  - [ ] If --gaps: issues linked bidirectionally (task_refs[], task_plan_dir in issues.jsonl)
298
295
  </success_criteria>
@@ -9,6 +9,8 @@ allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, request
9
9
  Wave-based template executor via `spawn_agents_on_csv`. Load template → bind variables → topological sort → group into barrier/non-barrier waves → spawn wave-by-wave → read results → report.
10
10
 
11
11
  Session: `.workflow/.maestro/MCP-{YYYYMMDD-HHmmss}/state.json`
12
+
13
+ **Output boundary**: ALL file writes MUST target `.workflow/.maestro/MCP-*/` (session state) and `.workflow/.csv-wave/` (wave CSVs). Template files at `~/.maestro/templates/workflows/` are read-only during playback.
12
14
  </purpose>
13
15
 
14
16
  <invariants>
@@ -28,6 +28,7 @@ $maestro-quick "add dark mode toggle to settings page" --discuss --full
28
28
 
29
29
  **Output**: `.workflow/scratch/{slug}/` with plan.json, execution results, optional verification
30
30
 
31
+ **Output boundary**: ALL metadata writes MUST target `.workflow/scratch/{slug}/`. Source code modifications are scoped to files identified in the plan. NEVER modify unrelated source files or `.workflow/state.json` structure beyond scratch task entries.
31
32
  </context>
32
33
 
33
34
  <invariants>
@@ -40,6 +41,22 @@ $maestro-quick "add dark mode toggle to settings page" --discuss --full
40
41
 
41
42
  <execution>
42
43
 
44
+ ### Phase Gates (MANDATORY, BLOCKING)
45
+
46
+ **GATE 1: Parse → Context**
47
+ - REQUIRED: Task description provided (non-empty).
48
+ - BLOCKED if: empty description (E001).
49
+
50
+ **GATE 2: Analysis → Plan**
51
+ - REQUIRED: Quick analysis completed with related files identified.
52
+ - REQUIRED: Existing patterns found (≥1 similar implementation).
53
+ - BLOCKED if: scratch directory creation failed (E002).
54
+
55
+ **GATE 3: Execute → Report**
56
+ - REQUIRED: All plan tasks attempted and statuses recorded.
57
+ - REQUIRED: `plan.json` updated with task outcomes.
58
+ - BLOCKED if: plan.json missing or no task statuses.
59
+
43
60
  ### Step 1: Parse Arguments
44
61
 
45
62
  Extract from arguments:
@@ -90,7 +90,7 @@ Remaining → intent (amend_mode 时为 change_request)
90
90
  7. **command_path 在 A_BUILD_STEPS 解析** — 通过 `maestro ralph skills --platform codex --json --quiet` 预校验(project 覆盖 global,限定 `.codex/skills/`),命中即写绝对路径到 status.json;未命中标 `command_scope = "missing"`
91
91
  8. **执行 step 加载契约** — 由 `maestro ralph next` CLI 在执行期完成:解析 frontmatter + `<required_reading>` + `<deferred_reading>`,自动读取 required 文件全文并拼入 prompt;缺失 required → 退出码 1(E007),pause session。ralph build 阶段只通过 `maestro ralph skills --platform codex` 校验路径存在性,不读 SKILL.md 内容
92
92
  9. **Decomposition is outcome-oriented** — sub-goals 为可观测交付,禁止 lifecycle 复刻;通过 `create_goal` 绑定目标,`update_goal` 在收敛时释放
93
- 10. **planning_mode governs arg granularity** — `unified` → skill args 无 `{phase}`;`independent` → `{phase}`
93
+ 10. **planning_mode governs arg granularity** — `unified` → skill args 无 phase/milestone 占位符;`independent` → analyze/plan `{milestone}`,execute/quality 用 `{phase}`
94
94
  11. **task_decomposition 驱动 steps[] 动态生长** — `post-goal-audit` 按 unmet 子目标插入 scoped mini-loop;字段可选/累加,既有字段不删不改
95
95
  12. **Platform** — `session.platform = "codex"`;CLI 调用一律带 `--platform codex`
96
96
  13. **Invariant violation = BLOCK** — violating any invariant above blocks the current operation. Do NOT bypass for "efficiency" or "clear intent" reasons. Especially invariants about ralph never executing steps and completion_confirmed by CLI.
@@ -426,8 +426,8 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`(`sess
426
426
  | init | `maestro-init` | *(same)* | — | all |
427
427
  | analyze-macro | `maestro-analyze "{intent}"` | *(same)* | `post-analyze-scope` | all |
428
428
  | roadmap | `maestro-roadmap --from analyze:{analyze_macro_id}` | *(same)* | — | all |
429
- | analyze | `maestro-analyze {phase}` | `maestro-analyze` | — | all |
430
- | plan | `maestro-plan {phase}` *(scope=phase)* / `maestro-plan --from analyze:{analyze_macro_id}` *(scope=standalone)* / `maestro-plan --from blueprint:{blueprint_id}` *(scope=standalone)* | `maestro-plan` | — | all |
429
+ | analyze | `maestro-analyze {milestone}` | `maestro-analyze` | — | all |
430
+ | plan | `maestro-plan {milestone}` *(scope=phase)* / `maestro-plan --from analyze:{analyze_macro_id}` *(scope=standalone)* / `maestro-plan --from blueprint:{blueprint_id}` *(scope=standalone)* | `maestro-plan` | — | all |
431
431
  | execute | `maestro-execute {phase}` | `maestro-execute` | `post-execute` | all |
432
432
  | business-test | `quality-auto-test {phase}` | `quality-auto-test` | `post-business-test` | full only |
433
433
  | review | `quality-review {phase}` | `quality-review` | `post-review` | all (quick: append `--tier quick`) |
@@ -471,9 +471,9 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`(`sess
471
471
  - `analyze_macro_id` 存在且当前 step 是 `roadmap` → args 改为 `--from analyze:{analyze_macro_id}`
472
472
  - `analyze_macro_id` 存在且 `scope_verdict ∈ {medium, small}` 且当前 step 是 `plan` → args 改为 `--from analyze:{analyze_macro_id}`
473
473
  - `blueprint_id` 存在 → 当前 step 是 `plan` → args 改为 `--from blueprint:{blueprint_id}`(优先级低于 phase 数字参数)
474
- - **phase-level deferred chaining**(独立模式,step 含 `{phase}` 占位符):build 阶段前序 artifact 尚未产出,由 A_RESOLVE_ARGS(ralph-execute)运行时从 state.json 查找同 phase+milestone 最新 completed artifact 注入:
475
- - `plan` step `--from analyze:{phase_analyze_id}`,写 `source_artifact_ref`
476
- - `execute` step `--dir {plan_path}`(现有逻辑),写 `source_artifact_ref = "plan:{id}"`
474
+ - **deferred chaining**(独立模式):build 阶段前序 artifact 尚未产出,由 A_RESOLVE_ARGS(ralph-execute)运行时从 state.json 查找并注入:
475
+ - `plan` step(含 `{milestone}` 占位符)→ 查同 milestone 最新 completed analyze artifact,`--from analyze:{milestone_analyze_id}`,写 `source_artifact_ref`
476
+ - `execute` step(含 `{phase}` 占位符)→ 查同 phase+milestone 最新 completed plan artifact,`--dir {plan_path}`(现有逻辑),写 `source_artifact_ref = "plan:{id}"`
477
477
  - 写入 `step.source_artifact_ref` 以便审计
478
478
  13. **D-007 Milestone-ref 标注**:每个含 `{phase}` 占位符的 step → `step.milestone_id = session.milestone`(由 A_RESOLVE_PHASE 反查得出),禁止读 `current_milestone`
479
479
  14. **动态插入步骤**(A_APPLY_*)同样应用规则 7-13
@@ -875,9 +875,9 @@ Decomposition 产出后通过 Codex 内置工具管理目标(由 A_DECOMPOSE_T
875
875
  - [ ] Intent overrides 识别 grill / brainstorm / blueprint / analyze-macro
876
876
  - [ ] auto_confirm=true 时 grill step args 追加 `-y`(Auto mode 代码代答,stage 不跳过)
877
877
  - [ ] A_RESOLVE_SCOPE_VERDICT 读 macro analyze conclusions.scope_verdict,写入 session.scope_verdict + analyze_macro_id
878
- - [ ] 链路起点 = analyze-macro 时:large→roadmap+analyze+plan(phase);medium/small→直跳 plan --from analyze:{ANL_ID}(跳过 roadmap+analyze)
878
+ - [ ] 链路起点 = analyze-macro 时:large→roadmap+analyze+plan(milestone);medium/small→直跳 plan --from analyze:{ANL_ID}(跳过 roadmap+analyze)
879
879
  - [ ] post-analyze-scope decision 节点在 macro analyze 之后插入;A_SCOPE_EVALUATE/A_APPLY_SCOPE_VERDICT 重塑链路
880
- - [ ] plan step args 支持三路径:`{phase}` / `--from analyze:{ANL_ID}` / `--from blueprint:{BLP_ID}`,写入 step.source_artifact_ref
880
+ - [ ] plan step args 支持三路径:`{milestone}` / `--from analyze:{ANL_ID}` / `--from blueprint:{BLP_ID}`,写入 step.source_artifact_ref
881
881
  - [ ] roadmap step args 自动注入 `--from analyze:{analyze_macro_id}`(若存在)
882
882
  - [ ] artifact 过滤按 session.phase;unified 按 milestone
883
883
  - [ ] quality_mode 由 A_DETERMINE_QUALITY_MODE 决定,过滤 build steps
@@ -889,13 +889,13 @@ Decomposition 产出后通过 Codex 内置工具管理目标(由 A_DECOMPOSE_T
889
889
  - [ ] 每个 sub-goal 含 `completion_confirmed`(初始 false)
890
890
  - [ ] post-goal-audit decision 仅在 decomposed 时插入,位于 milestone-complete 之前
891
891
  - [ ] Unmet sub-goals 动态 grow steps[](goal_ref tagged);max retries → escalate
892
- - [ ] planning_mode 显式决定;unified=无 `{phase}`, independent=带 `{phase}`
892
+ - [ ] planning_mode 显式决定;unified=无占位符, independent=analyze/plan 带 `{milestone}`、execute/quality `{phase}`
893
893
  - [ ] Chain 必须以 `milestone-complete` 结尾
894
894
  - [ ] Decision nodes 由 maestro delegate --role analyze 评估
895
895
  - [ ] Ralph 不执行 step,只 evaluate;`Skill(maestro-ralph-execute)` 直调 handoff
896
896
  - [ ] session.platform = "codex";所有 CLI 调用携带 `--platform codex`
897
- - [ ] Phase-level deferred chaining:plan/execute step 的 `--from`/`--dir` 注入由 A_RESOLVE_ARGS(ralph-execute)运行时完成;build 阶段标记意图,不预知 artifact ID
898
- - [ ] Phase-level plan step 运行时获得 `--from analyze:{phase_analyze_id}`(由 ralph-execute 从 state.json 查找注入)
897
+ - [ ] Deferred chaining:plan/execute step 的 `--from`/`--dir` 注入由 A_RESOLVE_ARGS(ralph-execute)运行时完成;build 阶段标记意图,不预知 artifact ID
898
+ - [ ] Milestone-level plan step 运行时获得 `--from analyze:{milestone_analyze_id}`(由 ralph-execute 从 state.json 查找注入)
899
899
  - [ ] Phase-level execute step 运行时获得 `source_artifact_ref = "plan:{id}"`
900
900
  - [ ] 每个 step 含 `completion_summary` + `completion_decisions` + `completion_caveats` + `completion_deferred`(初始 null)
901
901
  - [ ] `completion_summary` 在 DONE/DONE_WITH_CONCERNS 时为 MUST(由 CLI `--summary` 参数传入)
@@ -147,22 +147,22 @@ S_FALLBACK:
147
147
  |-------|-----------------|--------|
148
148
  | maestro-brainstorm | topic | `"{intent}"` |
149
149
  | maestro-roadmap | description | `"{intent}"` |
150
- | maestro-analyze | phase or topic | `{phase}` or `"{intent}"` |
151
- | maestro-plan | phase, --from, or --dir | see --from auto-injection below |
150
+ | maestro-analyze | milestone or topic | `{milestone}` or `"{intent}"` |
151
+ | maestro-plan | milestone, --from, or --dir | see --from auto-injection below |
152
152
  | maestro-execute | phase or --dir | see --from auto-injection below |
153
153
  | quality-debug | gap context | Read previous step's error/gap |
154
154
  | quality-* | phase | `{phase}` |
155
155
 
156
- **--from auto-injection (phase-level artifact chaining):**
156
+ **--from auto-injection (artifact chaining):**
157
157
 
158
- Phase-level steps 在 build 阶段无法预知前序 artifact ID。A_RESOLVE_ARGS 运行时从 state.json 查找并注入显式引用,打通 analyze→plan→execute 数据管道:
158
+ Steps 在 build 阶段无法预知前序 artifact ID。A_RESOLVE_ARGS 运行时从 state.json 查找并注入显式引用,打通 analyze→plan→execute 数据管道:
159
159
 
160
160
  ```
161
161
  Read state.json.artifacts(含 milestone_history 内归档 artifacts)
162
- → filter by milestone={session.milestone} + phase={session.phase} + status=="completed"
162
+ → filter by milestone={session.milestone} (+ phase={session.phase} for execute-step lookups) + status=="completed"
163
163
 
164
- plan step(含 {phase} 占位符,args 无 --from 且无 --dir):
165
- 1. 查同 phase+milestone 最新 completed type=="analyze" artifact → id = ANL-xxx
164
+ plan step(含 {milestone} 占位符,args 无 --from 且无 --dir):
165
+ 1. 查同 milestone 最新 completed type=="analyze" artifact → id = ANL-xxx
166
166
  2. 命中 → args 追加 --from analyze:{id}
167
167
  3. 写 step.source_artifact_ref = "analyze:{id}"
168
168
 
@@ -366,7 +366,7 @@ Display: `[{index}/{total}] ✗ {step.skill} 失败,会话已暂停。Skill(ma
366
366
  - [ ] Auto mode: retry 一次后 pause;interactive 提供 retry/skip/abort
367
367
  - [ ] 自调用持续到全部 completion_confirmed 或 paused
368
368
  - [ ] 只处理 session.platform == "codex" 的会话
369
- - [ ] --from auto-injection:phase-level plan step 运行时从 state.json 查找同 phase+milestone 最新 completed analyze artifact → 注入 `--from analyze:{id}`,写 `source_artifact_ref`
369
+ - [ ] --from auto-injection:milestone-level plan step 运行时从 state.json 查找同 milestone 最新 completed analyze artifact → 注入 `--from analyze:{id}`,写 `source_artifact_ref`
370
370
  - [ ] --from auto-injection:phase-level execute step 运行时查找同 phase+milestone 最新 completed plan artifact → 注入 `--dir`,写 `source_artifact_ref`
371
371
  - [ ] Goal context injection:`ralph_protocol_version < "2"` → 前置 `<goal_context>` block;`>= "2"` → skip(session_anchor 覆盖)
372
372
  - [ ] Goal context 包含 sub-goal description、done_when、boundary、evidence、execution_criteria
@@ -25,10 +25,41 @@ $maestro-tools-execute
25
25
  ```
26
26
 
27
27
  Empty arguments enters interactive mode: list all tools for user selection.
28
+
29
+ **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.
28
30
  </context>
29
31
 
32
+ <invariants>
33
+ 1. **Confirmation before execution** — MUST request_user_input before executing tool steps; NEVER auto-execute without user consent
34
+ 2. **Sequential step execution** — steps MUST be executed in defined order; NEVER skip or reorder steps unless user explicitly requests skip
35
+ 3. **Blocker escalation** — step failure MUST be reported to user with retry/skip/abort options; NEVER silently skip failed steps
36
+ 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
37
+ 5. **Progress feedback** — each completed step MUST report `[Step N/M] done — <step_name>`; NEVER execute silently
38
+ 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
39
+ </invariants>
40
+
30
41
  <execution>
31
42
 
43
+ ### Phase Gates (MANDATORY, BLOCKING)
44
+
45
+ **GATE 1: Parse → Load**
46
+ - REQUIRED: Tool name, keyword, or --category parsed from arguments (or empty for interactive mode).
47
+ - BLOCKED if: invalid category value.
48
+
49
+ **GATE 2: Load → Confirm**
50
+ - REQUIRED: Exactly one tool resolved (direct match or user selection from candidates).
51
+ - REQUIRED: Tool document loaded and steps extracted (ref entries expanded).
52
+ - BLOCKED if: E001 (no match found), E002 unresolved (multiple matches without user selection).
53
+
54
+ **GATE 3: Confirm → Execute**
55
+ - REQUIRED: User confirmed execution mode via request_user_input (execute / adjust / view only).
56
+ - BLOCKED if: user selects "View only" — display steps and END without execution.
57
+
58
+ **GATE 4: Execute → Report**
59
+ - REQUIRED: All steps attempted (completed, skipped with user approval, or aborted by user).
60
+ - REQUIRED: Results collected for each step (success/skip/fail).
61
+ - BLOCKED if: user chose abort mid-execution — report partial results and END.
62
+
32
63
  ### Step 1: Load Tool
33
64
 
34
65
  **By name** (search all categories first, then filter):
@@ -46,10 +46,39 @@ tool: true
46
46
  ---
47
47
  Step content...
48
48
  ```
49
+
50
+ **Output boundary**: ALL file writes MUST target `.workflow/knowhow/` (tool documents) and `.workflow/specs/` (ref entries) only. NEVER modify source code or files outside these paths.
49
51
  </context>
50
52
 
53
+ <invariants>
54
+ 1. **Schema validation** — tool knowhow document MUST include `tool: true`, `category`, `keywords/tags`, and `summary` in YAML frontmatter; missing fields → reject write
55
+ 2. **No duplicate names** — tool title MUST be unique within its category; duplicate detection → E002 warning with overwrite/optimize confirmation
56
+ 3. **Category required** — every tool MUST declare exactly one category from: coding, test, review, arch, debug; empty category → E003
57
+ 4. **Confirmation gate** — MUST request_user_input before writing knowhow document and spec ref entry; NEVER persist without user confirmation
58
+ 5. **Promote is in-place** — promote mode MUST update existing knowhow frontmatter; NEVER recreate the document
59
+ 6. **Output boundary** — ALL file writes MUST target `.workflow/knowhow/` (tool documents) and `.workflow/specs/` (ref entries) only. NEVER modify source code or files outside these paths
60
+ 7. **Description format** — first line after `### Title` MUST state "Use when ..." (usage timing); this is critical for ref entry summary visibility
61
+ </invariants>
62
+
51
63
  <execution>
52
64
 
65
+ ### Phase Gates (MANDATORY, BLOCKING)
66
+
67
+ **GATE 1: Parse → Gather**
68
+ - REQUIRED: Mode determined (extract/generate/optimize/promote) from argument parsing.
69
+ - REQUIRED: For optimize/promote modes, target tool/document exists and is loadable.
70
+ - BLOCKED if: empty args without user response to request_user_input.
71
+
72
+ **GATE 2: Gather → Write**
73
+ - REQUIRED: Tool name, category, and usage timing confirmed.
74
+ - REQUIRED: Steps extracted or generated (extract: ≥1 step, generate: user-confirmed scope).
75
+ - REQUIRED: User confirmed via request_user_input (title, category, keywords, summary, step count).
76
+ - BLOCKED if: E001 (`.workflow/specs/` not initialized), E003 (no category), user cancels.
77
+
78
+ **GATE 3: Write → Verify**
79
+ - REQUIRED: Knowhow document written with `tool: true` frontmatter (or updated in-place for promote).
80
+ - BLOCKED if: write failed or spec add returned error.
81
+
53
82
  ### Step 1: Intent Detection
54
83
 
55
84
  Parse $ARGUMENTS to determine mode:
@@ -61,6 +61,8 @@ $maestro-ui-codify "src/styles" --output-dir .workflow/packages --overwrite -y
61
61
  **Output Directory**: `.workflow/.csv-wave/{session-id}/`
62
62
  **Core Output**: `tasks.csv` (master state) + `results.csv` (final)
63
63
  **Package Output**: `{output-dir}/{package-name}/` with design-tokens.json, layout-templates.json, animation-tokens.json, preview.html, preview.css, knowhow-manifest.json
64
+
65
+ **Output boundary**: ALL file writes MUST target `.workflow/.csv-wave/{session-id}/` (wave state), `{output-dir}/{package-name}/` (reference package), `.workflow/knowhow/` (knowledge assets), and `.workflow/specs/` (spec entries). NEVER modify source code files in the scanned directory.
64
66
  </context>
65
67
 
66
68
  <csv_schema>
@@ -27,10 +27,38 @@ $ARGUMENTS — optional flags.
27
27
  - `--setup-only` -- Skip schema migration, run only the setup for current version
28
28
 
29
29
  **Version source:** `.workflow/state.json` → `version` field
30
+
31
+ **Output boundary**: ALL file writes MUST target `.workflow/state.json` (version bump), `.workflow/state.json.backup-*` (backup), and `.workflow/` config files touched by version-specific setup. NEVER modify source code or `src/migrations/` files.
30
32
  </context>
31
33
 
34
+ <invariants>
35
+ 1. **Backup before migration** — a timestamped backup of `.workflow/state.json` MUST be created before any schema migration runs; NEVER execute migration without backup
36
+ 2. **Idempotent** — running update when already on latest version MUST be a no-op (display "up to date"); NEVER re-apply migrations
37
+ 3. **Confirmation before execute** — migration diff MUST be displayed and user MUST confirm via request_user_input before execution (unless `--force`); NEVER silently apply schema changes
38
+ 4. **Migration diff always visible** — even with `--force`, the migration diff MUST be displayed for audit visibility; NEVER skip diff display
39
+ 5. **Restore path on failure** — if migration fails, the backup restore command MUST be displayed; NEVER leave user without recovery instructions
40
+ 6. **Sequential migration** — all intermediate version steps MUST be applied in order by the schema registry; NEVER skip intermediate versions
41
+ </invariants>
42
+
32
43
  <execution>
33
44
 
45
+ ### Phase Gates (MANDATORY, BLOCKING)
46
+
47
+ **GATE 1: Detect → Check**
48
+ - REQUIRED: Current version read from `.workflow/state.json`.
49
+ - BLOCKED if: state.json missing or unreadable (E001).
50
+
51
+ **GATE 2: Check → Execute**
52
+ - REQUIRED: Dry-run migration check completed; target version identified.
53
+ - REQUIRED: User confirmation via request_user_input (unless `--force`).
54
+ - BLOCKED if: already up to date (display message and exit) or user cancels.
55
+
56
+ **GATE 3: Execute → Summary**
57
+ - REQUIRED: Backup created at `.workflow/state.json.backup-v{current}-{timestamp}`.
58
+ - REQUIRED: Schema migration completed successfully.
59
+ - REQUIRED: Version-specific setup doc followed (if exists).
60
+ - BLOCKED if: migration failed — display restore command and exit.
61
+
34
62
  ### Step 1: Detect Version
35
63
 
36
64
  ```
@@ -68,6 +96,16 @@ Display version change, backup path, next steps.
68
96
 
69
97
  </execution>
70
98
 
99
+ <error_codes>
100
+ | Code | Severity | Condition | Recovery |
101
+ |------|----------|-----------|----------|
102
+ | E001 | error | `.workflow/state.json` missing or unreadable | Run `$maestro-init` first |
103
+ | E002 | error | Migration script execution failed | Display backup restore command |
104
+ | E003 | error | Version-specific setup doc not found | Skip setup, display manual steps |
105
+ | W001 | warning | Already up to date | No action needed |
106
+ | W002 | warning | Setup doc unavailable for target version | Continue without setup |
107
+ </error_codes>
108
+
71
109
  <success_criteria>
72
110
  - [ ] Version detected, schema migration run, setup doc followed
73
111
  - [ ] --setup-only, --dry-run, --force flags handled
@@ -74,6 +74,8 @@ When `--yes` or `-y`: Auto-confirm rebuild (implies --force), skip all prompts.
74
74
  **Output Directory**: `.workflow/.csv-wave/{session-id}/`
75
75
  **Core Output**: `tasks.csv` (master state) + `results.csv` (final) + `discoveries.ndjson` (shared exploration) + `context.md` (human-readable report)
76
76
  **Target**: `.workflow/codebase/` (doc-index.json, tech-registry/, feature-maps/)
77
+
78
+ **Output boundary**: ALL file writes MUST target `.workflow/codebase/`, `.workflow/state.json`, or `.workflow/project.md` (Tech Stack section only). NEVER modify source code or files outside these paths.
77
79
  </context>
78
80
 
79
81
  <csv_schema>
@@ -22,8 +22,19 @@ $manage-codebase-refresh "--since 3d --deep"
22
22
  **Flags**:
23
23
  - `--since <date>` -- Override change detection window (ISO date or relative like `3d`)
24
24
  - `--deep` -- Force deeper re-scan even for minor changes
25
+
26
+ **Output boundary**: ALL file writes MUST target `.workflow/codebase/` (doc files, doc-index.json) and `.workflow/state.json` (codebase_last_refreshed timestamp) only. NEVER modify source code or files outside these paths.
25
27
  </context>
26
28
 
29
+ <invariants>
30
+ 1. **Incremental only** — MUST NOT clear or rebuild .workflow/codebase/; for full rebuild use `$manage-codebase-rebuild`
31
+ 2. **Change-driven** — MUST only update doc entries affected by detected git changes; NEVER refresh unchanged docs
32
+ 3. **Baseline resolution** — MUST resolve change baseline via --since flag > state.json timestamp > 7-day fallback; NEVER scan entire history
33
+ 4. **Doc-index alignment** — doc-index.json timestamps MUST be updated for every refreshed entry
34
+ 5. **KG impact awareness** — if knowledge-graph.json exists, MUST run kg diff-wiki and log affected wiki entries as warnings
35
+ 6. **No-op safety** — if no changes detected (W001), MUST exit cleanly without modifying any files
36
+ </invariants>
37
+
27
38
  <execution>
28
39
 
29
40
  ### Step 1: Validate Preconditions
@@ -81,6 +81,8 @@ $manage-drift-realign --continue "20260624-drift-realign"
81
81
  **Core Output**: `tasks.csv` + `results.csv` + `discoveries.ndjson` + `context.md`
82
82
  **Report Output**: `.workflow/.drift-realign/drift-report-{date}.md` + `drift-log.jsonl`
83
83
 
84
+ **Output boundary**: ALL file writes MUST target `.workflow/` metadata files (specs, codebase docs, roadmap.md, state.json, issues.jsonl) or `.workflow/.trash/drift-realign-{timestamp}/` (backups) or `.workflow/.drift-realign/` (session details). NEVER modify source code files.
85
+
84
86
  **State files read**:
85
87
  - `.workflow/state.json` — project state + artifact registry
86
88
  - `.workflow/roadmap.md` — milestone/phase roadmap
@@ -34,6 +34,8 @@ $ARGUMENTS — session-id, path, or empty for scan mode.
34
34
  - `--prune` — State hygiene mode: classify artifacts, graduate harvested → knowhow, archive from state.json, prune accumulated_context
35
35
  - `--age N` — Graduation age threshold in days (default: 14). Used with `--prune`
36
36
 
37
+ **Output boundary**: ALL file writes MUST target `.workflow/knowhow/`, `.workflow/specs/`, `.workflow/issues/`, `.workflow/wiki/`, `.workflow/harvest/`, or `.workflow/state.json` only. NEVER modify source code, source artifacts, or files outside these paths.
38
+
37
39
  **Source registry:**
38
40
  | Source | Scan Path | Key Files |
39
41
  |--------|-----------|-----------|
@@ -47,17 +49,37 @@ $ARGUMENTS — session-id, path, or empty for scan mode.
47
49
  | learning | `.workflow/specs/` | learnings.md |
48
50
  </context>
49
51
 
52
+ <invariants>
53
+ 1. **Read-only until routing** — extraction and classification happen in-memory; no files written until Stage 6
54
+ 2. **Never modify source artifacts** — harvest is purely extractive; source files remain untouched
55
+ 3. **Dedup before write** — MUST check harvest-log.jsonl and existing stores before each write to prevent duplicates
56
+ 4. **Source tagging** — MUST set `source: "harvest"` on every issues.jsonl row so concurrent writers can be distinguished
57
+ 5. **Conflict pre-check on spec routing** — when routing to spec, MUST compare against existing specs with same keywords/category; set `confidence="low"` and log conflict note if semantic conflict detected
58
+ 6. **Provenance tracking** — every routed item MUST be logged in harvest-log.jsonl with fragment ID, target store, and timestamp
59
+ 7. **Dry-run safety** — `--dry-run` MUST NOT write any files; preview only
60
+ </invariants>
61
+
50
62
  <execution>
51
63
  Follow '~/.maestro/workflows/harvest.md' Stages 1–8 (standard mode) or Stage 9 (`--prune` mode).
52
64
 
53
- **Key invariants:**
54
- 1. **Read-only until Stage 6** — extraction/classification in-memory only
55
- 2. **Dedup before write** check harvest-log.jsonl + existing stores
56
- 3. **Stable fragment IDs** `HRV-{8 hex}` from `hash(source_id + content_hash)`
57
- 4. **Never modify source artifacts** purely extractive
58
- 5. **Confidence filtering** below threshold logged but not routed
59
- 6. **Spec format enforcement** — all spec routing must use `<spec-entry>` closed-tag format with `title`, `description`, `keywords`, `date`, `source="harvest"` attributes
60
- 7. **Conflict pre-check on spec routing** when routing to spec, compare new entry against existing specs with same keywords/category. If semantic conflict detected, set `confidence="low"` on the new entry and log conflict note. Use `maestro spec conflict mark` if contradiction is clear
65
+ ### Phase Gates (MANDATORY, BLOCKING)
66
+
67
+ **GATE 1: Discovery → Extraction** (Stages 1-3 Stage 4)
68
+ - REQUIRED: Source artifacts discovered and mode resolved (scan/session/path).
69
+ - REQUIRED: User selected artifact(s) to harvest (or auto-selected via session/path mode, or `-y`).
70
+ - BLOCKED if no harvestable artifacts found (W001) or invalid source (E004/E005).
71
+
72
+ **GATE 2: Extraction Routing** (Stage 4 Stage 5-6)
73
+ - REQUIRED: All files in selected artifacts loaded and parsed.
74
+ - REQUIRED: Knowledge fragments extracted with category, confidence, and tags.
75
+ - REQUIRED: Fragments filtered by `--min-confidence`.
76
+ - BLOCKED if extraction produces zero fragments.
77
+
78
+ **GATE 3: Routing → Write** (Stage 6 → Stage 7-8)
79
+ - REQUIRED: Routing classification applied (auto or forced by `--to`).
80
+ - REQUIRED: Dedup check passed against harvest-log.jsonl and existing stores.
81
+ - REQUIRED: If `--dry-run`: preview displayed, no files written — GATE blocks further writes.
82
+ - BLOCKED if dedup check fails or store paths unresolvable.
61
83
 
62
84
  **Routing rules:**
63
85
  - Universal design patterns → `coding` or `arch` category
@@ -29,10 +29,34 @@ $manage-issue "link ISS-20260318-001 --task TASK-003"
29
29
  ```
30
30
 
31
31
  **Subcommands**: `create`, `list`, `status`, `update`, `close`, `link`.
32
+
33
+ **Output boundary**: ALL file writes MUST target `.workflow/issues/issues.jsonl`, `.workflow/issues/issue-history.jsonl`, or `.workflow/issues/` directory only. NEVER modify source code or files outside these paths.
32
34
  </context>
33
35
 
36
+ <invariants>
37
+ 1. **Schema compliance** — every issue record MUST conform to the canonical issue.json template schema
38
+ 2. **ID uniqueness** — issue IDs (ISS-XXXXXXXX-NNN) MUST be unique across issues.jsonl and issue-history.jsonl
39
+ 3. **Close moves to history** — `close` subcommand MUST move the record from issues.jsonl to issue-history.jsonl, NEVER delete without archiving
40
+ 4. **Bidirectional links** — `link` subcommand MUST create references in both the issue and the linked task
41
+ 5. **Confirmation on destructive ops** — `close` and bulk `update` MUST require user confirmation unless `-y` flag is set
42
+ 6. **Append-only audit** — NEVER overwrite existing issue records; updates MUST preserve all prior fields and add `updated_at` timestamp
43
+ </invariants>
44
+
34
45
  <execution>
35
46
 
47
+ ### Phase Gates (MANDATORY, BLOCKING)
48
+
49
+ **GATE 1: Parse → Execute** (Subcommand routing)
50
+ - REQUIRED: Subcommand parsed and validated against valid set (create/list/status/update/close/link).
51
+ - REQUIRED: `.workflow/issues/` directory exists (auto-create with empty issues.jsonl if missing).
52
+ - BLOCKED if E_NO_SUBCOMMAND or E_INVALID_SUBCOMMAND.
53
+
54
+ **GATE 2: Execute → Write** (For mutating subcommands: create/update/close/link)
55
+ - REQUIRED: Target issue exists for update/close/link operations.
56
+ - REQUIRED: User confirmation for close operations (unless -y).
57
+ - REQUIRED: For link: both issue and task validated before any writes.
58
+ - BLOCKED if target not found or confirmation denied.
59
+
36
60
  ### Step 1: Parse Subcommand
37
61
 
38
62
  Extract first token as subcommand. Valid: `create`, `list`, `status`, `update`, `close`, `link`.
@@ -72,6 +72,8 @@ When `--yes` or `-y`: Auto-confirm perspective selection, skip interactive valid
72
72
 
73
73
  **Output Directory**: `.workflow/.csv-wave/{session-id}/`
74
74
  **Core Output**: `tasks.csv` (master state) + `results.csv` (final) + `discoveries.ndjson` (shared exploration) + `context.md` (human-readable report) + issues appended to `.workflow/issues/issues.jsonl`
75
+
76
+ **Output boundary**: ALL file writes MUST target `.workflow/issues/issues.jsonl` or `.workflow/issues/discoveries/{SESSION_ID}/` only. NEVER modify source code or files outside these paths.
75
77
  </context>
76
78
 
77
79
  <csv_schema>
@@ -32,10 +32,36 @@ $manage-knowhow "prune --before 2026-01-01 --type tip --dry-run"
32
32
  - `--before <date>` / `--after <date>` — Date filters for prune
33
33
  - `--dry-run` — Preview prune without deleting (default for prune — use `--execute` to actually delete)
34
34
  - `--execute` — Required to actually perform prune deletions (prune defaults to dry-run)
35
+
36
+ **Output boundary**: Workflow store writes MUST target `.workflow/knowhow/` only. System store writes MUST target `~/.claude/projects/*/memory/` only. NEVER modify source code or files outside these paths.
35
37
  </context>
36
38
 
39
+ <invariants>
40
+ 1. **MEMORY.md protected** — NEVER delete MEMORY.md; only editable via `edit` subcommand
41
+ 2. **MEMORY.md line limit** — MUST warn (W003) when MEMORY.md exceeds 200 lines; content beyond 200 lines will be truncated at load
42
+ 3. **Confirmation on destructive ops** — `delete` and `prune` MUST require user confirmation unless `--confirm` flag is set
43
+ 4. **Store isolation** — `prune` operates on workflow store only; NEVER prune system memory files
44
+ 5. **Reference integrity** — `delete` MUST check for references from other entries before removing; warn if orphaned references would result
45
+ 6. **Dry-run safety** — `--dry-run` MUST NOT write any files; preview destructive operations only
46
+ 7. **Index consistency** — after delete/prune, workflow index MUST be updated to reflect removals
47
+ </invariants>
48
+
37
49
  <execution>
38
50
 
51
+ ### Phase Gates (MANDATORY, BLOCKING)
52
+
53
+ **GATE 1: Parse → Execute** (Subcommand routing)
54
+ - REQUIRED: Subcommand parsed from first token (list/search/view/edit/delete/prune).
55
+ - REQUIRED: Both store paths resolved (workflow + system).
56
+ - BLOCKED if E001 (no memory stores found) or invalid subcommand.
57
+
58
+ **GATE 2: Execute → Mutate** (For destructive subcommands: delete/prune/edit)
59
+ - REQUIRED: Target entry/file resolved and exists (E002 if not found).
60
+ - REQUIRED: MEMORY.md protected from deletion (E004 — use `edit` instead).
61
+ - REQUIRED: For `prune`: at least one filter provided (E003).
62
+ - REQUIRED: User confirmation before delete/prune unless `--confirm` flag set.
63
+ - BLOCKED if target unresolvable or confirmation denied.
64
+
39
65
  ### Step 1: Resolve Store Paths
40
66
 
41
67
  - **Workflow store**: `.workflow/knowhow/` (entries: `KNW-*.md`, `TIP-*.md`, `TPL-*.md`, `RCP-*.md`, `REF-*.md`, `DCS-*.md`, indexed in `.workflow/wiki-index.json`)
@@ -33,10 +33,33 @@ $manage-knowhow-capture "decision Use PostgreSQL over MongoDB --status accepted"
33
33
  - `--code-paths <paths>` — Related source paths for asset/blueprint (comma-separated)
34
34
  - `--description <desc>` — One-line description for search results (falls back to content[:240])
35
35
  - `--category <cat>` — Spec category for agent discovery (coding, arch, test, debug, review, learning)
36
+
37
+ **Output boundary**: ALL file writes MUST target `.workflow/knowhow/` only. NEVER modify source code or files outside this path.
36
38
  </context>
37
39
 
40
+ <invariants>
41
+ 1. **Description required** — every entry MUST have a `description` field in frontmatter (under 120 chars) for search indexing
42
+ 2. **Tags language match** — tags MUST match content language (Chinese content → Chinese tags, English → English)
43
+ 3. **ID uniqueness** — generated file names ({PREFIX}-{YYYYMMDD}-{slug}.md) MUST be unique; NEVER overwrite existing entries
44
+ 4. **Frontmatter completeness** — YAML frontmatter MUST include: title, description, type, category, created, tags, status
45
+ 5. **Type-specific validation** — each type MUST populate all its required fields before writing (template needs code block, recipe needs steps, etc.)
46
+ 6. **Idempotent naming** — same content captured twice MUST produce same slug, enabling dedup detection
47
+ </invariants>
48
+
38
49
  <execution>
39
50
 
51
+ ### Phase Gates (MANDATORY, BLOCKING)
52
+
53
+ **GATE 1: Type Detection → Content Collection** (Type routing → Content extraction)
54
+ - REQUIRED: Type detected from first token or selected via request_user_input.
55
+ - REQUIRED: Type maps to a valid prefix (KNW-/TPL-/RCP-/REF-/DCS-/TIP-/AST-/BLP-/DOC-/INS-).
56
+ - BLOCKED if type unresolvable after interactive prompt.
57
+
58
+ **GATE 2: Content Collection → Write** (Content extraction → File write)
59
+ - REQUIRED: All type-specific required fields populated (e.g., template needs code block, recipe needs steps).
60
+ - REQUIRED: Description generated or provided (under 120 chars).
61
+ - BLOCKED if required fields missing after prompt.
62
+
40
63
  ### Step 1: Validate
41
64
 
42
65
  Verify `.workflow/` exists (E001). Create `.workflow/knowhow/` if missing.
@@ -44,6 +44,8 @@ $manage-learn "\"Zod v4 breaks z.object().strict() API\" --category gotcha --tag
44
44
  **Storage**:
45
45
  - `.workflow/specs/learnings.md` — append-only store (shared with `quality-retrospective`)
46
46
  - Index auto-maintained by WikiIndexer (no manual index file needed)
47
+
48
+ **Output boundary**: ALL file writes MUST target `.workflow/specs/learnings.md` only. NEVER modify source code or files outside this path. Bootstrap (creating `.workflow/specs/` directory and `learnings.md`) is the only exception.
47
49
  </context>
48
50
 
49
51
  <invariants>