maestro-flow 0.5.45 → 0.5.47

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 (310) hide show
  1. package/.agents/agents/ralph-executor.md +51 -6
  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-companion/SKILL.md +11 -0
  9. package/.agents/skills/maestro-composer/SKILL.md +11 -0
  10. package/.agents/skills/maestro-guard/SKILL.md +25 -0
  11. package/.agents/skills/maestro-init/SKILL.md +28 -0
  12. package/.agents/skills/maestro-overlay/SKILL.md +11 -0
  13. package/.agents/skills/maestro-player/SKILL.md +11 -0
  14. package/.agents/skills/maestro-quick/SKILL.md +29 -0
  15. package/.agents/skills/maestro-ralph-v2/SKILL.md +124 -61
  16. package/.agents/skills/maestro-swarm-workflow/SKILL.md +25 -0
  17. package/.agents/skills/maestro-tools-execute/SKILL.md +29 -0
  18. package/.agents/skills/maestro-tools-register/SKILL.md +29 -0
  19. package/.agents/skills/maestro-ui-codify/SKILL.md +11 -0
  20. package/.agents/skills/maestro-universal-workflow/SKILL.md +59 -0
  21. package/.agents/skills/maestro-update/SKILL.md +38 -0
  22. package/.agents/skills/manage-codebase-rebuild/SKILL.md +29 -0
  23. package/.agents/skills/manage-drift-realign/SKILL.md +12 -0
  24. package/.agents/skills/manage-harvest/SKILL.md +30 -6
  25. package/.agents/skills/manage-issue/SKILL.md +23 -0
  26. package/.agents/skills/manage-issue-discover/SKILL.md +28 -0
  27. package/.agents/skills/manage-kg-extractors/SKILL.md +27 -1
  28. package/.agents/skills/manage-knowhow/SKILL.md +26 -0
  29. package/.agents/skills/manage-knowhow-capture/SKILL.md +24 -0
  30. package/.agents/skills/manage-knowledge-audit/SKILL.md +13 -0
  31. package/.agents/skills/manage-status/SKILL.md +22 -0
  32. package/.agents/skills/manage-wiki/SKILL.md +28 -0
  33. package/.agents/skills/odyssey-debug/SKILL.md +338 -253
  34. package/.agents/skills/odyssey-improve/SKILL.md +417 -281
  35. package/.agents/skills/odyssey-planex/SKILL.md +536 -420
  36. package/.agents/skills/odyssey-review-test-fix/SKILL.md +386 -251
  37. package/.agents/skills/odyssey-ui/SKILL.md +382 -247
  38. package/.agents/skills/quality-auto-test/SKILL.md +12 -0
  39. package/.agents/skills/quality-debug/SKILL.md +11 -0
  40. package/.agents/skills/quality-refactor/SKILL.md +11 -0
  41. package/.agents/skills/quality-retrospective/SKILL.md +11 -0
  42. package/.agents/skills/quality-review/SKILL.md +11 -0
  43. package/.agents/skills/quality-sync/SKILL.md +10 -0
  44. package/.agents/skills/quality-test/SKILL.md +12 -0
  45. package/.agents/skills/security-audit/SKILL.md +11 -0
  46. package/.agents/skills/spec-add/SKILL.md +27 -0
  47. package/.agents/skills/spec-load/SKILL.md +25 -0
  48. package/.agents/skills/spec-remove/SKILL.md +26 -0
  49. package/.agents/skills/spec-setup/SKILL.md +30 -0
  50. package/.agy/agents/ralph-executor.md +53 -6
  51. package/.agy/skills/domain-add/SKILL.md +9 -0
  52. package/.agy/skills/learn-decompose/SKILL.md +12 -0
  53. package/.agy/skills/learn-follow/SKILL.md +41 -0
  54. package/.agy/skills/learn-investigate/SKILL.md +14 -0
  55. package/.agy/skills/learn-second-opinion/SKILL.md +14 -0
  56. package/.agy/skills/maestro-amend/SKILL.md +11 -0
  57. package/.agy/skills/maestro-companion/SKILL.md +11 -0
  58. package/.agy/skills/maestro-composer/SKILL.md +11 -0
  59. package/.agy/skills/maestro-guard/SKILL.md +25 -0
  60. package/.agy/skills/maestro-init/SKILL.md +28 -0
  61. package/.agy/skills/maestro-overlay/SKILL.md +11 -0
  62. package/.agy/skills/maestro-player/SKILL.md +11 -0
  63. package/.agy/skills/maestro-quick/SKILL.md +29 -0
  64. package/.agy/skills/maestro-ralph-v2/SKILL.md +123 -61
  65. package/.agy/skills/maestro-swarm-workflow/SKILL.md +25 -0
  66. package/.agy/skills/maestro-tools-execute/SKILL.md +29 -0
  67. package/.agy/skills/maestro-tools-register/SKILL.md +29 -0
  68. package/.agy/skills/maestro-ui-codify/SKILL.md +11 -0
  69. package/.agy/skills/maestro-universal-workflow/SKILL.md +59 -0
  70. package/.agy/skills/maestro-update/SKILL.md +38 -0
  71. package/.agy/skills/manage-codebase-rebuild/SKILL.md +29 -0
  72. package/.agy/skills/manage-drift-realign/SKILL.md +12 -0
  73. package/.agy/skills/manage-harvest/SKILL.md +30 -6
  74. package/.agy/skills/manage-issue/SKILL.md +23 -0
  75. package/.agy/skills/manage-issue-discover/SKILL.md +28 -0
  76. package/.agy/skills/manage-kg-extractors/SKILL.md +27 -1
  77. package/.agy/skills/manage-knowhow/SKILL.md +26 -0
  78. package/.agy/skills/manage-knowhow-capture/SKILL.md +24 -0
  79. package/.agy/skills/manage-knowledge-audit/SKILL.md +13 -0
  80. package/.agy/skills/manage-status/SKILL.md +22 -0
  81. package/.agy/skills/manage-wiki/SKILL.md +28 -0
  82. package/.agy/skills/odyssey-debug/SKILL.md +338 -253
  83. package/.agy/skills/odyssey-improve/SKILL.md +417 -281
  84. package/.agy/skills/odyssey-planex/SKILL.md +536 -420
  85. package/.agy/skills/odyssey-review-test-fix/SKILL.md +386 -251
  86. package/.agy/skills/odyssey-ui/SKILL.md +382 -247
  87. package/.agy/skills/quality-auto-test/SKILL.md +12 -0
  88. package/.agy/skills/quality-debug/SKILL.md +11 -0
  89. package/.agy/skills/quality-refactor/SKILL.md +11 -0
  90. package/.agy/skills/quality-retrospective/SKILL.md +11 -0
  91. package/.agy/skills/quality-review/SKILL.md +11 -0
  92. package/.agy/skills/quality-sync/SKILL.md +10 -0
  93. package/.agy/skills/quality-test/SKILL.md +12 -0
  94. package/.agy/skills/security-audit/SKILL.md +11 -0
  95. package/.agy/skills/spec-add/SKILL.md +27 -0
  96. package/.agy/skills/spec-load/SKILL.md +25 -0
  97. package/.agy/skills/spec-remove/SKILL.md +26 -0
  98. package/.agy/skills/spec-setup/SKILL.md +30 -0
  99. package/.claude/agents/ralph-executor.md +51 -6
  100. package/.claude/commands/domain-add.md +9 -0
  101. package/.claude/commands/learn-decompose.md +12 -0
  102. package/.claude/commands/learn-follow.md +41 -0
  103. package/.claude/commands/learn-investigate.md +14 -0
  104. package/.claude/commands/learn-second-opinion.md +14 -0
  105. package/.claude/commands/maestro-amend.md +11 -0
  106. package/.claude/commands/maestro-companion.md +11 -0
  107. package/.claude/commands/maestro-composer.md +11 -0
  108. package/.claude/commands/maestro-guard.md +25 -0
  109. package/.claude/commands/maestro-init.md +28 -0
  110. package/.claude/commands/maestro-overlay.md +11 -0
  111. package/.claude/commands/maestro-player.md +11 -0
  112. package/.claude/commands/maestro-quick.md +29 -0
  113. package/.claude/commands/maestro-ralph-v2.md +124 -61
  114. package/.claude/commands/maestro-swarm-workflow.md +25 -0
  115. package/.claude/commands/maestro-tools-execute.md +29 -0
  116. package/.claude/commands/maestro-tools-register.md +29 -0
  117. package/.claude/commands/maestro-ui-codify.md +11 -0
  118. package/.claude/commands/maestro-universal-workflow.md +59 -0
  119. package/.claude/commands/maestro-update.md +38 -0
  120. package/.claude/commands/manage-codebase-rebuild.md +29 -0
  121. package/.claude/commands/manage-drift-realign.md +12 -0
  122. package/.claude/commands/manage-harvest.md +30 -6
  123. package/.claude/commands/manage-issue-discover.md +28 -0
  124. package/.claude/commands/manage-issue.md +23 -0
  125. package/.claude/commands/manage-kg-extractors.md +27 -1
  126. package/.claude/commands/manage-knowhow-capture.md +24 -0
  127. package/.claude/commands/manage-knowhow.md +26 -0
  128. package/.claude/commands/manage-knowledge-audit.md +13 -0
  129. package/.claude/commands/manage-status.md +22 -0
  130. package/.claude/commands/manage-wiki.md +28 -0
  131. package/.claude/commands/odyssey-debug.md +352 -267
  132. package/.claude/commands/odyssey-improve.md +431 -295
  133. package/.claude/commands/odyssey-planex.md +550 -434
  134. package/.claude/commands/odyssey-review-test-fix.md +400 -265
  135. package/.claude/commands/odyssey-ui.md +396 -261
  136. package/.claude/commands/quality-auto-test.md +12 -0
  137. package/.claude/commands/quality-debug.md +11 -0
  138. package/.claude/commands/quality-refactor.md +11 -0
  139. package/.claude/commands/quality-retrospective.md +11 -0
  140. package/.claude/commands/quality-review.md +11 -0
  141. package/.claude/commands/quality-sync.md +10 -0
  142. package/.claude/commands/quality-test.md +12 -0
  143. package/.claude/commands/security-audit.md +11 -0
  144. package/.claude/commands/spec-add.md +27 -0
  145. package/.claude/commands/spec-load.md +25 -0
  146. package/.claude/commands/spec-remove.md +26 -0
  147. package/.claude/commands/spec-setup.md +30 -0
  148. package/.codex/skills/codify-to-knowhow/SKILL.md +2 -0
  149. package/.codex/skills/domain-add/SKILL.md +26 -0
  150. package/.codex/skills/domain-discover/SKILL.md +46 -0
  151. package/.codex/skills/domain-list/SKILL.md +29 -0
  152. package/.codex/skills/learn-decompose/SKILL.md +2 -0
  153. package/.codex/skills/learn-follow/SKILL.md +34 -0
  154. package/.codex/skills/learn-investigate/SKILL.md +33 -0
  155. package/.codex/skills/learn-retro/SKILL.md +33 -0
  156. package/.codex/skills/learn-second-opinion/SKILL.md +30 -0
  157. package/.codex/skills/maestro-amend/SKILL.md +11 -0
  158. package/.codex/skills/maestro-companion/SKILL.md +11 -0
  159. package/.codex/skills/maestro-composer/SKILL.md +11 -0
  160. package/.codex/skills/maestro-guard/SKILL.md +25 -0
  161. package/.codex/skills/maestro-help/SKILL.md +2 -0
  162. package/.codex/skills/maestro-init/SKILL.md +16 -0
  163. package/.codex/skills/maestro-learn/SKILL.md +2 -0
  164. package/.codex/skills/maestro-overlay/SKILL.md +1 -0
  165. package/.codex/skills/maestro-player/SKILL.md +2 -0
  166. package/.codex/skills/maestro-quick/SKILL.md +17 -0
  167. package/.codex/skills/maestro-tools-execute/SKILL.md +31 -0
  168. package/.codex/skills/maestro-tools-register/SKILL.md +29 -0
  169. package/.codex/skills/maestro-ui-codify/SKILL.md +2 -0
  170. package/.codex/skills/maestro-update/SKILL.md +38 -0
  171. package/.codex/skills/manage-codebase-rebuild/SKILL.md +2 -0
  172. package/.codex/skills/manage-codebase-refresh/SKILL.md +11 -0
  173. package/.codex/skills/manage-drift-realign/SKILL.md +2 -0
  174. package/.codex/skills/manage-harvest/SKILL.md +30 -8
  175. package/.codex/skills/manage-issue/SKILL.md +24 -0
  176. package/.codex/skills/manage-issue-discover/SKILL.md +2 -0
  177. package/.codex/skills/manage-knowhow/SKILL.md +26 -0
  178. package/.codex/skills/manage-knowhow-capture/SKILL.md +23 -0
  179. package/.codex/skills/manage-learn/SKILL.md +2 -0
  180. package/.codex/skills/manage-status/SKILL.md +22 -0
  181. package/.codex/skills/manage-wiki/SKILL.md +28 -0
  182. package/.codex/skills/odyssey-debug/SKILL.md +44 -0
  183. package/.codex/skills/odyssey-improve/SKILL.md +49 -0
  184. package/.codex/skills/odyssey-planex/SKILL.md +44 -0
  185. package/.codex/skills/odyssey-review-test-fix/SKILL.md +48 -0
  186. package/.codex/skills/odyssey-ui/SKILL.md +49 -0
  187. package/.codex/skills/quality-auto-test/SKILL.md +2 -0
  188. package/.codex/skills/quality-debug/SKILL.md +2 -0
  189. package/.codex/skills/quality-refactor/SKILL.md +2 -0
  190. package/.codex/skills/quality-retrospective/SKILL.md +2 -0
  191. package/.codex/skills/quality-review/SKILL.md +2 -0
  192. package/.codex/skills/quality-sync/SKILL.md +24 -0
  193. package/.codex/skills/quality-test/SKILL.md +2 -0
  194. package/.codex/skills/security-audit/SKILL.md +30 -0
  195. package/.codex/skills/spec-add/SKILL.md +28 -0
  196. package/.codex/skills/spec-load/SKILL.md +26 -0
  197. package/.codex/skills/spec-map/SKILL.md +1 -0
  198. package/.codex/skills/spec-remove/SKILL.md +28 -0
  199. package/.codex/skills/spec-setup/SKILL.md +28 -0
  200. package/.codex/skills/wiki-connect/SKILL.md +11 -0
  201. package/.codex/skills/wiki-digest/SKILL.md +11 -0
  202. package/dashboard/dist-server/dashboard/src/server/agents/api-explore-adapter.js +3 -1
  203. package/dashboard/dist-server/dashboard/src/server/agents/api-explore-adapter.js.map +1 -1
  204. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.d.ts +5 -0
  205. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +28 -4
  206. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -1
  207. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +4 -4
  208. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  209. package/dashboard/dist-server/src/graph/kg/db/queries.d.ts +10 -0
  210. package/dashboard/dist-server/src/graph/kg/db/queries.js +176 -38
  211. package/dashboard/dist-server/src/graph/kg/db/queries.js.map +1 -1
  212. package/dashboard/dist-server/src/graph/kg/extraction/code/svelte-extractor.js +1 -1
  213. package/dashboard/dist-server/src/graph/kg/extraction/code/svelte-extractor.js.map +1 -1
  214. package/dashboard/dist-server/src/graph/kg/extraction/code/tree-sitter.js +2 -2
  215. package/dashboard/dist-server/src/graph/kg/extraction/code/tree-sitter.js.map +1 -1
  216. package/dashboard/dist-server/src/graph/kg/extraction/code/vue-extractor.js +1 -1
  217. package/dashboard/dist-server/src/graph/kg/extraction/code/vue-extractor.js.map +1 -1
  218. package/dashboard/dist-server/src/graph/kg/extraction/code/wasm-stability.js +1 -1
  219. package/dashboard/dist-server/src/graph/kg/extraction/code/wasm-stability.js.map +1 -1
  220. package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js +20 -12
  221. package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js.map +1 -1
  222. package/dashboard/dist-server/src/graph/kg/surface/hook-injector.js +1 -1
  223. package/dashboard/dist-server/src/graph/kg/surface/hook-injector.js.map +1 -1
  224. package/dashboard/dist-server/src/hooks/keyword-spec-injector.js +35 -0
  225. package/dashboard/dist-server/src/hooks/keyword-spec-injector.js.map +1 -1
  226. package/dashboard/dist-server/src/hooks/spec-analytics.d.ts +1 -0
  227. package/dashboard/dist-server/src/hooks/spec-analytics.js.map +1 -1
  228. package/dashboard/dist-server/src/hooks/wiki-search-bridge.d.ts +32 -0
  229. package/dashboard/dist-server/src/hooks/wiki-search-bridge.js +71 -0
  230. package/dashboard/dist-server/src/hooks/wiki-search-bridge.js.map +1 -0
  231. package/dist/src/agents/api-explore/agent-loop.d.ts +15 -2
  232. package/dist/src/agents/api-explore/agent-loop.d.ts.map +1 -1
  233. package/dist/src/agents/api-explore/agent-loop.js +6 -5
  234. package/dist/src/agents/api-explore/agent-loop.js.map +1 -1
  235. package/dist/src/agents/api-explore/config.d.ts +67 -1
  236. package/dist/src/agents/api-explore/config.d.ts.map +1 -1
  237. package/dist/src/agents/api-explore/config.js +50 -15
  238. package/dist/src/agents/api-explore/config.js.map +1 -1
  239. package/dist/src/agents/api-explore/index.js +4 -4
  240. package/dist/src/agents/api-explore/index.js.map +1 -1
  241. package/dist/src/agents/api-explore/llm.d.ts +7 -1
  242. package/dist/src/agents/api-explore/llm.d.ts.map +1 -1
  243. package/dist/src/agents/api-explore/llm.js +26 -12
  244. package/dist/src/agents/api-explore/llm.js.map +1 -1
  245. package/dist/src/agents/api-explore/moa-cache.d.ts +12 -0
  246. package/dist/src/agents/api-explore/moa-cache.d.ts.map +1 -0
  247. package/dist/src/agents/api-explore/moa-cache.js +50 -0
  248. package/dist/src/agents/api-explore/moa-cache.js.map +1 -0
  249. package/dist/src/agents/api-explore/moa-loop.d.ts +49 -0
  250. package/dist/src/agents/api-explore/moa-loop.d.ts.map +1 -0
  251. package/dist/src/agents/api-explore/moa-loop.js +43 -0
  252. package/dist/src/agents/api-explore/moa-loop.js.map +1 -0
  253. package/dist/src/agents/api-explore/moa-pipeline.d.ts +43 -0
  254. package/dist/src/agents/api-explore/moa-pipeline.d.ts.map +1 -0
  255. package/dist/src/agents/api-explore/moa-pipeline.js +276 -0
  256. package/dist/src/agents/api-explore/moa-pipeline.js.map +1 -0
  257. package/dist/src/agents/api-explore/runner.d.ts +3 -0
  258. package/dist/src/agents/api-explore/runner.d.ts.map +1 -1
  259. package/dist/src/agents/api-explore/runner.js +39 -18
  260. package/dist/src/agents/api-explore/runner.js.map +1 -1
  261. package/dist/src/agents/api-explore/session.d.ts +15 -0
  262. package/dist/src/agents/api-explore/session.d.ts.map +1 -1
  263. package/dist/src/agents/api-explore/session.js.map +1 -1
  264. package/dist/src/cli.js +1 -0
  265. package/dist/src/cli.js.map +1 -1
  266. package/dist/src/commands/explore.d.ts.map +1 -1
  267. package/dist/src/commands/explore.js +34 -2
  268. package/dist/src/commands/explore.js.map +1 -1
  269. package/dist/src/commands/install.js +7 -28
  270. package/dist/src/commands/install.js.map +1 -1
  271. package/dist/src/commands/moa.d.ts +3 -0
  272. package/dist/src/commands/moa.d.ts.map +1 -0
  273. package/dist/src/commands/moa.js +217 -0
  274. package/dist/src/commands/moa.js.map +1 -0
  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/graph/kg/db/queries.d.ts +10 -0
  279. package/dist/src/graph/kg/db/queries.d.ts.map +1 -1
  280. package/dist/src/graph/kg/db/queries.js +176 -38
  281. package/dist/src/graph/kg/db/queries.js.map +1 -1
  282. package/dist/src/graph/kg/extraction/code/svelte-extractor.js +1 -1
  283. package/dist/src/graph/kg/extraction/code/svelte-extractor.js.map +1 -1
  284. package/dist/src/graph/kg/extraction/code/tree-sitter.js +2 -2
  285. package/dist/src/graph/kg/extraction/code/tree-sitter.js.map +1 -1
  286. package/dist/src/graph/kg/extraction/code/vue-extractor.js +1 -1
  287. package/dist/src/graph/kg/extraction/code/vue-extractor.js.map +1 -1
  288. package/dist/src/graph/kg/extraction/code/wasm-stability.js +1 -1
  289. package/dist/src/graph/kg/extraction/code/wasm-stability.js.map +1 -1
  290. package/dist/src/graph/kg/extraction/orchestrator.d.ts.map +1 -1
  291. package/dist/src/graph/kg/extraction/orchestrator.js +20 -12
  292. package/dist/src/graph/kg/extraction/orchestrator.js.map +1 -1
  293. package/dist/src/graph/kg/surface/hook-injector.js +1 -1
  294. package/dist/src/graph/kg/surface/hook-injector.js.map +1 -1
  295. package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -1
  296. package/dist/src/hooks/keyword-spec-injector.js +35 -0
  297. package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
  298. package/dist/src/hooks/plugins/explore-plugin.d.ts.map +1 -1
  299. package/dist/src/hooks/plugins/explore-plugin.js +3 -2
  300. package/dist/src/hooks/plugins/explore-plugin.js.map +1 -1
  301. package/dist/src/hooks/spec-analytics.d.ts +1 -0
  302. package/dist/src/hooks/spec-analytics.d.ts.map +1 -1
  303. package/dist/src/hooks/spec-analytics.js.map +1 -1
  304. package/dist/src/hooks/wiki-search-bridge.d.ts +33 -0
  305. package/dist/src/hooks/wiki-search-bridge.d.ts.map +1 -0
  306. package/dist/src/hooks/wiki-search-bridge.js +71 -0
  307. package/dist/src/hooks/wiki-search-bridge.js.map +1 -0
  308. package/dist/src/utils/update-notices.js +12 -0
  309. package/dist/src/utils/update-notices.js.map +1 -1
  310. package/package.json +1 -1
