maestro-flow 0.4.10 → 0.4.11

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 (226) hide show
  1. package/.agents/agents/cli-explore-agent.md +189 -0
  2. package/.agents/agents/conceptual-planning-agent.md +247 -0
  3. package/.agents/agents/impeccable-agent.md +101 -0
  4. package/.agents/agents/team-supervisor.md +145 -0
  5. package/.agents/agents/team-worker.md +239 -0
  6. package/.agents/agents/ui-design-agent.md +289 -0
  7. package/.agents/agents/workflow-analyzer.md +117 -0
  8. package/.agents/agents/workflow-codebase-mapper.md +79 -0
  9. package/.agents/agents/workflow-collab-planner.md +145 -0
  10. package/.agents/agents/workflow-debugger.md +105 -0
  11. package/.agents/agents/workflow-executor.md +134 -0
  12. package/.agents/agents/workflow-external-researcher.md +88 -0
  13. package/.agents/agents/workflow-integration-checker.md +85 -0
  14. package/.agents/agents/workflow-nyquist-auditor.md +87 -0
  15. package/.agents/agents/workflow-phase-researcher.md +87 -0
  16. package/.agents/agents/workflow-plan-checker.md +92 -0
  17. package/.agents/agents/workflow-planner.md +197 -0
  18. package/.agents/agents/workflow-project-researcher.md +76 -0
  19. package/.agents/agents/workflow-research-synthesizer.md +72 -0
  20. package/.agents/agents/workflow-reviewer.md +84 -0
  21. package/.agents/agents/workflow-roadmapper.md +83 -0
  22. package/.agents/agents/workflow-verifier.md +122 -0
  23. package/.agents/skills/codify-to-knowhow/SKILL.md +169 -0
  24. package/.agents/skills/codify-to-knowhow/phases/01-load-manifest.md +101 -0
  25. package/.agents/skills/codify-to-knowhow/phases/02-generate-knowhow.md +97 -0
  26. package/.agents/skills/codify-to-knowhow/phases/03-generate-specs.md +92 -0
  27. package/.agents/skills/codify-to-knowhow/phases/04-index-verify.md +119 -0
  28. package/.agents/skills/learn-decompose/SKILL.md +118 -0
  29. package/.agents/skills/learn-follow/SKILL.md +129 -0
  30. package/.agents/skills/learn-investigate/SKILL.md +154 -0
  31. package/.agents/skills/learn-retro/SKILL.md +159 -0
  32. package/.agents/skills/learn-second-opinion/SKILL.md +124 -0
  33. package/.agents/skills/maestro/SKILL.md +224 -0
  34. package/.agents/skills/maestro-amend/SKILL.md +165 -0
  35. package/.agents/skills/maestro-analyze/SKILL.md +135 -0
  36. package/.agents/skills/maestro-brainstorm/SKILL.md +118 -0
  37. package/.agents/skills/maestro-collab/SKILL.md +174 -0
  38. package/.agents/skills/maestro-composer/SKILL.md +181 -0
  39. package/.agents/skills/maestro-execute/SKILL.md +133 -0
  40. package/.agents/skills/maestro-fork/SKILL.md +88 -0
  41. package/.agents/skills/maestro-guard/SKILL.md +103 -0
  42. package/.agents/skills/maestro-help/SKILL.md +266 -0
  43. package/.agents/skills/maestro-help/index/catalog.json +184 -0
  44. package/.agents/skills/maestro-help/phases/01-parse-intent.md +122 -0
  45. package/.agents/skills/maestro-help/phases/02-search-present.md +181 -0
  46. package/.agents/skills/maestro-help/phases/03-workflow-guide.md +186 -0
  47. package/.agents/skills/maestro-impeccable/SKILL.md +251 -0
  48. package/.agents/skills/maestro-init/SKILL.md +80 -0
  49. package/.agents/skills/maestro-learn/SKILL.md +142 -0
  50. package/.agents/skills/maestro-merge/SKILL.md +66 -0
  51. package/.agents/skills/maestro-milestone-audit/SKILL.md +70 -0
  52. package/.agents/skills/maestro-milestone-complete/SKILL.md +77 -0
  53. package/.agents/skills/maestro-milestone-release/SKILL.md +98 -0
  54. package/.agents/skills/maestro-overlay/SKILL.md +180 -0
  55. package/.agents/skills/maestro-plan/SKILL.md +172 -0
  56. package/.agents/skills/maestro-player/SKILL.md +177 -0
  57. package/.agents/skills/maestro-quick/SKILL.md +67 -0
  58. package/.agents/skills/maestro-ralph/SKILL.md +685 -0
  59. package/.agents/skills/maestro-ralph-execute/SKILL.md +259 -0
  60. package/.agents/skills/maestro-roadmap/SKILL.md +170 -0
  61. package/.agents/skills/maestro-tools-execute/SKILL.md +119 -0
  62. package/.agents/skills/maestro-tools-register/SKILL.md +159 -0
  63. package/.agents/skills/maestro-ui-codify/SKILL.md +82 -0
  64. package/.agents/skills/maestro-update/SKILL.md +178 -0
  65. package/.agents/skills/maestro-verify/SKILL.md +111 -0
  66. package/.agents/skills/manage-codebase-rebuild/SKILL.md +77 -0
  67. package/.agents/skills/manage-codebase-refresh/SKILL.md +59 -0
  68. package/.agents/skills/manage-harvest/SKILL.md +96 -0
  69. package/.agents/skills/manage-issue/SKILL.md +75 -0
  70. package/.agents/skills/manage-issue-discover/SKILL.md +83 -0
  71. package/.agents/skills/manage-knowhow/SKILL.md +79 -0
  72. package/.agents/skills/manage-knowhow-capture/SKILL.md +81 -0
  73. package/.agents/skills/manage-learn/SKILL.md +67 -0
  74. package/.agents/skills/manage-status/SKILL.md +54 -0
  75. package/.agents/skills/manage-wiki/SKILL.md +64 -0
  76. package/.agents/skills/quality-auto-test/SKILL.md +138 -0
  77. package/.agents/skills/quality-debug/SKILL.md +122 -0
  78. package/.agents/skills/quality-refactor/SKILL.md +69 -0
  79. package/.agents/skills/quality-retrospective/SKILL.md +79 -0
  80. package/.agents/skills/quality-review/SKILL.md +130 -0
  81. package/.agents/skills/quality-sync/SKILL.md +53 -0
  82. package/.agents/skills/quality-test/SKILL.md +119 -0
  83. package/.agents/skills/security-audit/SKILL.md +157 -0
  84. package/.agents/skills/skill-iter-tune/SKILL.md +384 -0
  85. package/.agents/skills/skill-iter-tune/phases/01-setup.md +144 -0
  86. package/.agents/skills/skill-iter-tune/phases/02-execute.md +292 -0
  87. package/.agents/skills/skill-iter-tune/phases/03-evaluate.md +312 -0
  88. package/.agents/skills/skill-iter-tune/phases/04-improve.md +186 -0
  89. package/.agents/skills/skill-iter-tune/phases/05-report.md +166 -0
  90. package/.agents/skills/skill-iter-tune/specs/evaluation-criteria.md +63 -0
  91. package/.agents/skills/skill-iter-tune/templates/eval-prompt.md +134 -0
  92. package/.agents/skills/skill-iter-tune/templates/execute-prompt.md +97 -0
  93. package/.agents/skills/spec-add/SKILL.md +70 -0
  94. package/.agents/skills/spec-load/SKILL.md +73 -0
  95. package/.agents/skills/spec-remove/SKILL.md +53 -0
  96. package/.agents/skills/spec-setup/SKILL.md +50 -0
  97. package/.agents/skills/team-coordinate/SKILL.md +268 -0
  98. package/.agents/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +247 -0
  99. package/.agents/skills/team-coordinate/roles/coordinator/commands/dispatch.md +131 -0
  100. package/.agents/skills/team-coordinate/roles/coordinator/commands/monitor.md +358 -0
  101. package/.agents/skills/team-coordinate/roles/coordinator/role.md +365 -0
  102. package/.agents/skills/team-coordinate/specs/knowledge-transfer.md +111 -0
  103. package/.agents/skills/team-coordinate/specs/pipelines.md +97 -0
  104. package/.agents/skills/team-coordinate/specs/quality-gates.md +112 -0
  105. package/.agents/skills/team-coordinate/specs/role-spec-template.md +198 -0
  106. package/.agents/skills/team-executor/SKILL.md +191 -0
  107. package/.agents/skills/team-executor/roles/executor/commands/monitor.md +239 -0
  108. package/.agents/skills/team-executor/roles/executor/role.md +171 -0
  109. package/.agents/skills/team-executor/specs/session-schema.md +264 -0
  110. package/.agents/skills/team-lifecycle-v4/SKILL.md +211 -0
  111. package/.agents/skills/team-lifecycle-v4/roles/analyst/role.md +96 -0
  112. package/.agents/skills/team-lifecycle-v4/roles/coordinator/commands/analyze.md +56 -0
  113. package/.agents/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +56 -0
  114. package/.agents/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +206 -0
  115. package/.agents/skills/team-lifecycle-v4/roles/coordinator/role.md +130 -0
  116. package/.agents/skills/team-lifecycle-v4/roles/executor/commands/fix.md +35 -0
  117. package/.agents/skills/team-lifecycle-v4/roles/executor/commands/implement.md +62 -0
  118. package/.agents/skills/team-lifecycle-v4/roles/executor/role.md +69 -0
  119. package/.agents/skills/team-lifecycle-v4/roles/planner/role.md +87 -0
  120. package/.agents/skills/team-lifecycle-v4/roles/reviewer/commands/review-code.md +34 -0
  121. package/.agents/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +44 -0
  122. package/.agents/skills/team-lifecycle-v4/roles/reviewer/role.md +71 -0
  123. package/.agents/skills/team-lifecycle-v4/roles/supervisor/role.md +194 -0
  124. package/.agents/skills/team-lifecycle-v4/roles/tester/role.md +89 -0
  125. package/.agents/skills/team-lifecycle-v4/roles/writer/role.md +97 -0
  126. package/.agents/skills/team-lifecycle-v4/specs/knowledge-transfer.md +114 -0
  127. package/.agents/skills/team-lifecycle-v4/specs/pipelines.md +140 -0
  128. package/.agents/skills/team-lifecycle-v4/specs/quality-gates.md +130 -0
  129. package/.agents/skills/team-lifecycle-v4/templates/architecture.md +254 -0
  130. package/.agents/skills/team-lifecycle-v4/templates/epics.md +196 -0
  131. package/.agents/skills/team-lifecycle-v4/templates/product-brief.md +133 -0
  132. package/.agents/skills/team-lifecycle-v4/templates/requirements.md +224 -0
  133. package/.agents/skills/team-quality-assurance/SKILL.md +149 -0
  134. package/.agents/skills/team-quality-assurance/roles/analyst/role.md +90 -0
  135. package/.agents/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +72 -0
  136. package/.agents/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +111 -0
  137. package/.agents/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +250 -0
  138. package/.agents/skills/team-quality-assurance/roles/coordinator/role.md +143 -0
  139. package/.agents/skills/team-quality-assurance/roles/executor/role.md +68 -0
  140. package/.agents/skills/team-quality-assurance/roles/generator/role.md +70 -0
  141. package/.agents/skills/team-quality-assurance/roles/scout/role.md +77 -0
  142. package/.agents/skills/team-quality-assurance/roles/strategist/role.md +73 -0
  143. package/.agents/skills/team-quality-assurance/specs/pipelines.md +115 -0
  144. package/.agents/skills/team-quality-assurance/specs/team-config.json +131 -0
  145. package/.agents/skills/team-review/SKILL.md +149 -0
  146. package/.agents/skills/team-review/roles/coordinator/commands/analyze.md +71 -0
  147. package/.agents/skills/team-review/roles/coordinator/commands/dispatch.md +91 -0
  148. package/.agents/skills/team-review/roles/coordinator/commands/monitor.md +224 -0
  149. package/.agents/skills/team-review/roles/coordinator/role.md +132 -0
  150. package/.agents/skills/team-review/roles/fixer/role.md +78 -0
  151. package/.agents/skills/team-review/roles/reviewer/role.md +70 -0
  152. package/.agents/skills/team-review/roles/scanner/role.md +81 -0
  153. package/.agents/skills/team-review/specs/dimensions.md +82 -0
  154. package/.agents/skills/team-review/specs/finding-schema.json +82 -0
  155. package/.agents/skills/team-review/specs/pipelines.md +102 -0
  156. package/.agents/skills/team-review/specs/team-config.json +27 -0
  157. package/.agents/skills/team-tech-debt/SKILL.md +130 -0
  158. package/.agents/skills/team-tech-debt/roles/assessor/role.md +79 -0
  159. package/.agents/skills/team-tech-debt/roles/coordinator/commands/analyze.md +47 -0
  160. package/.agents/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +156 -0
  161. package/.agents/skills/team-tech-debt/roles/coordinator/commands/monitor.md +209 -0
  162. package/.agents/skills/team-tech-debt/roles/coordinator/role.md +123 -0
  163. package/.agents/skills/team-tech-debt/roles/executor/role.md +78 -0
  164. package/.agents/skills/team-tech-debt/roles/planner/role.md +71 -0
  165. package/.agents/skills/team-tech-debt/roles/scanner/role.md +92 -0
  166. package/.agents/skills/team-tech-debt/roles/validator/role.md +80 -0
  167. package/.agents/skills/team-tech-debt/specs/pipelines.md +47 -0
  168. package/.agents/skills/team-tech-debt/specs/team-config.json +129 -0
  169. package/.agents/skills/team-testing/SKILL.md +145 -0
  170. package/.agents/skills/team-testing/roles/analyst/role.md +105 -0
  171. package/.agents/skills/team-testing/roles/coordinator/commands/analyze.md +70 -0
  172. package/.agents/skills/team-testing/roles/coordinator/commands/dispatch.md +108 -0
  173. package/.agents/skills/team-testing/roles/coordinator/commands/monitor.md +257 -0
  174. package/.agents/skills/team-testing/roles/coordinator/role.md +134 -0
  175. package/.agents/skills/team-testing/roles/executor/role.md +101 -0
  176. package/.agents/skills/team-testing/roles/generator/role.md +100 -0
  177. package/.agents/skills/team-testing/roles/strategist/role.md +85 -0
  178. package/.agents/skills/team-testing/specs/pipelines.md +101 -0
  179. package/.agents/skills/team-testing/specs/team-config.json +93 -0
  180. package/.agents/skills/wiki-connect/SKILL.md +64 -0
  181. package/.agents/skills/wiki-digest/SKILL.md +70 -0
  182. package/.agents/skills/workflow-skill-designer/SKILL.md +498 -0
  183. package/.agents/skills/workflow-skill-designer/phases/01-requirements-analysis.md +356 -0
  184. package/.agents/skills/workflow-skill-designer/phases/02-orchestrator-design.md +444 -0
  185. package/.agents/skills/workflow-skill-designer/phases/03-phase-design.md +458 -0
  186. package/.agents/skills/workflow-skill-designer/phases/04-validation.md +471 -0
  187. package/.agy/skills/maestro/SKILL.md +13 -11
  188. package/.agy/skills/maestro-ralph/SKILL.md +222 -87
  189. package/.claude/commands/maestro-ralph.md +222 -87
  190. package/.claude/commands/maestro.md +13 -11
  191. package/.codex/skills/maestro/SKILL.md +23 -17
  192. package/.codex/skills/maestro-ralph/SKILL.md +177 -67
  193. package/dist/src/commands/install-backend.d.ts +12 -0
  194. package/dist/src/commands/install-backend.d.ts.map +1 -1
  195. package/dist/src/commands/install-backend.js +144 -0
  196. package/dist/src/commands/install-backend.js.map +1 -1
  197. package/dist/src/core/component-defs.d.ts +6 -0
  198. package/dist/src/core/component-defs.d.ts.map +1 -1
  199. package/dist/src/core/component-defs.js +97 -0
  200. package/dist/src/core/component-defs.js.map +1 -1
  201. package/dist/src/tui/install-ui/ExtraMcpConfig.d.ts +11 -0
  202. package/dist/src/tui/install-ui/ExtraMcpConfig.d.ts.map +1 -0
  203. package/dist/src/tui/install-ui/ExtraMcpConfig.js +61 -0
  204. package/dist/src/tui/install-ui/ExtraMcpConfig.js.map +1 -0
  205. package/dist/src/tui/install-ui/InstallConfirm.d.ts +3 -0
  206. package/dist/src/tui/install-ui/InstallConfirm.d.ts.map +1 -1
  207. package/dist/src/tui/install-ui/InstallConfirm.js +1 -1
  208. package/dist/src/tui/install-ui/InstallConfirm.js.map +1 -1
  209. package/dist/src/tui/install-ui/InstallExecution.d.ts +2 -0
  210. package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
  211. package/dist/src/tui/install-ui/InstallExecution.js +14 -2
  212. package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
  213. package/dist/src/tui/install-ui/InstallFlow.d.ts +1 -1
  214. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
  215. package/dist/src/tui/install-ui/InstallFlow.js +16 -3
  216. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
  217. package/dist/src/tui/install-ui/InstallHub.d.ts +2 -0
  218. package/dist/src/tui/install-ui/InstallHub.d.ts.map +1 -1
  219. package/dist/src/tui/install-ui/InstallHub.js +8 -0
  220. package/dist/src/tui/install-ui/InstallHub.js.map +1 -1
  221. package/dist/src/tui/install-ui/InstallResult.d.ts.map +1 -1
  222. package/dist/src/tui/install-ui/InstallResult.js +3 -1
  223. package/dist/src/tui/install-ui/InstallResult.js.map +1 -1
  224. package/dist/src/utils/update-notices.js +19 -0
  225. package/dist/src/utils/update-notices.js.map +1 -1
  226. package/package.json +5 -2
