maestro-flow 0.4.10 → 0.4.12

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 (354) hide show
  1. package/.agents/agents/cli-explore-agent.md +187 -0
  2. package/.agents/agents/cross-role-reviewer.md +173 -0
  3. package/.agents/agents/impeccable-agent.md +101 -0
  4. package/.agents/agents/role-design-author.md +218 -0
  5. package/.agents/agents/team-supervisor.md +145 -0
  6. package/.agents/agents/team-worker.md +239 -0
  7. package/.agents/agents/ui-design-agent.md +272 -0
  8. package/.agents/agents/workflow-analyzer.md +117 -0
  9. package/.agents/agents/workflow-codebase-mapper.md +79 -0
  10. package/.agents/agents/workflow-collab-planner.md +145 -0
  11. package/.agents/agents/workflow-debugger.md +105 -0
  12. package/.agents/agents/workflow-executor.md +134 -0
  13. package/.agents/agents/workflow-external-researcher.md +88 -0
  14. package/.agents/agents/workflow-integration-checker.md +85 -0
  15. package/.agents/agents/workflow-nyquist-auditor.md +87 -0
  16. package/.agents/agents/workflow-phase-researcher.md +87 -0
  17. package/.agents/agents/workflow-plan-checker.md +92 -0
  18. package/.agents/agents/workflow-planner.md +197 -0
  19. package/.agents/agents/workflow-project-researcher.md +76 -0
  20. package/.agents/agents/workflow-research-synthesizer.md +72 -0
  21. package/.agents/agents/workflow-reviewer.md +84 -0
  22. package/.agents/agents/workflow-roadmapper.md +83 -0
  23. package/.agents/agents/workflow-verifier.md +122 -0
  24. package/.agents/skills/codify-to-knowhow/SKILL.md +169 -0
  25. package/.agents/skills/codify-to-knowhow/phases/01-load-manifest.md +101 -0
  26. package/.agents/skills/codify-to-knowhow/phases/02-generate-knowhow.md +97 -0
  27. package/.agents/skills/codify-to-knowhow/phases/03-generate-specs.md +92 -0
  28. package/.agents/skills/codify-to-knowhow/phases/04-index-verify.md +119 -0
  29. package/.agents/skills/learn-decompose/SKILL.md +118 -0
  30. package/.agents/skills/learn-follow/SKILL.md +129 -0
  31. package/.agents/skills/learn-investigate/SKILL.md +154 -0
  32. package/.agents/skills/learn-retro/SKILL.md +159 -0
  33. package/.agents/skills/learn-second-opinion/SKILL.md +124 -0
  34. package/.agents/skills/maestro/SKILL.md +258 -0
  35. package/.agents/skills/maestro-amend/SKILL.md +165 -0
  36. package/.agents/skills/maestro-analyze/SKILL.md +161 -0
  37. package/.agents/skills/maestro-blueprint/SKILL.md +132 -0
  38. package/.agents/skills/maestro-brainstorm/SKILL.md +134 -0
  39. package/.agents/skills/maestro-collab/SKILL.md +174 -0
  40. package/.agents/skills/maestro-composer/SKILL.md +181 -0
  41. package/.agents/skills/maestro-execute/SKILL.md +133 -0
  42. package/.agents/skills/maestro-fork/SKILL.md +88 -0
  43. package/.agents/skills/maestro-guard/SKILL.md +103 -0
  44. package/.agents/skills/maestro-help/SKILL.md +300 -0
  45. package/.agents/skills/maestro-help/index/catalog.json +202 -0
  46. package/.agents/skills/maestro-help/phases/01-parse-intent.md +122 -0
  47. package/.agents/skills/maestro-help/phases/02-search-present.md +183 -0
  48. package/.agents/skills/maestro-help/phases/03-workflow-guide.md +213 -0
  49. package/.agents/skills/maestro-impeccable/SKILL.md +251 -0
  50. package/.agents/skills/maestro-init/SKILL.md +80 -0
  51. package/.agents/skills/maestro-learn/SKILL.md +142 -0
  52. package/.agents/skills/maestro-merge/SKILL.md +66 -0
  53. package/.agents/skills/maestro-milestone-audit/SKILL.md +72 -0
  54. package/.agents/skills/maestro-milestone-complete/SKILL.md +79 -0
  55. package/.agents/skills/maestro-milestone-release/SKILL.md +98 -0
  56. package/.agents/skills/maestro-overlay/SKILL.md +180 -0
  57. package/.agents/skills/maestro-plan/SKILL.md +182 -0
  58. package/.agents/skills/maestro-player/SKILL.md +177 -0
  59. package/.agents/skills/maestro-quick/SKILL.md +67 -0
  60. package/.agents/skills/maestro-ralph/SKILL.md +756 -0
  61. package/.agents/skills/maestro-ralph-execute/SKILL.md +273 -0
  62. package/.agents/skills/maestro-roadmap/SKILL.md +131 -0
  63. package/.agents/skills/maestro-tools-execute/SKILL.md +119 -0
  64. package/.agents/skills/maestro-tools-register/SKILL.md +159 -0
  65. package/.agents/skills/maestro-ui-codify/SKILL.md +82 -0
  66. package/.agents/skills/maestro-update/SKILL.md +178 -0
  67. package/.agents/skills/maestro-verify/SKILL.md +111 -0
  68. package/.agents/skills/manage-codebase-rebuild/SKILL.md +77 -0
  69. package/.agents/skills/manage-codebase-refresh/SKILL.md +59 -0
  70. package/.agents/skills/manage-harvest/SKILL.md +96 -0
  71. package/.agents/skills/manage-issue/SKILL.md +75 -0
  72. package/.agents/skills/manage-issue-discover/SKILL.md +83 -0
  73. package/.agents/skills/manage-knowhow/SKILL.md +79 -0
  74. package/.agents/skills/manage-knowhow-capture/SKILL.md +81 -0
  75. package/.agents/skills/manage-learn/SKILL.md +67 -0
  76. package/.agents/skills/manage-status/SKILL.md +54 -0
  77. package/.agents/skills/manage-wiki/SKILL.md +64 -0
  78. package/.agents/skills/quality-auto-test/SKILL.md +138 -0
  79. package/.agents/skills/quality-debug/SKILL.md +122 -0
  80. package/.agents/skills/quality-refactor/SKILL.md +69 -0
  81. package/.agents/skills/quality-retrospective/SKILL.md +79 -0
  82. package/.agents/skills/quality-review/SKILL.md +130 -0
  83. package/.agents/skills/quality-sync/SKILL.md +53 -0
  84. package/.agents/skills/quality-test/SKILL.md +119 -0
  85. package/.agents/skills/security-audit/SKILL.md +157 -0
  86. package/.agents/skills/skill-iter-tune/SKILL.md +384 -0
  87. package/.agents/skills/skill-iter-tune/phases/01-setup.md +144 -0
  88. package/.agents/skills/skill-iter-tune/phases/02-execute.md +292 -0
  89. package/.agents/skills/skill-iter-tune/phases/03-evaluate.md +312 -0
  90. package/.agents/skills/skill-iter-tune/phases/04-improve.md +186 -0
  91. package/.agents/skills/skill-iter-tune/phases/05-report.md +166 -0
  92. package/.agents/skills/skill-iter-tune/specs/evaluation-criteria.md +63 -0
  93. package/.agents/skills/skill-iter-tune/templates/eval-prompt.md +134 -0
  94. package/.agents/skills/skill-iter-tune/templates/execute-prompt.md +97 -0
  95. package/.agents/skills/spec-add/SKILL.md +70 -0
  96. package/.agents/skills/spec-load/SKILL.md +73 -0
  97. package/.agents/skills/spec-remove/SKILL.md +53 -0
  98. package/.agents/skills/spec-setup/SKILL.md +50 -0
  99. package/.agents/skills/team-coordinate/SKILL.md +268 -0
  100. package/.agents/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +247 -0
  101. package/.agents/skills/team-coordinate/roles/coordinator/commands/dispatch.md +131 -0
  102. package/.agents/skills/team-coordinate/roles/coordinator/commands/monitor.md +358 -0
  103. package/.agents/skills/team-coordinate/roles/coordinator/role.md +365 -0
  104. package/.agents/skills/team-coordinate/specs/knowledge-transfer.md +111 -0
  105. package/.agents/skills/team-coordinate/specs/pipelines.md +97 -0
  106. package/.agents/skills/team-coordinate/specs/quality-gates.md +112 -0
  107. package/.agents/skills/team-coordinate/specs/role-spec-template.md +198 -0
  108. package/.agents/skills/team-executor/SKILL.md +191 -0
  109. package/.agents/skills/team-executor/roles/executor/commands/monitor.md +239 -0
  110. package/.agents/skills/team-executor/roles/executor/role.md +171 -0
  111. package/.agents/skills/team-executor/specs/session-schema.md +264 -0
  112. package/.agents/skills/team-lifecycle-v4/SKILL.md +211 -0
  113. package/.agents/skills/team-lifecycle-v4/roles/analyst/role.md +96 -0
  114. package/.agents/skills/team-lifecycle-v4/roles/coordinator/commands/analyze.md +56 -0
  115. package/.agents/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +56 -0
  116. package/.agents/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +206 -0
  117. package/.agents/skills/team-lifecycle-v4/roles/coordinator/role.md +130 -0
  118. package/.agents/skills/team-lifecycle-v4/roles/executor/commands/fix.md +35 -0
  119. package/.agents/skills/team-lifecycle-v4/roles/executor/commands/implement.md +62 -0
  120. package/.agents/skills/team-lifecycle-v4/roles/executor/role.md +69 -0
  121. package/.agents/skills/team-lifecycle-v4/roles/planner/role.md +87 -0
  122. package/.agents/skills/team-lifecycle-v4/roles/reviewer/commands/review-code.md +34 -0
  123. package/.agents/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +44 -0
  124. package/.agents/skills/team-lifecycle-v4/roles/reviewer/role.md +71 -0
  125. package/.agents/skills/team-lifecycle-v4/roles/supervisor/role.md +194 -0
  126. package/.agents/skills/team-lifecycle-v4/roles/tester/role.md +89 -0
  127. package/.agents/skills/team-lifecycle-v4/roles/writer/role.md +97 -0
  128. package/.agents/skills/team-lifecycle-v4/specs/knowledge-transfer.md +114 -0
  129. package/.agents/skills/team-lifecycle-v4/specs/pipelines.md +140 -0
  130. package/.agents/skills/team-lifecycle-v4/specs/quality-gates.md +130 -0
  131. package/.agents/skills/team-lifecycle-v4/templates/architecture.md +254 -0
  132. package/.agents/skills/team-lifecycle-v4/templates/epics.md +196 -0
  133. package/.agents/skills/team-lifecycle-v4/templates/product-brief.md +133 -0
  134. package/.agents/skills/team-lifecycle-v4/templates/requirements.md +224 -0
  135. package/.agents/skills/team-quality-assurance/SKILL.md +149 -0
  136. package/.agents/skills/team-quality-assurance/roles/analyst/role.md +90 -0
  137. package/.agents/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +72 -0
  138. package/.agents/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +111 -0
  139. package/.agents/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +250 -0
  140. package/.agents/skills/team-quality-assurance/roles/coordinator/role.md +143 -0
  141. package/.agents/skills/team-quality-assurance/roles/executor/role.md +68 -0
  142. package/.agents/skills/team-quality-assurance/roles/generator/role.md +70 -0
  143. package/.agents/skills/team-quality-assurance/roles/scout/role.md +77 -0
  144. package/.agents/skills/team-quality-assurance/roles/strategist/role.md +73 -0
  145. package/.agents/skills/team-quality-assurance/specs/pipelines.md +115 -0
  146. package/.agents/skills/team-quality-assurance/specs/team-config.json +131 -0
  147. package/.agents/skills/team-review/SKILL.md +149 -0
  148. package/.agents/skills/team-review/roles/coordinator/commands/analyze.md +71 -0
  149. package/.agents/skills/team-review/roles/coordinator/commands/dispatch.md +91 -0
  150. package/.agents/skills/team-review/roles/coordinator/commands/monitor.md +224 -0
  151. package/.agents/skills/team-review/roles/coordinator/role.md +132 -0
  152. package/.agents/skills/team-review/roles/fixer/role.md +78 -0
  153. package/.agents/skills/team-review/roles/reviewer/role.md +70 -0
  154. package/.agents/skills/team-review/roles/scanner/role.md +81 -0
  155. package/.agents/skills/team-review/specs/dimensions.md +82 -0
  156. package/.agents/skills/team-review/specs/finding-schema.json +82 -0
  157. package/.agents/skills/team-review/specs/pipelines.md +102 -0
  158. package/.agents/skills/team-review/specs/team-config.json +27 -0
  159. package/.agents/skills/team-tech-debt/SKILL.md +130 -0
  160. package/.agents/skills/team-tech-debt/roles/assessor/role.md +79 -0
  161. package/.agents/skills/team-tech-debt/roles/coordinator/commands/analyze.md +47 -0
  162. package/.agents/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +156 -0
  163. package/.agents/skills/team-tech-debt/roles/coordinator/commands/monitor.md +209 -0
  164. package/.agents/skills/team-tech-debt/roles/coordinator/role.md +123 -0
  165. package/.agents/skills/team-tech-debt/roles/executor/role.md +78 -0
  166. package/.agents/skills/team-tech-debt/roles/planner/role.md +71 -0
  167. package/.agents/skills/team-tech-debt/roles/scanner/role.md +92 -0
  168. package/.agents/skills/team-tech-debt/roles/validator/role.md +80 -0
  169. package/.agents/skills/team-tech-debt/specs/pipelines.md +47 -0
  170. package/.agents/skills/team-tech-debt/specs/team-config.json +129 -0
  171. package/.agents/skills/team-testing/SKILL.md +145 -0
  172. package/.agents/skills/team-testing/roles/analyst/role.md +105 -0
  173. package/.agents/skills/team-testing/roles/coordinator/commands/analyze.md +70 -0
  174. package/.agents/skills/team-testing/roles/coordinator/commands/dispatch.md +108 -0
  175. package/.agents/skills/team-testing/roles/coordinator/commands/monitor.md +257 -0
  176. package/.agents/skills/team-testing/roles/coordinator/role.md +134 -0
  177. package/.agents/skills/team-testing/roles/executor/role.md +101 -0
  178. package/.agents/skills/team-testing/roles/generator/role.md +100 -0
  179. package/.agents/skills/team-testing/roles/strategist/role.md +85 -0
  180. package/.agents/skills/team-testing/specs/pipelines.md +101 -0
  181. package/.agents/skills/team-testing/specs/team-config.json +93 -0
  182. package/.agents/skills/wiki-connect/SKILL.md +64 -0
  183. package/.agents/skills/wiki-digest/SKILL.md +70 -0
  184. package/.agents/skills/workflow-skill-designer/SKILL.md +498 -0
  185. package/.agents/skills/workflow-skill-designer/phases/01-requirements-analysis.md +356 -0
  186. package/.agents/skills/workflow-skill-designer/phases/02-orchestrator-design.md +444 -0
  187. package/.agents/skills/workflow-skill-designer/phases/03-phase-design.md +458 -0
  188. package/.agents/skills/workflow-skill-designer/phases/04-validation.md +471 -0
  189. package/.agy/agents/cli-explore-agent.md +1 -3
  190. package/.agy/agents/cross-role-reviewer.md +170 -0
  191. package/.agy/agents/role-design-author.md +215 -0
  192. package/.agy/agents/ui-design-agent.md +1 -18
  193. package/.agy/agents/workflow-analyzer.md +1 -1
  194. package/.agy/agents/workflow-external-researcher.md +1 -1
  195. package/.agy/skills/maestro/SKILL.md +63 -27
  196. package/.agy/skills/maestro-analyze/SKILL.md +30 -4
  197. package/.agy/skills/maestro-blueprint/SKILL.md +132 -0
  198. package/.agy/skills/maestro-brainstorm/SKILL.md +119 -103
  199. package/.agy/skills/maestro-help/SKILL.md +48 -14
  200. package/.agy/skills/maestro-help/index/catalog.json +29 -11
  201. package/.agy/skills/maestro-help/phases/01-parse-intent.md +1 -1
  202. package/.agy/skills/maestro-help/phases/02-search-present.md +6 -4
  203. package/.agy/skills/maestro-help/phases/03-workflow-guide.md +60 -33
  204. package/.agy/skills/maestro-init/SKILL.md +3 -3
  205. package/.agy/skills/maestro-milestone-audit/SKILL.md +5 -3
  206. package/.agy/skills/maestro-milestone-complete/SKILL.md +7 -5
  207. package/.agy/skills/maestro-plan/SKILL.md +14 -4
  208. package/.agy/skills/maestro-ralph/SKILL.md +368 -162
  209. package/.agy/skills/maestro-ralph-execute/SKILL.md +81 -67
  210. package/.agy/skills/maestro-roadmap/SKILL.md +42 -81
  211. package/.agy/skills/quality-auto-test/SKILL.md +1 -1
  212. package/.agy/skills/team-lifecycle-v4/roles/analyst/role.md +1 -1
  213. package/.agy/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +2 -2
  214. package/.agy/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  215. package/.agy/skills/team-lifecycle-v4/templates/architecture.md +3 -3
  216. package/.agy/skills/team-lifecycle-v4/templates/epics.md +2 -2
  217. package/.agy/skills/team-lifecycle-v4/templates/product-brief.md +3 -3
  218. package/.agy/skills/team-lifecycle-v4/templates/requirements.md +2 -2
  219. package/.claude/agents/cli-explore-agent.md +1 -3
  220. package/.claude/agents/cross-role-reviewer.md +171 -0
  221. package/.claude/agents/role-design-author.md +216 -0
  222. package/.claude/agents/ui-design-agent.md +1 -18
  223. package/.claude/agents/workflow-analyzer.md +1 -1
  224. package/.claude/agents/workflow-external-researcher.md +1 -1
  225. package/.claude/commands/maestro-analyze.md +30 -4
  226. package/.claude/commands/maestro-blueprint.md +130 -0
  227. package/.claude/commands/maestro-brainstorm.md +132 -116
  228. package/.claude/commands/maestro-init.md +3 -3
  229. package/.claude/commands/maestro-milestone-audit.md +5 -3
  230. package/.claude/commands/maestro-milestone-complete.md +7 -5
  231. package/.claude/commands/maestro-plan.md +14 -4
  232. package/.claude/commands/maestro-ralph-execute.md +81 -67
  233. package/.claude/commands/maestro-ralph.md +368 -162
  234. package/.claude/commands/maestro-roadmap.md +42 -81
  235. package/.claude/commands/maestro.md +63 -27
  236. package/.claude/commands/quality-auto-test.md +1 -1
  237. package/.claude/skills/maestro-help/SKILL.md +48 -14
  238. package/.claude/skills/maestro-help/index/catalog.json +29 -11
  239. package/.claude/skills/maestro-help/phases/01-parse-intent.md +1 -1
  240. package/.claude/skills/maestro-help/phases/02-search-present.md +6 -4
  241. package/.claude/skills/maestro-help/phases/03-workflow-guide.md +60 -33
  242. package/.claude/skills/team-lifecycle-v4/roles/analyst/role.md +1 -1
  243. package/.claude/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +2 -2
  244. package/.claude/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  245. package/.claude/skills/team-lifecycle-v4/templates/architecture.md +3 -3
  246. package/.claude/skills/team-lifecycle-v4/templates/epics.md +2 -2
  247. package/.claude/skills/team-lifecycle-v4/templates/product-brief.md +3 -3
  248. package/.claude/skills/team-lifecycle-v4/templates/requirements.md +2 -2
  249. package/.codex/skills/maestro/SKILL.md +84 -41
  250. package/.codex/skills/maestro-amend/SKILL.md +157 -0
  251. package/.codex/skills/maestro-analyze/SKILL.md +71 -23
  252. package/.codex/skills/maestro-blueprint/SKILL.md +122 -0
  253. package/.codex/skills/maestro-brainstorm/SKILL.md +135 -45
  254. package/.codex/skills/maestro-composer/SKILL.md +1 -1
  255. package/.codex/skills/maestro-execute/SKILL.md +13 -4
  256. package/.codex/skills/maestro-help/SKILL.md +28 -18
  257. package/.codex/skills/maestro-help/catalog.json +29 -11
  258. package/.codex/skills/maestro-init/SKILL.md +7 -7
  259. package/.codex/skills/maestro-plan/SKILL.md +27 -9
  260. package/.codex/skills/maestro-ralph/SKILL.md +740 -491
  261. package/.codex/skills/maestro-roadmap/SKILL.md +55 -72
  262. package/.codex/skills/maestro-update/SKILL.md +169 -0
  263. package/.codex/skills/maestro-verify/SKILL.md +11 -2
  264. package/.codex/skills/manage-codebase-rebuild/SKILL.md +2 -2
  265. package/.codex/skills/manage-harvest/SKILL.md +10 -2
  266. package/.codex/skills/quality-retrospective/SKILL.md +9 -2
  267. package/.codex/skills/team-lifecycle-v4/roles/analyst/role.md +2 -2
  268. package/.codex/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +2 -2
  269. package/.codex/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  270. package/.codex/skills/team-lifecycle-v4/templates/architecture.md +3 -3
  271. package/.codex/skills/team-lifecycle-v4/templates/epics.md +2 -2
  272. package/.codex/skills/team-lifecycle-v4/templates/product-brief.md +3 -3
  273. package/.codex/skills/team-lifecycle-v4/templates/requirements.md +2 -2
  274. package/README.md +8 -8
  275. package/README.zh-CN.md +8 -8
  276. package/dashboard/dist-server/dashboard/src/server/routes/settings.js +3 -3
  277. package/dashboard/dist-server/dashboard/src/server/routes/settings.js.map +1 -1
  278. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  279. package/dist/src/agents/cli-agent-runner.js +13 -7
  280. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  281. package/dist/src/commands/install-backend.d.ts +12 -0
  282. package/dist/src/commands/install-backend.d.ts.map +1 -1
  283. package/dist/src/commands/install-backend.js +144 -0
  284. package/dist/src/commands/install-backend.js.map +1 -1
  285. package/dist/src/commands/spec.d.ts.map +1 -1
  286. package/dist/src/commands/spec.js +8 -1
  287. package/dist/src/commands/spec.js.map +1 -1
  288. package/dist/src/core/component-defs.d.ts +6 -0
  289. package/dist/src/core/component-defs.d.ts.map +1 -1
  290. package/dist/src/core/component-defs.js +97 -0
  291. package/dist/src/core/component-defs.js.map +1 -1
  292. package/dist/src/tools/spec-init.d.ts +16 -2
  293. package/dist/src/tools/spec-init.d.ts.map +1 -1
  294. package/dist/src/tools/spec-init.js +58 -187
  295. package/dist/src/tools/spec-init.js.map +1 -1
  296. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  297. package/dist/src/tools/spec-loader.js +16 -16
  298. package/dist/src/tools/spec-loader.js.map +1 -1
  299. package/dist/src/tools/spec-seeds.d.ts +33 -0
  300. package/dist/src/tools/spec-seeds.d.ts.map +1 -0
  301. package/dist/src/tools/spec-seeds.js +200 -0
  302. package/dist/src/tools/spec-seeds.js.map +1 -0
  303. package/dist/src/tools/spec-writer.d.ts.map +1 -1
  304. package/dist/src/tools/spec-writer.js +7 -9
  305. package/dist/src/tools/spec-writer.js.map +1 -1
  306. package/dist/src/tui/install-ui/ExtraMcpConfig.d.ts +11 -0
  307. package/dist/src/tui/install-ui/ExtraMcpConfig.d.ts.map +1 -0
  308. package/dist/src/tui/install-ui/ExtraMcpConfig.js +61 -0
  309. package/dist/src/tui/install-ui/ExtraMcpConfig.js.map +1 -0
  310. package/dist/src/tui/install-ui/InstallConfirm.d.ts +3 -0
  311. package/dist/src/tui/install-ui/InstallConfirm.d.ts.map +1 -1
  312. package/dist/src/tui/install-ui/InstallConfirm.js +1 -1
  313. package/dist/src/tui/install-ui/InstallConfirm.js.map +1 -1
  314. package/dist/src/tui/install-ui/InstallExecution.d.ts +2 -0
  315. package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
  316. package/dist/src/tui/install-ui/InstallExecution.js +14 -2
  317. package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
  318. package/dist/src/tui/install-ui/InstallFlow.d.ts +1 -1
  319. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
  320. package/dist/src/tui/install-ui/InstallFlow.js +16 -3
  321. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
  322. package/dist/src/tui/install-ui/InstallHub.d.ts +2 -0
  323. package/dist/src/tui/install-ui/InstallHub.d.ts.map +1 -1
  324. package/dist/src/tui/install-ui/InstallHub.js +8 -0
  325. package/dist/src/tui/install-ui/InstallHub.js.map +1 -1
  326. package/dist/src/tui/install-ui/InstallResult.d.ts.map +1 -1
  327. package/dist/src/tui/install-ui/InstallResult.js +3 -1
  328. package/dist/src/tui/install-ui/InstallResult.js.map +1 -1
  329. package/dist/src/utils/update-notices.js +31 -0
  330. package/dist/src/utils/update-notices.js.map +1 -1
  331. package/package.json +5 -2
  332. package/templates/business-test-report.json +1 -1
  333. package/templates/index.json +1 -1
  334. package/templates/roadmap.md +15 -9
  335. package/templates/state.json +18 -17
  336. package/workflows/analyze.md +79 -11
  337. package/workflows/auto-test.md +6 -6
  338. package/workflows/blueprint.md +431 -0
  339. package/workflows/brainstorm.md +603 -496
  340. package/workflows/business-test.md +7 -7
  341. package/workflows/codebase-rebuild.md +4 -4
  342. package/workflows/harvest.md +184 -10
  343. package/workflows/init.md +9 -8
  344. package/workflows/maestro.md +1 -1
  345. package/workflows/milestone-audit.md +12 -4
  346. package/workflows/milestone-complete.md +11 -6
  347. package/workflows/plan.md +88 -22
  348. package/workflows/roadmap-common.md +1 -1
  349. package/workflows/roadmap.md +13 -3
  350. package/workflows/spec-generate.md +24 -13
  351. package/workflows/ui-design.md +2 -2
  352. package/workflows/ui-style.md +1 -1
  353. package/.agy/agents/conceptual-planning-agent.md +0 -244
  354. package/.claude/agents/conceptual-planning-agent.md +0 -245
