maestro-flow 0.5.41 → 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 (363) 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 -43
  9. package/.agents/skills/maestro-blueprint/SKILL.md +1 -23
  10. package/.agents/skills/maestro-brainstorm/SKILL.md +8 -25
  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 +27 -9
  15. package/.agents/skills/maestro-fork/SKILL.md +4 -3
  16. package/.agents/skills/maestro-grill/SKILL.md +1 -17
  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 -15
  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 +6 -62
  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 -9
  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/.agents/skills/team-adversarial-swarm/workflows/wf-swarm-synthesize.js +248 -248
  63. package/.agents/skills/team-coordinate/specs/role-spec-template.md +197 -198
  64. package/.agents/skills/team-roadmap-dev/SKILL.md +164 -164
  65. package/.agents/skills/team-roadmap-dev/specs/team-config.json +1 -1
  66. package/.agents/skills/team-swarm/roles/analyst/role.md +172 -176
  67. package/.agy/skills/domain-add/SKILL.md +3 -0
  68. package/.agy/skills/learn-decompose/SKILL.md +7 -4
  69. package/.agy/skills/learn-follow/SKILL.md +4 -2
  70. package/.agy/skills/learn-investigate/SKILL.md +8 -6
  71. package/.agy/skills/learn-second-opinion/SKILL.md +6 -3
  72. package/.agy/skills/maestro/SKILL.md +1 -1
  73. package/.agy/skills/maestro-amend/SKILL.md +1 -1
  74. package/.agy/skills/maestro-analyze/SKILL.md +1 -43
  75. package/.agy/skills/maestro-blueprint/SKILL.md +1 -23
  76. package/.agy/skills/maestro-brainstorm/SKILL.md +8 -25
  77. package/.agy/skills/maestro-collab/SKILL.md +6 -2
  78. package/.agy/skills/maestro-companion/SKILL.md +4 -1
  79. package/.agy/skills/maestro-composer/SKILL.md +4 -2
  80. package/.agy/skills/maestro-execute/SKILL.md +27 -9
  81. package/.agy/skills/maestro-fork/SKILL.md +4 -3
  82. package/.agy/skills/maestro-grill/SKILL.md +1 -17
  83. package/.agy/skills/maestro-guard/SKILL.md +2 -2
  84. package/.agy/skills/maestro-impeccable/SKILL.md +2 -1
  85. package/.agy/skills/maestro-init/SKILL.md +1 -1
  86. package/.agy/skills/maestro-merge/SKILL.md +12 -1
  87. package/.agy/skills/maestro-milestone-audit/SKILL.md +1 -15
  88. package/.agy/skills/maestro-milestone-complete/SKILL.md +8 -3
  89. package/.agy/skills/maestro-milestone-release/SKILL.md +8 -4
  90. package/.agy/skills/maestro-overlay/SKILL.md +9 -0
  91. package/.agy/skills/maestro-plan/SKILL.md +6 -62
  92. package/.agy/skills/maestro-player/SKILL.md +2 -2
  93. package/.agy/skills/maestro-quick/SKILL.md +5 -3
  94. package/.agy/skills/maestro-ralph/SKILL.md +8 -8
  95. package/.agy/skills/maestro-ralph-cli/SKILL.md +661 -0
  96. package/.agy/skills/maestro-ralph-cli-execute/SKILL.md +235 -0
  97. package/.agy/skills/maestro-ralph-execute/SKILL.md +127 -11
  98. package/.agy/skills/maestro-roadmap/SKILL.md +1 -9
  99. package/.agy/skills/maestro-swarm-workflow/SKILL.md +16 -14
  100. package/.agy/skills/maestro-tools-register/SKILL.md +16 -1
  101. package/.agy/skills/maestro-ui-codify/SKILL.md +11 -1
  102. package/.agy/skills/maestro-universal-workflow/SKILL.md +28 -5
  103. package/.agy/skills/maestro-update/SKILL.md +10 -7
  104. package/.agy/skills/manage-codebase-rebuild/SKILL.md +5 -1
  105. package/.agy/skills/manage-drift-realign/SKILL.md +6 -2
  106. package/.agy/skills/manage-harvest/SKILL.md +4 -1
  107. package/.agy/skills/manage-issue-discover/SKILL.md +1 -0
  108. package/.agy/skills/manage-kg-extractors/SKILL.md +5 -1
  109. package/.agy/skills/manage-knowhow-capture/SKILL.md +1 -0
  110. package/.agy/skills/manage-knowledge-audit/SKILL.md +3 -0
  111. package/.agy/skills/manage-wiki/SKILL.md +1 -0
  112. package/.agy/skills/odyssey-debug/SKILL.md +2 -1
  113. package/.agy/skills/odyssey-improve/SKILL.md +2 -2
  114. package/.agy/skills/odyssey-planex/SKILL.md +8 -7
  115. package/.agy/skills/odyssey-review-test-fix/SKILL.md +4 -1
  116. package/.agy/skills/odyssey-ui/SKILL.md +4 -4
  117. package/.agy/skills/quality-auto-test/SKILL.md +11 -1
  118. package/.agy/skills/quality-debug/SKILL.md +16 -2
  119. package/.agy/skills/quality-retrospective/SKILL.md +9 -1
  120. package/.agy/skills/quality-review/SKILL.md +8 -0
  121. package/.agy/skills/quality-sync/SKILL.md +2 -2
  122. package/.agy/skills/quality-test/SKILL.md +9 -1
  123. package/.agy/skills/security-audit/SKILL.md +14 -4
  124. package/.agy/skills/spec-add/SKILL.md +5 -2
  125. package/.agy/skills/spec-load/SKILL.md +1 -1
  126. package/.agy/skills/spec-remove/SKILL.md +1 -1
  127. package/.agy/skills/spec-setup/SKILL.md +3 -0
  128. package/.agy/skills/team-adversarial-swarm/workflows/wf-swarm-synthesize.js +248 -248
  129. package/.agy/skills/team-coordinate/specs/role-spec-template.md +197 -198
  130. package/.agy/skills/team-roadmap-dev/SKILL.md +141 -153
  131. package/.agy/skills/team-roadmap-dev/specs/team-config.json +1 -1
  132. package/.agy/skills/team-swarm/roles/analyst/role.md +172 -176
  133. package/.claude/commands/domain-add.md +3 -0
  134. package/.claude/commands/learn-decompose.md +7 -4
  135. package/.claude/commands/learn-follow.md +4 -2
  136. package/.claude/commands/learn-investigate.md +8 -6
  137. package/.claude/commands/learn-second-opinion.md +6 -3
  138. package/.claude/commands/maestro-amend.md +1 -1
  139. package/.claude/commands/maestro-analyze.md +1 -43
  140. package/.claude/commands/maestro-blueprint.md +1 -23
  141. package/.claude/commands/maestro-brainstorm.md +8 -25
  142. package/.claude/commands/maestro-collab.md +6 -2
  143. package/.claude/commands/maestro-companion.md +4 -1
  144. package/.claude/commands/maestro-composer.md +4 -2
  145. package/.claude/commands/maestro-execute.md +27 -9
  146. package/.claude/commands/maestro-fork.md +4 -3
  147. package/.claude/commands/maestro-grill.md +1 -17
  148. package/.claude/commands/maestro-guard.md +2 -2
  149. package/.claude/commands/maestro-impeccable.md +2 -1
  150. package/.claude/commands/maestro-init.md +1 -1
  151. package/.claude/commands/maestro-merge.md +12 -1
  152. package/.claude/commands/maestro-milestone-audit.md +1 -15
  153. package/.claude/commands/maestro-milestone-complete.md +8 -3
  154. package/.claude/commands/maestro-milestone-release.md +8 -4
  155. package/.claude/commands/maestro-overlay.md +9 -0
  156. package/.claude/commands/maestro-plan.md +6 -62
  157. package/.claude/commands/maestro-player.md +2 -2
  158. package/.claude/commands/maestro-quick.md +5 -3
  159. package/.claude/commands/maestro-ralph-cli-execute.md +237 -0
  160. package/.claude/commands/maestro-ralph-cli.md +663 -0
  161. package/.claude/commands/maestro-ralph-execute.md +127 -11
  162. package/.claude/commands/maestro-ralph.md +8 -8
  163. package/.claude/commands/maestro-roadmap.md +1 -9
  164. package/.claude/commands/maestro-swarm-workflow.md +16 -14
  165. package/.claude/commands/maestro-tools-register.md +16 -1
  166. package/.claude/commands/maestro-ui-codify.md +11 -1
  167. package/.claude/commands/maestro-universal-workflow.md +28 -5
  168. package/.claude/commands/maestro-update.md +10 -7
  169. package/.claude/commands/maestro.md +1 -1
  170. package/.claude/commands/manage-codebase-rebuild.md +5 -1
  171. package/.claude/commands/manage-drift-realign.md +6 -2
  172. package/.claude/commands/manage-harvest.md +4 -1
  173. package/.claude/commands/manage-issue-discover.md +1 -0
  174. package/.claude/commands/manage-kg-extractors.md +5 -1
  175. package/.claude/commands/manage-knowhow-capture.md +1 -0
  176. package/.claude/commands/manage-knowledge-audit.md +3 -0
  177. package/.claude/commands/manage-wiki.md +1 -0
  178. package/.claude/commands/odyssey-debug.md +2 -1
  179. package/.claude/commands/odyssey-improve.md +2 -2
  180. package/.claude/commands/odyssey-planex.md +8 -7
  181. package/.claude/commands/odyssey-review-test-fix.md +4 -1
  182. package/.claude/commands/odyssey-ui.md +4 -4
  183. package/.claude/commands/quality-auto-test.md +11 -1
  184. package/.claude/commands/quality-debug.md +16 -2
  185. package/.claude/commands/quality-retrospective.md +9 -1
  186. package/.claude/commands/quality-review.md +8 -0
  187. package/.claude/commands/quality-sync.md +2 -2
  188. package/.claude/commands/quality-test.md +9 -1
  189. package/.claude/commands/security-audit.md +14 -4
  190. package/.claude/commands/spec-add.md +5 -2
  191. package/.claude/commands/spec-load.md +1 -1
  192. package/.claude/commands/spec-remove.md +1 -1
  193. package/.claude/commands/spec-setup.md +3 -0
  194. package/.claude/skills/team-adversarial-swarm/workflows/wf-swarm-synthesize.js +248 -248
  195. package/.claude/skills/team-coordinate/specs/role-spec-template.md +197 -198
  196. package/.claude/skills/team-roadmap-dev/SKILL.md +169 -169
  197. package/.claude/skills/team-roadmap-dev/specs/team-config.json +1 -1
  198. package/.claude/skills/team-swarm/roles/analyst/role.md +181 -185
  199. package/.codex/skills/codify-to-knowhow/SKILL.md +27 -15
  200. package/.codex/skills/domain-add/SKILL.md +5 -3
  201. package/.codex/skills/learn-decompose/SKILL.md +22 -4
  202. package/.codex/skills/learn-follow/SKILL.md +12 -6
  203. package/.codex/skills/learn-investigate/SKILL.md +11 -6
  204. package/.codex/skills/learn-retro/SKILL.md +12 -6
  205. package/.codex/skills/learn-second-opinion/SKILL.md +11 -3
  206. package/.codex/skills/maestro/SKILL.md +19 -13
  207. package/.codex/skills/maestro-amend/SKILL.md +10 -2
  208. package/.codex/skills/maestro-analyze/SKILL.md +7 -1
  209. package/.codex/skills/maestro-blueprint/SKILL.md +1 -1
  210. package/.codex/skills/maestro-brainstorm/SKILL.md +11 -8
  211. package/.codex/skills/maestro-collab/SKILL.md +5 -5
  212. package/.codex/skills/maestro-companion/SKILL.md +4 -1
  213. package/.codex/skills/maestro-composer/SKILL.md +6 -3
  214. package/.codex/skills/maestro-execute/SKILL.md +11 -8
  215. package/.codex/skills/maestro-fork/SKILL.md +4 -3
  216. package/.codex/skills/maestro-grill/SKILL.md +1 -1
  217. package/.codex/skills/maestro-guard/SKILL.md +1 -1
  218. package/.codex/skills/maestro-impeccable/SKILL.md +5 -5
  219. package/.codex/skills/maestro-init/SKILL.md +3 -2
  220. package/.codex/skills/maestro-milestone-audit/SKILL.md +21 -9
  221. package/.codex/skills/maestro-milestone-complete/SKILL.md +3 -3
  222. package/.codex/skills/maestro-milestone-release/SKILL.md +18 -1
  223. package/.codex/skills/maestro-next/SKILL.md +11 -10
  224. package/.codex/skills/maestro-overlay/SKILL.md +16 -6
  225. package/.codex/skills/maestro-player/SKILL.md +11 -5
  226. package/.codex/skills/maestro-quick/SKILL.md +2 -2
  227. package/.codex/skills/maestro-ralph/SKILL.md +44 -31
  228. package/.codex/skills/maestro-ralph-cli/SKILL.md +394 -0
  229. package/.codex/skills/maestro-ralph-cli-execute/SKILL.md +146 -0
  230. package/.codex/skills/maestro-ralph-execute/SKILL.md +105 -24
  231. package/.codex/skills/maestro-roadmap/SKILL.md +8 -2
  232. package/.codex/skills/maestro-tools-execute/SKILL.md +8 -4
  233. package/.codex/skills/maestro-tools-register/SKILL.md +10 -6
  234. package/.codex/skills/maestro-ui-codify/SKILL.md +14 -9
  235. package/.codex/skills/manage-codebase-rebuild/SKILL.md +36 -14
  236. package/.codex/skills/manage-codebase-refresh/SKILL.md +1 -1
  237. package/.codex/skills/manage-drift-realign/SKILL.md +15 -12
  238. package/.codex/skills/manage-harvest/SKILL.md +1 -1
  239. package/.codex/skills/manage-issue/SKILL.md +8 -4
  240. package/.codex/skills/manage-issue-discover/SKILL.md +15 -14
  241. package/.codex/skills/manage-knowhow/SKILL.md +3 -2
  242. package/.codex/skills/manage-knowhow-capture/SKILL.md +4 -3
  243. package/.codex/skills/manage-learn/SKILL.md +2 -2
  244. package/.codex/skills/odyssey-debug/SKILL.md +12 -7
  245. package/.codex/skills/odyssey-improve/SKILL.md +11 -6
  246. package/.codex/skills/odyssey-planex/SKILL.md +14 -8
  247. package/.codex/skills/odyssey-review-test-fix/SKILL.md +12 -7
  248. package/.codex/skills/odyssey-ui/SKILL.md +10 -5
  249. package/.codex/skills/quality-auto-test/SKILL.md +13 -5
  250. package/.codex/skills/quality-debug/SKILL.md +18 -11
  251. package/.codex/skills/quality-refactor/SKILL.md +4 -4
  252. package/.codex/skills/quality-retrospective/SKILL.md +5 -6
  253. package/.codex/skills/quality-review/SKILL.md +18 -11
  254. package/.codex/skills/quality-sync/SKILL.md +2 -2
  255. package/.codex/skills/quality-test/SKILL.md +7 -5
  256. package/.codex/skills/security-audit/SKILL.md +7 -5
  257. package/.codex/skills/spec-add/SKILL.md +9 -7
  258. package/.codex/skills/spec-load/SKILL.md +3 -2
  259. package/.codex/skills/spec-map/SKILL.md +10 -1
  260. package/.codex/skills/spec-remove/SKILL.md +3 -2
  261. package/.codex/skills/team-coordinate/SKILL.md +10 -4
  262. package/.codex/skills/team-lifecycle-v4/SKILL.md +33 -26
  263. package/.codex/skills/team-quality-assurance/SKILL.md +43 -0
  264. package/.codex/skills/team-review/SKILL.md +50 -6
  265. package/.codex/skills/team-tech-debt/SKILL.md +53 -7
  266. package/.codex/skills/team-testing/SKILL.md +50 -2
  267. package/.codex/skills/wiki-connect/SKILL.md +3 -1
  268. package/.codex/skills/wiki-digest/SKILL.md +6 -4
  269. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.d.ts +16 -0
  270. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +419 -44
  271. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -1
  272. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +43 -5
  273. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  274. package/dashboard/dist-server/src/commands/install-backend.js +31 -16
  275. package/dashboard/dist-server/src/commands/install-backend.js.map +1 -1
  276. package/dashboard/dist-server/src/core/component-defs.js +25 -0
  277. package/dashboard/dist-server/src/core/component-defs.js.map +1 -1
  278. package/dashboard/dist-server/src/graph/kg/db/types.d.ts +3 -0
  279. package/dashboard/dist-server/src/graph/kg/embedding/code-embedding.d.ts +46 -0
  280. package/dashboard/dist-server/src/graph/kg/embedding/code-embedding.js +329 -0
  281. package/dashboard/dist-server/src/graph/kg/embedding/code-embedding.js.map +1 -0
  282. package/dashboard/dist-server/src/graph/kg/embedding/index.d.ts +2 -0
  283. package/dashboard/dist-server/src/graph/kg/embedding/index.js +3 -0
  284. package/dashboard/dist-server/src/graph/kg/embedding/index.js.map +1 -0
  285. package/dashboard/dist-server/src/graph/kg/engine.d.ts +19 -1
  286. package/dashboard/dist-server/src/graph/kg/engine.js +71 -1
  287. package/dashboard/dist-server/src/graph/kg/engine.js.map +1 -1
  288. package/dashboard/dist-server/src/graph/kg/query/scoring.d.ts +5 -0
  289. package/dashboard/dist-server/src/graph/kg/query/scoring.js +85 -1
  290. package/dashboard/dist-server/src/graph/kg/query/scoring.js.map +1 -1
  291. package/dashboard/dist-server/src/graph/kg/query/search.d.ts +7 -0
  292. package/dashboard/dist-server/src/graph/kg/query/search.js +117 -1
  293. package/dashboard/dist-server/src/graph/kg/query/search.js.map +1 -1
  294. package/dashboard/dist-server/src/graph/kg/surface/mcp-tools.js +49 -0
  295. package/dashboard/dist-server/src/graph/kg/surface/mcp-tools.js.map +1 -1
  296. package/dashboard/dist-server/src/hooks/kg-sync-hook.js +3 -0
  297. package/dashboard/dist-server/src/hooks/kg-sync-hook.js.map +1 -1
  298. package/dashboard/dist-server/src/tools/spec-loader.js +7 -3
  299. package/dashboard/dist-server/src/tools/spec-loader.js.map +1 -1
  300. package/dist/src/commands/install-backend.d.ts.map +1 -1
  301. package/dist/src/commands/install-backend.js +31 -16
  302. package/dist/src/commands/install-backend.js.map +1 -1
  303. package/dist/src/core/component-defs.d.ts.map +1 -1
  304. package/dist/src/core/component-defs.js +25 -0
  305. package/dist/src/core/component-defs.js.map +1 -1
  306. package/dist/src/core/plugin-bridge.d.ts.map +1 -1
  307. package/dist/src/core/plugin-bridge.js +17 -0
  308. package/dist/src/core/plugin-bridge.js.map +1 -1
  309. package/dist/src/graph/kg/db/types.d.ts +3 -0
  310. package/dist/src/graph/kg/db/types.d.ts.map +1 -1
  311. package/dist/src/graph/kg/embedding/code-embedding.d.ts +47 -0
  312. package/dist/src/graph/kg/embedding/code-embedding.d.ts.map +1 -0
  313. package/dist/src/graph/kg/embedding/code-embedding.js +329 -0
  314. package/dist/src/graph/kg/embedding/code-embedding.js.map +1 -0
  315. package/dist/src/graph/kg/embedding/index.d.ts +3 -0
  316. package/dist/src/graph/kg/embedding/index.d.ts.map +1 -0
  317. package/dist/src/graph/kg/embedding/index.js +3 -0
  318. package/dist/src/graph/kg/embedding/index.js.map +1 -0
  319. package/dist/src/graph/kg/engine.d.ts +19 -1
  320. package/dist/src/graph/kg/engine.d.ts.map +1 -1
  321. package/dist/src/graph/kg/engine.js +71 -1
  322. package/dist/src/graph/kg/engine.js.map +1 -1
  323. package/dist/src/graph/kg/query/scoring.d.ts +5 -0
  324. package/dist/src/graph/kg/query/scoring.d.ts.map +1 -1
  325. package/dist/src/graph/kg/query/scoring.js +85 -1
  326. package/dist/src/graph/kg/query/scoring.js.map +1 -1
  327. package/dist/src/graph/kg/query/search.d.ts +7 -0
  328. package/dist/src/graph/kg/query/search.d.ts.map +1 -1
  329. package/dist/src/graph/kg/query/search.js +117 -1
  330. package/dist/src/graph/kg/query/search.js.map +1 -1
  331. package/dist/src/graph/kg/surface/mcp-tools.d.ts.map +1 -1
  332. package/dist/src/graph/kg/surface/mcp-tools.js +49 -0
  333. package/dist/src/graph/kg/surface/mcp-tools.js.map +1 -1
  334. package/dist/src/hooks/kg-sync-hook.d.ts.map +1 -1
  335. package/dist/src/hooks/kg-sync-hook.js +3 -0
  336. package/dist/src/hooks/kg-sync-hook.js.map +1 -1
  337. package/dist/src/tools/code-semantic-search.d.ts +10 -0
  338. package/dist/src/tools/code-semantic-search.d.ts.map +1 -0
  339. package/dist/src/tools/code-semantic-search.js +81 -0
  340. package/dist/src/tools/code-semantic-search.js.map +1 -0
  341. package/dist/src/tools/index.d.ts.map +1 -1
  342. package/dist/src/tools/index.js +4 -0
  343. package/dist/src/tools/index.js.map +1 -1
  344. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  345. package/dist/src/tools/spec-loader.js +7 -3
  346. package/dist/src/tools/spec-loader.js.map +1 -1
  347. package/dist/src/tools/wiki-search.d.ts +13 -0
  348. package/dist/src/tools/wiki-search.d.ts.map +1 -0
  349. package/dist/src/tools/wiki-search.js +114 -0
  350. package/dist/src/tools/wiki-search.js.map +1 -0
  351. package/dist/src/utils/update-notices.js +23 -0
  352. package/dist/src/utils/update-notices.js.map +1 -1
  353. package/package.json +4 -1
  354. package/workflows/agy-instructions.md +147 -161
  355. package/workflows/claude-instructions.md +100 -48
  356. package/workflows/codex-instructions.md +147 -161
  357. package/workflows/execute.md +4 -3
  358. package/workflows/explore-usage.md +41 -81
  359. package/workflows/grill.md +11 -0
  360. package/workflows/milestone-audit.md +8 -0
  361. package/workflows/odyssey-base-codex.md +115 -116
  362. package/workflows/odyssey-base.md +89 -91
  363. package/workflows/plan.md +6 -0