@@ -19,7 +19,7 @@ Entry points:
19
19
  - **`/maestro-ralph continue`** — Resume via maestro-ralph-execute
20
20
  - **`/maestro-ralph status`** — Display session progress
21
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.
22
+ Initial decomposition (S_DECOMPOSE): broad intents (重构/全面/迁移/重写) are boundary-clarified via ≤3 questions, producing 执行准则 + 子目标清单 written into status.json, plus a `goal-checklist.md` (a rendered view of status.json) and a copy-paste `/goal` prompt for the user to bind.
23
23
 
24
24
  Three node types:
25
25
  - **internal**: `Skill()` call (synchronous, lightweight)
@@ -32,6 +32,24 @@ Key difference from maestro coordinator:
32
32
 
33
33
  Session: `.workflow/.maestro/ralph-{YYYYMMDD-HHmmss}/status.json`
34
34
  Mutual invocation with `/maestro-ralph-execute` forms a self-perpetuating work loop.
35
+
36
+ ### 执行方式 / Execution Flow
37
+
38
+ ```
39
+ /maestro-ralph "intent" ─▶ ralph infer → decompose → build chain
40
+ │ writes status.json (truth)
41
+ │ renders goal-checklist.md (view)
42
+ │ emits /goal prompt
43
+
44
+ ralph-execute ◀─┐ runs next step:
45
+ │ │ internal → Skill()
46
+ │ │ external → delegate (STOP→callback)
47
+ │ │ decision → Skill("maestro-ralph")
48
+ └─────────┘ updates status.json + re-renders checklist
49
+ loop until done | paused
50
+ ```
51
+
52
+ `status.json` 是唯一真源;checklist 是渲染视图。决策节点是链路生长点(`post-goal-audit` 插入按子目标的 mini-loop;`post-verify/review/test` 插入修复 loop)。评估只走 ralph,执行只走 ralph-execute,两者不互相替代。
35
53
  </purpose>