@@ -21,12 +21,12 @@ Entry points:
21
21
  - **`/maestro-ralph continue`** — Resume via maestro-ralph-execute
22
22
  - **`/maestro-ralph status`** — Display session progress
23
23
 
24
- 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.
24
+ Initial decomposition (S_DECOMPOSE): boundary-clarified via ≤3 questions for broad intents (重构/全面/迁移/重写). 写入 status.json `boundary_contract` / `execution_criteria` / `task_decomposition`,附 `/goal` prompt
25
25
 
26
- Three node types:
27
- - **internal**: `Skill()` call (synchronous, lightweight)
28
- - **external**: `maestro delegate --to claude` (context-isolated, heavy computation)
29
- - **decision**: Hand back to ralph for re-evaluation (adaptive branching)
26
+ Node types:
27
+ - **internal** (default): ralph-execute `Read({command_path})` 命令 .md,按内容内联执行
28
+ - **decision**: ralph 评估
29
+ - **external**: 仅在显式声明时使用(`maestro delegate --to claude`)
30
30
 
31
31
  Key difference from maestro coordinator:
32
32
  - maestro: static chain → one-time selection → runs all steps
@@ -34,6 +34,20 @@ Key difference from maestro coordinator:
34
34
 
35
35
  Session: `.workflow/.maestro/ralph-{YYYYMMDD-HHmmss}/status.json`
