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,434 +1,550 @@
1
- ---
2
- name: odyssey-planex
3
- description: Requirement-driven iterative cycle — plan, execute, strict verify, fix loop until acceptance criteria met
4
- argument-hint: "<requirement> [--template <name>] [--max-iterations N] [--skip-generalize] [--auto] [--method agent|cli|auto] [--executor <tool>] [--skip-verify] [--heartbeat] [-y] [-c]"
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
- Requirement-to-delivery closed loop: parse requirement → define acceptance criteria →
19
- plan → execute → verify → fix gaps → iterate until ALL criteria pass.
20
- </purpose>
21
-
22
- <boundary>
23
- **In scope:** Single requirement delivery loop — from requirement parsing to all acceptance criteria passing + generalization.
24
- **Out of scope:** Multi-requirement orchestration → `/maestro-roadmap` | Deep debugging → `/odyssey-debug` | Code review → `/odyssey-review-test-fix` | UI optimization → `/odyssey-ui`
25
-
26
- **`--template <name>`:**
27
-
28
- | Template | Criteria pattern | Use case |
29
- |----------|-----------------|----------|
30
- | `feature` | User story acceptance + boundary tests + UI verification | New feature |
31
- | `bugfix` | Regression tests + root cause confirmation + boundary coverage | Bug fix |
32
- | `refactor` | Behavior preservation + performance baseline + API compatibility | Refactoring |
33
- | `migration` | Data consistency + rollback verification + performance comparison | Data/API migration |
34
- | `api-endpoint` | Request/response contract + error handling + permission checks | API development |
35
- </boundary>
36
-
37
- <context>
38
- $ARGUMENTS
39
-
40
- **Flags:**
41
-
42
- | Flag | Description | Default |
43
- |------|-------------|---------|
44
- | `--template <name>` | Predefined requirement template | — |
45
- | `--max-iterations N` | Max verify-fix cycles before escalation | 3 |
46
- | `--skip-generalize` | Skip S_GENERALIZE + S_DISCOVER | false |
47
- | `--auto` | CLI delegate calls without confirmation | false |
48
- | `--method agent\|cli\|auto` | Execution method | `auto` |
49
- | `--executor <tool>` | Explicit executor tool for CLI delegate | First enabled |
50
- | `--skip-verify` | Skip post-execution validation gate | false |
51
- | `--heartbeat` | Enable periodic progress heartbeat | false |
52
- | `-y` | Auto-confirm — decisions recorded as `deferred` | false |
53
- | `-c` | Resume most recent session | — |
54
-
55
- **Session**: `.workflow/scratch/{YYYYMMDD}-planex-odyssey-{slug}/`
56
- **Output**: `session.json` | `evidence.ndjson` | `understanding.md`
57
-
58
- **session.json planex-specific fields:**
59
- ```json
60
- { "requirement": "",
61
- "acceptance_criteria": [{"id":"AC1","criterion":"","verify_method":"test|grep|cli-review|manual","status":"pending","evidence":"","passed_at":null}],
62
- "plan": {"tasks":[{"id":"T1","title":"","description":"","criteria_refs":["AC1"],"status":"pending","files_modified":[],"domain":"general","executor":"agent"}],"created_at":""},
63
- "execution_config": {"method":"auto","default_executor":"","domain_routing":{"frontend":"","backend":"","default":"agent"},"code_review_tool":"Skip","verification_tool":"Auto","confirmed":false},
64
- "iterations": [{"iteration":1,"started_at":"","completed_at":"","criteria_before":{"passed":0,"total":0},"criteria_after":{"passed":0,"total":0},"gaps_fixed":[],"files_modified":[]}],
65
- "current_iteration": 0,
66
- "patterns": [{"id":"P1","source":"AC1 fix","layer":"syntax|semantic|structural","signature":"","description":"","risk":"","fix_template":""}],
67
- "generalization_stats": "-> base shared_schemas" }
68
- ```
69
-
70
- **evidence.ndjson phases:** `planning|execution|verification|fix|decision|generalization|discovery|self-iteration`
71
-
72
- **understanding.md 8 sections:**
73
- 1. Requirement & Criteria <- S_INTAKE | 2. Plan <- S_PLAN | 3. Execution <- S_EXECUTE
74
- 4. Verification <- S_VERIFY | 5. Fix Log <- S_FIX | 6. Generalization <- S_GENERALIZE
75
- 7. Discoveries <- S_DISCOVER | 8. Learnings <- S_RECORD
76
-
77
- **phase_goals[]:**
78
-
79
- | ID | Goal | done_when | phase | skip_when |
80
- |----|------|-----------|-------|-----------|
81
- | G1 | Acceptance criteria defined | >=1 criterion in acceptance_criteria[] | S_INTAKE | |
82
- | G2 | Plan created | session.json.plan populated | S_PLAN | — |
83
- | G3 | Implementation complete | all plan tasks executed | S_EXECUTE | — |
84
- | G4 | All criteria pass | all acceptance_criteria[].status == passed | S_VERIFY | — |
85
- | G5 | Pattern generalized | patterns[] >=1 entry | S_GENERALIZE | skip_generalize |
86
- | G6 | Discoveries triaged | all scan hits classified | S_DISCOVER | skip_generalize |
87
- | G7 | Learnings persisted | spec entries created OR no actionable | S_RECORD | |
88
-
89
- **Knowledge Persistence (written to understanding.md section 8):**
90
-
91
- | Category | Content | Follow-up |
92
- |----------|---------|-----------|
93
- | Multi-round fix cycle pattern | Problem scenario + fix iteration + final approach | `/spec-add debug` |
94
- | Reusable implementation pattern | Pattern + applicable scope + code template | `/spec-add coding` |
95
- | Acceptance criteria template | Standard template + verify_method suggestion | `/spec-add review` |
96
- | Generalization pattern | Signature + risk + fix template | `/spec-add coding` |
97
- </context>
98
-
99
- <invariants>
100
- Base execution_discipline #1-5.
101
- 6. **Acceptance criteria are sacred** — no "close enough", no manual override without explicit escalation
102
- </invariants>
103
-
104
- <self_iteration>
105
- Applies to: **S_PLAN, S_VERIFY, S_GENERALIZE**. Logic in base.
106
- </self_iteration>
107
-
108
- <state_machine>
109
-
110
- <states>
111
- S_INTAKE → S_PLAN → S_EXECUTE → S_VERIFY → S_FIX → S_GENERALIZE → S_DISCOVER → S_RECORD → END
112
- </states>
113
-
114
- <transitions>
115
- S_INTAKE → S_INTAKE : -c + session found (resume)
116
- S_INTAKE → S_PLAN : requirement + criteria defined
117
- S_INTAKE → S_INTAKE : no requirement AskUserQuestion
118
-
119
- S_PLAN → S_EXECUTE
120
- S_EXECUTE → S_VERIFY
121
-
122
- S_VERIFY → S_GENERALIZE : all passed AND NOT skip_generalize
123
- S_VERIFY → S_RECORD : all passed AND skip_generalize
124
- S_VERIFY S_FIX : some failed AND iteration < max
125
- S_VERIFY → S_PLAN : fundamental plan flaw → cross_phase_loops++ (replan). **Criteria preservation:** acceptance_criteria[] statuses are preserved; only plan.tasks[] are regenerated. Previously passed criteria retain `passed` status; failed criteria reset to `pending` for re-verification after new plan execution.
126
- S_VERIFY → S_RECORD : some failed AND iteration >= max (escalate)
127
-
128
- S_FIX S_VERIFY (loop)
129
-
130
- S_GENERALIZE → S_DISCOVER : hits found
131
- S_GENERALIZES_RECORD : no hits
132
-
133
- S_DISCOVER → S_EXECUTE : discovery finds area needing same implementation cross_phase_loops++
134
- S_DISCOVER S_RECORD : triage complete AND remaining_actionable == 0
135
- S_DISCOVERS_RECORD : loops >= max_loops log per-item reasons
136
-
137
- S_RECORDEND
138
- </transitions>
139
-
140
- <actions>
141
-
142
- ### A_INTAKE
143
-
144
- 1. Parse requirement and flags, generate slug, create SESSION_DIR
145
- 2. **Define acceptance criteria** analyze requirement derive testable criteria. Each gets `verify_method`: test | grep | cli-review | manual
146
- - Normal: AskUserQuestion to confirm/edit
147
- - `-y`: auto-derive, record `{"phase":"decision","type":"criteria-confirmation","status":"deferred"}`
148
- 3. Search prior knowledge: `maestro search`, related sessions
149
- 4. Write session.json + understanding.md section 1. Mark G1 done. Emit Goal Prompt.
150
-
151
- Commit: `"odyssey-planex({slug}): INTAKE parse requirement and define criteria"`
152
-
153
- ### A_PLAN
154
-
155
- 1. Decompose requirement into ordered tasks mapped to acceptance criteria
156
- 2. CLI-assisted planning (optional):
157
- ```bash
158
- maestro delegate "PURPOSE: Create implementation plan for: {requirement}
159
- TASK: Decompose into subtasks | Map to acceptance criteria | Identify dependencies
160
- MODE: analysis
161
- CONTEXT: @**/* | Criteria: {criteria_summary}
162
- EXPECTED: JSON [{task_id, title, description, criteria_refs, deps}]
163
- " --role analyze --mode analysis
164
- ```
165
- Run with `run_in_background: true`, wait for callback.
166
- 3. Write session.json.plan, append evidence (planning), update understanding.md section 2. Mark G2 done.
167
-
168
- Commit: `"odyssey-planex({slug}): PLAN — create execution plan"`
169
-
170
- ### A_EXECUTE
171
-
172
- #### Step 1: Execution Options Confirmation
173
-
174
- **Skip if** `-y` flag OR `--method` explicitly set OR `execution_config.confirmed == true` (resume).
175
-
176
- Load available tools: `maestro delegate-config show --json`.
177
-
178
- Present AskUserQuestion with 3 questions:
179
- 1. **Executor** — Auto (domain routing) | Agent (all tasks) | specific CLI tool | Other (custom domain routing)
180
- 2. **Review** Skip | {tool} review (git diff quality check)
181
- 3. **Verify** Auto (delegate convergence + structure + anti-pattern check) | specific tool | Skip
182
-
183
- Parse response → write `execution_config` to session.json, set `confirmed: true`. `--skip-verify` overrides verification to `"Skip"`.
184
-
185
- #### Step 2: Executor Resolution
186
-
187
- Per-task domain routing (when method == "auto"):
188
-
189
- | Domain | Keywords / Patterns | Extensions |
190
- |--------|-------------------|------------|
191
- | frontend | UI, component, page, style, layout, CSS, view | .tsx/.jsx/.vue/.css/.html/.svelte |
192
- | backend | API, server, database, service, algorithm, worker | .go/.rs/.java/.py/.sql/.proto |
193
- | general | mixed, config, tests, unclear | .ts/.js/other |
194
-
195
- Resolution: `execution_config.domain_routing[domain]` fallback `domain_routing.default` ("agent").
196
-
197
- #### Step 3: Task Execution
198
-
199
- Execute tasks per plan order. Independent tasks may run in parallel.
200
-
201
- **Agent path:**
202
- ```
203
- Spawn Agent with: task definition, acceptance criteria refs, prior task summaries, specs_content
204
- Agent implements → verifies convergence → auto-fix (max 3) → returns result
205
- ```
206
-
207
- **CLI path:**
208
- ```bash
209
- maestro delegate "PURPOSE: Implement task ${task_id}: ${title}; success = criteria ${criteria_refs} satisfied
210
- TASK: ${description} | Read existing code first | Verify convergence criteria after changes
211
- MODE: write
212
- CONTEXT: @${scope}/**/* | Criteria: ${criteria_summary}
213
- EXPECTED: Working code changes, convergence evidence, summary of what was done
214
- CONSTRAINTS: Scope limited to task files | Follow project specs
215
-
216
- ## Acceptance Criteria (must satisfy)
217
- ${criteria_refs.map(ref => criteria[ref].criterion).join('\n')}
218
-
219
- ## Implementation Steps
220
- ${task.description}
221
-
222
- ## Project Specs
223
- ${specs_content}
224
-
225
- ## Prior Task Summaries
226
- ${prior_summaries}
227
- " --to ${resolved_executor} --mode write --id planex-${slug}-${task_id}
228
- ```
229
-
230
- Run with `run_in_background: true`, wait for callback.
231
-
232
- **Deviation Rule** max 3 auto-fix attempts per task:
233
- 1. First attempt: normal dispatch
234
- 2. Retry: `--resume planex-${slug}-${task_id}` with simplified prompt
235
- 3. Final: fallback to Agent path
236
- 4. All 3 fail mark task `blocked`, record checkpoint, continue remaining tasks
237
-
238
- #### Step 4: Per-Task Evidence
239
-
240
- Per completed task:
241
- - Record evidence: `{"phase":"execution","type":"task-completed","task_id":"T1","executor":"agent|agy|...","files_modified":[],"summary":"","attempt":1}`
242
- - Update task status in session.json plan
243
-
244
- #### Step 5: Post-Execution Validation
245
-
246
- **Skip if** `execution_config.verification_tool == "Skip"` OR `--skip-verify` OR no completed tasks.
247
-
248
- **Check 1: Summary Consistency** — cross-check task status vs actual file changes (git diff).
249
-
250
- **Check 2: CLI Verification Gate** delegate to external model:
251
- ```bash
252
- maestro delegate "PURPOSE: Verify execution output meets acceptance criteria; success = all criteria verified with file:line evidence
253
- TASK:
254
- 1. CONVERGENCE: For each criterion, read actual code, verify behavior exists, report status with evidence
255
- 2. EXISTENCE: Verify all expected files exist on disk
256
- 3. SUBSTANCE: Verify real implementation flag stubs, placeholders, TODO-only
257
- 4. ANTI-PATTERNS: Scan for TODO/FIXME/HACK, console.log debug, disabled tests
258
- MODE: analysis
259
- CONTEXT: @${modified_files}
260
- EXPECTED: JSON { convergence: [{criterion, status, evidence}], issues: [{type, file, line, severity}], overall: passed|gaps_found }
261
- CONSTRAINTS: Read-only | Check ALL criteria exhaustively | Evidence must be file:line
262
-
263
- ## Acceptance Criteria (verify each)
264
- ${acceptance_criteria.map(c => c.criterion).join('\n')}
265
-
266
- ## Modified Files
267
- ${modified_files.join('\n')}
268
- " --to ${execution_config.verification_tool} --mode analysis
269
- ```
270
-
271
- Run with `run_in_background: true`, wait for callback.
272
-
273
- On result:
274
- - `overall == "passed"` proceed to S_VERIFY with boosted confidence
275
- - `overall == "gaps_found"` → log findings, proceed to S_VERIFY
276
-
277
- **Check 3: Code Review** (if `execution_config.code_review_tool != "Skip"`):
278
- ```bash
279
- maestro delegate "Review git diff for correctness, style, bugs" --to ${code_review_tool} --mode analysis --rule analysis-review-code-quality
280
- ```
281
-
282
- #### Step 6: Completion
283
-
284
- Update understanding.md section 3. Mark G3 done.
285
-
286
- Commit: `"odyssey-planex({slug}): EXECUTE — implementation complete"`
287
-
288
- ### A_VERIFY
289
-
290
- Iron gate — every acceptance criterion checked objectively.
291
-
292
- **Verify each criterion by method:**
293
-
294
- | Method | Action |
295
- |--------|--------|
296
- | `test` | Run relevant tests, check pass/fail |
297
- | `grep` | Grep for expected pattern |
298
- | `cli-review` | `maestro delegate "PURPOSE: Verify criterion {criterion_id}: {criterion}\nTASK: Read implementation code \| Check behavior matches criterion \| Report pass/fail with file:line evidence\nMODE: analysis\nCONTEXT: @{relevant_files}\nEXPECTED: JSON {criterion_id, status: passed\|failed, evidence: [{file, line, detail}]}" --role review --mode analysis` |
299
- | `manual` | Normal: AskUserQuestion / `-y`: record `deferred` |
300
-
301
- Record per criterion: `{"phase":"verification","type":"criterion-check","criterion_id":"AC1","method":"","result":"passed|failed","evidence":"","iteration":N}`. Update acceptance_criteria[].status. Append to iterations[].
302
-
303
- Update understanding.md section 4 with pass/fail table.
304
-
305
- **Route:** all passed → mark G4 done → next state. Some failed + iteration < max → S_FIX. Some failed + iteration >= max → Normal: AskUserQuestion (continue/lower bar/accept) / `-y`: `deferred`, proceed S_RECORD.
306
-
307
- Commit: `"odyssey-planex({slug}): VERIFY acceptance check"`
308
-
309
- ### A_FIX
310
-
311
- 1. Increment current_iteration
312
- 2. For each failed criterion: diagnose gap → targeted code fix
313
- 3. CLI fix review (optional):
314
- ```bash
315
- maestro delegate "PURPOSE: Review fixes for failing criteria; success = no regressions and fixes correct
316
- TASK: Check fix correctness | Verify no regressions on passing criteria | Report verdict with file:line evidence
317
- MODE: analysis
318
- CONTEXT: @{modified_files} | Passing: {passing} | Fixed: {fixed}
319
- EXPECTED: JSON {verdict: passed|concerns_found, regression_risk: low|medium|high, concerns: [{criterion_id, file, line, description}]}
320
- CONSTRAINTS: Read-only | Check ALL passing criteria for regressions
321
- " --role review --mode analysis
322
- ```
323
- 4. Append evidence (fix), update understanding.md section 5 → S_VERIFY
324
-
325
- Commit: `"odyssey-planex({slug}): FIX — targeted fix for failing criteria"`
326
-
327
- ### A_GENERALIZE
328
-
329
- Base shared_actions. Pattern source: implementation patterns.
330
-
331
- Commit: `"odyssey-planex({slug}): GENERALIZE pattern scan complete"`
332
-
333
- ### A_DISCOVER
334
-
335
- Base shared_actions. Planex override: discovery finding needing same implementation → route back to S_EXECUTE (not S_FIX).
336
-
337
- Commit: `"odyssey-planex({slug}): DISCOVER findings classified"`
338
-
339
- ### A_RECORD
340
-
341
- Base shared_actions. Planex additions:
342
- 1. Iteration summary: what worked, what needed rework, fix cycle patterns
343
- 2. Learnings structured per Knowledge Persistence table: problem scenario + fix iteration process + final approach + applicable scope
344
-
345
- **Completion summary:**
346
- ```
347
- --- PLANEX ODYSSEY COMPLETE ---
348
- Requirement: {requirement}
349
- Criteria: {passed}/{total} passed
350
- Iterations: {N} cycles
351
- Patterns: {patterns_extracted} ({by_layer} distribution)
352
- Scan hits: {total_hits} ({cross_layer_confirmed} cross-layer confirmed)
353
- Issues: {N} created | Decisions: {N} resolved, {M} pending, {K} deferred
354
- Learnings: {N} spec entries
355
- Self-iter: {N} rounds across {M} stages
356
- Goals: {done}/{total} confirmed ({skipped} skipped)
357
- Status: {ALL_PASSED|PARTIAL|ESCALATED}
358
- ---
359
- ```
360
-
361
- Commit: `"odyssey-planex({slug}): RECORD — session summary"`
362
-
363
- </actions>
364
-
365
- <appendix>
366
-
367
- ### `-y` planex-specific points
368
-
369
- | Decision Point | Normal | `-y` |
370
- |---------------|--------|------|
371
- | S_INTAKE criteria confirmation | AskUserQuestion | auto-derive, `deferred` |
372
- | S_EXECUTE execution options | AskUserQuestion | use defaults (auto/Skip/Auto), `confirmed: true` |
373
- | S_EXECUTE task blocked (3 retries) | AskUserQuestion: continue or stop | auto continue, log blocked |
374
- | S_VERIFY manual criterion | AskUserQuestion | `deferred` |
375
- | S_VERIFY max iteration reached | AskUserQuestion | auto accept, `deferred` |
376
-
377
- ### Goal Prompt convergence rules
378
-
379
- ```
380
- Exhaustive iteration: until all acceptance_criteria[*].status==passed
381
- AND phase_goals_all_done=true. Verify failure auto-triggers fix->re-verify loop.
382
- Each fix round re-verifies; new criterion violations continue fixing within max_iterations.
383
- No "close enough" — all criteria must ALL pass.
384
- ```
385
-
386
- ### Iteration Model
387
-
388
- ```
389
- S_EXECUTE → S_VERIFY ──all pass──→ S_GENERALIZE → S_DISCOVER → S_RECORD
390
- │ │
391
- some fail + iter < max no hits ─→ S_RECORD
392
-
393
- S_FIX ──→ S_VERIFY (loop)
394
- ```
395
-
396
- Max iterations (default 3) prevents infinite loops. Each iteration records criteria_before, gaps_fixed, criteria_after.
397
-
398
- </appendix>
399
-
400
- </state_machine>
401
-
402
- <error_codes>
403
- | Code | Severity | Condition | Recovery |
404
- |------|----------|-----------|----------|
405
- | E001 | error | No requirement provided | Provide requirement |
406
- | W001 | warning | No acceptance criteria derived | Manual definition needed |
407
- | W002 | warning | Max iterations reached, criteria still failing | Escalate to user |
408
- | W003 | warning | CLI review regression concern | Review before next iteration |
409
- </error_codes>
410
-
411
- <success_criteria>
412
- - [ ] Requirement parsed with >=1 acceptance criterion (verify_method assigned)
413
- - [ ] Plan tasks mapped to criteria; execution options confirmed
414
- - [ ] Tasks dispatched via resolved executor with deviation rule (max 3 retries)
415
- - [ ] Post-execution validation gate run (unless --skip-verify)
416
- - [ ] Every criterion verified per method; failing targeted fix (not re-implementation)
417
- - [ ] Iteration count tracked and max respected; unfixed criteria individually classified
418
- - [ ] understanding.md sections 1-8 updated per phase; phase_goals G1-G7 audited
419
- - [ ] Generalization + discovery completed (unless --skip-generalize)
420
- - [ ] Quality Gate self-iteration triggered when insufficient
421
- - [ ] Goal Prompt displayed once after intake; `-y` mode: no blocking prompts
422
- - [ ] Session resumable via -c; completion summary output
423
- </success_criteria>
424
-
425
- <next_step_routing>
426
- | Condition | Next |
427
- |-----------|------|
428
- | All criteria passed | `/odyssey-review-test-fix <changed-files>` |
429
- | Max iterations, still failing | `/odyssey-debug "<failing criterion>"` |
430
- | Formal review | `/quality-review <phase>` |
431
- | Issues from discoveries | `/manage-issue list --source planex-odyssey` |
432
- | Pattern worth documenting | `/learn-decompose <module>` |
433
- </next_step_routing>
434
- </output>
1
+ ---
2
+ name: odyssey-planex
3
+ description: Requirement-driven iterative cycle — plan, execute, strict verify, fix loop until acceptance criteria met
4
+ argument-hint: "<requirement> [--template <name>] [--max-iterations N] [--skip-generalize] [--auto] [--method agent|cli|auto] [--executor <tool>] [--skip-verify] [--heartbeat] [-y] [-c]"
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
+ Requirement-to-delivery closed loop: parse requirement → define acceptance criteria →
19
+ plan → execute → verify → fix gaps → iterate until ALL criteria pass.
20
+ </purpose>
21
+
22
+ <boundary>
23
+ **In scope:** Single requirement delivery loop — from requirement parsing to all acceptance criteria passing + generalization.
24
+ **Out of scope:** Multi-requirement orchestration → `/maestro-roadmap` | Deep debugging → `/odyssey-debug` | Code review → `/odyssey-review-test-fix` | UI optimization → `/odyssey-ui`
25
+
26
+ **`--template <name>`:**
27
+
28
+ | Template | Criteria pattern | Use case |
29
+ |----------|-----------------|----------|
30
+ | `feature` | User story acceptance + boundary tests + UI verification | New feature |
31
+ | `bugfix` | Regression tests + root cause confirmation + boundary coverage | Bug fix |
32
+ | `refactor` | Behavior preservation + performance baseline + API compatibility | Refactoring |
33
+ | `migration` | Data consistency + rollback verification + performance comparison | Data/API migration |
34
+ | `api-endpoint` | Request/response contract + error handling + permission checks | API development |
35
+ </boundary>
36
+
37
+ <context>
38
+ $ARGUMENTS
39
+
40
+ **Flags:**
41
+
42
+ | Flag | Description | Default |
43
+ |------|-------------|---------|
44
+ | `--template <name>` | Predefined requirement template | — |
45
+ | `--max-iterations N` | Max verify-fix cycles before escalation | 3 |
46
+ | `--skip-generalize` | Skip S_GENERALIZE + S_DISCOVER | false |
47
+ | `--auto` | CLI delegate calls without confirmation | false |
48
+ | `--method agent\|cli\|auto` | Execution method | `auto` |
49
+ | `--executor <tool>` | Explicit executor tool for CLI delegate | First enabled |
50
+ | `--skip-verify` | Skip post-execution validation gate | false |
51
+ | `--heartbeat` | Enable periodic progress heartbeat | false |
52
+ | `-y` | Auto-confirm — decisions recorded as `deferred` | false |
53
+ | `-c` | Resume most recent session | — |
54
+
55
+ **Session**: `.workflow/scratch/{YYYYMMDD}-planex-odyssey-{slug}/`
56
+ **Output**: `session.json` | `evidence.ndjson` | `understanding.md`
57
+
58
+ **Output boundary**: ALL session artifacts MUST target the session directory (`.workflow/scratch/{YYYYMMDD}-planex-odyssey-{slug}/`) or `.workflow/state.json` only. Source code modifications during S_EXECUTE and S_FIX are in-scope but MUST be committed per action. NEVER write session artifacts outside these paths.
59
+
60
+ **session.json planex-specific fields:**
61
+ ```json
62
+ { "requirement": "",
63
+ "acceptance_criteria": [{"id":"AC1","criterion":"","verify_method":"test|grep|cli-review|manual","status":"pending","evidence":"","passed_at":null}],
64
+ "plan": {"tasks":[{"id":"T1","title":"","description":"","criteria_refs":["AC1"],"status":"pending","files_modified":[],"domain":"general","executor":"agent"}],"created_at":""},
65
+ "execution_config": {"method":"auto","default_executor":"","domain_routing":{"frontend":"","backend":"","default":"agent"},"code_review_tool":"Skip","verification_tool":"Auto","confirmed":false},
66
+ "iterations": [{"iteration":1,"started_at":"","completed_at":"","criteria_before":{"passed":0,"total":0},"criteria_after":{"passed":0,"total":0},"gaps_fixed":[],"files_modified":[]}],
67
+ "current_iteration": 0,
68
+ "patterns": [{"id":"P1","source":"AC1 fix","layer":"syntax|semantic|structural","signature":"","description":"","risk":"","fix_template":""}],
69
+ "generalization_stats": "-> base shared_schemas" }
70
+ ```
71
+
72
+ **evidence.ndjson phases:** `planning|execution|verification|fix|decision|generalization|discovery|self-iteration`
73
+
74
+ **understanding.md 8 sections:**
75
+ 1. Requirement & Criteria <- S_INTAKE | 2. Plan <- S_PLAN | 3. Execution <- S_EXECUTE
76
+ 4. Verification <- S_VERIFY | 5. Fix Log <- S_FIX | 6. Generalization <- S_GENERALIZE
77
+ 7. Discoveries <- S_DISCOVER | 8. Learnings <- S_RECORD
78
+
79
+ **phase_goals[]:**
80
+
81
+ | ID | Goal | done_when | phase | skip_when |
82
+ |----|------|-----------|-------|-----------|
83
+ | G1 | Acceptance criteria defined | >=1 criterion in acceptance_criteria[] | S_INTAKE | — |
84
+ | G2 | Plan created | session.json.plan populated | S_PLAN | — |
85
+ | G3 | Implementation complete | all plan tasks executed | S_EXECUTE | |
86
+ | G4 | All criteria pass | all acceptance_criteria[].status == passed | S_VERIFY | |
87
+ | G5 | Pattern generalized | patterns[] >=1 entry | S_GENERALIZE | skip_generalize |
88
+ | G6 | Discoveries triaged | all scan hits classified | S_DISCOVER | skip_generalize |
89
+ | G7 | Learnings persisted | spec entries created OR no actionable | S_RECORD | — |
90
+
91
+ **Knowledge Persistence (written to understanding.md section 8):**
92
+
93
+ | Category | Content | Follow-up |
94
+ |----------|---------|-----------|
95
+ | Multi-round fix cycle pattern | Problem scenario + fix iteration + final approach | `/spec-add debug` |
96
+ | Reusable implementation pattern | Pattern + applicable scope + code template | `/spec-add coding` |
97
+ | Acceptance criteria template | Standard template + verify_method suggestion | `/spec-add review` |
98
+ | Generalization pattern | Signature + risk + fix template | `/spec-add coding` |
99
+ </context>
100
+
101
+ <invariants>
102
+ Base execution_discipline #1-5.
103
+ 6. **Acceptance criteria are sacred** — no "close enough", no manual override without explicit escalation
104
+ 7. **Generalize is mandatory** — S_GENERALIZE and S_DISCOVER execute unless `skip_generalize == true`. "All criteria passed" or context pressure are NOT valid reasons to skip. The phase itself determines whether patterns exist.
105
+ </invariants>
106
+
107
+ <self_iteration>
108
+ Applies to: **S_PLAN, S_VERIFY, S_GENERALIZE**. Logic in base.
109
+ </self_iteration>
110
+
111
+ <execution>
112
+ Follow base execution discipline completely. Actions defined in state_machine below.
113
+
114
+ ### Phase Gates (MANDATORY, BLOCKING)
115
+
116
+ **GATE 1: INTAKE PLAN**
117
+ - REQUIRED: Requirement parsed, >=1 acceptance criterion defined with verify_method assigned.
118
+ - REQUIRED: session.json initialized, understanding.md §1 written, G1 marked done.
119
+ - BLOCKED if: no requirement provided (E001) or zero criteria derived (W001).
120
+
121
+ **GATE 2: PLAN → EXECUTE**
122
+ - REQUIRED: Plan tasks decomposed with criteria_refs mapping each task to acceptance criteria.
123
+ - REQUIRED: session.json.plan populated, understanding.md §2 updated, G2 marked done.
124
+ - BLOCKED if: plan has zero tasks or unmapped criteria.
125
+
126
+ **GATE 3: EXECUTE VERIFY**
127
+ - REQUIRED: All plan tasks executed (or marked blocked after 3 retries per deviation rule).
128
+ - REQUIRED: execution_config confirmed, per-task evidence logged, understanding.md §3 updated, G3 marked done.
129
+ - BLOCKED if: tasks still pending execution.
130
+
131
+ **GATE 4: VERIFY FIX / GENERALIZE**
132
+ - REQUIRED: Every acceptance criterion verified by its assigned method (test/grep/cli-review/manual).
133
+ - REQUIRED: Per-criterion evidence logged with pass/fail status and iteration count.
134
+ - BLOCKED if: verification incomplete all criteria must be checked before routing decision.
135
+ - Route: all passed GENERALIZE (or RECORD if skip_generalize). Some failed + iteration < max → FIX.
136
+
137
+ **GATE 5: FIX VERIFY**
138
+ - REQUIRED: current_iteration incremented, targeted fixes applied for each failed criterion.
139
+ - REQUIRED: Fix evidence logged, understanding.md §5 updated.
140
+ - BLOCKED if: no fix attempted for failing criteria.
141
+
142
+ **GATE 6: GENERALIZE → DISCOVER**
143
+ - REQUIRED: ALL 3 layers (syntax/semantic/structural) attempted with evidence logged.
144
+ - REQUIRED: generalization_stats written with by_layer entries for all 3 layers, G5 marked done.
145
+ - BLOCKED if: any layer not attempted (thoroughness floor violation).
146
+
147
+ **GATE 7: DISCOVER RECORD**
148
+ - REQUIRED: All hits triaged with per-item classification and reason.
149
+ - REQUIRED: remaining_actionable == 0 OR loops >= max_loops with per-item reasons logged.
150
+ - REQUIRED: G6 marked done.
151
+ - BLOCKED if: unclassified hits remain.
152
+
153
+ </execution>
154
+
155
+ <state_machine>
156
+
157
+ <states>
158
+ S_INTAKE S_PLAN S_EXECUTE S_VERIFY → S_FIX → S_GENERALIZE → S_DISCOVER → S_RECORD → END
159
+ </states>
160
+
161
+ <transitions>
162
+ S_INTAKE → S_INTAKE : -c + session found (resume)
163
+ S_INTAKE S_PLAN : requirement + criteria defined
164
+ S_INTAKE → S_INTAKE : no requirement → AskUserQuestion
165
+
166
+ S_PLAN → S_EXECUTE
167
+ S_EXECUTE → S_VERIFY
168
+
169
+ S_VERIFY → S_GENERALIZE : all passed AND NOT skip_generalize
170
+ S_VERIFY → S_RECORD : all passed AND skip_generalize
171
+ S_VERIFY → S_FIX : some failed AND iteration < max
172
+ S_VERIFY S_PLAN : fundamental plan flaw → cross_phase_loops++ (replan). **Criteria preservation:** acceptance_criteria[] statuses are preserved; only plan.tasks[] are regenerated. Previously passed criteria retain `passed` status; failed criteria reset to `pending` for re-verification after new plan execution.
173
+ S_VERIFY → S_RECORD : some failed AND iteration >= max (escalate)
174
+
175
+ S_FIX → S_VERIFY (loop)
176
+
177
+ S_GENERALIZE → S_DISCOVER : hits found
178
+ S_GENERALIZE S_RECORD : all 3 layers scanned with evidence, total_hits == 0
179
+
180
+ S_DISCOVER S_EXECUTE : discovery finds area needing same implementation cross_phase_loops++
181
+ S_DISCOVER S_RECORD : triage complete AND remaining_actionable == 0
182
+ S_DISCOVER → S_RECORD : loops >= max_loops → log per-item reasons
183
+
184
+ S_RECORD → END
185
+ </transitions>
186
+
187
+ <actions>
188
+
189
+ ### A_INTAKE
190
+
191
+ 1. Parse requirement and flags, generate slug, create SESSION_DIR
192
+ 2. **Define acceptance criteria** analyze requirement derive testable criteria. Each gets `verify_method`: test | grep | cli-review | manual
193
+ - Normal: AskUserQuestion to confirm/edit
194
+ - `-y`: auto-derive, record `{"phase":"decision","type":"criteria-confirmation","status":"deferred"}`
195
+ 3. Search prior knowledge: `maestro search`, related sessions
196
+ 4. Write session.json + understanding.md section 1. Mark G1 done. Emit Goal Prompt.
197
+
198
+ Commit: `"odyssey-planex({slug}): INTAKE — parse requirement and define criteria"`
199
+
200
+ ### A_PLAN
201
+
202
+ 1. Decompose requirement into ordered tasks mapped to acceptance criteria
203
+ 2. CLI-assisted planning (optional):
204
+ ```bash
205
+ maestro delegate "PURPOSE: Create implementation plan for: {requirement}
206
+ TASK: Decompose into subtasks | Map to acceptance criteria | Identify dependencies
207
+ MODE: analysis
208
+ CONTEXT: @**/* | Criteria: {criteria_summary}
209
+ EXPECTED: JSON [{task_id, title, description, criteria_refs, deps}]
210
+ " --role analyze --mode analysis
211
+ ```
212
+ Run with `run_in_background: true`, wait for callback.
213
+ 3. Write session.json.plan, append evidence (planning), update understanding.md section 2. Mark G2 done.
214
+
215
+ Commit: `"odyssey-planex({slug}): PLAN — create execution plan"`
216
+
217
+ ### A_EXECUTE
218
+
219
+ #### Step 1: Execution Options Confirmation
220
+
221
+ **Skip if** `-y` flag OR `--method` explicitly set OR `execution_config.confirmed == true` (resume).
222
+
223
+ Load available tools: `maestro delegate-config show --json`.
224
+
225
+ Present AskUserQuestion with 3 questions:
226
+ 1. **Executor** — Auto (domain routing) | Agent (all tasks) | specific CLI tool | Other (custom domain routing)
227
+ 2. **Review** — Skip | {tool} review (git diff quality check)
228
+ 3. **Verify** — Auto (delegate convergence + structure + anti-pattern check) | specific tool | Skip
229
+
230
+ Parse response → write `execution_config` to session.json, set `confirmed: true`. `--skip-verify` overrides verification to `"Skip"`.
231
+
232
+ #### Step 2: Executor Resolution
233
+
234
+ Per-task domain routing (when method == "auto"):
235
+
236
+ | Domain | Keywords / Patterns | Extensions |
237
+ |--------|-------------------|------------|
238
+ | frontend | UI, component, page, style, layout, CSS, view | .tsx/.jsx/.vue/.css/.html/.svelte |
239
+ | backend | API, server, database, service, algorithm, worker | .go/.rs/.java/.py/.sql/.proto |
240
+ | general | mixed, config, tests, unclear | .ts/.js/other |
241
+
242
+ Resolution: `execution_config.domain_routing[domain]` fallback `domain_routing.default` ("agent").
243
+
244
+ #### Step 3: Task Execution
245
+
246
+ Execute tasks per plan order. Independent tasks may run in parallel.
247
+
248
+ **Agent path:**
249
+ ```
250
+ Spawn Agent with: task definition, acceptance criteria refs, prior task summaries, specs_content
251
+ Agent implements → verifies convergence → auto-fix (max 3) → returns result
252
+ ```
253
+
254
+ **CLI path:**
255
+ ```bash
256
+ maestro delegate "PURPOSE: Implement task ${task_id}: ${title}; success = criteria ${criteria_refs} satisfied
257
+ TASK: ${description} | Read existing code first | Verify convergence criteria after changes
258
+ MODE: write
259
+ CONTEXT: @${scope}/**/* | Criteria: ${criteria_summary}
260
+ EXPECTED: Working code changes, convergence evidence, summary of what was done
261
+ CONSTRAINTS: Scope limited to task files | Follow project specs
262
+
263
+ ## Acceptance Criteria (must satisfy)
264
+ ${criteria_refs.map(ref => criteria[ref].criterion).join('\n')}
265
+
266
+ ## Implementation Steps
267
+ ${task.description}
268
+
269
+ ## Project Specs
270
+ ${specs_content}
271
+
272
+ ## Prior Task Summaries
273
+ ${prior_summaries}
274
+ " --to ${resolved_executor} --mode write --id planex-${slug}-${task_id}
275
+ ```
276
+
277
+ Run with `run_in_background: true`, wait for callback.
278
+
279
+ **Deviation Rule** max 3 auto-fix attempts per task:
280
+ 1. First attempt: normal dispatch
281
+ 2. Retry: `--resume planex-${slug}-${task_id}` with simplified prompt
282
+ 3. Final: fallback to Agent path
283
+ 4. All 3 fail → mark task `blocked`, record checkpoint, continue remaining tasks
284
+
285
+ #### Step 4: Per-Task Evidence
286
+
287
+ Per completed task:
288
+ - Record evidence: `{"phase":"execution","type":"task-completed","task_id":"T1","executor":"agent|agy|...","files_modified":[],"summary":"","attempt":1}`
289
+ - Update task status in session.json plan
290
+
291
+ #### Step 5: Post-Execution Validation
292
+
293
+ **Skip if** `execution_config.verification_tool == "Skip"` OR `--skip-verify` OR no completed tasks.
294
+
295
+ **Check 1: Summary Consistency** — cross-check task status vs actual file changes (git diff).
296
+
297
+ **Check 2: CLI Verification Gate** delegate to external model:
298
+ ```bash
299
+ maestro delegate "PURPOSE: Verify execution output meets acceptance criteria; success = all criteria verified with file:line evidence
300
+ TASK:
301
+ 1. CONVERGENCE: For each criterion, read actual code, verify behavior exists, report status with evidence
302
+ 2. EXISTENCE: Verify all expected files exist on disk
303
+ 3. SUBSTANCE: Verify real implementation — flag stubs, placeholders, TODO-only
304
+ 4. ANTI-PATTERNS: Scan for TODO/FIXME/HACK, console.log debug, disabled tests
305
+ MODE: analysis
306
+ CONTEXT: @${modified_files}
307
+ EXPECTED: JSON { convergence: [{criterion, status, evidence}], issues: [{type, file, line, severity}], overall: passed|gaps_found }
308
+ CONSTRAINTS: Read-only | Check ALL criteria exhaustively | Evidence must be file:line
309
+
310
+ ## Acceptance Criteria (verify each)
311
+ ${acceptance_criteria.map(c => c.criterion).join('\n')}
312
+
313
+ ## Modified Files
314
+ ${modified_files.join('\n')}
315
+ " --to ${execution_config.verification_tool} --mode analysis
316
+ ```
317
+
318
+ Run with `run_in_background: true`, wait for callback.
319
+
320
+ On result:
321
+ - `overall == "passed"` proceed to S_VERIFY with boosted confidence
322
+ - `overall == "gaps_found"` → log findings, proceed to S_VERIFY
323
+
324
+ **Check 3: Code Review** (if `execution_config.code_review_tool != "Skip"`):
325
+ ```bash
326
+ maestro delegate "Review git diff for correctness, style, bugs" --to ${code_review_tool} --mode analysis --rule analysis-review-code-quality
327
+ ```
328
+
329
+ #### Step 6: Completion
330
+
331
+ Update understanding.md section 3. Mark G3 done.
332
+
333
+ Commit: `"odyssey-planex({slug}): EXECUTE — implementation complete"`
334
+
335
+ ### A_VERIFY
336
+
337
+ Iron gateevery acceptance criterion checked objectively.
338
+
339
+ **Verify each criterion by method:**
340
+
341
+ | Method | Action |
342
+ |--------|--------|
343
+ | `test` | Run relevant tests, check pass/fail |
344
+ | `grep` | Grep for expected pattern |
345
+ | `cli-review` | `maestro delegate "PURPOSE: Verify criterion {criterion_id}: {criterion}\nTASK: Read implementation code \| Check behavior matches criterion \| Report pass/fail with file:line evidence\nMODE: analysis\nCONTEXT: @{relevant_files}\nEXPECTED: JSON {criterion_id, status: passed\|failed, evidence: [{file, line, detail}]}" --role review --mode analysis` |
346
+ | `manual` | Normal: AskUserQuestion / `-y`: record `deferred` |
347
+
348
+ Record per criterion: `{"phase":"verification","type":"criterion-check","criterion_id":"AC1","method":"","result":"passed|failed","evidence":"","iteration":N}`. Update acceptance_criteria[].status. Append to iterations[].
349
+
350
+ Update understanding.md section 4 with pass/fail table.
351
+
352
+ **Route:** all passed → mark G4 done → next state. Some failed + iteration < max → S_FIX. Some failed + iteration >= max → Normal: AskUserQuestion (continue/lower bar/accept) / `-y`: `deferred`, proceed S_RECORD.
353
+
354
+ Commit: `"odyssey-planex({slug}): VERIFY — acceptance check"`
355
+
356
+ ### A_FIX
357
+
358
+ 1. Increment current_iteration
359
+ 2. For each failed criterion: diagnose gap → targeted code fix
360
+ 3. CLI fix review (optional):
361
+ ```bash
362
+ maestro delegate "PURPOSE: Review fixes for failing criteria; success = no regressions and fixes correct
363
+ TASK: Check fix correctness | Verify no regressions on passing criteria | Report verdict with file:line evidence
364
+ MODE: analysis
365
+ CONTEXT: @{modified_files} | Passing: {passing} | Fixed: {fixed}
366
+ EXPECTED: JSON {verdict: passed|concerns_found, regression_risk: low|medium|high, concerns: [{criterion_id, file, line, description}]}
367
+ CONSTRAINTS: Read-only | Check ALL passing criteria for regressions
368
+ " --role review --mode analysis
369
+ ```
370
+ 4. Append evidence (fix), update understanding.md section 5 → S_VERIFY
371
+
372
+ Commit: `"odyssey-planex({slug}): FIX targeted fix for failing criteria"`
373
+
374
+ ### A_GENERALIZE
375
+
376
+ **MANDATORY — executes unless `skip_generalize == true`. "All criteria passed" or context pressure are NOT valid skip reasons.**
377
+
378
+ Pattern source: implementation patterns from executed tasks.
379
+
380
+ **Step 1 3-layer pattern extraction** from implementation:
381
+
382
+ | Layer | Method | Targets |
383
+ |-------|--------|---------|
384
+ | Syntax | Build regex from implementation diffs → Grep | API contract patterns, validation shapes, error response format, config structure |
385
+ | Semantic | Understand implementation pattern → Agent scan | Similar feature needs elsewhere, analogous data flows, parallel business logic |
386
+ | Structural | Find modules with same structure / dependency shape | Parallel module structures, sibling endpoints, same-shape services |
387
+
388
+ Write `session.json.patterns[]`: `[{id, source, layer, signature, description, risk, fix_template, confidence}]`
389
+
390
+ **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.
391
+
392
+ **Step 2 — 4-agent concurrent scan** (single message, 4 Agents):
393
+
394
+ | Agent | Strategy | Scope |
395
+ |-------|----------|-------|
396
+ | Syntax grep | Grep regex from pattern signatures | Full project |
397
+ | Semantic scan | Implementation pattern check | Related modules |
398
+ | Structural match | Find structurally similar modules | Full project |
399
+ | Historical grep | `git log -S` for pattern signatures | Git history |
400
+
401
+ **Step 3 — Cross-layer dedup:** multi-layer hit → boost | single-layer → `needs_review` | historically fixed → `regression_risk`
402
+
403
+ **Step 4 Iterative deepening:** Module with ≥3 hits → targeted deep scan (max 1 round).
404
+
405
+ **Step 5 Persist:** Update understanding.md section 6 + write `session.json.generalization_stats`:
406
+ ```json
407
+ {"patterns_extracted": 0, "total_hits": 0, "cross_layer_confirmed": 0, "regression_risks": 0, "by_layer": {"syntax": 0, "semantic": 0, "structural": 0}, "deepening_triggered": false}
408
+ ```
409
+
410
+ **Transition guard:** `S_GENERALIZE → S_RECORD` requires `by_layer` has entries for all 3 layers with search evidence logged. Mark G5 done.
411
+
412
+ Commit: `"odyssey-planex({slug}): GENERALIZE pattern scan complete"`
413
+
414
+ ### A_DISCOVER
415
+
416
+ **Executes whenever `total_hits > 0`. Cannot be skipped without `skip_generalize == true`.**
417
+
418
+ 1. **Triage** each hit with ±10 lines context classify:
419
+ - `bug` area needing same implementation (missing feature parity)
420
+ - `risk` potential inconsistency or missing pattern application
421
+ - `safe` false positive (must log individual reason blanket "pre-existing" forbidden)
422
+
423
+ 2. **Route (planex-specific — routes to S_EXECUTE, not S_FIX):**
424
+
425
+ | Classification | Action |
426
+ |---------------|--------|
427
+ | needs same implementation | Route to S_EXECUTE with new task, `cross_phase_loops++` |
428
+ | risk + guard addable | Fix directly |
429
+ | risk + complex | Create issue |
430
+ | safe | Skip with logged per-item reason |
431
+
432
+ Normal: AskUserQuestion per hit | `-y`: auto-route to execute, create issue for rest
433
+
434
+ 3. **Cross-phase loops:** `loops >= max_loops` → must log per-item reasons, advance to S_RECORD.
435
+
436
+ 4. Append evidence phase=discovery. Update understanding.md section 7. Mark G6 done.
437
+
438
+ Commit: `"odyssey-planex({slug}): DISCOVER — findings classified"`
439
+
440
+ ### A_RECORD
441
+
442
+ 1. Iteration summary: what worked, what needed rework, fix cycle patterns
443
+ 2. understanding.md section 8 — learnings by Knowledge Persistence categories:
444
+ - Multi-round fix cycle pattern → `/spec-add debug`
445
+ - Reusable implementation pattern → `/spec-add coding`
446
+ - Acceptance criteria template → `/spec-add review`
447
+ - Generalization pattern → `/spec-add coding`
448
+
449
+ 3. Mark G7 done. Pending decisions: Normal → AskUserQuestion | `-y` → skip (show deferred count).
450
+
451
+ 4. **Goal audit (hardened):**
452
+ - `done` → confirmed
453
+ - `skipped` → confirmed ONLY if corresponding `skip_when` flag is true
454
+ - **Hard rule:** G5 and G6 CANNOT be `skipped` unless `skip_generalize == true`. Pending without flag → `failed` (Normal: AskUserQuestion | `-y`: record `failed`)
455
+ - `phase_goals_all_done = true` only when all goals pass this audit
456
+
457
+ 5. `current_state = "COMPLETED"`, emit completion summary.
458
+
459
+ **Completion summary:**
460
+ ```
461
+ --- PLANEX ODYSSEY COMPLETE ---
462
+ Requirement: {requirement}
463
+ Criteria: {passed}/{total} passed
464
+ Iterations: {N} cycles
465
+ Patterns: {patterns_extracted} ({by_layer} distribution)
466
+ Scan hits: {total_hits} ({cross_layer_confirmed} cross-layer confirmed)
467
+ Issues: {N} created | Decisions: {N} resolved, {M} pending, {K} deferred
468
+ Learnings: {N} spec entries
469
+ Self-iter: {N} rounds across {M} stages
470
+ Goals: {done}/{total} confirmed ({skipped} skipped)
471
+ Status: {ALL_PASSED|PARTIAL|ESCALATED}
472
+ ---
473
+ ```
474
+
475
+ Commit: `"odyssey-planex({slug}): RECORD — session summary"`
476
+
477
+ </actions>
478
+
479
+ <appendix>
480
+
481
+ ### `-y` planex-specific points
482
+
483
+ | Decision Point | Normal | `-y` |
484
+ |---------------|--------|------|
485
+ | S_INTAKE criteria confirmation | AskUserQuestion | auto-derive, `deferred` |
486
+ | S_EXECUTE execution options | AskUserQuestion | use defaults (auto/Skip/Auto), `confirmed: true` |
487
+ | S_EXECUTE task blocked (3 retries) | AskUserQuestion: continue or stop | auto continue, log blocked |
488
+ | S_VERIFY manual criterion | AskUserQuestion | `deferred` |
489
+ | S_VERIFY max iteration reached | AskUserQuestion | auto accept, `deferred` |
490
+ | A_DISCOVER hit routing | AskUserQuestion | auto-route to execute, create issue for rest |
491
+
492
+ ### Goal Prompt convergence rules
493
+
494
+ ```
495
+ Exhaustive iteration: until all acceptance_criteria[*].status==passed
496
+ AND phase_goals_all_done=true. Verify failure auto-triggers fix->re-verify loop.
497
+ Each fix round re-verifies; new criterion violations continue fixing within max_iterations.
498
+ No "close enough" — all criteria must ALL pass.
499
+ ```
500
+
501
+ ### Iteration Model
502
+
503
+ ```
504
+ S_EXECUTE → S_VERIFY ──all pass──→ S_GENERALIZE → S_DISCOVER → S_RECORD
505
+ │ │
506
+ some fail + iter < max 3-layer scan, 0 hits ─→ S_RECORD
507
+
508
+ S_FIX ──→ S_VERIFY (loop)
509
+ ```
510
+
511
+ Max iterations (default 3) prevents infinite loops. Each iteration records criteria_before, gaps_fixed, criteria_after.
512
+
513
+ </appendix>
514
+
515
+ </state_machine>
516
+
517
+ <error_codes>
518
+ | Code | Severity | Condition | Recovery |
519
+ |------|----------|-----------|----------|
520
+ | E001 | error | No requirement provided | Provide requirement |
521
+ | W001 | warning | No acceptance criteria derived | Manual definition needed |
522
+ | W002 | warning | Max iterations reached, criteria still failing | Escalate to user |
523
+ | W003 | warning | CLI review regression concern | Review before next iteration |
524
+ | W004 | warning | Generalization 0 hits after full 3-layer scan | Advance to S_RECORD (requires all 3 layers attempted with evidence) |
525
+ </error_codes>
526
+
527
+ <success_criteria>
528
+ - [ ] Requirement parsed with >=1 acceptance criterion (verify_method assigned)
529
+ - [ ] Plan tasks mapped to criteria; execution options confirmed
530
+ - [ ] Tasks dispatched via resolved executor with deviation rule (max 3 retries)
531
+ - [ ] Post-execution validation gate run (unless --skip-verify)
532
+ - [ ] Every criterion verified per method; failing → targeted fix (not re-implementation)
533
+ - [ ] Iteration count tracked and max respected; unfixed criteria individually classified
534
+ - [ ] understanding.md sections 1-8 updated per phase; phase_goals G1-G7 audited
535
+ - [ ] Generalization + discovery completed (unless --skip-generalize)
536
+ - [ ] Quality Gate self-iteration triggered when insufficient
537
+ - [ ] Goal Prompt displayed once after intake; `-y` mode: no blocking prompts
538
+ - [ ] Session resumable via -c; completion summary output
539
+ </success_criteria>
540
+
541
+ <next_step_routing>
542
+ | Condition | Next |
543
+ |-----------|------|
544
+ | All criteria passed | `/odyssey-review-test-fix <changed-files>` |
545
+ | Max iterations, still failing | `/odyssey-debug "<failing criterion>"` |
546
+ | Formal review | `/quality-review <phase>` |
547
+ | Issues from discoveries | `/manage-issue list --source planex-odyssey` |
548
+ | Pattern worth documenting | `/learn-decompose <module>` |
549
+ </next_step_routing>
550
+ </output>