36
54
 
37
55
  <context>
@@ -66,8 +84,9 @@ Remaining → intent
66
84
  S_PARSE_ROUTE — 解析参数、路由入口 PERSIST: —
67
85
  S_STATUS — 显示 session 进度 PERSIST: —
68
86
  S_CONTINUE — 恢复执行 PERSIST: —
69
- S_INFER state.json、推断生命周期位置 PERSIST: session.lifecycle_position
70
- S_RESOLVE_PHASE 解析目标 phase PERSIST: session.phase
87
+ S_RESOLVE_PHASE 解析目标 phase + 标记 phase_is_new PERSIST: session.phase, session.phase_is_new
88
+ S_INFER 基于已解析 phase 推断 lifecycle_position PERSIST: session.lifecycle_position
89
+ S_QUALITY_MODE — 决定质量管线模式 PERSIST: session.quality_mode
71
90
  S_DECOMPOSE — 边界澄清、写执行准则+子目标清单 PERSIST: session.boundary_contract, .execution_criteria, .task_decomposition
72
91
  S_BUILD_CHAIN — 构建步骤链 PERSIST: session.steps[]
73
92
  S_CREATE_SESSION — 写 status.json PERSIST: session (全量)
@@ -84,7 +103,7 @@ S_PARSE_ROUTE:
84
103
  → S_STATUS WHEN: intent == "status"