36
36
  Mutual invocation with `/maestro-ralph-execute` forms a self-perpetuating work loop.
37
+
38
+ ### Execution Flow
39
+
40
+ ```
41
+ /maestro-ralph "intent" ─▶ ralph infer → decompose → build chain
42
+ │ resolves command_path per step
43
+ │ writes status.json
44
+ │ emits /goal prompt
45
+
46
+ ralph-execute ◀─┐ internal → Read(command_path) inline
47
+ │ │ decision → Skill("maestro-ralph")
48
+ └─────────┘ writes step.completion_confirmed
49
+ loop until all completion_confirmed | paused
50
+ ```
37
51
  </purpose>
38
52
 
39
53
  <context>
@@ -56,10 +70,13 @@ Remaining → intent
56
70
  1. **Ralph never executes steps** — only creates sessions and evaluates decisions
57
71
  2. **Handoff via Skill("maestro-ralph-execute")** — at session creation and after decision evaluation
58
72
  3. **Decision delegates read-only** — `maestro delegate --role analyze --mode analysis`
59
- 4. **External CLI call** — external spawns full Claude Code session executing the skill command
60
- 5. **Delegate sessions non-interactive** all external skills MUST append `-y` to args inside the prompt
61
- 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
62
- 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
73
+ 4. **Default type = internal** — `external` 仅显式标注时出现,build 不默认生成
74
+ 5. **status.json 是唯一真源**不生成 markdown 清单或侧文件
75
+ 6. **每个 step 必须 `completion_confirmed: true`** 基于 `--- COMPLETION STATUS ---` `STATUS: DONE`;缺失则视为未完成
76
+ 7. **command_path A_BUILD_STEPS 解析**全局优先 `~/.claude/commands/{name}.md`,fallback 项目 `.claude/commands/{name}.md`,写入 status.json
77
+ 8. **Decomposition is outcome-oriented** — sub-goals 为可观测交付,禁止 lifecycle 复刻;`/goal` 用户绑定,ralph 只发提示词
78
+ 9. **planning_mode governs arg granularity** — `unified` → skill args 无 `{phase}`;`independent` → 含 `{phase}`
79
+ 10. **task_decomposition 驱动 steps[] 动态生长** — `post-goal-audit` 按 unmet 子目标插入 scoped mini-loop;字段可选/累加,既有字段不删不改
63
80
  </invariants>