@@ -1,265 +1,400 @@
1
- ---
2
- name: odyssey-review-test-fix
3
- description: Deep review + fix cycle — archaeology, exploration, multi-dimensional review, targeted fix, generalization, discovery, and knowledge persistence
4
- argument-hint: "<target> [--dimensions <list>] [--fix-threshold critical|high|medium|low|all] [--skip-fix] [--skip-generalize] [--auto] [-y] [-c] [--heartbeat]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Edit
9
- - Bash
10
- - Glob
11
- - Grep
12
- - Agent
13
- - AskUserQuestion
14
- ---
15
- <base>@~/.maestro/workflows/odyssey-base.md</base>
16
-
17
- <purpose>
18
- archaeology → explore → multi-dimensional review → fix ALL findings → confirm → generalize → discover → persist. Zero-residual: every finding gets an action.
19
- </purpose>
20
-
21
- <boundary>
22
- **In scope:** Multi-dimensional deep review of target code → exhaustive fix ALL findings by severity → generalize patterns project-wide.
23
- **Out of scope:** Root cause debug → `/odyssey-debug` | Feature implementation → `/odyssey-planex` | UI visual optimization → `/odyssey-ui`
24
-
25
- **Exploration freedom:** Free within boundary — cross-dimension correlation, git history tracing, project-wide generalization scan. Fix ALL findings within fix_threshold (default: all).
26
- **Zero-residual:** Every finding MUST have a concrete action (fix / issue / decision). "Report and shelve" and "pre-existing skip" are forbidden.
27
- </boundary>
28
-
29
- <context>
30
- $ARGUMENTS
31
-
32
- **Target resolution:**
33
-
34
- | Input | Resolution |
35
- |-------|-----------|
36
- | File/dir path | Review those files |
37
- | `HEAD` / `staged` | `git diff HEAD` / `git diff --staged` |
38
- | Phase number | state.json → changed files |
39
- | PR number | `git diff main...HEAD` |
40
-
41
- **Flags:** `--dimensions <list>` subset of review dimensions | `--fix-threshold <level>` severity cutoff (default: all) | `--skip-fix` skip S_FIX+S_CONFIRM | `--skip-generalize` skip S_GENERALIZE+S_DISCOVER | `--auto` no delegate confirmation | `-y` auto-confirm | `-c` resume | `--heartbeat` /loop heartbeat
42
-
43
- **Session**: `.workflow/scratch/{YYYYMMDD}-review-odyssey-{slug}/`
44
- **Output**: `session.json` | `evidence.ndjson` | `explore.json` | `understanding.md`
45
-
46
- **session.json review-specific fields:**
47
- ```json
48
- { "target": "", "dimensions": [], "review_result": {"remaining_actionable": 0},
49
- "patterns": [], "confirmation": null, "generalization_stats": null }
50
- ```
51
-
52
- **evidence.ndjson phases:** `archaeology|explore|review|fix|discovery|decision|self-iteration`
53
-
54
- **phase_goals[]:**
55
-
56
- | ID | Goal | done_when | phase | skip_when |
57
- |----|------|-----------|-------|-----------|
58
- | G1 | Review completed | all dimensions reviewed | S_REVIEW | |
59
- | G2 | Explore context | explore.json populated | S_EXPLORE | — |
60
- | G3 | Zero remaining | `remaining_actionable == 0` | S_CONFIRM | skip_fix |
61
- | G4 | Pattern generalized | patterns[] >=1 | S_GENERALIZE | skip_generalize |
62
- | G5 | Discoveries triaged | all hits classified | S_DISCOVER | skip_generalize |
63
- | G6 | Learnings persisted | spec entries or no actionable | S_RECORD | |
64
-
65
- **understanding.md8 sections:**
66
- 1. Target & Scope ← S_INTAKE | 2. Archaeology ← S_ARCHAEOLOGY | 3. Exploration ← S_EXPLORE
67
- 4. Review Results ← S_REVIEW | 5. Fix & Confirmation ← S_FIX+S_CONFIRM
68
- 6. GeneralizationS_GENERALIZE | 7. DiscoveriesS_DISCOVER | 8. LearningsS_RECORD
69
-
70
- Specs: `maestro load --type spec --category review`
71
-
72
- **Knowledge Persistence categories (section 8):**
73
-
74
- | Category | Content | Follow-up |
75
- |----------|---------|-----------|
76
- | Cross-dimension recurring pattern | Pattern + affected dimensions + coding standard | `/spec-add review` |
77
- | Security finding | Vulnerability type + triggers + fix approach | `/spec-add debug` |
78
- | Architecture violation pattern | Violation + correct boundary + verification | `/spec-add arch` |
79
- | Reusable generalization pattern | Signature + risk + fix template + scope | `/spec-add coding` |
80
- </context>
81
-
82
- <invariants>
83
- All invariants defined in base.
84
- </invariants>
85
-
86
- <self_iteration>
87
- Applies to: **S_ARCHAEOLOGY, S_EXPLORE, S_REVIEW, S_FIX, S_GENERALIZE**. Logic in base.
88
- </self_iteration>
89
-
90
- <state_machine>
91
-
92
- <states>
93
- S_INTAKE → S_ARCHAEOLOGY → S_EXPLORE → S_REVIEW → S_FIX → S_CONFIRM → S_GENERALIZE → S_DISCOVER → S_RECORD → END
94
- </states>
95
-
96
- <transitions>
97
- S_INTAKE → S_INTAKE : -c + session found → A_RESUME_SESSION
98
- S_INTAKE → S_ARCHAEOLOGY : target resolved A_INTAKE
99
- S_INTAKE → S_INTAKE : no target AskUserQuestion
100
-
101
- S_ARCHAEOLOGY S_EXPLORE : complete
102
- S_EXPLORE → S_REVIEW : complete
103
-
104
- S_REVIEW → S_FIX : !skip_fix AND findings
105
- S_REVIEW → S_GENERALIZE : skip_fix OR no findings, !skip_generalize
106
- S_REVIEW → S_RECORD : both skip
107
-
108
- S_FIX → S_CONFIRM : tier complete
109
- S_CONFIRM → S_GENERALIZE : confirmed, !skip_generalize
110
- S_CONFIRM → S_RECORD : confirmed, skip_generalize
111
- S_CONFIRM S_FIX : needs_rework
112
-
113
- S_GENERALIZE → S_DISCOVER : similar code found
114
- S_GENERALIZE → S_RECORD : no similar code
115
-
116
- S_DISCOVER S_FIX : fixable sibling cross_phase_loops++
117
- S_DISCOVER → S_REVIEW : new target, loops < max_loops → cross_phase_loops++
118
- S_DISCOVER → S_RECORD : remaining_actionable == 0 OR loops >= max_loops
119
- </transitions>
120
-
121
- <actions>
122
-
123
- ### A_INTAKE
124
- 1. Parse target + flags file list. Create SESSION_DIR, derive phase_goals[]
125
- 2. `maestro search "<keywords>"` + Glob prior sessions + ARCHITECTURE.md + Grep keywords
126
- 3. Write `session.json` + `understanding.md` section 1, emit Goal Prompt
127
-
128
- Commit: `"odyssey-review({slug}): INTAKE parse target and load context"`
129
-
130
- ### A_RESUME_SESSION
131
- Glob latest session read `session.json` jump to `current_state`.
132
-
133
- ### A_ARCHAEOLOGY
134
- 2 parallel Agents: Timeline (`git log --oneline -20 -- {files}`) + Blame (top 3 files `git blame -L {region}`). Evidence phase=archaeology.
135
-
136
- **Error handling:** If any archaeology agent fails (Timeline or Blame), log W003 and proceed with available results. If delegate fails, log W003 and proceed with local agent results only.
137
-
138
- `maestro delegate --role analyze --mode analysis` (`run_in_background: true`):
139
- - PURPOSE: Review recent modifications related to {target}
140
- - EXPECTED: JSON [{commit_sha, risk_level, analysis, could_cause_issue, explanation}]
141
-
142
- Update section 2. Commit: `"odyssey-review({slug}): ARCHAEOLOGY — git history analysis"`
143
-
144
- ### A_EXPLORE
145
- Skip if no CLI tools (W006).
146
-
147
- `maestro delegate --role explore --mode analysis` (`run_in_background: true`):
148
- - PURPOSE: Call chains, recent changes, error gaps, similar patterns
149
- - EXPECTED: JSON {call_chains, recent_changes, error_gaps, similar_patterns}
150
-
151
- Write `explore.json` + evidence phase=explore. Update section 3. Mark G2. Commit: `"odyssey-review({slug}): EXPLORE — codebase exploration"`
152
-
153
- ### A_REVIEW
154
- Spawn N parallel Agents, one per dimension:
155
- - **Correctness**: logic errors, boundary conditions, null/undefined, race conditions
156
- - **Security**: injection, XSS, CSRF, data exposure, auth bypass
157
- - **Performance**: hot paths, N+1, memory leaks, unnecessary recomputation
158
- - **Architecture**: layer violations, circular deps, interface contracts, SoC
159
-
160
- Each returns `[{title, severity, file, line, description, suggestion, cwe}]`. Merge → evidence phase=review. Write `review_result` + section 4 severity matrix. Mark G1.
161
-
162
- Commit: `"odyssey-review({slug}): REVIEW — multi-dimension review complete"`
163
-
164
- ### A_FIX
165
- Exhaustive iterative fix descend by severity until `remaining_actionable == 0`.
166
-
167
- ```
168
- for tier in [critical, high, medium, low].filter(>= threshold):
169
- for each unfixed candidate: read +/-20 lines fix evidence phase=fix
170
- re-review modified area (new findings → append, continue; max 2 per tier)
171
- tier done → auto-commit
172
- ```
173
-
174
- Normal: AskUserQuestion per tier. `-y`: auto-fix all.
175
- Remaining > 0 retry (max_fix_rounds = 5). Unchanged 2 rounds classify each individually. After 5 rounds with remaining > 0 → escalate: Normal: AskUserQuestion (continue/accept/reclassify) | `-y`: classify remaining as `deferred`, proceed.
176
- Blanket "pre-existing" forbidden.
177
-
178
- Commit per tier: `"odyssey-review({slug}): FIX-{tier} — {N} items fixed"`
179
-
180
- ### A_CONFIRM
181
- Run tests + `maestro delegate --role review --mode analysis` (`run_in_background: true`) for zero-residual review.
182
- - `remaining == 0 AND new == 0` → confirmed, mark G3
183
- - Otherwise → needs_rework → S_FIX
184
-
185
- Update `confirmation` + `remaining_actionable` + section 5.
186
-
187
- Commit: `"odyssey-review({slug}): CONFIRM zero-residual verified"`
188
-
189
- ### A_GENERALIZE, A_DISCOVER, A_RECORD
190
- Base shared_actions. Review overrides:
191
- - **A_GENERALIZE** pattern source: findings with severity >= medium
192
- - **A_RECORD** learnings per Knowledge Persistence table
193
-
194
- **Completion summary:**
195
- ```
196
- --- REVIEW-TEST-FIX ODYSSEY COMPLETE ---
197
- Target: {target} Dimensions: {dims}
198
- Findings: {C}C {H}H {M}M {L}L Fix: {fixed}, confirmed={yes|skip}
199
- Patterns: {N} ({by_layer}) Scan hits: {total} ({cross} cross-layer)
200
- Issues: {N} created
201
- Decisions: {N} resolved, {M} pending, {K} deferred
202
- Learnings: {N} persisted
203
- Self-iter: {N} rounds across {M} stages
204
- Goals: {done}/{total} ({skipped} skipped)
205
- ---
206
- ```
207
-
208
- </actions>
209
-
210
- <appendix>
211
-
212
- ### `-y` review-specific points
213
-
214
- | Decision Point | Normal | `-y` |
215
- |---------------|--------|------|
216
- | S_FIX tier candidates | AskUserQuestion | auto-fix, deferred |
217
- | S_FIX re-review new findings | AskUserQuestion | auto-append |
218
- | S_CONFIRM needs_rework | Display → S_FIX | auto proceed |
219
-
220
- ### Goal Prompt convergence rules
221
-
222
- ```
223
- Stop when remaining_actionable == 0, confirmation == confirmed,
224
- generalization exhausted, phase_goals_all_done=true.
225
- Fix iterates by severity tier; each tier re-reviews modified area, new findings appended.
226
- Every finding must have action (fix/issue/decision). Decision pending must AskUserQuestion.
227
- ```
228
-
229
- </appendix>
230
-
231
- </state_machine>
232
-
233
- <error_codes>
234
- | Code | Severity | Condition | Recovery |
235
- |------|----------|-----------|----------|
236
- | E001 | error | No target specified | Provide target |
237
- | E002 | error | Target path not found | Check path |
238
- | W001 | warning | No git history | Proceed |
239
- | W002 | warning | Some dimension agents failed | Partial coverage |
240
- | W003 | warning | Archaeology agent or delegate failure | Proceed with available results |
241
- </error_codes>
242
-
243
- <success_criteria>
244
- - [ ] Session + 4 output files + prior knowledge searched
245
- - [ ] Archaeology + CLI review → evidence phase=archaeology
246
- - [ ] CLI exploration explore.json + evidence phase=explore
247
- - [ ] All dimensions reviewed, ALL findings fixed (remaining_actionable == 0)
248
- - [ ] Per-tier re-review gate; every unfixed finding individually classified
249
- - [ ] understanding.md sections 1-8 progressive
250
- - [ ] Fix + confirmed (unless --skip-fix)
251
- - [ ] Generalization + scan (unless --skip-generalize)
252
- - [ ] Discoveries classified; unfixed findings individually justified
253
- - [ ] phase_goals G1-G6 audited, Goal Prompt once, `-y` no blocking, -c resumable
254
- - [ ] Completion summary
255
- </success_criteria>
256
-
257
- <next_step_routing>
258
- | Condition | Next |
259
- |-----------|------|
260
- | Deeper debug needed | `/odyssey-debug "<finding>"` |
261
- | Issues created | `/manage-issue list --source review-odyssey` |
262
- | Document pattern | `/learn-decompose <module>` |
263
- | Plan fixes | `/maestro-plan --gaps` |
264
- </next_step_routing>
265
- </output>
1
+ ---
2
+ name: odyssey-review-test-fix
3
+ description: Deep review + fix cycle — archaeology, exploration, multi-dimensional review, targeted fix, generalization, discovery, and knowledge persistence
4
+ argument-hint: "<target> [--dimensions <list>] [--fix-threshold critical|high|medium|low|all] [--skip-fix] [--skip-generalize] [--auto] [-y] [-c] [--heartbeat]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - AskUserQuestion
14
+ ---
15
+ <base>@~/.maestro/workflows/odyssey-base.md</base>
16
+
17
+ <purpose>
18
+ archaeology → explore → multi-dimensional review → fix ALL findings → confirm → generalize → discover → persist. Zero-residual: every finding gets an action.
19
+ </purpose>
20
+
21
+ <boundary>
22
+ **In scope:** Multi-dimensional deep review of target code → exhaustive fix ALL findings by severity → generalize patterns project-wide.
23
+ **Out of scope:** Root cause debug → `/odyssey-debug` | Feature implementation → `/odyssey-planex` | UI visual optimization → `/odyssey-ui`
24
+
25
+ **Exploration freedom:** Free within boundary — cross-dimension correlation, git history tracing, project-wide generalization scan. Fix ALL findings within fix_threshold (default: all).
26
+ **Zero-residual:** Every finding MUST have a concrete action (fix / issue / decision). "Report and shelve" and "pre-existing skip" are forbidden.
27
+ </boundary>
28
+
29
+ <context>
30
+ $ARGUMENTS
31
+
32
+ **Target resolution:**
33
+
34
+ | Input | Resolution |
35
+ |-------|-----------|
36
+ | File/dir path | Review those files |
37
+ | `HEAD` / `staged` | `git diff HEAD` / `git diff --staged` |
38
+ | Phase number | state.json → changed files |
39
+ | PR number | `git diff main...HEAD` |
40
+
41
+ **Flags:** `--dimensions <list>` subset of review dimensions | `--fix-threshold <level>` severity cutoff (default: all) | `--skip-fix` skip S_FIX+S_CONFIRM | `--skip-generalize` skip S_GENERALIZE+S_DISCOVER | `--auto` no delegate confirmation | `-y` auto-confirm | `-c` resume | `--heartbeat` /loop heartbeat
42
+
43
+ **Session**: `.workflow/scratch/{YYYYMMDD}-review-odyssey-{slug}/`
44
+ **Output**: `session.json` | `evidence.ndjson` | `explore.json` | `understanding.md`
45
+
46
+ **Output boundary**: ALL session artifacts MUST target the session directory (`.workflow/scratch/{YYYYMMDD}-review-odyssey-{slug}/`) or `.workflow/state.json` only. Source code modifications during S_FIX are in-scope but MUST be committed per action. NEVER write session artifacts outside these paths.
47
+
48
+ **session.json review-specific fields:**
49
+ ```json
50
+ { "target": "", "dimensions": [], "review_result": {"remaining_actionable": 0},
51
+ "patterns": [], "confirmation": null, "generalization_stats": null }
52
+ ```
53
+
54
+ **evidence.ndjson phases:** `archaeology|explore|review|fix|discovery|decision|self-iteration`
55
+
56
+ **phase_goals[]:**
57
+
58
+ | ID | Goal | done_when | phase | skip_when |
59
+ |----|------|-----------|-------|-----------|
60
+ | G1 | Review completed | all dimensions reviewed | S_REVIEW | |
61
+ | G2 | Explore context | explore.json populated | S_EXPLORE | |
62
+ | G3 | Zero remaining | `remaining_actionable == 0` | S_CONFIRM | skip_fix |
63
+ | G4 | Pattern generalized | patterns[] >=1 | S_GENERALIZE | skip_generalize |
64
+ | G5 | Discoveries triaged | all hits classified | S_DISCOVER | skip_generalize |
65
+ | G6 | Learnings persisted | spec entries or no actionable | S_RECORD | |
66
+
67
+ **understanding.md 8 sections:**
68
+ 1. Target & Scope S_INTAKE | 2. ArchaeologyS_ARCHAEOLOGY | 3. ExplorationS_EXPLORE
69
+ 4. Review Results ← S_REVIEW | 5. Fix & Confirmation ← S_FIX+S_CONFIRM
70
+ 6. Generalization S_GENERALIZE | 7. Discoveries ← S_DISCOVER | 8. Learnings ← S_RECORD
71
+
72
+ Specs: `maestro load --type spec --category review`
73
+
74
+ **Knowledge Persistence categories (section 8):**
75
+
76
+ | Category | Content | Follow-up |
77
+ |----------|---------|-----------|
78
+ | Cross-dimension recurring pattern | Pattern + affected dimensions + coding standard | `/spec-add review` |
79
+ | Security finding | Vulnerability type + triggers + fix approach | `/spec-add debug` |
80
+ | Architecture violation pattern | Violation + correct boundary + verification | `/spec-add arch` |
81
+ | Reusable generalization pattern | Signature + risk + fix template + scope | `/spec-add coding` |
82
+ </context>
83
+
84
+ <invariants>
85
+ All invariants defined in base.
86
+ 6. **Generalize is mandatory** — S_GENERALIZE and S_DISCOVER execute unless `skip_generalize == true`. "Zero remaining" or context pressure are NOT valid reasons to skip. The phase itself determines whether patterns exist.
87
+ </invariants>
88
+
89
+ <self_iteration>
90
+ Applies to: **S_ARCHAEOLOGY, S_EXPLORE, S_REVIEW, S_FIX, S_GENERALIZE**. Logic in base.
91
+ </self_iteration>
92
+
93
+ <execution>
94
+ Follow base execution discipline completely. Actions defined in state_machine below.
95
+
96
+ ### Phase Gates (MANDATORY, BLOCKING)
97
+
98
+ **GATE 1: INTAKEARCHAEOLOGY**
99
+ - REQUIRED: Target resolved to file list, SESSION_DIR created, session.json initialized.
100
+ - REQUIRED: phase_goals[] derived from flags, understanding.md §1 written.
101
+ - BLOCKED if: no target specified (E001) or target path not found (E002).
102
+
103
+ **GATE 2: ARCHAEOLOGY → EXPLORE**
104
+ - REQUIRED: Git history analysis completed (timeline + blame agents), evidence phase=archaeology logged.
105
+ - REQUIRED: understanding.md §2 updated.
106
+ - BLOCKED if: both archaeology agents failed AND delegate failed (partial results via W003 are acceptable).
107
+
108
+ **GATE 3: EXPLORE → REVIEW**
109
+ - REQUIRED: explore.json written with call_chains/recent_changes/error_gaps/similar_patterns (or W006 skip logged).
110
+ - REQUIRED: Evidence phase=explore logged, understanding.md §3 updated, G2 marked done.
111
+ - BLOCKED if: exploration started but not completed (W006 skip is acceptable, incomplete is not).
112
+
113
+ **GATE 4: REVIEW FIX**
114
+ - REQUIRED: All dimension agents completed, findings merged with severity classification.
115
+ - REQUIRED: review_result written to session.json, understanding.md §4 with severity matrix, G1 marked done.
116
+ - BLOCKED if: zero dimensions reviewed (W002 partial is allowed, zero is not).
117
+
118
+ **GATE 5: FIX CONFIRM**
119
+ - REQUIRED: Current severity tier fully addressed — all findings in tier fixed or individually classified.
120
+ - REQUIRED: Per-fix evidence phase=fix logged, auto-commit per tier.
121
+ - BLOCKED if: tier incomplete — no partial tier advancement.
122
+
123
+ **GATE 6: CONFIRM → GENERALIZE**
124
+ - REQUIRED: Tests pass, remaining_actionable == 0, new findings == 0.
125
+ - REQUIRED: confirmation written, understanding.md §5 updated, G3 marked done.
126
+ - BLOCKED if: needs_rework route back to S_FIX.
127
+
128
+ **GATE 7: GENERALIZE DISCOVER**
129
+ - REQUIRED: ALL 3 layers (syntax/semantic/structural) attempted with evidence logged.
130
+ - REQUIRED: generalization_stats written with by_layer entries for all 3 layers, G4 marked done.
131
+ - BLOCKED if: any layer not attempted (thoroughness floor violation).
132
+
133
+ **GATE 8: DISCOVER → RECORD**
134
+ - REQUIRED: All hits triaged with per-item classification and reason.
135
+ - REQUIRED: remaining_actionable == 0 OR loops >= max_loops with per-item reasons logged.
136
+ - REQUIRED: G5 marked done.
137
+ - BLOCKED if: unclassified hits remain.
138
+
139
+ </execution>
140
+
141
+ <state_machine>
142
+
143
+ <states>
144
+ S_INTAKE → S_ARCHAEOLOGY → S_EXPLORE → S_REVIEW → S_FIX → S_CONFIRM → S_GENERALIZE → S_DISCOVER → S_RECORD → END
145
+ </states>
146
+
147
+ <transitions>
148
+ S_INTAKE → S_INTAKE : -c + session found A_RESUME_SESSION
149
+ S_INTAKE → S_ARCHAEOLOGY : target resolved A_INTAKE
150
+ S_INTAKE → S_INTAKE : no target → AskUserQuestion
151
+
152
+ S_ARCHAEOLOGY → S_EXPLORE : complete
153
+ S_EXPLORE → S_REVIEW : complete
154
+
155
+ S_REVIEW → S_FIX : !skip_fix AND findings
156
+ S_REVIEW → S_GENERALIZE : skip_fix OR no findings, !skip_generalize
157
+ S_REVIEW → S_RECORD : both skip
158
+
159
+ S_FIX → S_CONFIRM : tier complete
160
+ S_CONFIRM S_GENERALIZE : confirmed, !skip_generalize
161
+ S_CONFIRM → S_RECORD : confirmed, skip_generalize
162
+ S_CONFIRM → S_FIX : needs_rework
163
+
164
+ S_GENERALIZE → S_DISCOVER : similar code found
165
+ S_GENERALIZE S_RECORD : all 3 layers scanned with evidence, total_hits == 0
166
+
167
+ S_DISCOVER → S_FIX : fixable sibling → cross_phase_loops++
168
+ S_DISCOVER S_REVIEW : new target, loops < max_loops → cross_phase_loops++
169
+ S_DISCOVER S_RECORD : remaining_actionable == 0 OR loops >= max_loops
170
+ </transitions>
171
+
172
+ <actions>
173
+
174
+ ### A_INTAKE
175
+ 1. Parse target + flagsfile list. Create SESSION_DIR, derive phase_goals[]
176
+ 2. `maestro search "<keywords>"` + Glob prior sessions + ARCHITECTURE.md + Grep keywords
177
+ 3. Write `session.json` + `understanding.md` section 1, emit Goal Prompt
178
+
179
+ Commit: `"odyssey-review({slug}): INTAKE — parse target and load context"`
180
+
181
+ ### A_RESUME_SESSION
182
+ Glob latest session read `session.json`jump to `current_state`.
183
+
184
+ ### A_ARCHAEOLOGY
185
+ 2 parallel Agents: Timeline (`git log --oneline -20 -- {files}`) + Blame (top 3 files `git blame -L {region}`). Evidence phase=archaeology.
186
+
187
+ **Error handling:** If any archaeology agent fails (Timeline or Blame), log W003 and proceed with available results. If delegate fails, log W003 and proceed with local agent results only.
188
+
189
+ `maestro delegate --role analyze --mode analysis` (`run_in_background: true`):
190
+ - PURPOSE: Review recent modifications related to {target}
191
+ - EXPECTED: JSON [{commit_sha, risk_level, analysis, could_cause_issue, explanation}]
192
+
193
+ Update section 2. Commit: `"odyssey-review({slug}): ARCHAEOLOGY — git history analysis"`
194
+
195
+ ### A_EXPLORE
196
+ Skip if no CLI tools (W006).
197
+
198
+ `maestro delegate --role explore --mode analysis` (`run_in_background: true`):
199
+ - PURPOSE: Call chains, recent changes, error gaps, similar patterns
200
+ - EXPECTED: JSON {call_chains, recent_changes, error_gaps, similar_patterns}
201
+
202
+ Write `explore.json` + evidence phase=explore. Update section 3. Mark G2. Commit: `"odyssey-review({slug}): EXPLORE — codebase exploration"`
203
+
204
+ ### A_REVIEW
205
+ Spawn N parallel Agents, one per dimension:
206
+ - **Correctness**: logic errors, boundary conditions, null/undefined, race conditions
207
+ - **Security**: injection, XSS, CSRF, data exposure, auth bypass
208
+ - **Performance**: hot paths, N+1, memory leaks, unnecessary recomputation
209
+ - **Architecture**: layer violations, circular deps, interface contracts, SoC
210
+
211
+ Each returns `[{title, severity, file, line, description, suggestion, cwe}]`. Merge → evidence phase=review. Write `review_result` + section 4 severity matrix. Mark G1.
212
+
213
+ Commit: `"odyssey-review({slug}): REVIEW — multi-dimension review complete"`
214
+
215
+ ### A_FIX
216
+ Exhaustive iterative fix descend by severity until `remaining_actionable == 0`.
217
+
218
+ ```
219
+ for tier in [critical, high, medium, low].filter(>= threshold):
220
+ for each unfixed candidate: read +/-20 lines → fix → evidence phase=fix
221
+ re-review modified area (new findings → append, continue; max 2 per tier)
222
+ tier done → auto-commit
223
+ ```
224
+
225
+ Normal: AskUserQuestion per tier. `-y`: auto-fix all.
226
+ Remaining > 0 retry (max_fix_rounds = 5). Unchanged 2 rounds → classify each individually. After 5 rounds with remaining > 0 → escalate: Normal: AskUserQuestion (continue/accept/reclassify) | `-y`: classify remaining as `deferred`, proceed.
227
+ Blanket "pre-existing" forbidden.
228
+
229
+ Commit per tier: `"odyssey-review({slug}): FIX-{tier} — {N} items fixed"`
230
+
231
+ ### A_CONFIRM
232
+ Run tests + `maestro delegate --role review --mode analysis` (`run_in_background: true`) for zero-residual review.
233
+ - `remaining == 0 AND new == 0` → confirmed, mark G3
234
+ - Otherwise needs_rework S_FIX
235
+
236
+ Update `confirmation` + `remaining_actionable` + section 5.
237
+
238
+ Commit: `"odyssey-review({slug}): CONFIRM zero-residual verified"`
239
+
240
+ ### A_GENERALIZE
241
+
242
+ **MANDATORY — executes unless `skip_generalize == true`. Prior-phase convergence, "zero remaining," or context pressure are NOT valid skip reasons.**
243
+
244
+ Pattern source: review findings with severity >= medium.
245
+
246
+ **Step 1 3-layer pattern extraction** from confirmed findings:
247
+
248
+ | Layer | Method | Targets |
249
+ |-------|--------|---------|
250
+ | Syntax | Build regex from fix diffs → Grep | Unchecked return values, deprecated API calls, missing type assertion, unhandled await |
251
+ | Semantic | Understand anti-pattern per dimension Agent scan | Logic inversion in edge case, unhandled rejection, incomplete state machine transition |
252
+ | Structural | Find files with same handler/validator shape | Similar route handlers, parallel DTO validators, analogous test fixtures |
253
+
254
+ Write `session.json.patterns[]`: `[{id, source, layer, signature, description, risk, fix_template, confidence}]`
255
+
256
+ **Thoroughness floor:** ALL 3 layers must be attempted and logged. Each layer records search method, scope, hit count in evidence phase=generalization. "No hits" requires all 3 layers to return 0 with logged evidence.
257
+
258
+ **Step 2 4-agent concurrent scan** (single message, 4 Agents):
259
+
260
+ | Agent | Strategy | Scope |
261
+ |-------|----------|-------|
262
+ | Syntax grep | Grep regex from pattern signatures | Full project |
263
+ | Semantic scan | Per-dimension anti-pattern check | Related modules |
264
+ | Structural match | Find structurally similar files | Full project |
265
+ | Historical grep | `git log -S` for pattern signatures | Git history |
266
+
267
+ **Step 3 — Cross-layer dedup:** multi-layer hit → boost | single-layer → `needs_review` | historically fixed → `regression_risk`
268
+
269
+ **Step 4 — Iterative deepening:** Module with ≥3 hits → targeted deep scan (max 1 round).
270
+
271
+ **Step 5 — Persist:** Update understanding.md section 6 + write `session.json.generalization_stats`:
272
+ ```json
273
+ {"patterns_extracted": 0, "total_hits": 0, "cross_layer_confirmed": 0, "regression_risks": 0, "by_layer": {"syntax": 0, "semantic": 0, "structural": 0}, "deepening_triggered": false}
274
+ ```
275
+
276
+ **Transition guard:** `S_GENERALIZE → S_RECORD` requires `by_layer` has entries for all 3 layers with search evidence logged. Mark G4 done.
277
+
278
+ Commit: `"odyssey-review({slug}): GENERALIZE — pattern scan complete"`
279
+
280
+ ### A_DISCOVER
281
+
282
+ **Executes whenever `total_hits > 0`. Cannot be skipped without `skip_generalize == true`.**
283
+
284
+ 1. **Triage** each hit with ±10 lines context → classify:
285
+ - `bug` — same defect pattern confirmed in sibling code
286
+ - `risk` — potential issue needing guard
287
+ - `safe` — false positive (must log individual reason — blanket "pre-existing" forbidden)
288
+
289
+ 2. **Route:**
290
+
291
+ | Classification | Action |
292
+ |---------------|--------|
293
+ | fixable sibling | Immediate fix → back to S_FIX, `cross_phase_loops++` |
294
+ | new target needing review | Route to S_REVIEW, `cross_phase_loops++` |
295
+ | risk + guard addable | Fix directly |
296
+ | risk + complex | Create issue |
297
+ | safe | Skip with logged per-item reason |
298
+
299
+ Normal: AskUserQuestion per hit | `-y`: auto-fix with template, create issue for rest
300
+
301
+ 3. **Cross-phase loops:** `loops >= max_loops` → must log per-item reasons, advance to S_RECORD.
302
+
303
+ 4. Append evidence phase=discovery. Update understanding.md section 7. Mark G5 done.
304
+
305
+ Commit: `"odyssey-review({slug}): DISCOVER — sibling triage complete"`
306
+
307
+ ### A_RECORD
308
+
309
+ 1. Finalize understanding.md section 8 — learnings by Knowledge Persistence categories:
310
+ - Cross-dimension recurring pattern → `/spec-add review`
311
+ - Security finding → `/spec-add debug`
312
+ - Architecture violation pattern → `/spec-add arch`
313
+ - Reusable generalization pattern → `/spec-add coding`
314
+
315
+ 2. Mark G6 done. Pending decisions: Normal → AskUserQuestion | `-y` → skip (show deferred count).
316
+
317
+ 3. **Goal audit (hardened):**
318
+ - `done` → confirmed
319
+ - `skipped` → confirmed ONLY if corresponding `skip_when` flag is true
320
+ - **Hard rule:** G4 and G5 CANNOT be `skipped` unless `skip_generalize == true`. Pending without flag → `failed` (Normal: AskUserQuestion | `-y`: record `failed`)
321
+ - `phase_goals_all_done = true` only when all goals pass this audit
322
+
323
+ 4. `current_state = "COMPLETED"`, emit completion summary.
324
+
325
+ **Completion summary:**
326
+ ```
327
+ --- REVIEW-TEST-FIX ODYSSEY COMPLETE ---
328
+ Target: {target} Dimensions: {dims}
329
+ Findings: {C}C {H}H {M}M {L}L Fix: {fixed}, confirmed={yes|skip}
330
+ Patterns: {N} ({by_layer}) Scan hits: {total} ({cross} cross-layer)
331
+ Issues: {N} created
332
+ Decisions: {N} resolved, {M} pending, {K} deferred
333
+ Learnings: {N} persisted
334
+ Self-iter: {N} rounds across {M} stages
335
+ Goals: {done}/{total} ({skipped} skipped)
336
+ ---
337
+ ```
338
+
339
+ Commit: `"odyssey-review({slug}): RECORD — summary and knowledge persistence"`
340
+
341
+ </actions>
342
+
343
+ <appendix>
344
+
345
+ ### `-y` review-specific points
346
+
347
+ | Decision Point | Normal | `-y` |
348
+ |---------------|--------|------|
349
+ | S_FIX tier candidates | AskUserQuestion | auto-fix, deferred |
350
+ | S_FIX re-review new findings | AskUserQuestion | auto-append |
351
+ | S_CONFIRM needs_rework | Display → S_FIX | auto proceed |
352
+ | A_DISCOVER hit routing | AskUserQuestion | auto-fix with template, create issue for rest |
353
+
354
+ ### Goal Prompt convergence rules
355
+
356
+ ```
357
+ Stop when remaining_actionable == 0, confirmation == confirmed,
358
+ generalization exhausted, phase_goals_all_done=true.
359
+ Fix iterates by severity tier; each tier re-reviews modified area, new findings appended.
360
+ Every finding must have action (fix/issue/decision). Decision pending must AskUserQuestion.
361
+ ```
362
+
363
+ </appendix>
364
+
365
+ </state_machine>
366
+
367
+ <error_codes>
368
+ | Code | Severity | Condition | Recovery |
369
+ |------|----------|-----------|----------|
370
+ | E001 | error | No target specified | Provide target |
371
+ | E002 | error | Target path not found | Check path |
372
+ | W001 | warning | No git history | Proceed |
373
+ | W002 | warning | Some dimension agents failed | Partial coverage |
374
+ | W003 | warning | Archaeology agent or delegate failure | Proceed with available results |
375
+ | W004 | warning | Generalization 0 hits after full 3-layer scan | Advance to S_RECORD (requires all 3 layers attempted with evidence) |
376
+ </error_codes>
377
+
378
+ <success_criteria>
379
+ - [ ] Session + 4 output files + prior knowledge searched
380
+ - [ ] Archaeology + CLI review → evidence phase=archaeology
381
+ - [ ] CLI exploration → explore.json + evidence phase=explore
382
+ - [ ] All dimensions reviewed, ALL findings fixed (remaining_actionable == 0)
383
+ - [ ] Per-tier re-review gate; every unfixed finding individually classified
384
+ - [ ] understanding.md sections 1-8 progressive
385
+ - [ ] Fix + confirmed (unless --skip-fix)
386
+ - [ ] Generalization + scan (unless --skip-generalize)
387
+ - [ ] Discoveries classified; unfixed findings individually justified
388
+ - [ ] phase_goals G1-G6 audited, Goal Prompt once, `-y` no blocking, -c resumable
389
+ - [ ] Completion summary
390
+ </success_criteria>
391
+
392
+ <next_step_routing>
393
+ | Condition | Next |
394
+ |-----------|------|
395
+ | Deeper debug needed | `/odyssey-debug "<finding>"` |
396
+ | Issues created | `/manage-issue list --source review-odyssey` |
397
+ | Document pattern | `/learn-decompose <module>` |
398
+ | Plan fixes | `/maestro-plan --gaps` |
399
+ </next_step_routing>
400
+ </output>