85
104
  → S_CONTINUE WHEN: intent == "continue"
86
105
  → S_DECISION_EVAL WHEN: running session with decision step in "running" status
87
- S_INFER WHEN: intent is non-empty
106
+ S_RESOLVE_PHASE WHEN: intent is non-empty ← phase 必须先于 position
88
107
  → S_FALLBACK WHEN: no intent AND no running session
89
108
 
90
109
  S_STATUS:
@@ -94,15 +113,18 @@ S_CONTINUE:
94
113
  → S_DISPATCH WHEN: running session found
95
114
  → S_FALLBACK WHEN: no running session DO: display "无运行中的 ralph 会话"
96
115
 
97
- S_INFER:
98
- → S_RESOLVE_PHASE WHEN: position resolved DO: A_INFER_POSITION
99
- → S_FALLBACK WHEN: cannot infer
100
-
101
116
  S_RESOLVE_PHASE:
102
- S_DECOMPOSE WHEN: phase resolved or null DO: A_RESOLVE_PHASE
117
+ S_INFER WHEN: phase resolved or null DO: A_RESOLVE_PHASE
103
118
  → S_FALLBACK WHEN: ambiguous
104
119
  GUARD: auto_confirm does NOT skip phase ambiguity
105
120
 
121
+ S_INFER:
122
+ → S_QUALITY_MODE WHEN: position resolved DO: A_INFER_POSITION
123
+ → S_FALLBACK WHEN: cannot infer
124
+
125
+ S_QUALITY_MODE:
126
+ → S_DECOMPOSE DO: A_DETERMINE_QUALITY_MODE
127
+
106
128
  S_DECOMPOSE:
107
129
  → S_BUILD_CHAIN DO: A_DECOMPOSE_TASKS
108
130
  GUARD: broad intent (重构/全面/重写/迁移/overhaul/migrate/rewrite) → MUST clarify boundary even if auto_confirm
@@ -160,7 +182,36 @@ S_FALLBACK:
160
182
  1. Find latest ralph session (by created_at)
161
183
  2. Display: Session, Status, Position, Progress, Current step
162
184
  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)