64
81
 
65
82
  <state_machine>
@@ -68,8 +85,11 @@ Remaining → intent
68
85
  S_PARSE_ROUTE — 解析参数、路由入口 PERSIST: —
69
86
  S_STATUS — 显示 session 进度 PERSIST: —
70
87
  S_CONTINUE — 恢复执行 PERSIST: —
71
- S_INFER state.json、推断生命周期位置 PERSIST: session.lifecycle_position
72
- S_RESOLVE_PHASE 解析目标 phase PERSIST: session.phase
88
+ S_RESOLVE_PHASE 解析 phase + phase_is_new + D-007 milestone PERSIST: session.phase, session.phase_is_new, session.milestone
89
+ S_INFER 基于已解析 phase 推断 lifecycle_position PERSIST: session.lifecycle_position
90
+ S_RESOLVE_SCOPE — 读 macro analyze conclusions.scope_verdict PERSIST: session.scope_verdict, session.analyze_macro_id
91
+ S_QUALITY_MODE — 决定质量管线模式 PERSIST: session.quality_mode
92
+ S_PLANNING_MODE — 决定统一/独立规划模式 PERSIST: session.planning_mode
73
93
  S_DECOMPOSE — 边界澄清、写执行准则+子目标清单 PERSIST: session.boundary_contract, .execution_criteria, .task_decomposition
74
94
  S_BUILD_CHAIN — 构建步骤链 PERSIST: session.steps[]
75
95
  S_CREATE_SESSION — 写 status.json PERSIST: session (全量)
@@ -86,7 +106,7 @@ S_PARSE_ROUTE:
86
106
  → S_STATUS WHEN: intent == "status"
87
107
  → S_CONTINUE WHEN: intent == "continue"
88
108
  → S_DECISION_EVAL WHEN: running session with decision step in "running" status
89
- S_INFER WHEN: intent is non-empty
109
+ S_RESOLVE_PHASE WHEN: intent is non-empty ← phase 必须先于 position
90
110
  → S_FALLBACK WHEN: no intent AND no running session
91
111
 
92
112
  S_STATUS:
@@ -96,20 +116,31 @@ S_CONTINUE:
96
116
  → S_DISPATCH WHEN: running session found
97
117
  → S_FALLBACK WHEN: no running session DO: display "无运行中的 ralph 会话"
98
118
 
99
- S_INFER:
100
- → S_RESOLVE_PHASE WHEN: position resolved DO: A_INFER_POSITION
101
- → S_FALLBACK WHEN: cannot infer
102
-
103
119
  S_RESOLVE_PHASE:
104
- S_DECOMPOSE WHEN: phase resolved or null DO: A_RESOLVE_PHASE
120
+ S_INFER WHEN: phase resolved or null DO: A_RESOLVE_PHASE
105
121
  → S_FALLBACK WHEN: ambiguous
106
122
  GUARD: auto_confirm does NOT skip phase ambiguity
107
123
 
124
+ S_INFER:
125
+ → S_RESOLVE_SCOPE WHEN: position resolved DO: A_INFER_POSITION
126
+ → S_FALLBACK WHEN: cannot infer
127
+
128
+ S_RESOLVE_SCOPE:
129
+ → S_QUALITY_MODE DO: A_RESOLVE_SCOPE_VERDICT
130
+ GUARD: position ∈ {brainstorm, blueprint, init} → skip (scope_verdict = null)
131
+
132
+ S_QUALITY_MODE:
133
+ → S_PLANNING_MODE DO: A_DETERMINE_QUALITY_MODE
134
+
135
+ S_PLANNING_MODE:
136
+ → S_DECOMPOSE DO: A_DETERMINE_PLANNING_MODE
137
+ GUARD: lifecycle_position ∈ {brainstorm, blueprint, init, analyze-macro, roadmap} → skip (force independent)
138
+
108
139
  S_DECOMPOSE:
109
140
  → S_BUILD_CHAIN DO: A_DECOMPOSE_TASKS
110
- GUARD: broad intent (重构/全面/重写/迁移/overhaul/migrate/rewrite) → MUST clarify boundary even if auto_confirm
111
- GUARD: narrow intent (single file/function/bug) → auto-derive, skip questions
112
- GUARD: position ∈ {brainstorm, init} → skip decomposition (no concrete target yet)
141
+ GUARD: broad intent → MUST clarify boundary even if auto_confirm
142
+ GUARD: narrow intent → auto-derive, skip questions
143
+ GUARD: position ∈ {brainstorm, blueprint, init} → skip decomposition
113
144
 
114
145
  S_BUILD_CHAIN:
115
146
  → S_CREATE_SESSION DO: A_BUILD_STEPS
@@ -131,6 +162,8 @@ S_DECISION_EVAL:
131
162
  DO: A_DELEGATE_EVALUATE
132
163
  → S_APPLY_VERDICT WHEN: goal-gate (post-goal-audit)
133
164
  DO: A_GOAL_AUDIT_EVALUATE
165
+ → S_APPLY_VERDICT WHEN: scope-gate (post-analyze-scope)
166
+ DO: A_SCOPE_EVALUATE
134
167
  → S_APPLY_VERDICT WHEN: structural (post-milestone, post-debug-escalate)
135
168
  DO: A_STRUCTURAL_EVALUATE
136
169
 
@@ -138,10 +171,12 @@ S_APPLY_VERDICT:
138
171
  → S_DISPATCH WHEN: verdict == "proceed" DO: A_APPLY_PROCEED
139
172
  → S_DISPATCH WHEN: post-goal-audit + unmet sub-goals DO: A_APPLY_GOAL_FIX
140
173
  → S_DISPATCH WHEN: post-goal-audit + all sub-goals met DO: A_APPLY_GOAL_DONE
174
+ → S_DISPATCH WHEN: post-analyze-scope DO: A_APPLY_SCOPE_VERDICT
141
175
  → S_DISPATCH WHEN: verdict == "fix" DO: A_APPLY_FIX
142
176
  → S_DISPATCH WHEN: verdict == "escalate" DO: A_APPLY_ESCALATE
143
- → S_DISPATCH WHEN: post-milestone + next milestone DO: A_ADVANCE_MILESTONE
144
- → END WHEN: post-milestone + no next milestone DO: mark completed
177
+ → S_DISPATCH WHEN: post-milestone + standard + next milestone DO: A_ADVANCE_MILESTONE
178
+ → END WHEN: post-milestone + standard + no next milestone DO: mark completed
179
+ → END WHEN: post-milestone + adhoc DO: mark completed (adhoc self-contained)
145
180
  → END WHEN: post-debug-escalate (always STOP) DO: A_PAUSE_ESCALATE
146
181
  GUARD: retry_count >= max_retries → force escalate
147
182
  GUARD: confidence_score < 60 AND proceed → override to fix
@@ -161,12 +196,53 @@ S_FALLBACK:
161
196
 
162
197
  1. Find latest ralph session (by created_at)
163
198
  2. Display: Session, Status, Position, Progress, Current step
164
- 3. List steps: [✓] completed, [▸] current, [ ] pending, [◆] decision
165
- 4. If `task_decomposition` present: show `Sub-goals: {done}/{total}` and any unmet G-ids (graceful skip if field absent backward compat)
199
+ 3. List steps: [✓] completion_confirmed, [▸] current, [ ] pending, [◆] decision;附 `command_scope`(global/project) + `command_path`
200
+ 4. If `task_decomposition` present (absent skip):
201
+ ```
202
+ Sub-goals ({done}/{total}) source: {session_dir}/status.json#/task_decomposition
203
+ [x] G1 done_when={done_when} evidence={evidence} confirmed={completion_confirmed}
204
+ [ ] G2 done_when={done_when} evidence={evidence} confirmed=false ◀ unmet
205
+ ```
206
+
207
+ ### A_RESOLVE_PHASE
208
+
209
+ 前置于 A_INFER_POSITION。产出 `phase` + `phase_is_new` + `milestone`(D-007 反查)三元组。
210
+
211
+ **Priority:**
212
+
213
+ | Step | 行为 | phase_is_new |
214
+ |------|------|--------------|
215
+ | 1 | intent 匹配 `phase\s*(\d+)` → 取 state.json 对应 phase | false |
216
+ | 2 | intent 派生短语 → 在 `state.json.milestones[*].phase_slugs` / `artifacts[*].path` 查找 | false (匹配) / true (无匹配) |
217
+ | 3 | 未派生 → 取最新 in-progress artifact 的 phase | false |
218
+ | 4 | 仍无 → state.json 首个 incomplete phase | false |
219
+ | 5 | position 将是 brainstorm/blueprint/init/roadmap/analyze-macro → phase = null | n/a |
220
+ | 6 | 仍模糊 → `AskUserQuestion` | 由用户回答确定 |
221
+
222
+ **D-007 Phase→Milestone 反查**(数字 phase 已解析时):
223
+ ```
224
+ resolve_milestone(phase_number):
225
+ for ms in state.json.milestones:
226
+ if str(phase_number) in ms.phase_slugs: return ms.id
227
+ return state.json.current_milestone # fallback
228
+ ```
229
+ 写入 `session.milestone`;禁止直接使用 `current_milestone` 当做 phase 所属 milestone。
230
+
231
+ **写入 session**: `phase`, `phase_is_new`, `milestone`。
232
+
233
+ **新派生 phase 时 milestone 处理**:
234
+ - state.json 当前 milestone 仍 active → 沿用,新增 phase
235
+ - intent 派生新 milestone 名 → 写入 session 仅作标签;`state.json.milestones` 由 `maestro-roadmap` / `maestro-milestone-release` 创建
166
236
 
167
237
  ### A_INFER_POSITION
