maestro-flow 0.4.8 → 0.4.10

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 (280) hide show
  1. package/.agy/agents/cli-explore-agent.md +186 -0
  2. package/.agy/agents/conceptual-planning-agent.md +244 -0
  3. package/.agy/agents/impeccable-agent.md +97 -0
  4. package/.agy/agents/team-supervisor.md +142 -0
  5. package/.agy/agents/team-worker.md +236 -0
  6. package/.agy/agents/ui-design-agent.md +286 -0
  7. package/.agy/agents/workflow-analyzer.md +114 -0
  8. package/.agy/agents/workflow-codebase-mapper.md +76 -0
  9. package/.agy/agents/workflow-collab-planner.md +142 -0
  10. package/.agy/agents/workflow-debugger.md +102 -0
  11. package/.agy/agents/workflow-executor.md +131 -0
  12. package/.agy/agents/workflow-external-researcher.md +86 -0
  13. package/.agy/agents/workflow-integration-checker.md +82 -0
  14. package/.agy/agents/workflow-nyquist-auditor.md +84 -0
  15. package/.agy/agents/workflow-phase-researcher.md +84 -0
  16. package/.agy/agents/workflow-plan-checker.md +89 -0
  17. package/.agy/agents/workflow-planner.md +194 -0
  18. package/.agy/agents/workflow-project-researcher.md +73 -0
  19. package/.agy/agents/workflow-research-synthesizer.md +70 -0
  20. package/.agy/agents/workflow-reviewer.md +81 -0
  21. package/.agy/agents/workflow-roadmapper.md +81 -0
  22. package/.agy/agents/workflow-verifier.md +119 -0
  23. package/.agy/skills/codify-to-knowhow/SKILL.md +172 -0
  24. package/.agy/skills/codify-to-knowhow/phases/01-load-manifest.md +101 -0
  25. package/.agy/skills/codify-to-knowhow/phases/02-generate-knowhow.md +97 -0
  26. package/.agy/skills/codify-to-knowhow/phases/03-generate-specs.md +92 -0
  27. package/.agy/skills/codify-to-knowhow/phases/04-index-verify.md +119 -0
  28. package/.agy/skills/learn-decompose/SKILL.md +118 -0
  29. package/.agy/skills/learn-follow/SKILL.md +129 -0
  30. package/.agy/skills/learn-investigate/SKILL.md +154 -0
  31. package/.agy/skills/learn-retro/SKILL.md +159 -0
  32. package/.agy/skills/learn-second-opinion/SKILL.md +124 -0
  33. package/.agy/skills/maestro/SKILL.md +221 -0
  34. package/.agy/skills/maestro-amend/SKILL.md +162 -0
  35. package/.agy/skills/maestro-analyze/SKILL.md +135 -0
  36. package/.agy/skills/maestro-brainstorm/SKILL.md +118 -0
  37. package/.agy/skills/maestro-collab/SKILL.md +174 -0
  38. package/.agy/skills/maestro-composer/SKILL.md +180 -0
  39. package/.agy/skills/maestro-execute/SKILL.md +133 -0
  40. package/.agy/skills/maestro-fork/SKILL.md +88 -0
  41. package/.agy/skills/maestro-guard/SKILL.md +101 -0
  42. package/.agy/skills/maestro-help/SKILL.md +267 -0
  43. package/.agy/skills/maestro-help/index/catalog.json +184 -0
  44. package/.agy/skills/maestro-help/phases/01-parse-intent.md +122 -0
  45. package/.agy/skills/maestro-help/phases/02-search-present.md +181 -0
  46. package/.agy/skills/maestro-help/phases/03-workflow-guide.md +186 -0
  47. package/.agy/skills/maestro-impeccable/SKILL.md +250 -0
  48. package/.agy/skills/maestro-init/SKILL.md +80 -0
  49. package/.agy/skills/maestro-learn/SKILL.md +142 -0
  50. package/.agy/skills/maestro-merge/SKILL.md +66 -0
  51. package/.agy/skills/maestro-milestone-audit/SKILL.md +70 -0
  52. package/.agy/skills/maestro-milestone-complete/SKILL.md +77 -0
  53. package/.agy/skills/maestro-milestone-release/SKILL.md +98 -0
  54. package/.agy/skills/maestro-overlay/SKILL.md +177 -0
  55. package/.agy/skills/maestro-plan/SKILL.md +172 -0
  56. package/.agy/skills/maestro-player/SKILL.md +176 -0
  57. package/.agy/skills/maestro-quick/SKILL.md +67 -0
  58. package/.agy/skills/maestro-ralph/SKILL.md +546 -0
  59. package/.agy/skills/maestro-ralph-execute/SKILL.md +255 -0
  60. package/.agy/skills/maestro-roadmap/SKILL.md +170 -0
  61. package/.agy/skills/maestro-tools-execute/SKILL.md +119 -0
  62. package/.agy/skills/maestro-tools-register/SKILL.md +159 -0
  63. package/.agy/skills/maestro-ui-codify/SKILL.md +81 -0
  64. package/.agy/skills/maestro-update/SKILL.md +175 -0
  65. package/.agy/skills/maestro-verify/SKILL.md +111 -0
  66. package/.agy/skills/manage-codebase-rebuild/SKILL.md +77 -0
  67. package/.agy/skills/manage-codebase-refresh/SKILL.md +59 -0
  68. package/.agy/skills/manage-harvest/SKILL.md +96 -0
  69. package/.agy/skills/manage-issue/SKILL.md +72 -0
  70. package/.agy/skills/manage-issue-discover/SKILL.md +83 -0
  71. package/.agy/skills/manage-knowhow/SKILL.md +76 -0
  72. package/.agy/skills/manage-knowhow-capture/SKILL.md +78 -0
  73. package/.agy/skills/manage-learn/SKILL.md +64 -0
  74. package/.agy/skills/manage-status/SKILL.md +51 -0
  75. package/.agy/skills/manage-wiki/SKILL.md +61 -0
  76. package/.agy/skills/quality-auto-test/SKILL.md +135 -0
  77. package/.agy/skills/quality-debug/SKILL.md +122 -0
  78. package/.agy/skills/quality-refactor/SKILL.md +69 -0
  79. package/.agy/skills/quality-retrospective/SKILL.md +79 -0
  80. package/.agy/skills/quality-review/SKILL.md +130 -0
  81. package/.agy/skills/quality-sync/SKILL.md +53 -0
  82. package/.agy/skills/quality-test/SKILL.md +119 -0
  83. package/.agy/skills/security-audit/SKILL.md +157 -0
  84. package/.agy/skills/skill-iter-tune/SKILL.md +381 -0
  85. package/.agy/skills/skill-iter-tune/phases/01-setup.md +144 -0
  86. package/.agy/skills/skill-iter-tune/phases/02-execute.md +292 -0
  87. package/.agy/skills/skill-iter-tune/phases/03-evaluate.md +312 -0
  88. package/.agy/skills/skill-iter-tune/phases/04-improve.md +198 -0
  89. package/.agy/skills/skill-iter-tune/phases/05-report.md +166 -0
  90. package/.agy/skills/skill-iter-tune/specs/evaluation-criteria.md +63 -0
  91. package/.agy/skills/skill-iter-tune/templates/eval-prompt.md +134 -0
  92. package/.agy/skills/skill-iter-tune/templates/execute-prompt.md +97 -0
  93. package/.agy/skills/spec-add/SKILL.md +67 -0
  94. package/.agy/skills/spec-load/SKILL.md +70 -0
  95. package/.agy/skills/spec-remove/SKILL.md +50 -0
  96. package/.agy/skills/spec-setup/SKILL.md +47 -0
  97. package/.agy/skills/team-coordinate/SKILL.md +267 -0
  98. package/.agy/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +247 -0
  99. package/.agy/skills/team-coordinate/roles/coordinator/commands/dispatch.md +131 -0
  100. package/.agy/skills/team-coordinate/roles/coordinator/commands/monitor.md +348 -0
  101. package/.agy/skills/team-coordinate/roles/coordinator/role.md +362 -0
  102. package/.agy/skills/team-coordinate/specs/knowledge-transfer.md +111 -0
  103. package/.agy/skills/team-coordinate/specs/pipelines.md +97 -0
  104. package/.agy/skills/team-coordinate/specs/quality-gates.md +112 -0
  105. package/.agy/skills/team-coordinate/specs/role-spec-template.md +198 -0
  106. package/.agy/skills/team-executor/SKILL.md +180 -0
  107. package/.agy/skills/team-executor/roles/executor/commands/monitor.md +235 -0
  108. package/.agy/skills/team-executor/roles/executor/role.md +171 -0
  109. package/.agy/skills/team-executor/specs/session-schema.md +264 -0
  110. package/.agy/skills/team-lifecycle-v4/SKILL.md +189 -0
  111. package/.agy/skills/team-lifecycle-v4/roles/analyst/role.md +92 -0
  112. package/.agy/skills/team-lifecycle-v4/roles/coordinator/commands/analyze.md +56 -0
  113. package/.agy/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +56 -0
  114. package/.agy/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +206 -0
  115. package/.agy/skills/team-lifecycle-v4/roles/coordinator/role.md +130 -0
  116. package/.agy/skills/team-lifecycle-v4/roles/executor/commands/fix.md +35 -0
  117. package/.agy/skills/team-lifecycle-v4/roles/executor/commands/implement.md +62 -0
  118. package/.agy/skills/team-lifecycle-v4/roles/executor/role.md +64 -0
  119. package/.agy/skills/team-lifecycle-v4/roles/planner/role.md +82 -0
  120. package/.agy/skills/team-lifecycle-v4/roles/reviewer/commands/review-code.md +34 -0
  121. package/.agy/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +44 -0
  122. package/.agy/skills/team-lifecycle-v4/roles/reviewer/role.md +65 -0
  123. package/.agy/skills/team-lifecycle-v4/roles/supervisor/role.md +188 -0
  124. package/.agy/skills/team-lifecycle-v4/roles/tester/role.md +84 -0
  125. package/.agy/skills/team-lifecycle-v4/roles/writer/role.md +92 -0
  126. package/.agy/skills/team-lifecycle-v4/specs/knowledge-transfer.md +114 -0
  127. package/.agy/skills/team-lifecycle-v4/specs/pipelines.md +140 -0
  128. package/.agy/skills/team-lifecycle-v4/specs/quality-gates.md +130 -0
  129. package/.agy/skills/team-lifecycle-v4/templates/architecture.md +254 -0
  130. package/.agy/skills/team-lifecycle-v4/templates/epics.md +196 -0
  131. package/.agy/skills/team-lifecycle-v4/templates/product-brief.md +133 -0
  132. package/.agy/skills/team-lifecycle-v4/templates/requirements.md +224 -0
  133. package/.agy/skills/team-quality-assurance/SKILL.md +148 -0
  134. package/.agy/skills/team-quality-assurance/roles/analyst/role.md +85 -0
  135. package/.agy/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +72 -0
  136. package/.agy/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +111 -0
  137. package/.agy/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +235 -0
  138. package/.agy/skills/team-quality-assurance/roles/coordinator/role.md +143 -0
  139. package/.agy/skills/team-quality-assurance/roles/executor/role.md +62 -0
  140. package/.agy/skills/team-quality-assurance/roles/generator/role.md +65 -0
  141. package/.agy/skills/team-quality-assurance/roles/scout/role.md +72 -0
  142. package/.agy/skills/team-quality-assurance/roles/strategist/role.md +69 -0
  143. package/.agy/skills/team-quality-assurance/specs/pipelines.md +115 -0
  144. package/.agy/skills/team-quality-assurance/specs/team-config.json +131 -0
  145. package/.agy/skills/team-review/SKILL.md +149 -0
  146. package/.agy/skills/team-review/roles/coordinator/commands/analyze.md +71 -0
  147. package/.agy/skills/team-review/roles/coordinator/commands/dispatch.md +91 -0
  148. package/.agy/skills/team-review/roles/coordinator/commands/monitor.md +209 -0
  149. package/.agy/skills/team-review/roles/coordinator/role.md +132 -0
  150. package/.agy/skills/team-review/roles/fixer/role.md +74 -0
  151. package/.agy/skills/team-review/roles/reviewer/role.md +66 -0
  152. package/.agy/skills/team-review/roles/scanner/role.md +77 -0
  153. package/.agy/skills/team-review/specs/dimensions.md +82 -0
  154. package/.agy/skills/team-review/specs/finding-schema.json +82 -0
  155. package/.agy/skills/team-review/specs/pipelines.md +102 -0
  156. package/.agy/skills/team-review/specs/team-config.json +27 -0
  157. package/.agy/skills/team-tech-debt/SKILL.md +133 -0
  158. package/.agy/skills/team-tech-debt/roles/assessor/role.md +76 -0
  159. package/.agy/skills/team-tech-debt/roles/coordinator/commands/analyze.md +47 -0
  160. package/.agy/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +156 -0
  161. package/.agy/skills/team-tech-debt/roles/coordinator/commands/monitor.md +198 -0
  162. package/.agy/skills/team-tech-debt/roles/coordinator/role.md +123 -0
  163. package/.agy/skills/team-tech-debt/roles/executor/role.md +76 -0
  164. package/.agy/skills/team-tech-debt/roles/planner/role.md +68 -0
  165. package/.agy/skills/team-tech-debt/roles/scanner/role.md +90 -0
  166. package/.agy/skills/team-tech-debt/roles/validator/role.md +78 -0
  167. package/.agy/skills/team-tech-debt/specs/pipelines.md +47 -0
  168. package/.agy/skills/team-tech-debt/specs/team-config.json +129 -0
  169. package/.agy/skills/team-testing/SKILL.md +144 -0
  170. package/.agy/skills/team-testing/roles/analyst/role.md +101 -0
  171. package/.agy/skills/team-testing/roles/coordinator/commands/analyze.md +70 -0
  172. package/.agy/skills/team-testing/roles/coordinator/commands/dispatch.md +108 -0
  173. package/.agy/skills/team-testing/roles/coordinator/commands/monitor.md +242 -0
  174. package/.agy/skills/team-testing/roles/coordinator/role.md +134 -0
  175. package/.agy/skills/team-testing/roles/executor/role.md +95 -0
  176. package/.agy/skills/team-testing/roles/generator/role.md +95 -0
  177. package/.agy/skills/team-testing/roles/strategist/role.md +81 -0
  178. package/.agy/skills/team-testing/specs/pipelines.md +101 -0
  179. package/.agy/skills/team-testing/specs/team-config.json +93 -0
  180. package/.agy/skills/wiki-connect/SKILL.md +64 -0
  181. package/.agy/skills/wiki-digest/SKILL.md +70 -0
  182. package/.agy/skills/workflow-skill-designer/SKILL.md +506 -0
  183. package/.agy/skills/workflow-skill-designer/phases/01-requirements-analysis.md +356 -0
  184. package/.agy/skills/workflow-skill-designer/phases/02-orchestrator-design.md +444 -0
  185. package/.agy/skills/workflow-skill-designer/phases/03-phase-design.md +458 -0
  186. package/.agy/skills/workflow-skill-designer/phases/04-validation.md +471 -0
  187. package/dashboard/dist/assets/{ArtifactsPage-CVh0Z2I2.js → ArtifactsPage-BLvAqQlQ.js} +1 -1
  188. package/dashboard/dist/assets/{ChatInput-CBI3qHQQ.js → ChatInput-DU9YGZKX.js} +1 -1
  189. package/dashboard/dist/assets/{ChatPage-BjJ9CYox.js → ChatPage-DYHfheXC.js} +1 -1
  190. package/dashboard/dist/assets/{CollabPage-CprGGO9y.js → CollabPage-CSlmvEa-.js} +1 -1
  191. package/dashboard/dist/assets/{ExecutionPanel-CClxD7cH.js → ExecutionPanel-RYWf0dYC.js} +1 -1
  192. package/dashboard/dist/assets/{KanbanPage-copqjdPg.js → KanbanPage-N55Iv0-X.js} +1 -1
  193. package/dashboard/dist/assets/{MaestroCoordinatePage-CioZjQ9N.js → MaestroCoordinatePage-BxwZ6yy5.js} +1 -1
  194. package/dashboard/dist/assets/{MarkdownRenderer-CtUhoxCT.js → MarkdownRenderer-ZGtOY7Ti.js} +1 -1
  195. package/dashboard/dist/assets/{McpPage-BcPPcJpr.js → McpPage-Im6s4pGR.js} +1 -1
  196. package/dashboard/dist/assets/{MeetingRoomPage-BgmAKxU-.js → MeetingRoomPage-CxHRn1xx.js} +1 -1
  197. package/dashboard/dist/assets/{OutputPanel-DgT3gMyp.js → OutputPanel-DaL8c1i5.js} +1 -1
  198. package/dashboard/dist/assets/{ProblemsPanel-BmG7rxoG.js → ProblemsPanel-BQTd5812.js} +1 -1
  199. package/dashboard/dist/assets/{RequirementBoardPage-k8YoeQ0r.js → RequirementBoardPage-22y9u1qh.js} +1 -1
  200. package/dashboard/dist/assets/{RequirementPage-Da2354px.js → RequirementPage-_mO743Xm.js} +1 -1
  201. package/dashboard/dist/assets/{RoomsPage-BtqDiYaU.js → RoomsPage-CExTbOGr.js} +1 -1
  202. package/dashboard/dist/assets/{SpecsPage-ByPVH_M3.js → SpecsPage-gr4KX51-.js} +1 -1
  203. package/dashboard/dist/assets/{TeamsPage-sFDLN30L.js → TeamsPage-BxEXLb5g.js} +1 -1
  204. package/dashboard/dist/assets/{TreeBrowser-oEx8YJXV.js → TreeBrowser-CVtPF5C9.js} +1 -1
  205. package/dashboard/dist/assets/{WorkflowPage-JrX7CVHh.js → WorkflowPage-BoN18Lhs.js} +1 -1
  206. package/dashboard/dist/assets/{arrow-left-DYvgSdIH.js → arrow-left-C5ROg97G.js} +1 -1
  207. package/dashboard/dist/assets/{check-jcgYBWVR.js → check-Bs8PM0tQ.js} +1 -1
  208. package/dashboard/dist/assets/{chevron-right-DvZ5sMOg.js → chevron-right-SmErd_1F.js} +1 -1
  209. package/dashboard/dist/assets/{circle-DYT-zoRZ.js → circle-CjpslL_D.js} +1 -1
  210. package/dashboard/dist/assets/{circle-alert-Bfbv3gt4.js → circle-alert-CuzAg2fd.js} +1 -1
  211. package/dashboard/dist/assets/{circle-check-D82WnpbI.js → circle-check-BIkDU5D5.js} +1 -1
  212. package/dashboard/dist/assets/{circle-check-big-CPVD1GKF.js → circle-check-big-CYctV8bK.js} +1 -1
  213. package/dashboard/dist/assets/{code-B3bKFGI4.js → code-DoB7rfxt.js} +1 -1
  214. package/dashboard/dist/assets/{columns-3-BeMAQCix.js → columns-3-Ch5KIyRa.js} +1 -1
  215. package/dashboard/dist/assets/{download-BCtpoWYB.js → download-DadtG2Nr.js} +1 -1
  216. package/dashboard/dist/assets/{folder-CTj6SNNu.js → folder-B8ODoZfb.js} +1 -1
  217. package/dashboard/dist/assets/{index-BxR_3IbJ.js → index-BL4h1OKY.js} +1 -1
  218. package/dashboard/dist/assets/{index-DpcPd-UG.js → index-DQIlX2w_.js} +4 -4
  219. package/dashboard/dist/assets/{index-CWBJLu42.js → index-DaFwSmVJ.js} +10 -10
  220. package/dashboard/dist/assets/{list-BMv8pIQn.js → list-CI-XIPZh.js} +1 -1
  221. package/dashboard/dist/assets/{loader-DdM4VOgF.js → loader-DpdMoQvh.js} +1 -1
  222. package/dashboard/dist/assets/{minus-D15s2E__.js → minus-BVbfXGrC.js} +1 -1
  223. package/dashboard/dist/assets/{pen-line-DO6o4xWz.js → pen-line-CR8GaHt-.js} +1 -1
  224. package/dashboard/dist/assets/{pencil-qGxg9jOe.js → pencil-I7GE0y29.js} +1 -1
  225. package/dashboard/dist/assets/{proxy-DOffTzwA.js → proxy-CcYyZZWI.js} +1 -1
  226. package/dashboard/dist/assets/{refresh-cw-C9UNdLCy.js → refresh-cw-BG9V_T4R.js} +1 -1
  227. package/dashboard/dist/assets/{rows-2-CifAA5SL.js → rows-2-DP6NjQFk.js} +1 -1
  228. package/dashboard/dist/assets/{search-pe7pU1YN.js → search-b78eLlw2.js} +1 -1
  229. package/dashboard/dist/assets/{shallow-r7YynQYA.js → shallow-CJEesgtu.js} +1 -1
  230. package/dashboard/dist/assets/{table-Bh772iIw.js → table-B_lk-a1d.js} +1 -1
  231. package/dashboard/dist/assets/{team-types-C_HqX2p2.js → team-types-Se7f9LfJ.js} +1 -1
  232. package/dashboard/dist/assets/{terminal-EpmtGBlw.js → terminal-DXx4tvzq.js} +1 -1
  233. package/dashboard/dist/assets/{trash-2-Xen46iNQ.js → trash-2-CVh9mnRj.js} +1 -1
  234. package/dashboard/dist/assets/{users-BLueDPxF.js → users-Da9zGME5.js} +1 -1
  235. package/dashboard/dist/assets/{zap-DsQCPF61.js → zap-C0zaC7gJ.js} +1 -1
  236. package/dashboard/dist/index.html +1 -1
  237. package/dashboard/dist-server/dashboard/src/server/agents/adapter-factory.js +4 -0
  238. package/dashboard/dist-server/dashboard/src/server/agents/adapter-factory.js.map +1 -1
  239. package/dashboard/dist-server/dashboard/src/server/agents/agy-adapter.d.ts +39 -0
  240. package/dashboard/dist-server/dashboard/src/server/agents/agy-adapter.js +423 -0
  241. package/dashboard/dist-server/dashboard/src/server/agents/agy-adapter.js.map +1 -0
  242. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.d.ts +6 -0
  243. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +109 -0
  244. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
  245. package/dashboard/dist-server/dashboard/src/shared/constants.js +2 -0
  246. package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
  247. package/dashboard/dist-server/shared/agent-types.d.ts +1 -1
  248. package/dist/shared/agent-types.d.ts +1 -1
  249. package/dist/shared/agent-types.d.ts.map +1 -1
  250. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  251. package/dist/src/agents/cli-agent-runner.js +3 -0
  252. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  253. package/dist/src/commands/hooks.d.ts +64 -0
  254. package/dist/src/commands/hooks.d.ts.map +1 -1
  255. package/dist/src/commands/hooks.js +107 -0
  256. package/dist/src/commands/hooks.js.map +1 -1
  257. package/dist/src/commands/install.d.ts.map +1 -1
  258. package/dist/src/commands/install.js +17 -3
  259. package/dist/src/commands/install.js.map +1 -1
  260. package/dist/src/commands/update.d.ts.map +1 -1
  261. package/dist/src/commands/update.js +53 -0
  262. package/dist/src/commands/update.js.map +1 -1
  263. package/dist/src/config/cli-tools-config.d.ts +19 -5
  264. package/dist/src/config/cli-tools-config.d.ts.map +1 -1
  265. package/dist/src/config/cli-tools-config.js +77 -32
  266. package/dist/src/config/cli-tools-config.js.map +1 -1
  267. package/dist/src/config/cli-tools-defaults.json +2 -1
  268. package/dist/src/core/component-defs.d.ts.map +1 -1
  269. package/dist/src/core/component-defs.js +53 -0
  270. package/dist/src/core/component-defs.js.map +1 -1
  271. package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
  272. package/dist/src/tui/install-ui/InstallExecution.js +5 -3
  273. package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
  274. package/dist/src/utils/update-notices.d.ts +62 -0
  275. package/dist/src/utils/update-notices.d.ts.map +1 -0
  276. package/dist/src/utils/update-notices.js +178 -0
  277. package/dist/src/utils/update-notices.js.map +1 -0
  278. package/package.json +84 -82
  279. package/shared/agent-types.ts +1 -1
  280. package/workflows/agy-instructions.md +124 -0