185
+ 4. If `task_decomposition` present (graceful skip if absent — backward compat):
186
+ ```
187
+ Sub-goals ({done}/{total}) source: {session_dir}/status.json#/task_decomposition
188
+ [x] G1 done_when={done_when} evidence={evidence}
189
+ [ ] G2 done_when={done_when} evidence={evidence} ◀ unmet
190
+ ...
191
+ Checklist view: {session_dir}/goal-checklist.md (regenerated from status.json)
192
+ ```
193
+ Reads state directly from `status.json.task_decomposition[*].status` — checklist is just a view, status.json wins on conflict.
194
+
195
+ ### A_RESOLVE_PHASE
196
+
197
+ **前置于 A_INFER_POSITION**——position 推断需要先知道 target phase 是否在 state.json 中已存在。
198
+
199
+ **Priority (产出 `phase` + `phase_is_new` 二元组):**
200
+
201
+ | Step | 行为 | phase_is_new |
202
+ |------|------|--------------|
203
+ | 1 | intent 匹配 `phase\s*(\d+)` 正则 → 取 state.json 中对应 phase | false |
204
+ | 2 | intent 派生短语(如 "docs-site-redesign", "auth-refactor")→ 在 state.json.milestones[*].phases / artifacts[*].path 中查找 | false (匹配) / true (无匹配) |
205
+ | 3 | 未派生 → 取最新 in-progress artifact 的 phase | false |
206
+ | 4 | 仍无 → state.json 首个 incomplete phase | false |
207
+ | 5 | position 将是 brainstorm/init/roadmap → phase = null | n/a |
208
+ | 6 | 仍模糊 → `ask_question`(新 phase / 已存在 phase 二选一) | 由用户回答确定 |
209
+
210
+ **写入 session**: `phase`(字符串或 null)+ `phase_is_new`(bool)。`phase_is_new=true` 表示当前 milestone 下需要为这个 phase 创建全套生命周期(A_INFER_POSITION 据此强制起始位置)。
211
+
212
+ **新派生 phase 时 milestone 处理**:
213
+ - 若 state.json 当前 milestone 仍 active → 沿用当前 milestone,仅新增 phase
214
+ - 若 intent 同时派生了新 milestone 名(如 "M1-visual-replication")→ 写入 session 但**仅作标签**;state.json.milestones 由后续 `maestro-roadmap` / `maestro-milestone-release` 真实创建。session 层面禁止虚构 milestone 直接改 state.json
164
215
 
165
216
  ### A_INFER_POSITION
166
217
 
@@ -173,18 +224,22 @@ S_FALLBACK:
173
224
  | No `.workflow/` + no source files | `brainstorm` |
174
225
  | No `.workflow/` + has source files | `init` |
175
226
  | Has `.workflow/` but no state.json | `init` |
176
- | Has state.json | → artifact-based inference |
227
+ | Has state.json | → phase-aware artifact inference |
177
228
 
178
- **Artifact-based inference:** Filter by current_milestone + target phase:
229
+ **Phase-aware artifact inference** (使用 A_RESOLVE_PHASE 已写入的 `session.phase` + `session.phase_is_new`):
179
230
 
180
- | Latest artifact type | Position |
181
- |---------------------|----------|
231
+ | Condition | Position |
232
+ |-----------|----------|
233
+ | `phase_is_new == true` (intent 派生的新 phase, state.json 中无) | **`analyze`** (强制从头起) |
182
234
  | 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 |
235
+ | `phase == null` (brainstorm/init/roadmap 已由 override 决定) | n/a |
236
+ | phase 已存在 + 无任何 artifact | `analyze` |
237
+ | phase 已存在 + 最新 artifact = analyze | `plan` |
238
+ | phase 已存在 + 最新 artifact = plan | `execute` |
239
+ | phase 已存在 + 最新 artifact = execute | `verify` |
240
+ | phase 已存在 + 最新 artifact = verify | → refine from result files |
241
+
242
+ **关键不变量**:artifact 过滤必须用 `session.phase`(A_RESOLVE_PHASE 已写入),而不是 state.json.current_phase。当 `phase_is_new` 时跳过过滤直接走 `analyze`,避免错用其他 phase 的 artifact 推断。
188
243
 
189
244
  **Refine from verify results:**
190
245
 
@@ -197,9 +252,17 @@ S_FALLBACK:
197
252
  | uat.md: all passed | `milestone-audit` |
198
253
  | uat.md: has failures | `test-failed` |
199
254
 
200
- ### A_RESOLVE_PHASE
255
+ ### A_DETERMINE_QUALITY_MODE
201
256
 
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
257
+ 决定下游质量管线长度。读 `session.quality_mode_override`(CLI 标志 `--quality`),无则按规则推断:
258
+
259
+ | Condition | Mode | Pipeline (verify 之后) |
260
+ |-----------|------|-------------------------|
261
+ | Has `specs/REQ-*.md` + 当前 phase 业务范围明确 | `full` | business-test → review → test-gen → test |
262
+ | Default | `standard` | review → test-gen (当 coverage<80%) → test |
263
+ | `--quality quick` | `quick` | review --tier quick |
264
+
265
+ 写入 `session.quality_mode`。A_BUILD_STEPS 据此过滤 stage(见下)。
203
266
 
204
267
  ### A_DECOMPOSE_TASKS
205
268
 
@@ -240,37 +303,52 @@ narrow → derive defaults from intent + codebase, skip questions.
240
303
 
241
304
  ### A_BUILD_STEPS