168
238
 
169
- **Intent-based override:** brainstorm/头脑风暴/探索/ideate/设计思路 → position = `brainstorm`
239
+ **Intent-based overrides** (按顺序匹配,先命中先用):
240
+
241
+ | Pattern | Position |
242
+ |---------|----------|
243
+ | brainstorm / 头脑风暴 / 探索 / ideate / 设计思路 | `brainstorm` |
244
+ | blueprint / 规格 / 正式文档 / spec-generate / 7-phase | `blueprint` |
245
+ | broad/medium intent 无数字 phase (重构/全面/重写/迁移/新功能 X) | `analyze-macro` |
170
246
 
171
247
  **Bootstrap detection:**
172
248
 
@@ -175,18 +251,38 @@ S_FALLBACK:
175
251
  | No `.workflow/` + no source files | `brainstorm` |
176
252
  | No `.workflow/` + has source files | `init` |
177
253
  | Has `.workflow/` but no state.json | `init` |
178
- | Has state.json | → artifact-based inference |
254
+ | Has state.json | → phase-aware artifact inference |
179
255
 
180
- **Artifact-based inference:** Filter by current_milestone + target phase:
256
+ **Phase-aware artifact inference** (使用 A_RESOLVE_PHASE 已写入的 `session.phase` + `session.phase_is_new`):
181
257
 
182
- | Latest artifact type | Position |
183
- |---------------------|----------|
184
- | no milestones or no roadmap.md | `roadmap` |
185
- | none for phase | `analyze` |
186
- | analyze | `plan` |
187
- | plan | `execute` |
188
- | execute | `verify` |
189
- | verify | refine from result files |
258
+ | Condition | Position |
259
+ |-----------|----------|
260
+ | `phase_is_new == true` (新 phase) | `analyze` |
261
+ | no milestones AND no roadmap.md AND has analyze macro artifact | `roadmap` |
262
+ | no milestones AND no roadmap.md AND no analyze artifact | `analyze-macro` |
263
+ | `phase == null` (brainstorm/blueprint/init/roadmap/analyze-macro override 已定) | n/a |
264
+ | phase 已存在 + 无任何 artifact | `analyze` |
265
+ | phase 已存在 + 最新 artifact = analyze | `plan` |
266
+ | phase 已存在 + 最新 artifact = plan | `execute` |
267
+ | phase 已存在 + 最新 artifact = execute | `verify` |
268
+ | phase 已存在 + 最新 artifact = verify | → refine from result files |
269
+
270
+ **关键不变量**:artifact 过滤按 `session.phase`,不读 `state.json.current_phase`。`phase_is_new` → 直接 `analyze`。
271
+
272
+ ### A_RESOLVE_SCOPE_VERDICT
273
+
274
+ 仅当 `lifecycle_position ∈ {analyze-macro, roadmap, plan}` 且存在最新 analyze artifact 时执行。
275
+
276
+ 1. 定位最新 macro analyze artifact(`type=="analyze"` 且 `scope=="macro"`,按 created_at DESC)→ 记 `session.analyze_macro_id = ANL-xxx`
277
+ 2. 读 `{artifact_path}/conclusions.json` 的 `scope_verdict` 字段(`large | medium | small`)
278
+ 3. 写入 `session.scope_verdict`;缺失时设 `unknown`
279
+ 4. 路由建议(A_BUILD_STEPS 据此决定是否插入 roadmap、plan 是否走 `--from`):
280
+
281
+ | scope_verdict | 链路 |
282
+ |---------------|------|
283
+ | `large` | analyze-macro → roadmap → analyze → plan → execute → ... |
284
+ | `medium` / `small` | analyze-macro → plan --from analyze:{ANL_ID} → execute → ...(跳过 roadmap + analyze-phase) |
285
+ | `unknown` | 默认走 large 路径,post-analyze-scope 决策节点再纠正 |
190
286
 
191
287
  **Refine from verify results:**
192
288
 
@@ -199,13 +295,49 @@ S_FALLBACK:
199
295
  | uat.md: all passed | `milestone-audit` |
200
296
  | uat.md: has failures | `test-failed` |
201
297
 
202
- ### A_RESOLVE_PHASE
298
+ ### A_DETERMINE_QUALITY_MODE
299
+
300
+ 决定下游质量管线长度。读 `session.quality_mode_override`(CLI 标志 `--quality`),无则按规则推断:
203
301
 
204
- Priority: 1) regex from intent 2) latest artifact's phase 3) first incomplete phase 4) null if brainstorm/init/roadmap 5) AskUserQuestion if ambiguous
302
+ | Condition | Mode | Pipeline (verify 之后) |
303
+ |-----------|------|-------------------------|
304
+ | Has `specs/REQ-*.md` + 当前 phase 业务范围明确 | `full` | business-test → review → test-gen → test |
305
+ | Default | `standard` | review → test-gen (当 coverage<80%) → test |
306
+ | `--quality quick` | `quick` | review --tier quick |
307
+
308
+ 写入 `session.quality_mode`。A_BUILD_STEPS 据此过滤 stage(见下)。
309
+
310
+ ### A_DETERMINE_PLANNING_MODE
311
+
312
+ 决定里程碑的规划粒度:一次性规划整个里程碑(统一)还是逐 phase 走完整生命周期(独立)。
313
+
314
+ **Auto-resolve rules (按优先级):**
315
+
316
+ | Condition | Mode | Reason |
317
+ |-----------|------|--------|
318
+ | lifecycle_position ∈ {brainstorm, init, roadmap} | `independent` | 前期阶段不涉及多 phase 规划 |
319
+ | `phase_is_new == true` | `independent` | 新 phase 尚无里程碑上下文 |
320
+ | intent 显式指定 phase 编号(如 "phase 2"、"P3") | `independent` | 用户明确针对单个 phase |
321
+ | milestone 仅含 1 个 phase(读 state.json) | `independent` | 统一无意义 |
322
+ | milestone 含多个 phase + `auto_confirm` | `unified` | 自动模式倾向高效 |
323
+ | milestone 含多个 phase + 非 `auto_confirm` | → AskUserQuestion | 征询用户选择 |
324
+
325
+ **AskUserQuestion** (仅当 milestone 含 ≥2 phase 且非 auto_confirm):
326
+
327
+ ```
328
+ question: "当前里程碑含 {N} 个 phase,选择规划模式?"
329
+ options:
330
+ - label: "统一规划 (Recommended)"
331
+ description: "一次性分析+规划整个里程碑所有 phase,analyze/plan 走里程碑级,适合 phase 间关联紧密"
332
+ - label: "独立规划"
333
+ description: "逐个 phase 走完整生命周期(analyze→plan→execute→verify→...),适合 phase 间独立性高"
334
+ ```
335
+
336
+ 写入 `session.planning_mode`(`"unified"` 或 `"independent"`)。`A_BUILD_STEPS` 据此决定 skill args 是否携带 `{phase}` 占位符。
205
337
 
206
338
  ### A_DECOMPOSE_TASKS
207
339
 
208
- 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.
340
+ Runs once before chain build; additive to status.json.
209
341
 
210
342
  **1. Classify intent breadth:**
211
343
 
@@ -225,7 +357,7 @@ Build the boundary contract + outcome sub-goal checklist that `/goal` will track
225
357
 
226
358
  narrow → derive defaults from intent + codebase, skip questions.
227
359
 
228
- **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.
360
+ **3. Derive `execution_criteria`**: backward-compatscope-freezetest/coverage barfix-don't-hideincremental commit
229
361
 
230
362
  **4. Derive `task_decomposition`** (子目标清单 — outcome-oriented, NOT lifecycle stages). Each entry:
231
363
  ```json
@@ -234,45 +366,70 @@ narrow → derive defaults from intent + codebase, skip questions.
234
366
  "evidence": "verification.json|review.json|uat.md|<test path>",
235
367
  "lifecycle": ["analyze","execute","verify"], "status": "pending" }
236
368
  ```
237
- **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.
369
+ `done_when` 必须客观可验证,且引用 ralph 已产出的 artifact;`lifecycle` 字段映射到产出 evidence 的生命周期 stage。
238
370
 
239
- **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".
371
+ **5. Persist** (additive): `boundary_contract`, `execution_criteria`, `task_decomposition`。每个 sub-goal `status: "pending"` + `completion_confirmed: false`。
240
372
 
241
- **6. Stage** the Goal Checklist + Goal Prompt (Appendix) for A_CREATE_SESSION to emit.
373
+ **6. Stage** the Goal Prompt (Appendix) for A_CREATE_SESSION to emit.
242
374
 
243
375
  ### A_BUILD_STEPS
244
376
 