@@ -1,185 +1,181 @@
1
- ---
2
- role: analyst
3
- prefix: ANALYST
4
- inner_loop: false
5
- output_tag: "[analyst]"
6
- message_types:
7
- success: analysis_ready
8
- error: error
9
- ---
10
-
11
- # Analyst Role — Phase 2-4
12
-
13
- Tag: `[analyst]` | Prefix: `ANALYST-*`
14
- Responsibility: After swarm converges, synthesize the best solution + top trails + convergence curve into a human-readable `best-solution.md` report. Provides interpretation, not just data dump.
15
-
16
- ## Boundaries
17
-
18
- ### MUST
19
- - Read `<session>/best.json`, `<session>/artifacts/swarm-report.json`, all `<session>/trails/*.jsonl`
20
- - Produce `<session>/artifacts/best-solution.md` as the final deliverable
21
- - Explain WHY the best path won (which decisions mattered, evidence chain)
22
- - Compare best vs runner-ups to surface stability vs luck
23
- - Document convergence story (entropy curve, when stagnation hit)
24
-
25
- ### MUST NOT
26
- - Re-score solutions (that is scorer's job — analyst takes verified_score as given)
27
- - Modify best.json, trails, or pheromone state
28
- - Generate solutions of its own — analyst synthesizes existing ant outputs
29
- - Exceed ~150 lines in best-solution.md (be sharp, not verbose)
30
-
31
- ## Phase 2: Context Loading
32
-
33
- | Input | Source | Required |
34
- |-------|--------|----------|
35
- | Original objective | `<session>/swarm-config.json#ant_prompt.objective` | Yes |
36
- | Best solution | `<session>/best.json` | Yes |
37
- | Full swarm report | `<session>/artifacts/swarm-report.json` | Yes |
38
- | All trails | `<session>/trails/*.jsonl` | Yes |
39
- | Convergence reason | swarm-report.json or `aco.py converged` output | Yes |
40
- | Best ant artifact | `<session>/artifacts/ant-<best.iteration>-<best.id>.json` (full evidence) | Yes |
41
- | Issues log | `<session>/wisdom/issues.md` | Optional |
42
-
43
- Workflow:
44
- 1. Extract session path from task description
45
- 2. Read swarm-config.json -> capture objective
46
- 3. Read best.json -> identify best ant
47
- 4. Read full swarm-report.json -> get top_k + convergence_curve
48
- 5. Read the best ant's full artifact for evidence chain
49
- 6. Read all trails/*.jsonl into a list (chronological)
50
-
51
- ## Phase 3: Synthesis
52
-
53
- ### 3.1 Structure the report
54
-
55
- Layout for `best-solution.md`:
56
-
57
- ```markdown
58
- # Swarm Result — <objective_short_form>
59
-
60
- ## Best Solution
61
-
62
- **Path**: node_a → node_c → node_f
63
- **Verified Score**: 0.82
64
- **Iteration**: 3 of 5
65
- **Ant**: ANT-3-2
66
-
67
- ### Summary
68
- <one paragraph — what the best solution proposes and why it answers the objective>
69
-
70
- ### Evidence Chain
71
- - `src/foo.ts:42` — <how this evidence supports the decision>
72
- - `tests/foo.spec.ts:18` — <...>
73
-
74
- ### Candidate Artifact
75
- <extract from best.candidate_solution — quote or summarize, link to file if file_ref>
76
-
77
- ## Why This Path Won
78
-
79
- | Decision | Pheromone-guided? | Why it mattered |
80
- |----------|-------------------|-----------------|
81
- | start = node_a | weighted | <reason> |
82
- | a → c | yes (0.45 hint) | <reason> |
83
- | c → f | NO (deviation) | <reason> — this was the key call |
84
-
85
- ## Runner-Up Solutions
86
-
87
- | Rank | Ant | Path | Score | Diff from best |
88
- |------|-----|------|-------|----------------|
89
- | 2 | ANT-2-1 | a → b → e | 0.74 | -0.08; weaker evidence at e |
90
- | 3 | ANT-4-3 | a → c → g | 0.71 | -0.11; valid but less specific |
91
-
92
- ## Convergence Story
93
-
94
- Iterations: 4 of 5 max
95
- Trigger: stagnation (best unchanged for 2 iterations)
96
-
97
- Entropy curve:
98
- - iter 1: 3.21 (broad exploration)
99
- - iter 2: 2.45 (narrowing on node_a region)
100
- - iter 3: 1.85 (best emerges at ANT-3-2)
101
- - iter 4: 1.72 (consensus around best, no improvement)
102
-
103
- Interpretation: <2-3 sentences on whether the swarm converged on a genuine optimum or got stuck>
104
-
105
- ## Caveats
106
-
107
- - <e.g., 40% of ants in iter 2 flagged as hallucinations>
108
- - <e.g., evidence for node_f is single-source — recommend manual verification>
109
- - <e.g., search space had only N nodes — larger space may surface better solutions>
110
-
111
- ## Reproducibility
112
-
113
- - Config: `swarm-config.json` (pinned)
114
- - Best path: `best.json`
115
- - Full trails: `trails/<iter>.jsonl`
116
- - Random seed: <if used>
117
- ```
118
-
119
- ### 3.2 Interpretation rules
120
-
121
- - **Why-it-won analysis** is the highest-value content. Don't just describe the path — explain which decisions were pivotal.
122
- - **Pheromone vs deviation**: track which steps followed pheromone hints vs deviated. Deviations that produced higher scores are the most interesting signal.
123
- - **Runner-up diff**: surface why #2 lost — was it a weaker path or just unlucky evidence?
124
- - **Caveats are mandatory**: every swarm result has limitations. List them honestly.
125
-
126
- ### 3.3 Constraints
127
-
128
- - Target 150 lines
129
- - No prose padding every section earns its place
130
- - Quote evidence verbatim where possible (file:line refs)
131
- - Don't editorialize beyond what evidence supports
132
-
133
- ## Phase 4: Verify + Publish
134
-
135
- ### Behavioral Traits
136
-
137
- #### Accuracy
138
- - Every cited path/score MUST match best.json or trails source
139
- - Every evidence reference MUST be verifiable (Read to confirm if file_ref)
140
- - Convergence curve numbers MUST match swarm-report.json#convergence_curve
141
-
142
- #### Feedback Contract
143
- | Field | Required | Content |
144
- |-------|----------|---------|
145
- | artifacts_written | Always | `<session>/artifacts/best-solution.md` |
146
- | line_count | Always | int (target 150) |
147
- | verification_method | Always | "cross_ref_with_best.json + evidence_verified" |
148
-
149
- #### Quality Gate
150
- - Final report file exists and parses as markdown
151
- - All sections present (Best Solution / Why Won / Runner-Ups / Convergence / Caveats / Reproducibility)
152
- - Line count ≤ 200 (hard cap — fail if exceeded, retry with sharper edit)
153
-
154
- ### Verification Steps
155
-
156
- 1. Read written best-solution.md back
157
- 2. Cross-check best.score against best.json
158
- 3. Confirm runner-up scores against trails
159
- 4. If file_ref evidence in best.candidate_solution -> Read to confirm file exists
160
- 5. Count lines — if > 200, condense and rewrite
161
-
162
- ### State Update
163
-
164
- ```json
165
- {
166
- "task_id": "ANALYST-1",
167
- "role": "analyst",
168
- "status": "completed",
169
- "artifact_path": "<session>/artifacts/best-solution.md",
170
- "best_score": <float>,
171
- "best_ant_id": "<id>",
172
- "line_count": <int>,
173
- "verification": "cross_ref_pass + evidence_verified"
174
- }
175
- ```
176
-
177
- ## Error Handling
178
-
179
- | Scenario | Resolution |
180
- |----------|------------|
181
- | best.json missing | Pipeline produced no valid ant write minimal report with `status: no_solution` |
182
- | Trails empty | Same as above — no exploration data to analyze |
183
- | Best ant artifact missing | Use only best.json fields; note as caveat |
184
- | Cross-ref mismatch (score discrepancy) | Trust best.json; note discrepancy in caveats |
185
- | Line count > 200 after rewrite | Hard-fail report; coordinator decides retry vs accept |
1
+ ---
2
+ role: analyst
3
+ prefix: ANALYST
4
+ inner_loop: false
5
+ output_tag: "[analyst]"
6
+ message_types:
7
+ success: analysis_ready
8
+ error: error
9
+ ---
10
+
11
+ # Analyst Role — Phase 2-4
12
+
13
+ Tag: `[analyst]` | Prefix: `ANALYST-*`
14
+ Responsibility: After swarm converges, synthesize the best solution + top trails + convergence curve into a human-readable `best-solution.md` report. Provides interpretation, not just data dump.
15
+
16
+ ## Boundaries
17
+
18
+ ### MUST
19
+ - Read `<session>/best.json`, `<session>/artifacts/swarm-report.json`, all `<session>/trails/*.jsonl`
20
+ - Produce `<session>/artifacts/best-solution.md` as the final deliverable
21
+ - Explain WHY the best path won (which decisions mattered, evidence chain)
22
+ - Compare best vs runner-ups to surface stability vs luck
23
+ - Document convergence story (entropy curve, when stagnation hit)
24
+
25
+ ### MUST NOT
26
+ - Re-score solutions (that is scorer's job — analyst takes verified_score as given)
27
+ - Modify best.json, trails, or pheromone state
28
+ - Generate solutions of its own — analyst synthesizes existing ant outputs
29
+ - Pad best-solution.md with prose every section must earn its place
30
+
31
+ ## Phase 2: Context Loading
32
+
33
+ | Input | Source | Required |
34
+ |-------|--------|----------|
35
+ | Original objective | `<session>/swarm-config.json#ant_prompt.objective` | Yes |
36
+ | Best solution | `<session>/best.json` | Yes |
37
+ | Full swarm report | `<session>/artifacts/swarm-report.json` | Yes |
38
+ | All trails | `<session>/trails/*.jsonl` | Yes |
39
+ | Convergence reason | swarm-report.json or `aco.py converged` output | Yes |
40
+ | Best ant artifact | `<session>/artifacts/ant-<best.iteration>-<best.id>.json` (full evidence) | Yes |
41
+ | Issues log | `<session>/wisdom/issues.md` | Optional |
42
+
43
+ Workflow:
44
+ 1. Extract session path from task description
45
+ 2. Read swarm-config.json -> capture objective
46
+ 3. Read best.json -> identify best ant
47
+ 4. Read full swarm-report.json -> get top_k + convergence_curve
48
+ 5. Read the best ant's full artifact for evidence chain
49
+ 6. Read all trails/*.jsonl into a list (chronological)
50
+
51
+ ## Phase 3: Synthesis
52
+
53
+ ### 3.1 Structure the report
54
+
55
+ Layout for `best-solution.md`:
56
+
57
+ ```markdown
58
+ # Swarm Result — <objective_short_form>
59
+
60
+ ## Best Solution
61
+
62
+ **Path**: node_a → node_c → node_f
63
+ **Verified Score**: 0.82
64
+ **Iteration**: 3 of 5
65
+ **Ant**: ANT-3-2
66
+
67
+ ### Summary
68
+ <one paragraph — what the best solution proposes and why it answers the objective>
69
+
70
+ ### Evidence Chain
71
+ - `src/foo.ts:42` — <how this evidence supports the decision>
72
+ - `tests/foo.spec.ts:18` — <...>
73
+
74
+ ### Candidate Artifact
75
+ <extract from best.candidate_solution — quote or summarize, link to file if file_ref>
76
+
77
+ ## Why This Path Won
78
+
79
+ | Decision | Pheromone-guided? | Why it mattered |
80
+ |----------|-------------------|-----------------|
81
+ | start = node_a | weighted | <reason> |
82
+ | a → c | yes (0.45 hint) | <reason> |
83
+ | c → f | NO (deviation) | <reason> — this was the key call |
84
+
85
+ ## Runner-Up Solutions
86
+
87
+ | Rank | Ant | Path | Score | Diff from best |
88
+ |------|-----|------|-------|----------------|
89
+ | 2 | ANT-2-1 | a → b → e | 0.74 | -0.08; weaker evidence at e |
90
+ | 3 | ANT-4-3 | a → c → g | 0.71 | -0.11; valid but less specific |
91
+
92
+ ## Convergence Story
93
+
94
+ Iterations: 4 of 5 max
95
+ Trigger: stagnation (best unchanged for 2 iterations)
96
+
97
+ Entropy curve:
98
+ - iter 1: 3.21 (broad exploration)
99
+ - iter 2: 2.45 (narrowing on node_a region)
100
+ - iter 3: 1.85 (best emerges at ANT-3-2)
101
+ - iter 4: 1.72 (consensus around best, no improvement)
102
+
103
+ Interpretation: <2-3 sentences on whether the swarm converged on a genuine optimum or got stuck>
104
+
105
+ ## Caveats
106
+
107
+ - <e.g., 40% of ants in iter 2 flagged as hallucinations>
108
+ - <e.g., evidence for node_f is single-source — recommend manual verification>
109
+ - <e.g., search space had only N nodes — larger space may surface better solutions>
110
+
111
+ ## Reproducibility
112
+
113
+ - Config: `swarm-config.json` (pinned)
114
+ - Best path: `best.json`
115
+ - Full trails: `trails/<iter>.jsonl`
116
+ - Random seed: <if used>
117
+ ```
118
+
119
+ ### 3.2 Interpretation rules
120
+
121
+ - **Why-it-won analysis** is the highest-value content. Don't just describe the path — explain which decisions were pivotal.
122
+ - **Pheromone vs deviation**: track which steps followed pheromone hints vs deviated. Deviations that produced higher scores are the most interesting signal.
123
+ - **Runner-up diff**: surface why #2 lost — was it a weaker path or just unlucky evidence?
124
+ - **Caveats are mandatory**: every swarm result has limitations. List them honestly.
125
+
126
+ ### 3.3 Constraints
127
+
128
+ - No prose padding — every section earns its place
129
+ - Quote evidence verbatim where possible (file:line refs)
130
+ - Don't editorialize beyond what evidence supports
131
+
132
+ ## Phase 4: Verify + Publish
133
+
134
+ ### Behavioral Traits
135
+
136
+ #### Accuracy
137
+ - Every cited path/score MUST match best.json or trails source
138
+ - Every evidence reference MUST be verifiable (Read to confirm if file_ref)
139
+ - Convergence curve numbers MUST match swarm-report.json#convergence_curve
140
+
141
+ #### Feedback Contract
142
+ | Field | Required | Content |
143
+ |-------|----------|---------|
144
+ | artifacts_written | Always | `<session>/artifacts/best-solution.md` |
145
+ | line_count | Always | int (informational) |
146
+ | verification_method | Always | "cross_ref_with_best.json + evidence_verified" |
147
+
148
+ #### Quality Gate
149
+ - Final report file exists and parses as markdown
150
+ - All sections present (Best Solution / Why Won / Runner-Ups / Convergence / Caveats / Reproducibility)
151
+
152
+ ### Verification Steps
153
+
154
+ 1. Read written best-solution.md back
155
+ 2. Cross-check best.score against best.json
156
+ 3. Confirm runner-up scores against trails
157
+ 4. If file_ref evidence in best.candidate_solution -> Read to confirm file exists
158
+
159
+ ### State Update
160
+
161
+ ```json
162
+ {
163
+ "task_id": "ANALYST-1",
164
+ "role": "analyst",
165
+ "status": "completed",
166
+ "artifact_path": "<session>/artifacts/best-solution.md",
167
+ "best_score": <float>,
168
+ "best_ant_id": "<id>",
169
+ "line_count": <int>,
170
+ "verification": "cross_ref_pass + evidence_verified"
171
+ }
172
+ ```
173
+
174
+ ## Error Handling
175
+
176
+ | Scenario | Resolution |
177
+ |----------|------------|
178
+ | best.json missing | Pipeline produced no valid ant — write minimal report with `status: no_solution` |
179
+ | Trails empty | Same as above — no exploration data to analyze |
180
+ | Best ant artifact missing | Use only best.json fields; note as caveat |
181
+ | Cross-ref mismatch (score discrepancy) | Trust best.json; note discrepancy in caveats |
@@ -145,22 +145,24 @@ $codify-to-knowhow ".workflow/reference_style/my-style-v1"
145
145
  2. **Idempotent Writes**: Same-slug file exists = skip, never overwrite
146
146
  3. **Closed Tags**: All entries use `<spec-entry>` / `<knowhow-entry>` closed-tag format
147
147
  4. **Upstream Generates Manifest**: This skill only writes, never extracts knowledge
148
- 5. **CLI First, File Fallback**: Prefer `maestro spec add` CLI; fall back to direct file append on failure
149
- 6. **Ref Bridge**: Spec entries reference knowhow files via `ref` attribute
148
+ 5. **CLI First, File Fallback**: Prefer `maestro spec add` CLI with `--ref` param; fall back to direct file append on failure (with confirmation log)
149
+ 6. **Ref Bridge**: Spec entries reference knowhow files via `ref` attribute — both CLI path (`--ref` flag) and fallback path (`ref` attr in `<spec-entry>`) carry the ref
150
150
  </invariants>
151
151
 
152
152
  <execution>
153
153
 
154
154
  ### Step 1: Parse Package Path
155
155
 
156
- **Parse from `$ARGUMENTS`**:
156
+ **Parse first positional from `$ARGUMENTS` and assign to `package_path`**:
157
157
 
158
158
  | Variable | Source | Default |
159
159
  |----------|--------|---------|
160
- | `package_path` | positional (required) | ERROR if missing |
160
+ | `package_path` | first positional from $ARGUMENTS (required) | ERROR if missing |
161
161
 
162
162
  ```bash
163
- package_path="${PACKAGE_PATH}"
163
+ # Parse first positional argument from $ARGUMENTS
164
+ package_path="$(echo "$ARGUMENTS" | awk '{print $1}')"
165
+ test -n "$package_path" || { echo "ERROR: package_path is required as first positional argument"; exit 1; }
164
166
 
165
167
  # Validate directory exists
166
168
  test -d "$package_path" || { echo "ERROR: Package path not found: $package_path"; exit 1; }
@@ -313,10 +315,12 @@ ${spec.body}
313
315
 
314
316
  // Prefer CLI, fallback to direct append
315
317
  const descFlag = spec.description ? ` --description "${spec.description}"` : '';
316
- const cliResult = Bash(`maestro spec add ${spec.category} "${spec.title}" "${spec.body}" --keywords "${spec.keywords}"${descFlag} 2>/dev/null`);
318
+ const refFlag = spec.ref ? ` --ref "${spec.ref}"` : '';
319
+ const cliResult = Bash(`maestro spec add ${spec.category} "${spec.title}" "${spec.body}" --keywords "${spec.keywords}"${descFlag}${refFlag} 2>/dev/null`);
317
320
 
318
321
  if (cliResult.exitCode !== 0) {
319
- // Fallback: direct file append
322
+ // Fallback: direct file append — confirm before writing
323
+ REPORT(`CLI failed for "${spec.title}", falling back to direct append to ${targetFile}`);
320
324
  Edit(targetFile, { append: entryBlock });
321
325
  }
322
326
 
@@ -348,22 +352,30 @@ for file in ${knowhowPaths}; do
348
352
  done
349
353
  ```
350
354
 
351
- **6b: Verify spec entries**:
355
+ **6b: Verify spec entries** (verify by actual targetFile set from manifest, not hardcoded categories):
356
+
357
+ ```javascript
358
+ // Collect unique target files from manifest specs
359
+ const verifiedFiles = new Set();
360
+ for (const spec of manifest.specs) {
361
+ const targetFile = `.workflow/specs/${categoryFileMap[spec.category]}`;
362
+ verifiedFiles.add(targetFile);
363
+ }
364
+ ```
352
365
 
353
366
  ```bash
354
367
  echo "=== Spec Entry Verification ==="
355
- grep -c "${slug}" .workflow/specs/coding-conventions.md 2>/dev/null && \
356
- echo " OK: coding-conventions.md" || echo " MISSING: No entries in coding-conventions.md"
357
-
358
- grep -c "${slug}" .workflow/specs/architecture-constraints.md 2>/dev/null && \
359
- echo " OK: architecture-constraints.md" || echo " MISSING: No entries in architecture-constraints.md"
368
+ for target_file in ${verifiedFiles}; do
369
+ grep -c "${slug}" "${target_file}" 2>/dev/null && \
370
+ echo " OK: ${target_file}" || echo " MISSING: No entries in ${target_file}"
371
+ done
360
372
  ```
361
373
 
362
- **6c: Verify ref links**:
374
+ **6c: Verify ref links** (scan only the target files derived from the manifest):
363
375
 
364
376
  ```bash
365
377
  echo "=== Ref Link Verification ==="
366
- refs=$(grep -oP 'ref="knowhow/[^"]*"' .workflow/specs/coding-conventions.md .workflow/specs/architecture-constraints.md 2>/dev/null | grep "${slug}" || true)
378
+ refs=$(grep -oP 'ref="knowhow/[^"]*"' ${verifiedFiles} 2>/dev/null | grep "${slug}" || true)
367
379
 
368
380
  if [ -n "$refs" ]; then
369
381
  echo "$refs" | while IFS= read -r ref; do
@@ -34,7 +34,7 @@ Extract canonical (first token, kebab-case) and definition (remainder) from argu
34
34
 
35
35
  ### Step 2: Validate Domain Directory
36
36
 
37
- Verify `.workflow/domain/glossary.yaml` exists (E002). If not, run `maestro domain init`.
37
+ Verify `.workflow/domain/glossary.yaml` exists. If missing, ask user to confirm auto-initialization (`maestro domain init`). Proceed on confirmation; abort with E002 if declined. Skip confirmation when `--yes` flag is set.
38
38
 
39
39
  ### Step 3: Check Duplicates
40
40
 
@@ -42,7 +42,7 @@ Read existing glossary and check for:
42
42
  - Exact duplicate (same canonical name) → report existing entry, exit
43
43
  - Near match (Levenshtein ≤ 2 or alias overlap) → warn, ask to confirm or merge
44
44
 
45
- ### Step 4: Extract Metadata
45
+ ### Step 4: Extract & Confirm Metadata
46
46
 
47
47
  Auto-derive from the definition and codebase context:
48
48
  - **aliases** (1-3): common abbreviations, Chinese translations, alternate forms
@@ -50,6 +50,8 @@ Auto-derive from the definition and codebase context:
50
50
  - **tier**: `core` | `extended` | `peripheral`
51
51
  - **relationships**: scan existing glossary for related terms
52
52
 
53
+ Display a preview of all derived metadata and ask user to confirm or edit before proceeding. When `--yes` / `-y` flag is set, skip confirmation and write directly.
54
+
53
55
  ### Step 5: Register Term
54
56
 
55
57
  ```bash
@@ -66,7 +68,7 @@ Display: canonical name, definition, aliases, tier, relationships, and verify co
66
68
  | Code | Severity | Description |
67
69
  |------|----------|-------------|
68
70
  | E001 | fatal | Canonical name and definition are both required |
69
- | E002 | fatal | `.workflow/domain/` not initialized run `maestro domain init` first |
71
+ | E002 | fatal | `.workflow/domain/` not initialized and user declined auto-init |
70
72
  | E003 | fatal | Term already registered with same canonical name |
71
73
  </error_codes>
72
74
 
@@ -77,7 +77,9 @@ Generate `tasks.csv` with 4 dimension rows (wave 1) + 1 cross-ref row (wave 2).
77
77
  "findings": { "type": "string", "maxLength": 500 },
78
78
  "error": { "type": "string" }
79
79
  },
80
- "required": ["id", "result_status", "findings"]
80
+ "required": ["id", "result_status", "findings"],
81
+ "if": { "properties": { "result_status": { "const": "completed" } } },
82
+ "then": { "required": ["id", "result_status", "findings", "patterns", "dimension"] }
81
83
  }
82
84
  ```
83
85
 
@@ -110,14 +112,29 @@ Each dimension agent populates `patterns` as a JSON array string of:
110
112
 
111
113
  ### Phase 3: Wave 2 — Cross-Reference + Catalog
112
114
 
113
- Single agent receives all wave 1 findings via `prev_context`. Uses same `output_schema` + termination contract above. Tasks:
115
+ Single agent receives all wave 1 findings via `prev_context`. Uses same `output_schema` + termination contract above.
116
+
117
+ **prev_context filtering**: Only rows with `result_status=="completed"` are forwarded. For each wave 1 row that `failed`, append a `gap_note` line to the cross-ref instruction: `"[GAP] {dimension} scan failed — catalog may be incomplete for this dimension."` The cross-ref agent must not fabricate patterns for missing dimensions.
118
+
119
+ Tasks:
114
120
  - Match against dedup set → mark as `documented`, `known`, or `new`
115
121
  - Merge duplicates across dimensions (same pattern found by multiple agents)
116
122
  - Flag contradictions with documented conventions
117
- - Build pattern catalog grouped by dimension
123
+ - Build pattern catalog grouped by dimension; note any gap dimensions
118
124
 
119
125
  ### Phase 4: Persist
120
126
 
127
+ **Preview gate** (unless `-y`/`--yes`):
128
+ 1. Build a summary table of all writes that will be performed:
129
+ - Knowhow file path + pattern count
130
+ - New patterns to append to `learnings.md` (list names + INS-ids)
131
+ - If `--save-spec`: spec entries to create
132
+ - If `--save-wiki`: wiki notes to create
133
+ 2. Display the summary to the user via `request_user_input` asking for confirmation (`y` to proceed, `n` to abort, `e` to edit selection).
134
+ 3. If user selects `e`, re-display with checkboxes and apply only checked items.
135
+ 4. If `-y`/`--yes` flag is set, skip the preview gate and write all items automatically.
136
+
137
+ **Writes:**
121
138
  1. Write `KNW-decompose-{slug}-{date}.md` with full catalog
122
139
  2. Append each **new** pattern to `.workflow/specs/learnings.md` (source: "decompose", category: "pattern")
123
140
  3. If `--save-spec`: invoke `spec-add` per new pattern
@@ -129,7 +146,7 @@ Single agent receives all wave 1 findings via `prev_context`. Uses same `output_
129
146
  |------|----------|-----------|----------|
130
147
  | E001 | error | Target path not found | Check path or use module name |
131
148
  | E002 | error | No source files in target | Check target has .ts/.js files |
132
- | W001 | warning | Dimension agent failed — partial results | Proceed with available dimensions |
149
+ | W001 | warning | Dimension agent failed — partial results | Exclude from prev_context, add gap_note, proceed |
133
150
  | W002 | warning | coding-conventions.md not found | All patterns marked "new" |
134
151
  </error_codes>
135
152
 
@@ -138,6 +155,7 @@ Single agent receives all wave 1 findings via `prev_context`. Uses same `output_
138
155
  - [ ] 4 dimension agents spawned in parallel via spawn_agents_on_csv
139
156
  - [ ] Each finding has: name, dimension, confidence, anchors, description
140
157
  - [ ] Cross-reference performed (documented / known / new)
158
+ - [ ] Preview summary shown and user confirmed (or `-y` flag bypassed)
141
159
  - [ ] Pattern catalog written to `KNW-decompose-{slug}-{date}.md`
142
160
  - [ ] New patterns appended to `.workflow/specs/learnings.md` with stable INS-ids
143
161
  - [ ] If --save-spec / --save-wiki: entries created
@@ -52,10 +52,15 @@ From forcing question answers, extract: design patterns (with file:line anchors)
52
52
 
53
53
  Cross-reference against `coding-conventions.md`: documented vs undocumented patterns.
54
54
 
55
- ### Stage 5: Persist
56
- 1. Write `KNW-follow-{slug}-{date}.md` with understanding map
57
- 2. Append new patterns to `.workflow/specs/learnings.md` (source: "follow", stable INS-ids)
58
- 3. If `--save-wiki`: create wiki note entry
55
+ ### Stage 5: Persist (confirmation-gated)
56
+ 1. Display understanding map summary to user
57
+ 2. **Confirmation gate**: prompt user via `request_user_input` "Save knowhow and specs? (y/n/edit)"
58
+ - `y` proceed to write
59
+ - `n` → skip persistence, display summary only
60
+ - `edit` → let user modify findings before writing
61
+ 3. On confirmation: write `KNW-follow-{slug}-{date}.md` with understanding map
62
+ 4. On confirmation: append new patterns to `.workflow/specs/learnings.md` (source: "follow", stable INS-ids)
63
+ 5. If `--save-wiki`: create wiki note entry (also gated by step 2 confirmation)
59
64
 
60
65
  **Next steps:** `$learn-decompose <path>`, `$spec-add coding ...`, `$learn-second-opinion <file>`
61
66
  </execution>
@@ -75,6 +80,7 @@ Cross-reference against `coding-conventions.md`: documented vs undocumented patt
75
80
  - [ ] All 4 forcing questions applied per section
76
81
  - [ ] Patterns extracted with file:line anchors
77
82
  - [ ] Understanding map produced with concepts, patterns, assumptions, questions
78
- - [ ] `KNW-follow-{slug}-{date}.md` written
79
- - [ ] `.workflow/specs/learnings.md` appended with stable INS-ids
83
+ - [ ] User confirmation obtained before persistence
84
+ - [ ] `KNW-follow-{slug}-{date}.md` written (if confirmed)
85
+ - [ ] `.workflow/specs/learnings.md` appended with stable INS-ids (if confirmed)
80
86
  </success_criteria>
@@ -17,6 +17,7 @@ $ARGUMENTS — question text and optional flags.
17
17
  **Flags:**
18
18
  - `--scope <path>` — Restrict to files under this directory (default: entire project)
19
19
  - `--max-hypotheses N` — Max hypotheses before escalating (default: 3)
20
+ - `--no-persist` — Skip writing to learnings.md (report.md still written locally)
20
21
 
21
22
  **Output**: `.workflow/knowhow/KNW-investigate-{slug}/` (evidence.ndjson, understanding.md, report.md)
22
23
  </context>
@@ -50,12 +51,15 @@ Generate ranked hypotheses from evidence. For each (in rank order):
50
51
  ### Stage 4: 3-Strike Escalation
51
52
  If all hypotheses fail: broaden scope, search wiki with alt keywords, or mark INCONCLUSIVE.
52
53
 
53
- ### Stage 5: Synthesize + Persist
54
+ ### Stage 5: Synthesize + Persist (confirmation-gated)
54
55
  1. Write `report.md` with answer, evidence trail, hypothesis results
55
- 2. Append to `.workflow/specs/learnings.md`:
56
- - Confirmed category: "technique" / "pattern"
57
- - Disprovedcategory: "gotcha"
58
- 3. Display summary with next-step routing
56
+ 2. If `--no-persist`: skip learnings append, display summary only
57
+ 3. Otherwise: **Confirmation gate** — prompt user via `request_user_input`: "Persist findings to learnings.md? (y/n)"
58
+ - `y`append to `.workflow/specs/learnings.md`:
59
+ - Confirmed category: "technique" / "pattern"
60
+ - Disproved → category: "gotcha"
61
+ - `n` → skip learnings append
62
+ 4. Display summary with next-step routing
59
63
 
60
64
  **Next steps:** `$spec-add debug <finding>`, `$learn-follow <path>`, `$learn-decompose <module>`
61
65
  </execution>
@@ -76,6 +80,7 @@ If all hypotheses fail: broaden scope, search wiki with alt keywords, or mark IN
76
80
  - [ ] At least 1 hypothesis formed and tested
77
81
  - [ ] understanding.md tracks evolving understanding
78
82
  - [ ] report.md written with answer and evidence trail
79
- - [ ] Findings appended to .workflow/specs/learnings.md with stable INS-ids
83
+ - [ ] User confirmation obtained before learnings append (unless --no-persist)
84
+ - [ ] Findings appended to .workflow/specs/learnings.md with stable INS-ids (if confirmed)
80
85
  - [ ] 3-strike escalation triggered if all hypotheses fail
81
86
  </success_criteria>