@@ -0,0 +1,546 @@
1
+ ---
2
+ name: maestro-ralph
3
+ description: Use when the optimal command sequence is unclear and needs automated state-based determination
4
+ argument-hint: <intent> [-y] | status | continue
5
+ allowed-tools:
6
+ - ask_question
7
+ - grep_search
8
+ - replace_file_content
9
+ - run_command
10
+ - view_file
11
+ - write_to_file
12
+ ---
13
+ <purpose>
14
+ Closed-loop decision engine for the maestro workflow lifecycle.
15
+ Reads project state → infers position → builds adaptive chain → delegates execution.
16
+
17
+ Entry points:
18
+ - **`/maestro-ralph "intent"`** — New session: infer → decompose → build → execute
19
+ - **`/maestro-ralph continue`** — Resume via maestro-ralph-execute
20
+ - **`/maestro-ralph status`** — Display session progress
21
+
22
+ Initial decomposition (S_DECOMPOSE): broad intents (重构/全面/迁移/重写) are boundary-clarified via ≤3 questions, producing 执行准则 + 子目标清单 written into status.json, plus a `goal-checklist.md` and a copy-paste `/goal` prompt for the user to bind.
23
+
24
+ Three node types:
25
+ - **internal**: `Skill()` call (synchronous, lightweight)
26
+ - **external**: `maestro delegate --to claude` (context-isolated, heavy computation)
27
+ - **decision**: Hand back to ralph for re-evaluation (adaptive branching)
28
+
29
+ Key difference from maestro coordinator:
30
+ - maestro: static chain → one-time selection → runs all steps
31
+ - ralph: living chain → decision nodes re-evaluate → chain grows/shrinks dynamically
32
+
33
+ Session: `.workflow/.maestro/ralph-{YYYYMMDD-HHmmss}/status.json`
34
+ Mutual invocation with `/maestro-ralph-execute` forms a self-perpetuating work loop.
35
+ </purpose>
36
+
37
+ <context>
38
+ $ARGUMENTS — intent text, flags, or keywords.
39
+
40
+ **Parse:**
41
+ ```
42
+ -y flag → auto_confirm = true
43
+ .md/.txt path → input_doc (supplementary context only, NEVER substitutes lifecycle stages)
44
+ Remaining → intent
45
+ ```
46
+
47
+ **State files:**
48
+ - `.workflow/state.json` — artifact registry, milestones, phases
49
+ - `.workflow/roadmap.md` — milestone/phase structure
50
+ - `.workflow/.maestro/ralph-*/status.json` — ralph session state
51
+ </context>
52
+
53
+ <invariants>
54
+ 1. **Ralph never executes steps** — only creates sessions and evaluates decisions
55
+ 2. **Handoff via Skill("maestro-ralph-execute")** — at session creation and after decision evaluation
56
+ 3. **Decision delegates read-only** — `maestro delegate --role analyze --mode analysis`
57
+ 4. **External ≠ CLI call** — external spawns full Claude Code session executing the skill command
58
+ 5. **Delegate sessions non-interactive** — all external skills MUST append `-y` to args inside the prompt
59
+ 6. **Decomposition is outcome-oriented** — sub-goals are deliverables/done-criteria, NEVER lifecycle-stage duplicates (analyze/plan/...). `/goal` binding is user-driven; ralph only emits the prompt
60
+ 7. **task_decomposition drives DYNAMIC step growth, not a frozen plan** — sub-goals are the convergence spec; `status.json.steps[]` remains the living chain. The `post-goal-audit` decision node re-checks the checklist and **dynamically inserts scoped execution steps** for every unmet sub-goal (same insert+reindex+retry mechanism as fix-loops). Decomposition never replaces ralph's adaptive branching — it feeds it. New fields are also additive/optional (absent → decomposition off, old behavior); never remove/rename existing fields
61
+ </invariants>
62
+
63
+ <state_machine>
64
+
65
+ <states>
66
+ S_PARSE_ROUTE — 解析参数、路由入口 PERSIST: —
67
+ S_STATUS — 显示 session 进度 PERSIST: —
68
+ S_CONTINUE — 恢复执行 PERSIST: —
69
+ S_INFER — 读 state.json、推断生命周期位置 PERSIST: session.lifecycle_position
70
+ S_RESOLVE_PHASE — 解析目标 phase PERSIST: session.phase
71
+ S_DECOMPOSE — 边界澄清、写执行准则+子目标清单 PERSIST: session.boundary_contract, .execution_criteria, .task_decomposition
72
+ S_BUILD_CHAIN — 构建步骤链 PERSIST: session.steps[]
73
+ S_CREATE_SESSION — 写 status.json PERSIST: session (全量)
74
+ S_CONFIRM — 用户确认 PERSIST: —
75
+ S_DISPATCH — 移交 maestro-ralph-execute PERSIST: —
76
+ S_DECISION_EVAL — 委托评估质量门 PERSIST: —
77
+ S_APPLY_VERDICT — 应用裁决 + 插入命令 PERSIST: session.steps[], session.passed_gates[]
78
+ S_FALLBACK — 请求用户输入 PERSIST: —
79
+ </states>
80
+
81
+ <transitions>
82
+
83
+ S_PARSE_ROUTE:
84
+ → S_STATUS WHEN: intent == "status"
85
+ → S_CONTINUE WHEN: intent == "continue"
86
+ → S_DECISION_EVAL WHEN: running session with decision step in "running" status
87
+ → S_INFER WHEN: intent is non-empty
88
+ → S_FALLBACK WHEN: no intent AND no running session
89
+
90
+ S_STATUS:
91
+ → END DO: A_SHOW_STATUS
92
+
93
+ S_CONTINUE:
94
+ → S_DISPATCH WHEN: running session found
95
+ → S_FALLBACK WHEN: no running session DO: display "无运行中的 ralph 会话"
96
+
97
+ S_INFER:
98
+ → S_RESOLVE_PHASE WHEN: position resolved DO: A_INFER_POSITION
99
+ → S_FALLBACK WHEN: cannot infer
100
+
101
+ S_RESOLVE_PHASE:
102
+ → S_DECOMPOSE WHEN: phase resolved or null DO: A_RESOLVE_PHASE
103
+ → S_FALLBACK WHEN: ambiguous
104
+ GUARD: auto_confirm does NOT skip phase ambiguity
105
+
106
+ S_DECOMPOSE:
107
+ → S_BUILD_CHAIN DO: A_DECOMPOSE_TASKS
108
+ GUARD: broad intent (重构/全面/重写/迁移/overhaul/migrate/rewrite) → MUST clarify boundary even if auto_confirm
109
+ GUARD: narrow intent (single file/function/bug) → auto-derive, skip questions
110
+ GUARD: position ∈ {brainstorm, init} → skip decomposition (no concrete target yet)
111
+
112
+ S_BUILD_CHAIN:
113
+ → S_CREATE_SESSION DO: A_BUILD_STEPS
114
+
115
+ S_CREATE_SESSION:
116
+ → S_CONFIRM WHEN: not auto_confirm DO: A_CREATE_SESSION
117
+ → S_DISPATCH WHEN: auto_confirm DO: A_CREATE_SESSION
118
+
119
+ S_CONFIRM:
120
+ → S_DISPATCH WHEN: user selects "Proceed"
121
+ → S_BUILD_CHAIN WHEN: user selects "Edit"
122
+ → END WHEN: user selects "Cancel"
123
+
124
+ S_DISPATCH:
125
+ → END DO: view_file(AbsolutePath="<agy-skills-dir>/maestro-ralph-execute/SKILL.md") + execute inline
126
+
127
+ S_DECISION_EVAL:
128
+ → S_APPLY_VERDICT WHEN: quality-gate (post-verify, post-business-test, post-review, post-test)
129
+ DO: A_DELEGATE_EVALUATE
130
+ → S_APPLY_VERDICT WHEN: goal-gate (post-goal-audit)
131
+ DO: A_GOAL_AUDIT_EVALUATE
132
+ → S_APPLY_VERDICT WHEN: structural (post-milestone, post-debug-escalate)
133
+ DO: A_STRUCTURAL_EVALUATE
134
+
135
+ S_APPLY_VERDICT:
136
+ → S_DISPATCH WHEN: verdict == "proceed" DO: A_APPLY_PROCEED
137
+ → S_DISPATCH WHEN: post-goal-audit + unmet sub-goals DO: A_APPLY_GOAL_FIX
138
+ → S_DISPATCH WHEN: post-goal-audit + all sub-goals met DO: A_APPLY_GOAL_DONE
139
+ → S_DISPATCH WHEN: verdict == "fix" DO: A_APPLY_FIX
140
+ → S_DISPATCH WHEN: verdict == "escalate" DO: A_APPLY_ESCALATE
141
+ → S_DISPATCH WHEN: post-milestone + next milestone DO: A_ADVANCE_MILESTONE
142
+ → END WHEN: post-milestone + no next milestone DO: mark completed
143
+ → END WHEN: post-debug-escalate (always STOP) DO: A_PAUSE_ESCALATE
144
+ GUARD: retry_count >= max_retries → force escalate
145
+ GUARD: confidence_score < 60 AND proceed → override to fix
146
+ GUARD: confidence_score > 95 AND fix AND retry > 0 → suggest proceed
147
+ GUARD: auto_confirm → skip user prompt, apply adjusted verdict
148
+ GUARD: not auto_confirm → ask_question with override options
149
+
150
+ S_FALLBACK:
151
+ → S_PARSE_ROUTE WHEN: user provides input DO: ask_question
152
+ → END WHEN: user cancels
153
+
154
+ </transitions>
155
+
156
+ <actions>
157
+
158
+ ### A_SHOW_STATUS
159
+
160
+ 1. Find latest ralph session (by created_at)
161
+ 2. Display: Session, Status, Position, Progress, Current step
162
+ 3. List steps: [✓] completed, [▸] current, [ ] pending, [◆] decision
163
+ 4. If `task_decomposition` present: show `Sub-goals: {done}/{total}` and any unmet G-ids (graceful skip if field absent — backward compat)
164
+
165
+ ### A_INFER_POSITION
166
+
167
+ **Intent-based override:** brainstorm/头脑风暴/探索/ideate/设计思路 → position = `brainstorm`
168
+
169
+ **Bootstrap detection:**
170
+
171
+ | Condition | Position |
172
+ |-----------|----------|
173
+ | No `.workflow/` + no source files | `brainstorm` |
174
+ | No `.workflow/` + has source files | `init` |
175
+ | Has `.workflow/` but no state.json | `init` |
176
+ | Has state.json | → artifact-based inference |
177
+
178
+ **Artifact-based inference:** Filter by current_milestone + target phase:
179
+
180
+ | Latest artifact type | Position |
181
+ |---------------------|----------|
182
+ | no milestones or no roadmap.md | `roadmap` |
183
+ | none for phase | `analyze` |
184
+ | analyze | `plan` |
185
+ | plan | `execute` |
186
+ | execute | `verify` |
187
+ | verify | → refine from result files |
188
+
189
+ **Refine from verify results:**
190
+
191
+ | Condition | Position |
192
+ |-----------|----------|
193
+ | verification.json: passed==false or gaps[] | `verify-failed` |
194
+ | passed==true, no review.json | `business-test` |
195
+ | review.json: verdict=="BLOCK" | `review-failed` |
196
+ | review.json: verdict!="BLOCK" | `test` |
197
+ | uat.md: all passed | `milestone-audit` |
198
+ | uat.md: has failures | `test-failed` |
199
+
200
+ ### A_RESOLVE_PHASE
201
+
202
+ Priority: 1) regex from intent 2) latest artifact's phase 3) first incomplete phase 4) null if brainstorm/init/roadmap 5) ask_question if ambiguous
203
+
204
+ ### A_DECOMPOSE_TASKS
205
+
206
+ Build the boundary contract + outcome sub-goal checklist that `/goal` will track. Runs once at session creation, before chain build. All output is **additive** to status.json.
207
+
208
+ **1. Classify intent breadth:**
209
+
210
+ | Pattern | Breadth | Clarify? |
211
+ |---------|---------|----------|
212
+ | 重构/全面/重写/重做/整体/迁移 · overhaul/migrate/rewrite/revamp | broad | MUST (ignores auto_confirm) |
213
+ | named single file/function/bug, "fix X", "add Y to Z" | narrow | skip — auto-derive |
214
+ | otherwise | medium | clarify unless auto_confirm |
215
+
216
+ **2. Clarify boundary** (broad/medium) — `ask_question`, ≤3 rounds, options pre-filled from intent + a quick Glob/Grep scan of the target module:
217
+
218
+ | Round | Question | Drives |
219
+ |-------|----------|--------|
220
+ | Scope | 哪些目录/文件/层在范围内?明确排除什么? | boundary_contract.in_scope / out_of_scope |
221
+ | Constraints | 必须向后兼容?公共 API 冻结?行为/性能预算?测试门槛? | boundary_contract.constraints + execution_criteria |
222
+ | Done | 什么可观测结果算"完成"?(如:测试全绿 + 行为零变更 + X 指标) | boundary_contract.definition_of_done |
223
+
224
+ narrow → derive defaults from intent + codebase, skip questions.
225
+
226
+ **3. Derive `execution_criteria`** (执行准则 — 3-6 short imperative rules every step obeys): backward-compat stance, scope-freeze ("只改请求范围"), test/coverage bar, fix-don't-hide, incremental commit. Each verify/review/test gate later checks against these.
227
+
228
+ **4. Derive `task_decomposition`** (子目标清单 — outcome-oriented, NOT lifecycle stages). Each entry:
229
+ ```json
230
+ { "id": "G1", "goal": "<deliverable>", "boundary": "<in/out note>",
231
+ "done_when": "<objectively checkable condition>",
232
+ "evidence": "verification.json|review.json|uat.md|<test path>",
233
+ "lifecycle": ["analyze","execute","verify"], "status": "pending" }
234
+ ```
235
+ **Cleverness rule**: `done_when` MUST be objectively verifiable and SHOULD reference an artifact ralph already produces, so the `/goal` Stop hook can re-verify after context compaction. Map each sub-goal to the lifecycle phase(s) that will produce its evidence — this is how the checklist "adapts to ralph": the existing pipeline becomes the machinery that satisfies the goals.
236
+
237
+ **5. Persist** (additive) into session for A_CREATE_SESSION to write: `boundary_contract`, `execution_criteria`, `task_decomposition`. Absent feature (skipped) → write none; downstream treats as "decomposition off".
238
+
239
+ **6. Stage** the Goal Checklist + Goal Prompt (Appendix) for A_CREATE_SESSION to emit.
240
+
241
+ ### A_BUILD_STEPS
242
+
243
+ Generate steps from lifecycle_position to milestone-complete:
244
+
245
+ | Stage | Skill | Type | Decision after |
246
+ |-------|-------|------|----------------|
247
+ | brainstorm | `maestro-brainstorm "{intent}"` | external | — |
248
+ | init | `maestro-init` | internal | — |
249
+ | roadmap | `maestro-roadmap "{intent}"` | internal | — |
250
+ | analyze | `maestro-analyze {phase}` | external | — |
251
+ | plan | `maestro-plan {phase}` | internal | — |
252
+ | execute | `maestro-execute {phase}` | external | — |
253
+ | verify | `maestro-verify {phase}` | internal | `post-verify` |
254
+ | business-test | `quality-auto-test {phase}` | internal | `post-business-test` |
255
+ | review | `quality-review {phase}` | internal | `post-review` |
256
+ | test-gen | `quality-auto-test {phase}` | internal | — |
257
+ | test | `quality-test {phase}` | internal | `post-test` |
258
+ | milestone-audit | `maestro-milestone-audit` | internal | — |
259
+ | goal-audit | *(decision-only, no skill)* | decision | `post-goal-audit` |
260
+ | milestone-complete | `maestro-milestone-complete` | internal | `post-milestone` |
261
+
262
+ `goal-audit` row is inserted **only when `task_decomposition` present**, immediately before `milestone-complete`. It is a pure decision node (no skill step) — its job is to re-check the goal-checklist and **dynamically grow `steps[]`** for unmet sub-goals.
263
+
264
+ Type rationale: `internal` = Skill(), lightweight/interactive; `external` = delegate --to claude, context-isolated heavy computation
265
+
266
+ Build rules: start from position, skip completed, insert decision nodes with `{ retry_count: 0, max_retries: 2 }`, args use placeholders resolved at execution time by ralph-execute. Steps dynamically inserted by `post-goal-audit` carry optional `goal_ref: "G{n}"` tracing which sub-goal they serve.
267
+
268
+ ### A_CREATE_SESSION
269
+
270
+ 1. Write `.workflow/.maestro/ralph-{YYYYMMDD-HHmmss}/status.json` (see Appendix: Session Schema) — include decomposition fields only if produced (additive)
271
+ 2. If `task_decomposition` present: write `{session_dir}/goal-checklist.md` (see Appendix: Goal Checklist Template) — stable within session, referenced verbatim by `/goal`
272
+ 3. Display chain overview with step list
273
+ 4. If `task_decomposition` present: display the **Goal Prompt block** (Appendix: Goal Prompt Template) — the copy-paste `/goal …` line binding the checklist as a Stop-hook target
274
+
275
+ ### A_DELEGATE_EVALUATE
276
+
277
+ 1. Resolve artifact dir: `.workflow/scratch/{artifact.path}/` with fallback glob
278
+ 2. Parse decision metadata: `{ decision, retry_count, max_retries }`
279
+ 3. Map result files:
280
+ | Decision | Files |
281
+ |----------|-------|
282
+ | post-verify | verification.json |
283
+ | post-business-test | .tests/auto-test/report.json |
284
+ | post-review | review.json |
285
+ | post-test | uat.md, .tests/test-results.json |
286
+ 4. Check artifact for confidence section → include as signal
287
+ 5. Execute delegate (run_in_background, STOP, wait for callback):
288
+ ```
289
+ maestro delegate "PURPOSE: 评估 {decision} 质量门结果
290
+ TASK: 读取结果 | 分析状态 | 评估严重性 | 给出建议
291
+ EXPECTED: ---VERDICT--- STATUS/REASON/GAP_SUMMARY/CONFIDENCE(high|medium|low)/CONFIDENCE_SCORE(0-100)/WEAKEST_DIMENSION ---END---
292
+ CONSTRAINTS: 只评估 | 置信度<60% 倾向 fix | retry {n}/{max} 达上限必须 escalate"
293
+ --role analyze --mode analysis
294
+ ```
295
+ 6. On callback: parse verdict; if parse fails → fallback STATUS="fix"
296
+ 7. Confidence adjustment: <60 + proceed → fix; >95 + fix + retry>0 → suggest proceed
297
+ 8. **Decision log**: Append to `{session_dir}/decisions.ndjson`:
298
+ ```json
299
+ { "id": "DEC-{timestamp}", "timestamp": "{ISO}", "source": "ralph",
300
+ "node_id": "{step.decision}", "type": "quality-gate",
301
+ "verdict": "{adjusted_verdict}", "confidence_score": {N},
302
+ "close_call": {N>=50 && N<=70}, "summary": "{REASON}" }
303
+ ```
304
+
305
+ ### A_STRUCTURAL_EVALUATE
306
+
307
+ **post-milestone:** Read state.json → next milestone? → insert lifecycle steps / complete
308
+ **post-debug-escalate:** Always STOP → set paused, display "请人工介入"
309
+
310
+ ### A_GOAL_AUDIT_EVALUATE
311
+
312
+ Re-checks the goal-checklist and decides whether `steps[]` must dynamically grow. Only runs when `task_decomposition` present.
313
+
314
+ 1. Read `session.task_decomposition` + `goal_checklist_path`
315
+ 2. For each sub-goal `status != "done"`: resolve its `evidence` artifact (verification.json / review.json / uat.md / test path) under the current phase scratch dir
316
+ 3. Delegate read-only audit (run_in_background, STOP, wait):
317
+ ```
318
+ maestro delegate "PURPOSE: 审计子目标达成情况,决定是否需要补充执行步骤
319
+ TASK: 逐个读取每个未完成子目标的 evidence 产物 | 对照 done_when 判定 met/unmet | 给出每个 unmet 子目标的差距
320
+ CONTEXT: @{goal_checklist_path} @{evidence artifacts} | 执行准则: {execution_criteria} | 边界: {boundary_contract}
321
+ EXPECTED: ---VERDICT--- STATUS(all_met|has_unmet) / UNMET=[{id:G2,gap:'...',target_phase:execute}] / CONFIDENCE_SCORE(0-100) ---END---
322
+ CONSTRAINTS: 只评估不修改 | 严格按 done_when 判定 | 不得超出 boundary_contract"
323
+ --role analyze --mode analysis
324
+ ```
325
+ 4. On callback: parse UNMET list. For each met sub-goal → set `task_decomposition[i].status="done"` + flip `[ ]→[x]` in goal-checklist.md
326
+ 5. **Decision log**: append to `{session_dir}/decisions.ndjson` with `"type": "goal-gate"`, `unmet_count`, `unmet_ids`
327
+ 6. Verdict: `all_met` → A_APPLY_GOAL_DONE; `has_unmet` → A_APPLY_GOAL_FIX
328
+ GUARD: retry_count >= max_retries AND still unmet → A_APPLY_ESCALATE (insert quality-debug, hand to human)
329
+
330
+ ### A_APPLY_PROCEED
331
+
332
+ 1. Mark decision completed, write status.json
333
+ 2. Display: ◆ Decision: {type} → proceed ({reason})
334
+
335
+ ### A_APPLY_FIX
336
+
337
+ 1. Insert fix-loop commands after current step (see Appendix: Fix-Loop Templates)
338
+ 2. Reindex steps, increment retry_count, write status.json
339
+ 3. Display: ◆ Decision: {type} → fix, +{N} commands inserted
340
+
341
+ ### A_APPLY_ESCALATE
342
+
343
+ 1. Insert `[quality-debug "{gap_summary}", decision:post-debug-escalate]`
344
+ 2. Increment retry_count, reindex, write status.json
345
+
346
+ ### A_APPLY_GOAL_FIX
347
+
348
+ **This is the dynamic step-growth core.** For every unmet sub-goal, inject scoped execution steps so `steps[]` grows toward convergence:
349
+
350
+ 1. For each `unmet` sub-goal `G{n}` (grouped by `target_phase` to avoid duplicate runs):
351
+ insert before the `goal-audit` node a scoped mini-loop (see Appendix: Fix-Loop Templates → post-goal-audit), each inserted step tagged `goal_ref: "G{n}"`
352
+ 2. Re-append a fresh `decision:post-goal-audit {retry+1}` after the inserted steps (re-loops until all met or max retries)
353
+ 3. Reindex steps, increment retry_count, write status.json (steps[] now larger — the JSON "grew")
354
+ 4. Display: ◆ Goal audit: {k} sub-goals unmet → +{N} steps inserted (G{ids}), retry {r}/{max}
355
+
356
+ ### A_APPLY_GOAL_DONE
357
+
358
+ 1. Set all `task_decomposition[*].status="done"`, write status.json
359
+ 2. Append `ALL_GOALS_DONE` sentinel line to goal-checklist.md (satisfies the user's `/goal` Stop hook)
360
+ 3. Mark goal-audit decision completed; proceed to `milestone-complete`
361
+ 4. Display: ◆ Goal audit: 全部子目标达成 ✓ — checklist 已写入 ALL_GOALS_DONE
362
+
363
+ ### A_ADVANCE_MILESTONE
364
+
365
+ 1. Update session: milestone, phase, reset passed_gates
366
+ 2. Insert full lifecycle steps for next milestone
367
+ 3. Reindex, write status.json
368
+
369
+ ### A_PAUSE_ESCALATE
370
+
371
+ 1. Set session status = "paused", write status.json
372
+ 2. Display: ◆ 已达最大重试次数,debug 已执行。请人工介入。
373
+ 3. Display: /maestro-ralph continue 恢复
374
+
375
+ </actions>
376
+
377
+ </state_machine>
378
+
379
+ <appendix>
380
+
381
+ ### Session Schema
382
+
383
+ ```json
384
+ {
385
+ "session_id": "ralph-{YYYYMMDD-HHmmss}",
386
+ "source": "ralph", "status": "running",
387
+ "intent": "", "lifecycle_position": "",
388
+ "phase": null, "milestone": "",
389
+ "auto_mode": false, "quality_mode": "standard",
390
+ "cli_tool": "claude", "passed_gates": [],
391
+ "context": { "issue_id": null, "scratch_dir": null, "plan_dir": null,
392
+ "analysis_dir": null, "brainstorm_dir": null },
393
+ "steps": [{ "index": 0, "type": "internal|external|decision",
394
+ "skill": "", "args": "", "status": "pending",
395
+ "goal_ref": null }],
396
+ "waves": [], "current_step": 0,
397
+
398
+ "_comment": "↓ OPTIONAL additive decomposition block (v0.4.8+). Absent → no decomposition; readers MUST tolerate missing keys. Never remove/rename above fields.",
399
+ "boundary_contract": {
400
+ "in_scope": [], "out_of_scope": [], "constraints": [], "definition_of_done": ""
401
+ },
402
+ "execution_criteria": [],
403
+ "task_decomposition": [
404
+ { "id": "G1", "goal": "", "boundary": "", "done_when": "",
405
+ "evidence": "", "lifecycle": [], "status": "pending|done" }
406
+ ],
407
+ "goal_checklist_path": ""
408
+ }
409
+ ```
410
+
411
+ > **Extensibility contract (two dimensions)**:
412
+ > 1. **Schema-additive** — decomposition block fields are optional; absence = old behavior.
413
+ > 2. **Step-dynamic** — `steps[]` is a *living array*: `post-goal-audit` (and existing fix/escalate/milestone decisions) **append/reindex steps at runtime** until sub-goals converge. The JSON "extends" primarily by growing `steps[]`, not by freezing a plan. `goal_ref` (optional, default null) traces dynamically-added steps back to the sub-goal that spawned them.
414
+
415
+ ### Fix-Loop Templates
416
+
417
+ **post-verify:**
418
+ ```
419
+ quality-debug "{gap_summary}"
420
+ maestro-plan --gaps {phase}
421
+ maestro-execute {phase} [external]
422
+ maestro-verify {phase}
423
+ decision:post-verify {retry+1}
424
+ ```
425
+
426
+ **post-business-test:**
427
+ ```
428
+ quality-debug --from-business-test "{gap_summary}"
429
+ maestro-plan --gaps {phase}
430
+ maestro-execute {phase} [external]
431
+ maestro-verify {phase}
432
+ decision:post-verify {retry: 0}
433
+ quality-auto-test {phase}
434
+ decision:post-business-test {retry+1}
435
+ ```
436
+
437
+ **post-review:**
438
+ ```
439
+ quality-debug "{gap_summary}"
440
+ maestro-plan --gaps {phase}
441
+ maestro-execute {phase} [external]
442
+ quality-review {phase}
443
+ decision:post-review {retry+1}
444
+ ```
445
+
446
+ **post-test:**
447
+ ```
448
+ quality-debug --from-uat "{gap_summary}"
449
+ maestro-plan --gaps {phase}
450
+ maestro-execute {phase} [external]
451
+ maestro-verify {phase}
452
+ decision:post-verify {retry: 0}
453
+ quality-auto-test {phase}
454
+ decision:post-business-test {retry: 0}
455
+ quality-review {phase}
456
+ decision:post-review {retry: 0}
457
+ quality-auto-test {phase}
458
+ quality-test {phase}
459
+ decision:post-test {retry+1}
460
+ ```
461
+
462
+ **post-goal-audit:** (per unmet sub-goal group — this is what dynamically grows `steps[]`)
463
+ ```
464
+ # for each unmet sub-goal G{n}, scoped to its target_phase:
465
+ maestro-plan --gaps {target_phase} "G{n}: {gap}" [goal_ref: G{n}]
466
+ maestro-execute {target_phase} [external] [goal_ref: G{n}]
467
+ maestro-verify {target_phase} [goal_ref: G{n}]
468
+ # after all unmet groups inserted, re-loop the audit:
469
+ decision:post-goal-audit {retry+1}
470
+ ```
471
+ Notes: only unmet sub-goals' phases are re-run (no full-pipeline replay); inserted steps carry `goal_ref` for traceability; loop exits when audit returns `all_met` (→ A_APPLY_GOAL_DONE) or retry hits max (→ escalate to human). This keeps growth bounded.
472
+
473
+ ### Goal Checklist Template
474
+
475
+ Written to `{session_dir}/goal-checklist.md`. Stable within the session; never renamed (so the `/goal` condition string stays valid across context compaction).
476
+
477
+ ```markdown
478
+ # Ralph Goal Checklist — {session_id}
479
+ > Intent: {intent}
480
+
481
+ ## 执行准则 / Execution Criteria
482
+ - {criterion 1}
483
+ - {criterion 2}
484
+
485
+ ## 边界契约 / Boundary Contract
486
+ - In scope: {in_scope}
487
+ - Out of scope: {out_of_scope}
488
+ - Constraints: {constraints}
489
+ - Definition of Done: {definition_of_done}
490
+
491
+ ## 子目标 / Sub-goals
492
+ - [ ] G1: {goal} — done when: {done_when} (evidence: {evidence})
493
+ - [ ] G2: {goal} — done when: {done_when} (evidence: {evidence})
494
+ - [ ] G3: ...
495
+
496
+ <!-- ralph-execute flips [ ]→[x] when a sub-goal's evidence artifact confirms done;
497
+ appends the line `ALL_GOALS_DONE` once every box is [x]. -->
498
+ ```
499
+
500
+ `maestro-ralph-execute` responsibility (additive, optional): after a step whose `lifecycle` covers a sub-goal, re-check that sub-goal's `evidence` artifact; if satisfied, set `task_decomposition[i].status="done"` in status.json AND flip its checkbox in goal-checklist.md. When all done → append `ALL_GOALS_DONE`. If decomposition fields absent → do nothing (old behavior).
501
+
502
+ ### Goal Prompt Template
503
+
504
+ Displayed verbatim after the chain overview (only when decomposition produced):
505
+
506
+ ```
507
+ 📋 任务分解完成。可选(推荐):复制下面一行设定目标,让会话在所有子目标达成前不停:
508
+
509
+ /goal 当 {session_dir}/goal-checklist.md 中所有子目标复选框均为 [x] 且文件含 ALL_GOALS_DONE 哨兵时目标达成;否则依据文件内"执行准则"继续推进未完成子目标,不得超出边界契约范围
510
+
511
+ 然后运行 /maestro-ralph continue 开始执行。
512
+ ```
513
+
514
+ > `/goal` 是 harness 命令、仅用户可输入 — ralph 只输出此提示词,不能自行注册。这与 status.json 的可扩展约定一致:绑定是用户侧、可选的增量能力。
515
+
516
+ ### Error Codes
517
+
518
+ | Code | Severity | Description | Recovery |
519
+ |------|----------|-------------|----------|
520
+ | E001 | error | No intent and no running session | Prompt for intent |
521
+ | E002 | error | Cannot infer lifecycle position | Show raw state, ask |
522
+ | E003 | error | Artifact dir not found for decision | Show glob, ask |
523
+ | E004 | error | Delegate verdict parse failed | Fallback: "fix" |
524
+ | E005 | error | Delegate execution failed | Fallback: "fix" |
525
+ | W001 | warning | Decision expanded chain | Auto-handled |
526
+ | W002 | warning | Max retries, escalating | Auto-handled |
527
+ | W003 | warning | Multiple running sessions | Use latest, warn |
528
+ | W004 | warning | Low delegate confidence | Show warning |
529
+
530
+ ### Success Criteria
531
+
532
+ - [ ] State parsed, position inferred from bootstrap + artifacts + result files
533
+ - [ ] Decomposition runs as initial step; broad intent boundary-clarified via ≤3 questions (ignores auto_confirm); narrow auto-derives
534
+ - [ ] status.json enriched additively with boundary_contract + execution_criteria + task_decomposition; absent fields = old behavior preserved
535
+ - [ ] goal-checklist.md generated with verifiable done_when mapped to ralph evidence + ALL_GOALS_DONE sentinel
536
+ - [ ] Goal Prompt emitted for user to bind via /goal
537
+ - [ ] post-goal-audit decision node inserted before milestone-complete (only when decomposed)
538
+ - [ ] Unmet sub-goals DYNAMICALLY grow steps[] via scoped per-goal mini-loops (goal_ref tagged), looping until all_met or max retries → escalate
539
+ - [ ] Quality pipeline generated: verify → business-test → review → test-gen → test
540
+ - [ ] Decision nodes delegate-evaluated via maestro delegate --role analyze
541
+ - [ ] Verdict parsed with confidence adjustment
542
+ - [ ] Fix-loop templates applied with retry tracking
543
+ - [ ] Ralph never executes steps — only creates sessions and evaluates decisions
544
+ - [ ] Handoff to maestro-ralph-execute via Skill() at creation and after decisions
545
+
546
+ </appendix>