245
- Generate steps from lifecycle_position to milestone-complete:
246
-
247
- | Stage | Skill | Type | Decision after |
248
- |-------|-------|------|----------------|
249
- | brainstorm | `maestro-brainstorm "{intent}"` | external | — |
250
- | init | `maestro-init` | internal | — |
251
- | roadmap | `maestro-roadmap "{intent}"` | internal | — |
252
- | analyze | `maestro-analyze {phase}` | external | |
253
- | plan | `maestro-plan {phase}` | internal | — |
254
- | execute | `maestro-execute {phase}` | external | — |
255
- | verify | `maestro-verify {phase}` | internal | `post-verify` |
256
- | business-test | `quality-auto-test {phase}` | internal | `post-business-test` |
257
- | review | `quality-review {phase}` | internal | `post-review` |
258
- | test-gen | `quality-auto-test {phase}` | internal | |
259
- | test | `quality-test {phase}` | internal | `post-test` |
260
- | milestone-audit | `maestro-milestone-audit` | internal | — |
261
- | goal-audit | *(decision-only, no skill)* | decision | `post-goal-audit` |
262
- | milestone-complete | `maestro-milestone-complete` | internal | `post-milestone` |
263
-
264
- `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.
265
-
266
- Type rationale: `internal` = Skill(), lightweight/interactive; `external` = delegate --to claude, context-isolated heavy computation
267
-
268
- 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.
377
+ Generate steps from `session.lifecycle_position` to `milestone-complete`.
378
+
379
+ | Stage | Skill (independent) | Skill (unified) | Type | Decision after | quality_mode |
380
+ |-------|---------------------|-----------------|------|----------------|--------------|
381
+ | brainstorm | `maestro-brainstorm "{intent}"` | *(same)* | internal | — | all |
382
+ | blueprint | `maestro-blueprint "{intent}"` | *(same)* | internal | — | all |
383
+ | init | `maestro-init` | *(same)* | internal | — | all |
384
+ | analyze-macro | `maestro-analyze "{intent}"` | *(same)* | internal | `post-analyze-scope` | all |
385
+ | roadmap | `maestro-roadmap --from analyze:{analyze_macro_id}` | *(same)* | internal | — | all |
386
+ | analyze | `maestro-analyze {phase}` | `maestro-analyze` | internal | — | all |
387
+ | plan | `maestro-plan {phase}` *(scope=phase)* / `maestro-plan --from analyze:{analyze_macro_id}` *(scope=standalone)* / `maestro-plan --from blueprint:{blueprint_id}` *(scope=standalone)* | `maestro-plan` | internal | — | all |
388
+ | execute | `maestro-execute {phase}` | `maestro-execute` | internal | | all |
389
+ | verify | `maestro-verify {phase}` | `maestro-verify` | internal | `post-verify` | all |
390
+ | business-test | `quality-auto-test {phase}` | `quality-auto-test` | internal | `post-business-test` | full only |
391
+ | review | `quality-review {phase}` | `quality-review` | internal | `post-review` | all (quick: append `--tier quick`) |
392
+ | test-gen | `quality-auto-test {phase}` | `quality-auto-test` | internal | — | full / standard if coverage<80% |
393
+ | test | `quality-test {phase}` | `quality-test` | internal | `post-test` | full, standard |
394
+ | milestone-audit | `maestro-milestone-audit` | *(same)* | internal | | all |
395
+ | goal-audit | *(decision-only)* | *(same)* | decision | `post-goal-audit` | all (only if decomposed) |
396
+ | milestone-complete | `maestro-milestone-complete` | *(same)* | internal | `post-milestone` | all |
397
+
398
+ **Build rules (按顺序应用):**
399
+
400
+ 0. **planning_mode 选列**:`unified` Skill (unified) 列;`independent` Skill (independent)
401
+ 1. **起点**:从 `session.lifecycle_position` 开始
402
+ 2. **跳过已完成**:跳过当前 milestone+phase 下已有 completed artifact 的 stage(按 `session.phase` 过滤);unified 按 milestone 过滤
403
+ 3. **quality_mode 过滤**:按 `session.quality_mode` 排除不匹配 stage
404
+ 4. **决策节点**:每个 Decision after 非空的 stage 之后插入 `{ type: "decision", decision: "<gate>", retry_count: 0, max_retries: 2 }`
405
+ 5. **goal-audit 插入**:`task_decomposition` 存在时,在最后一个 evidence-producing stage(verify/review/test)之后、`milestone-complete` 之前插入 `decision:post-goal-audit`
406
+ 6. **终点硬约束**:chain 以 `milestone-complete` 结尾
407
+ 7. **goal_ref 传播**:`task_decomposition` 存在时,每个 step 按 `step.stage ∈ g.lifecycle` 匹配 `step.goal_ref = g.id`(多匹配取字典序最小);decision 节点不打 goal_ref
408
+ 8. **占位符**:independent 保留 `{phase}` `{intent}`;unified 不带 `{phase}`
409
+ 9. **command_path 解析**(每个非 decision step):
410
+ - 取 skill 名(args 前的第一个 token)
411
+ - 全局优先:`~/.claude/commands/{name}.md` 存在 → `command_scope = "global"`
412
+ - Fallback:`.claude/commands/{name}.md` 存在 → `command_scope = "project"`
413
+ - 两者都缺 → `command_scope = "missing"`, `command_path = null`,A_CREATE_SESSION 报错 E006
414
+ 10. **每个 step 初始化** `completion_confirmed: false`, `completion_status: null`, `completion_evidence: null`
415
+ 11. **scope_verdict gating**(仅当 chain 起点 = `analyze-macro`):
416
+ - `scope_verdict ∈ {medium, small}` → 跳过 `roadmap` + `analyze` 两 stage;`plan` 选 standalone 列(`--from analyze:{analyze_macro_id}`),不带 `{phase}`
417
+ - `scope_verdict == large` → 保留 `roadmap` + `analyze`;`plan` 选 phase 列(`{phase}`)
418
+ - `scope_verdict == unknown` → 默认 large 路径;由 `post-analyze-scope` 决策节点在 macro analyze 完成后纠正(A_APPLY_SCOPE_VERDICT)
419
+ 12. **--from 自动注入**:
420
+ - `analyze_macro_id` 存在且当前 step 是 `roadmap` → args 改为 `--from analyze:{analyze_macro_id}`
421
+ - `analyze_macro_id` 存在且 `scope_verdict ∈ {medium, small}` 且当前 step 是 `plan` → args 改为 `--from analyze:{analyze_macro_id}`
422
+ - `blueprint_id` 存在 → 当前 step 是 `plan` → args 改为 `--from blueprint:{blueprint_id}`(优先级低于 phase 数字参数)
423
+ - 写入 `step.source_artifact_ref` 以便审计
424
+ 13. **D-007 Milestone-ref 标注**:每个含 `{phase}` 占位符的 step → `step.milestone_id = session.milestone`(由 A_RESOLVE_PHASE 反查得出),禁止读 `current_milestone`
425
+ 14. **动态插入步骤**(A_APPLY_*)同样应用规则 7-13
269
426
 
270
427
  ### A_CREATE_SESSION
271
428
 
272
- 1. Write `.workflow/.maestro/ralph-{YYYYMMDD-HHmmss}/status.json` (see Appendix: Session Schema) include decomposition fields only if produced (additive)
273
- 2. If `task_decomposition` present: write `{session_dir}/goal-checklist.md` (see Appendix: Goal Checklist Template) — stable within session, referenced verbatim by `/goal`
274
- 3. Display chain overview with step list
275
- 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
429
+ 1. Validate: 所有 step `command_scope != "missing"`;否则 raise E006 + 列出缺失 skill
430
+ 2. Write `.workflow/.maestro/ralph-{YYYYMMDD-HHmmss}/status.json` (Appendix: Session Schema)
431
+ 3. Display chain overview:每步显示 `{index}. {skill} [{type}] [{command_scope}]`
432
+ 4. If `task_decomposition` present: display the **Goal Prompt block** (Appendix: Goal Prompt Template)
276
433
 
277
434
  ### A_DELEGATE_EVALUATE
278
435
 
@@ -306,28 +463,64 @@ Build rules: start from position, skip completed, insert decision nodes with `{
306
463
 
307
464
  ### A_STRUCTURAL_EVALUATE
308
465
 
309
- **post-milestone:** Read state.json → next milestone? → insert lifecycle steps / complete
466
+ **post-milestone:**
467
+ 1. Read state.json → resolve completed milestone object
468
+ 2. Determine milestone type: `milestone_obj.type` (default `"standard"` if missing)
469
+ 3. **Standard milestone** (`type != "adhoc"`): next milestone exists? → insert lifecycle steps / complete
470
+ 4. **Adhoc milestone** (`type == "adhoc"`): always END — adhoc milestones are self-contained, no successor to advance to. Set `current_milestone = null`.
471
+
310
472
  **post-debug-escalate:** Always STOP → set paused, display "请人工介入"
311
473
 
474
+ ### A_SCOPE_EVALUATE
475
+
476
+ 仅由 `post-analyze-scope` 决策节点触发;macro analyze 完成后读 `conclusions.json.scope_verdict` 决定下游链路。
477
+
478
+ 1. 定位刚完成的 macro analyze artifact → `analyze_macro_id`, `conclusions_path = {artifact_path}/conclusions.json`
479
+ 2. 读取 `conclusions.scope_verdict`(`large | medium | small`),缺失 → `unknown`
480
+ 3. 写入 `session.scope_verdict` + `session.analyze_macro_id`
481
+ 4. Append `{session_dir}/decisions.ndjson`:
482
+ ```json
483
+ { "id": "DEC-{timestamp}", "type": "scope-gate",
484
+ "source": "ralph", "node_id": "post-analyze-scope",
485
+ "verdict": "{scope_verdict}", "analyze_macro_id": "{ANL_ID}" }
486
+ ```
487
+ 5. → A_APPLY_SCOPE_VERDICT
488
+
312
489
  ### A_GOAL_AUDIT_EVALUATE
313
490
 
314
- Re-checks the goal-checklist and decides whether `steps[]` must dynamically grow. Only runs when `task_decomposition` present.
491
+ Runs only when `task_decomposition` present.
315
492
 
316
- 1. Read `session.task_decomposition` + `goal_checklist_path`
317
- 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
493
+ 1. Read `session.task_decomposition` from status.json
494
+ 2. For each sub-goal `status != "done"`: resolve `evidence` artifact under current phase scratch dir
318
495
  3. Delegate read-only audit (run_in_background, STOP, wait):
319
496
  ```
320
- maestro delegate "PURPOSE: 审计子目标达成情况,决定是否需要补充执行步骤
321
- TASK: 逐个读取每个未完成子目标的 evidence 产物 | 对照 done_when 判定 met/unmet | 给出每个 unmet 子目标的差距
322
- CONTEXT: @{goal_checklist_path} @{evidence artifacts} | 执行准则: {execution_criteria} | 边界: {boundary_contract}
323
- EXPECTED: ---VERDICT--- STATUS(all_met|has_unmet) / UNMET=[{id:G2,gap:'...',target_phase:execute}] / CONFIDENCE_SCORE(0-100) ---END---
324
- CONSTRAINTS: 只评估不修改 | 严格按 done_when 判定 | 不得超出 boundary_contract"
497
+ maestro delegate "PURPOSE: 审计未完成子目标,判定 met / unmet
498
+ TASK:
499
+ 1. 读取 status.json.task_decomposition status!=done 的子目标
500
+ 2. 打开 evidence 产物,对照 done_when 严格判定
501
+ 3. 输出 met / unmet,unmet 给出 gap + target_phase
502
+ CONTEXT:
503
+ status.json = {session_dir}/status.json
504
+ evidence = {evidence artifacts}
505
+ execution_criteria = {execution_criteria}
506
+ boundary_contract = {boundary_contract}
507
+ EXPECTED:
508
+ ---VERDICT---
509
+ STATUS=all_met|has_unmet
510
+ UNMET=[{id:G2,gap:'...',target_phase:execute}, ...]
511
+ CONFIDENCE_SCORE=0-100
512
+ ---END---
513
+ CONSTRAINTS:
514
+ - 只评估,不修改文件
515
+ - 严格按 done_when 判定;evidence 缺失 → unmet
516
+ - 不得建议超出 boundary_contract 的修改
517
+ "
325
518
  --role analyze --mode analysis
326
519
  ```
327
- 4. On callback: parse UNMET list. For each met sub-goal → set `task_decomposition[i].status="done"` + flip `[ ]→[x]` in goal-checklist.md
328
- 5. **Decision log**: append to `{session_dir}/decisions.ndjson` with `"type": "goal-gate"`, `unmet_count`, `unmet_ids`
520
+ 4. On callback: 对每个 met 子目标,set `task_decomposition[i].status="done"` + `completion_confirmed=true` + `completed_at=now`
521
+ 5. Append `{session_dir}/decisions.ndjson` with `"type": "goal-gate"`, `unmet_count`, `unmet_ids`
329
522
  6. Verdict: `all_met` → A_APPLY_GOAL_DONE; `has_unmet` → A_APPLY_GOAL_FIX
330
- GUARD: retry_count >= max_retries AND still unmet → A_APPLY_ESCALATE (insert quality-debug, hand to human)
523
+ GUARD: retry_count >= max_retries AND still unmet → A_APPLY_ESCALATE
331
524
 
332
525
  ### A_APPLY_PROCEED
333
526
 
@@ -345,22 +538,33 @@ Re-checks the goal-checklist and decides whether `steps[]` must dynamically grow
345
538
  1. Insert `[quality-debug "{gap_summary}", decision:post-debug-escalate]`
346
539
  2. Increment retry_count, reindex, write status.json
347
540
 
348
- ### A_APPLY_GOAL_FIX
541
+ ### A_APPLY_SCOPE_VERDICT
349
542
 
350
- **This is the dynamic step-growth core.** For every unmet sub-goal, inject scoped execution steps so `steps[]` grows toward convergence:
543
+ `post-analyze-scope` 触发,依据 `session.scope_verdict` 重塑下游链路。
351
544
 
352
- 1. For each `unmet` sub-goal `G{n}` (grouped by `target_phase` to avoid duplicate runs):
353
- 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}"`
354
- 2. Re-append a fresh `decision:post-goal-audit {retry+1}` after the inserted steps (re-loops until all met or max retries)
355
- 3. Reindex steps, increment retry_count, write status.json (steps[] now larger — the JSON "grew")
356
- 4. Display: Goal audit: {k} sub-goals unmet → +{N} steps inserted (G{ids}), retry {r}/{max}
545
+ 1. `session.scope_verdict`
546
+ 2. 路径 A(`large`):保持当前链;为后续 `roadmap` step 注入 `--from analyze:{analyze_macro_id}`;为后续 `plan` step phase 列;继续推进
547
+ 3. 路径 B(`medium` / `small`):
548
+ - 删除 `goal-audit` 之前所有未完成的 `roadmap` + `analyze` (phase) step
549
+ - 把下一个未完成的 `plan` step 改为 `maestro-plan --from analyze:{analyze_macro_id}`,去掉 `{phase}`,`source_artifact_ref = analyze:{analyze_macro_id}`
550
+ - 后续 `execute` / `verify` 等沿用同一 standalone scope(不带 `{phase}`,由 plan 写出的 task 列表驱动)
551
+ 4. 路径 C(`unknown`):
552
+ - 非 auto_confirm → AskUserQuestion 二选一(large / medium-small);auto_confirm → 默认 large
553
+ 5. Reindex steps,标 decision completed,write status.json
554
+ 6. Display: ◆ Scope verdict: {verdict} → {kept|collapsed to standalone via analyze:{ANL_ID}}
555
+
556
+ ### A_APPLY_GOAL_FIX
557
+
558
+ 1. 对每个 unmet 子目标 `G{n}`(按 `target_phase` 分组去重):在 `goal-audit` 节点前插入 scoped mini-loop(见 Appendix: Fix-Loop Templates → post-goal-audit),每条插入 step `goal_ref: "G{n}"`,按 A_BUILD_STEPS 规则 9 解析 `command_path`
559
+ 2. 重新追加 `decision:post-goal-audit {retry+1}`
560
+ 3. Reindex steps, increment retry_count, write status.json
561
+ 4. Display: ◆ Goal audit: {k} unmet → +{N} steps inserted (G{ids}), retry {r}/{max}
357
562
 