242
305
 
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.
306
+ Generate steps from `session.lifecycle_position` to `milestone-complete`(终点硬约束)。
307
+
308
+ | Stage | Skill | Type | Decision after | quality_mode |
309
+ |-------|-------|------|----------------|--------------|
310
+ | brainstorm | `maestro-brainstorm "{intent}"` | external | — | all |
311
+ | init | `maestro-init` | internal | — | all |
312
+ | roadmap | `maestro-roadmap "{intent}"` | internal | — | all |
313
+ | analyze | `maestro-analyze {phase}` | external | — | all |
314
+ | plan | `maestro-plan {phase}` | internal | — | all |
315
+ | execute | `maestro-execute {phase}` | external | — | all |
316
+ | verify | `maestro-verify {phase}` | internal | `post-verify` | all |
317
+ | business-test | `quality-auto-test {phase}` | internal | `post-business-test` | **full only** |
318
+ | review | `quality-review {phase}` | internal | `post-review` | all (quick: append `--tier quick`) |
319
+ | test-gen | `quality-auto-test {phase}` | internal | — | full / standard if coverage<80% |
320
+ | test | `quality-test {phase}` | internal | `post-test` | full, standard |
321
+ | milestone-audit | `maestro-milestone-audit` | internal | — | all |
322
+ | goal-audit | *(decision-only, no skill)* | decision | `post-goal-audit` | all (only if decomposed) |
323
+ | milestone-complete | `maestro-milestone-complete` | internal | `post-milestone` | all (chain 终点) |
263
324
 
264
325
  Type rationale: `internal` = Skill(), lightweight/interactive; `external` = delegate --to claude, context-isolated heavy computation
265
326
 
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.
327
+ **Build rules (按顺序应用):**
328
+
329
+ 1. **起点**:从 `session.lifecycle_position` 开始;不读 `state.json.current_phase`
330
+ 2. **跳过已完成**:跳过当前 milestone+phase 下已有 completed artifact 的 stage(artifact 过滤同样按 `session.phase`,不按 state.json 当前 phase)
331
+ 3. **quality_mode 过滤**:按 `session.quality_mode` 排除上表 `quality_mode` 列不包含该模式的 stage(如 standard 不跑 business-test、quick 不跑 test-gen/test)
332
+ 4. **决策节点**:每个 Decision after 非空的 stage 之后插入 `{ type: "decision", decision: "<gate>", retry_count: 0, max_retries: 2 }`
333
+ 5. **goal-audit 插入**:当且仅当 `task_decomposition` 存在 → 在最后一个 evidence-producing stage(verify/review/test)之后、`milestone-complete` 之前插入 `decision:post-goal-audit`
334
+ 6. **终点硬约束**:chain 必须以 `milestone-complete` 步骤结尾(除非 `lifecycle_position` 已是 `milestone-complete` 之后的状态)。生成器在收尾时不论 quality_mode 都必须 append 该 step
335
+ 7. **初始 goal_ref 传播**:若 `task_decomposition` 存在,遍历每个新建 step:
336
+ - 计算 `step.stage`(如 execute/verify/review)
337
+ - 对每个 `g ∈ task_decomposition`:若 `step.stage ∈ g.lifecycle` → `step.goal_ref = g.id`
338
+ - 多 G 匹配 → 取 id 字典序最小者;保证 verify/review 等共用 lifecycle 的 step 也有可追溯标签
339
+ - decision 节点不打 goal_ref(goal-audit 自身除外,它的 verdict 直接修改 task_decomposition)
340
+ 8. **占位符**:args 用 `{phase}` `{intent}` 等,由 ralph-execute 在执行时解析
341
+ 9. **动态插入**:`post-goal-audit` 触发 A_APPLY_GOAL_FIX 时插入的步骤同样按规则 7 打 `goal_ref`(追溯到触发它的子目标 G{n})
267
342
 
268
343
  ### A_CREATE_SESSION
269
344
 
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`
345
+ 1. Write `.workflow/.maestro/ralph-{YYYYMMDD-HHmmss}/status.json` (Appendix: Session Schema) — decomposition fields included only if produced (additive)
346
+ 2. If `task_decomposition` present:
347
+ - Set `session.goal_checklist_path = "{session_dir}/goal-checklist.md"` in status.json
348
+ - **Render** checklist from status.json (Appendix: Goal Checklist Template + Sync Rule). This is a one-way projection — status.json drives content; the file is never hand-edited
349
+ - Stable filename within session (so `/goal` condition string survives context compaction)
272
350
  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
351
+ 4. If `task_decomposition` present: display the **Goal Prompt block** (Appendix: Goal Prompt Template) — the copy-paste `/goal …` line binds status.json + checklist as a Stop-hook target
274
352
 
275
353
  ### A_DELEGATE_EVALUATE
276
354
 
@@ -309,20 +387,37 @@ Build rules: start from position, skip completed, insert decision nodes with `{
309
387
 
310
388
  ### A_GOAL_AUDIT_EVALUATE
311
389
 
312
- Re-checks the goal-checklist and decides whether `steps[]` must dynamically grow. Only runs when `task_decomposition` present.
390
+ Re-checks sub-goals against `status.json` (source of truth) and decides whether `steps[]` must dynamically grow. Only runs when `task_decomposition` present.
313
391
 
314
- 1. Read `session.task_decomposition` + `goal_checklist_path`
392
+ 1. Read `session.task_decomposition` from status.json (NOT from checklist — checklist is just a view)
315
393
  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
394
  3. Delegate read-only audit (run_in_background, STOP, wait):
317
395
  ```
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"
396
+ maestro delegate "PURPOSE: 审计未完成子目标,判定哪些已达成、哪些仍需补步骤
397
+ TASK:
398
+ 1. 读取 status.json.task_decomposition 中每个 status!=done 的子目标
399
+ 2. 打开其 evidence 产物,对照 done_when 严格判定
400
+ 3. 输出 met / unmet 分类,unmet 给出差距 + 应回补的 target_phase
401
+ CONTEXT:
402
+ status.json = {session_dir}/status.json
403
+ checklist = {goal_checklist_path} (人类可读视图,仅供参考)
404
+ evidence = {evidence artifacts}
405
+ 执行准则 = {execution_criteria}
406
+ 边界契约 = {boundary_contract}
407
+ EXPECTED (单行 verdict 块,严格遵循):
408
+ ---VERDICT---
409
+ STATUS=all_met|has_unmet
410
+ UNMET=[{id:G2,gap:'...',target_phase:execute}, ...] # 空数组当 STATUS=all_met
411
+ CONFIDENCE_SCORE=0-100
412
+ ---END---
413
+ CONSTRAINTS:
414
+ - 只评估,不修改任何文件
415
+ - 严格按 done_when 判定;evidence 缺失 → 视为 unmet
416
+ - 不得建议超出 boundary_contract 的修改
417
+ "
323
418
  --role analyze --mode analysis
324
419
  ```
325
- 4. On callback: parse UNMET list. For each met sub-goal → set `task_decomposition[i].status="done"` + flip `[ ]→[x]` in goal-checklist.md
420
+ 4. On callback: parse UNMET list. **status.json is the write target** — for each met sub-goal: `task_decomposition[i].status="done"` + `task_decomposition[i].completed_at=now`. Then regenerate checklist view from status.json (see Sync Rule in Appendix).
326
421
  5. **Decision log**: append to `{session_dir}/decisions.ndjson` with `"type": "goal-gate"`, `unmet_count`, `unmet_ids`
327
422
  6. Verdict: `all_met` → A_APPLY_GOAL_DONE; `has_unmet` → A_APPLY_GOAL_FIX
328
423
  GUARD: retry_count >= max_retries AND still unmet → A_APPLY_ESCALATE (insert quality-debug, hand to human)
@@ -355,10 +450,10 @@ Re-checks the goal-checklist and decides whether `steps[]` must dynamically grow
355
450
 
356
451
  ### A_APPLY_GOAL_DONE
357
452
 
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)
453
+ 1. Write status.json (source of truth): set every `task_decomposition[*].status="done"`, `completed_at=now`, plus top-level `task_decomposition_all_done=true`
454
+ 2. Regenerate `goal-checklist.md` from status.json (Sync Rule in Appendix) — all boxes flip to `[x]`, sentinel `ALL_GOALS_DONE` appended at file end
360
455
  3. Mark goal-audit decision completed; proceed to `milestone-complete`