358
563
  ### A_APPLY_GOAL_DONE
359
564
 
360
- 1. Set all `task_decomposition[*].status="done"`, write status.json
361
- 2. Append `ALL_GOALS_DONE` sentinel line to goal-checklist.md (satisfies the user's `/goal` Stop hook)
362
- 3. Mark goal-audit decision completed; proceed to `milestone-complete`
363
- 4. Display: ◆ Goal audit: 全部子目标达成 ✓ — checklist 已写入 ALL_GOALS_DONE
565
+ 1. status.json: set 每个 `task_decomposition[*].status="done"`, `completion_confirmed=true`, `completed_at=now`,顶层 `task_decomposition_all_done=true`
566
+ 2. Mark goal-audit decision completed;proceed to `milestone-complete`
567
+ 3. Display: Goal audit: all met
364
568
 
365
569
  ### A_ADVANCE_MILESTONE
366
570
 
@@ -387,40 +591,62 @@ Re-checks the goal-checklist and decides whether `steps[]` must dynamically grow
387
591
  "session_id": "ralph-{YYYYMMDD-HHmmss}",
388
592
  "source": "ralph", "status": "running",
389
593
  "intent": "", "lifecycle_position": "",
390
- "phase": null, "milestone": "",
391
- "auto_mode": false, "quality_mode": "standard",
594
+ "phase": null, "phase_is_new": false,
595
+ "milestone": "", // D-007 反查结果,禁止读 current_milestone
596
+ "auto_mode": false,
597
+ "quality_mode": "standard", // "full" | "standard" | "quick"
598
+ "planning_mode": "independent", // "unified" | "independent"
599
+ "scope_verdict": null, // "large" | "medium" | "small" | "unknown" | null
600
+ "analyze_macro_id": null, // "ANL-xxx" 来自最新 macro analyze
601
+ "blueprint_id": null, // "BLP-xxx" 若存在
392
602
  "cli_tool": "claude", "passed_gates": [],
393
603
  "context": { "issue_id": null, "scratch_dir": null, "plan_dir": null,
394
- "analysis_dir": null, "brainstorm_dir": null },
395
- "steps": [{ "index": 0, "type": "internal|external|decision",
396
- "skill": "", "args": "", "status": "pending",
397
- "goal_ref": null }],
604
+ "analysis_dir": null, "brainstorm_dir": null, "blueprint_dir": null },
605
+ "steps": [{
606
+ "index": 0,
607
+ "type": "internal|external|decision",
608
+ "skill": "",
609
+ "args": "",
610
+ "stage": "", // brainstorm|blueprint|init|analyze-macro|roadmap|analyze|plan|execute|verify|...
611
+ "scope": null, // "phase"|"standalone"|"milestone"|null(plan 等需要)
612
+ "command_scope": "global|project|missing|null",
613
+ "command_path": "~/.claude/commands/{name}.md | .claude/commands/{name}.md | null",
614
+ "milestone_id": null, // D-007 反查注入;仅含 {phase} 占位符的 step 有
615
+ "source_artifact_ref": null, // "analyze:ANL-xxx" | "blueprint:BLP-xxx" | null
616
+ "status": "pending|running|completed|skipped|failed",
617
+ "goal_ref": null,
618
+ "completion_confirmed": false,
619
+ "completion_status": null,
620
+ "completion_evidence": null,
621
+ "completed_at": null
622
+ }],
398
623
  "waves": [], "current_step": 0,
399
624
 
400
- "_comment": "↓ OPTIONAL additive decomposition block (v0.4.8+). Absentno decomposition; readers MUST tolerate missing keys. Never remove/rename above fields.",
625
+ // Optional decomposition block (additive; absent → decomposition off)
401
626
  "boundary_contract": {
402
627
  "in_scope": [], "out_of_scope": [], "constraints": [], "definition_of_done": ""
403
628
  },
404
629
  "execution_criteria": [],
405
630
  "task_decomposition": [
406
631
  { "id": "G1", "goal": "", "boundary": "", "done_when": "",
407
- "evidence": "", "lifecycle": [], "status": "pending|done" }
632
+ "evidence": "", "lifecycle": [], "status": "pending|done",
633
+ "completion_confirmed": false, "completed_at": null }
408
634
  ],
409
- "goal_checklist_path": ""
635
+ "task_decomposition_all_done": false
410
636
  }
411
637
  ```
412
638
 
413
- > **Extensibility contract (two dimensions)**:
414
- > 1. **Schema-additive** — decomposition block fields are optional; absence = old behavior.
415
- > 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.
639
+ 新增字段可选,缺省=旧行为;既有字段名不删不改。
416
640
 
417
641
  ### Fix-Loop Templates
418
642
 
643
+ 所有插入 step 默认 `type: "internal"`,按 A_BUILD_STEPS 规则 9 解析 `command_path` + `command_scope`。
644
+
419
645
  **post-verify:**
420
646
  ```
421
647
  quality-debug "{gap_summary}"
422
648
  maestro-plan --gaps {phase}