361
- 4. Display: ◆ Goal audit: 全部子目标达成 ✓ — checklist 已写入 ALL_GOALS_DONE
456
+ 4. Display: ◆ Goal audit: 全部子目标达成 ✓ — status.json + checklist 已同步 ALL_GOALS_DONE
362
457
 
363
458
  ### A_ADVANCE_MILESTONE
364
459
 
@@ -385,8 +480,9 @@ Re-checks the goal-checklist and decides whether `steps[]` must dynamically grow
385
480
  "session_id": "ralph-{YYYYMMDD-HHmmss}",
386
481
  "source": "ralph", "status": "running",
387
482
  "intent": "", "lifecycle_position": "",
388
- "phase": null, "milestone": "",
389
- "auto_mode": false, "quality_mode": "standard",
483
+ "phase": null, "phase_is_new": false, "milestone": "",
484
+ "auto_mode": false,
485
+ "quality_mode": "standard", // "full" | "standard" | "quick" — 由 A_DETERMINE_QUALITY_MODE 写入
390
486
  "cli_tool": "claude", "passed_gates": [],
391
487
  "context": { "issue_id": null, "scratch_dir": null, "plan_dir": null,
392
488
  "analysis_dir": null, "brainstorm_dir": null },
@@ -402,15 +498,18 @@ Re-checks the goal-checklist and decides whether `steps[]` must dynamically grow
402
498
  "execution_criteria": [],
403
499
  "task_decomposition": [
404
500
  { "id": "G1", "goal": "", "boundary": "", "done_when": "",
405
- "evidence": "", "lifecycle": [], "status": "pending|done" }
501
+ "evidence": "", "lifecycle": [], "status": "pending|done",
502
+ "completed_at": null }
406
503
  ],
407
- "goal_checklist_path": ""
504
+ "task_decomposition_all_done": false,
505
+ "goal_checklist_path": "",
506
+ "goal_checklist_synced_at": null
408
507
  }
409
508
  ```
410
509
 
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.
510
+ **扩展约定**:
511
+ - Schema 加字段 = 可选(缺省 = 旧行为);不删/不改既有字段名。
512
+ - `steps[]` 是活数组:`post-goal-audit` `post-verify/review/test` 等决策节点按需追加+重排,子目标收敛即停。`goal_ref`(可选)回溯每条动态插入步骤所属子目标。
414
513
 
415
514
  ### Fix-Loop Templates
416
515
 
@@ -470,48 +569,76 @@ decision:post-goal-audit {retry+1}
470
569
  ```
471
570
  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
571
 
473
- ### Goal Checklist Template
572
+ ### Goal Checklist Template (status.json projection)
474
573
 
475
- Written to `{session_dir}/goal-checklist.md`. Stable within the session; never renamed (so the `/goal` condition string stays valid across context compaction).
574
+ `{session_dir}/goal-checklist.md` `status.json` 的只读投影:不要手改,永远从 JSON 重渲染。文件名在 session 内稳定,`/goal` 条件字符串跨上下文压缩仍可用。
476
575
 
477
576
  ```markdown
478
577
  # Ralph Goal Checklist — {session_id}
479
- > Intent: {intent}
578
+ <!-- AUTO-GENERATED from status.json. Source: ../status.json#/task_decomposition -->
579
+
580
+ > Intent : {intent}
581
+ > Source : `{session_dir}/status.json` (authoritative)
582
+ > Last sync : {ISO} Phase: {phase} Milestone: {milestone}
583
+
584
+ ## Resume / 恢复入口
585
+ **不要直接执行 skill,调用入口:**
586
+ ```
587
+ /maestro-ralph continue
588
+ ```
589
+ ralph 评估下一步门控,ralph-execute 跑实际步骤。Stop hook 触发时也走这条路径。
480
590
 
481
591
  ## 执行准则 / Execution Criteria
592
+ <!-- status.json#/execution_criteria -->
482
593
  - {criterion 1}
483
594
  - {criterion 2}
484
595
 
485
596
  ## 边界契约 / 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]. -->
597
+ <!-- status.json#/boundary_contract -->
598
+ - In scope : {in_scope}
599
+ - Out of scope : {out_of_scope}
600
+ - Constraints : {constraints}
601
+ - Definition of Done : {definition_of_done}
602
+
603
+ ## 子目标 / Sub-goals ({done}/{total})
604
+ <!-- status.json#/task_decomposition -->
605
+ - [ ] G1 — {goal}
606
+ done_when : {done_when}
607
+ evidence : {evidence}
608
+ lifecycle : {lifecycle}
609
+ <!-- ref: status.json#/task_decomposition/0 status=pending -->
610
+ - [x] G2 — {goal}
611
+ done_when : {done_when}
612
+ evidence : {evidence}
613
+ <!-- ref: status.json#/task_decomposition/1 status=done completed_at={ISO} -->
614
+ - [ ] G3 — ...
615
+
616
+ <!-- A_APPLY_GOAL_DONE 在全部 status=done 时在文件末尾追加 ALL_GOALS_DONE -->
498
617
  ```
499
618
 
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).
619
+ ### Sync Rule (status.json goal-checklist.md)
620
+
621
+ 单向投影;status.json 为真源;冲突时直接重渲染,不合并。
622
+
623
+ 1. 只有 ralph / ralph-execute 写 `task_decomposition[*].status`;markdown 不可写入状态。
624
+ 2. `task_decomposition` / `execution_criteria` / `boundary_contract` 任一变化 → 立即重渲染 checklist。
625
+ 3. 全部 `status="done"` → 在文件末追加 `ALL_GOALS_DONE` 哨兵行。
626
+ 4. 检测到 checklist 缺失或与 JSON 漂移 → 直接重渲染覆盖;视 markdown 为可丢弃产物。
627
+ 5. ralph-execute(可选、向后兼容):完成 `lifecycle` 覆盖某子目标的 step 后,校验 evidence;满足则置 `status="done"` + 重渲染。无 `task_decomposition` 字段 → 不动作。
501
628
 
502
629
  ### Goal Prompt Template
503
630
 
504
- Displayed verbatim after the chain overview (only when decomposition produced):
631
+ 链路概览后逐字显示(仅当 decomposition 已产出):
505
632
 
506
633
  ```
507
- 📋 任务分解完成。可选(推荐):复制下面一行设定目标,让会话在所有子目标达成前不停:
634
+ 📋 任务分解完成。复制下面一行设定目标,会话在子目标全部达成前不停:
508
635
 
509
- /goal {session_dir}/goal-checklist.md 中所有子目标复选框均为 [x] 且文件含 ALL_GOALS_DONE 哨兵时目标达成;否则依据文件内"执行准则"继续推进未完成子目标,不得超出边界契约范围
636
+ /goal 目标达成条件: {session_dir}/status.json 中 task_decomposition[*].status 全部为 "done"(等价: {session_dir}/goal-checklist.md 末尾含 ALL_GOALS_DONE)。未达成时: 阅读 {session_dir}/goal-checklist.md 取得"执行准则/边界契约/子目标"作为行动手册, 然后调用 /maestro-ralph continue 推进下一步; 严禁手动执行 skill 或越界修改 status.json.boundary_contract.out_of_scope。
510
637
 
511
- 然后运行 /maestro-ralph continue 开始执行。
638
+ 随后运行 /maestro-ralph continue 立即开始执行。
512
639
  ```
513
640
 
514
- > `/goal` 是 harness 命令、仅用户可输入 — ralph 只输出此提示词,不能自行注册。这与 status.json 的可扩展约定一致:绑定是用户侧、可选的增量能力。
641
+ `/goal` 是 harness 命令,仅用户能输入;ralph 只能输出此提示词。判据以 status.json 为权威,哨兵为等价信号,避免视图漂移误判。
515
642
 
516
643
  ### Error Codes
517
644
 
@@ -529,14 +656,22 @@ Displayed verbatim after the chain overview (only when decomposition produced):
529
656
 
530
657
  ### Success Criteria
531
658
 
659
+ - [ ] Phase 先于 position 解析(S_RESOLVE_PHASE → S_INFER → S_QUALITY_MODE);phase_is_new 标记写入 session
660
+ - [ ] phase_is_new=true 时 lifecycle_position 强制为 `analyze`(禁止用其他 phase 的 artifact 推断)
661
+ - [ ] artifact 过滤始终按 session.phase(不读 state.json.current_phase)
662
+ - [ ] quality_mode 显式由 A_DETERMINE_QUALITY_MODE 决定(full/standard/quick),过滤 build steps
532
663
  - [ ] State parsed, position inferred from bootstrap + artifacts + result files
533
664
  - [ ] Decomposition runs as initial step; broad intent boundary-clarified via ≤3 questions (ignores auto_confirm); narrow auto-derives
534
665
  - [ ] 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
666
+ - [ ] status.json is single source of truth; goal-checklist.md is a regenerated projection (Sync Rule), never hand-edited
667
+ - [ ] goal-checklist.md carries explicit `status.json#/task_decomposition[i]` JSON-pointer refs per entry + last-sync timestamp
668
+ - [ ] Mutations to task_decomposition trigger checklist re-render; ALL_GOALS_DONE sentinel appended only when all entries status=done
669
+ - [ ] Goal Prompt names status.json as the authoritative judgement source, with ALL_GOALS_DONE sentinel as equivalent signal
537
670
  - [ ] post-goal-audit decision node inserted before milestone-complete (only when decomposed)
538
671
  - [ ] 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
672
+ - [ ] Quality pipeline quality_mode 生成(full=全管线 / standard=skip business-test / quick=仅 review --tier quick)
673
+ - [ ] Chain 末端硬约束:必须以 `milestone-complete` 结尾(goal-audit decision 紧前)
674
+ - [ ] 初始构建按 task_decomposition[*].lifecycle 给每个 step 打 goal_ref(verify/review 等共用 lifecycle 的 step 也有标签)
540
675
  - [ ] Decision nodes delegate-evaluated via maestro delegate --role analyze
541
676
  - [ ] Verdict parsed with confidence adjustment
542
677
  - [ ] Fix-loop templates applied with retry tracking