423
- maestro-execute {phase} [external]
649
+ maestro-execute {phase}
424
650
  maestro-verify {phase}
425
651
  decision:post-verify {retry+1}
426
652
  ```
@@ -429,7 +655,7 @@ decision:post-verify {retry+1}
429
655
  ```
430
656
  quality-debug --from-business-test "{gap_summary}"
431
657
  maestro-plan --gaps {phase}
432
- maestro-execute {phase} [external]
658
+ maestro-execute {phase}
433
659
  maestro-verify {phase}
434
660
  decision:post-verify {retry: 0}
435
661
  quality-auto-test {phase}
@@ -440,7 +666,7 @@ decision:post-business-test {retry+1}
440
666
  ```
441
667
  quality-debug "{gap_summary}"
442
668
  maestro-plan --gaps {phase}
443
- maestro-execute {phase} [external]
669
+ maestro-execute {phase}
444
670
  quality-review {phase}
445
671
  decision:post-review {retry+1}
446
672
  ```
@@ -449,7 +675,7 @@ decision:post-review {retry+1}
449
675
  ```
450
676
  quality-debug --from-uat "{gap_summary}"
451
677
  maestro-plan --gaps {phase}
452
- maestro-execute {phase} [external]
678
+ maestro-execute {phase}
453
679
  maestro-verify {phase}
454
680
  decision:post-verify {retry: 0}
455
681
  quality-auto-test {phase}
@@ -461,59 +687,29 @@ quality-test {phase}
461
687
  decision:post-test {retry+1}
462
688
  ```
463
689
 
464
- **post-goal-audit:** (per unmet sub-goal group — this is what dynamically grows `steps[]`)
690
+ **post-goal-audit:** (per unmet sub-goal group)
465
691
  ```
466
- # for each unmet sub-goal G{n}, scoped to its target_phase:
692
+ # for each unmet sub-goal G{n}, scoped to target_phase:
467
693
  maestro-plan --gaps {target_phase} "G{n}: {gap}" [goal_ref: G{n}]
468
- maestro-execute {target_phase} [external] [goal_ref: G{n}]
469
- maestro-verify {target_phase} [goal_ref: G{n}]
470
- # after all unmet groups inserted, re-loop the audit:
694
+ maestro-execute {target_phase} [goal_ref: G{n}]
695
+ maestro-verify {target_phase} [goal_ref: G{n}]
696
+ # after all unmet groups inserted:
471
697
  decision:post-goal-audit {retry+1}
472
698
  ```
473
- 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.
474
-
475
- ### Goal Checklist Template
476
-
477
- Written to `{session_dir}/goal-checklist.md`. Stable within the session; never renamed (so the `/goal` condition string stays valid across context compaction).
478
-
479
- ```markdown
480
- # Ralph Goal Checklist — {session_id}
481
- > Intent: {intent}
482
-
483
- ## 执行准则 / Execution Criteria
484
- - {criterion 1}
485
- - {criterion 2}
486
-
487
- ## 边界契约 / Boundary Contract
488
- - In scope: {in_scope}
489
- - Out of scope: {out_of_scope}
490
- - Constraints: {constraints}
491
- - Definition of Done: {definition_of_done}
492
-
493
- ## 子目标 / Sub-goals
494
- - [ ] G1: {goal} — done when: {done_when} (evidence: {evidence})
495
- - [ ] G2: {goal} — done when: {done_when} (evidence: {evidence})
496
- - [ ] G3: ...
497
-
498
- <!-- ralph-execute flips [ ]→[x] when a sub-goal's evidence artifact confirms done;
499
- appends the line `ALL_GOALS_DONE` once every box is [x]. -->
500
- ```
501
-
502
- `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).
503
699
 
504
700
  ### Goal Prompt Template
505
701
 
506
- Displayed verbatim after the chain overview (only when decomposition produced):
702
+ 链路概览后逐字显示(仅当 decomposition 已产出):
507
703
 
508
704
  ```
509
- 📋 任务分解完成。可选(推荐):复制下面一行设定目标,让会话在所有子目标达成前不停:
705
+ 📋 任务分解完成。复制下面一行设定目标,会话在子目标全部达成前不停:
510
706
 
511
- /goal {session_dir}/goal-checklist.md 中所有子目标复选框均为 [x] 且文件含 ALL_GOALS_DONE 哨兵时目标达成;否则依据文件内"执行准则"继续推进未完成子目标,不得超出边界契约范围
707
+ /goal 目标达成条件: {session_dir}/status.json task_decomposition[*].status == "done" 且 task_decomposition[*].completion_confirmed == true 且 steps[*].completion_confirmed == true。未达成时:阅读 {session_dir}/status.json 取得 execution_criteria / boundary_contract / task_decomposition / steps 作为行动手册,调用 /maestro-ralph continue 推进;严禁手动执行 skill 或越界修改 status.json.boundary_contract.out_of_scope。
512
708
 
513
- 然后运行 /maestro-ralph continue 开始执行。
709
+ 随后运行 /maestro-ralph continue 立即开始执行。
514
710
  ```
515
711
 
516
- > `/goal` 是 harness 命令、仅用户可输入 — ralph 只输出此提示词,不能自行注册。这与 status.json 的可扩展约定一致:绑定是用户侧、可选的增量能力。
712
+ `/goal` 由用户输入;ralph 只输出此提示词。判据以 status.json 为权威。
517
713
 
518
714
  ### Error Codes
519
715
 
@@ -524,6 +720,7 @@ Displayed verbatim after the chain overview (only when decomposition produced):
524
720
  | E003 | error | Artifact dir not found for decision | Show glob, ask |
525
721
  | E004 | error | Delegate verdict parse failed | Fallback: "fix" |
526
722
  | E005 | error | Delegate execution failed | Fallback: "fix" |
723
+ | E006 | error | command_scope == "missing" for one or more steps | List missing skills, abort build |
527
724
  | W001 | warning | Decision expanded chain | Auto-handled |
528
725
  | W002 | warning | Max retries, escalating | Auto-handled |
529
726
  | W003 | warning | Multiple running sessions | Use latest, warn |
@@ -531,18 +728,27 @@ Displayed verbatim after the chain overview (only when decomposition produced):
531
728
 
532
729
  ### Success Criteria
533
730
 
534
- - [ ] State parsed, position inferred from bootstrap + artifacts + result files
535
- - [ ] Decomposition runs as initial step; broad intent boundary-clarified via ≤3 questions (ignores auto_confirm); narrow auto-derives
536
- - [ ] status.json enriched additively with boundary_contract + execution_criteria + task_decomposition; absent fields = old behavior preserved
537
- - [ ] goal-checklist.md generated with verifiable done_when mapped to ralph evidence + ALL_GOALS_DONE sentinel
538
- - [ ] Goal Prompt emitted for user to bind via /goal
539
- - [ ] post-goal-audit decision node inserted before milestone-complete (only when decomposed)
540
- - [ ] Unmet sub-goals DYNAMICALLY grow steps[] via scoped per-goal mini-loops (goal_ref tagged), looping until all_met or max retries → escalate
541
- - [ ] Quality pipeline generated: verify business-test review test-gen → test
542
- - [ ] Decision nodes delegate-evaluated via maestro delegate --role analyze
543
- - [ ] Verdict parsed with confidence adjustment
544
- - [ ] Fix-loop templates applied with retry tracking
545
- - [ ] Ralph never executes steps only creates sessions and evaluates decisions
546
- - [ ] Handoff to maestro-ralph-execute via Skill() at creation and after decisions
731
+ - [ ] Phase 先于 position 解析;phase_is_new 标记写入 session
732
+ - [ ] D-007 反查:phase 数字 `session.milestone`,禁止读 current_milestone;写入 step.milestone_id
733
+ - [ ] phase_is_new=true lifecycle_position 强制 `analyze`
734
+ - [ ] Intent overrides 识别 brainstorm / blueprint / analyze-macro
735
+ - [ ] A_RESOLVE_SCOPE_VERDICT macro analyze conclusions.scope_verdict,写入 session.scope_verdict + analyze_macro_id
736
+ - [ ] 链路起点 = analyze-macro 时:large→roadmap+analyze+plan(phase);medium/small→直跳 plan --from analyze:{ANL_ID}(跳过 roadmap+analyze)
737
+ - [ ] post-analyze-scope decision 节点在 macro analyze 之后插入;A_SCOPE_EVALUATE/A_APPLY_SCOPE_VERDICT 重塑链路
738
+ - [ ] plan step args 支持三路径:`{phase}` / `--from analyze:{ANL_ID}` / `--from blueprint:{BLP_ID}`,写入 step.source_artifact_ref
739
+ - [ ] roadmap step args 自动注入 `--from analyze:{analyze_macro_id}`(若存在)
740
+ - [ ] artifact 过滤按 session.phase;unified milestone
741
+ - [ ] quality_mode A_DETERMINE_QUALITY_MODE 决定,过滤 build steps
742
+ - [ ] Decomposition: broad intent ≤3 question clarify;narrow auto-derive
743
+ - [ ] status.json 唯一真源:boundary_contract + execution_criteria + task_decomposition;无外部清单
744
+ - [ ] 每个 step 默认 `type: "internal"`,含 `command_scope` + `command_path`(全局优先 fallback 项目)
745
+ - [ ] 每个 step 含 `completion_confirmed` + `completion_status` + `completion_evidence`(初始 false/null)
746
+ - [ ] 每个 sub-goal 含 `completion_confirmed`(初始 false)
747
+ - [ ] post-goal-audit decision 仅在 decomposed 时插入,位于 milestone-complete 之前
748
+ - [ ] Unmet sub-goals 动态 grow steps[](goal_ref tagged);max retries → escalate
749
+ - [ ] planning_mode 显式决定;unified=无 `{phase}`, independent=带 `{phase}`
750
+ - [ ] Chain 必须以 `milestone-complete` 结尾
751
+ - [ ] Decision nodes 由 maestro delegate --role analyze 评估
752
+ - [ ] Ralph 不执行 step,只 evaluate;Skill("maestro-ralph-execute") handoff
547
753
 
548
754
  </appendix>