maestro-flow 0.4.11 → 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 (166) hide show
  1. package/.agents/agents/cli-explore-agent.md +1 -3
  2. package/.agents/agents/cross-role-reviewer.md +173 -0
  3. package/.agents/agents/role-design-author.md +218 -0
  4. package/.agents/agents/ui-design-agent.md +1 -18
  5. package/.agents/agents/workflow-analyzer.md +1 -1
  6. package/.agents/agents/workflow-external-researcher.md +1 -1
  7. package/.agents/skills/maestro/SKILL.md +61 -27
  8. package/.agents/skills/maestro-analyze/SKILL.md +30 -4
  9. package/.agents/skills/maestro-blueprint/SKILL.md +132 -0
  10. package/.agents/skills/maestro-brainstorm/SKILL.md +119 -103
  11. package/.agents/skills/maestro-help/SKILL.md +48 -14
  12. package/.agents/skills/maestro-help/index/catalog.json +29 -11
  13. package/.agents/skills/maestro-help/phases/01-parse-intent.md +1 -1
  14. package/.agents/skills/maestro-help/phases/02-search-present.md +6 -4
  15. package/.agents/skills/maestro-help/phases/03-workflow-guide.md +60 -33
  16. package/.agents/skills/maestro-init/SKILL.md +3 -3
  17. package/.agents/skills/maestro-milestone-audit/SKILL.md +5 -3
  18. package/.agents/skills/maestro-milestone-complete/SKILL.md +7 -5
  19. package/.agents/skills/maestro-plan/SKILL.md +14 -4
  20. package/.agents/skills/maestro-ralph/SKILL.md +297 -226
  21. package/.agents/skills/maestro-ralph-execute/SKILL.md +81 -67
  22. package/.agents/skills/maestro-roadmap/SKILL.md +42 -81
  23. package/.agents/skills/quality-auto-test/SKILL.md +1 -1
  24. package/.agents/skills/team-lifecycle-v4/roles/analyst/role.md +1 -1
  25. package/.agents/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +2 -2
  26. package/.agents/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  27. package/.agents/skills/team-lifecycle-v4/templates/architecture.md +3 -3
  28. package/.agents/skills/team-lifecycle-v4/templates/epics.md +2 -2
  29. package/.agents/skills/team-lifecycle-v4/templates/product-brief.md +3 -3
  30. package/.agents/skills/team-lifecycle-v4/templates/requirements.md +2 -2
  31. package/.agy/agents/cli-explore-agent.md +1 -3
  32. package/.agy/agents/cross-role-reviewer.md +170 -0
  33. package/.agy/agents/role-design-author.md +215 -0
  34. package/.agy/agents/ui-design-agent.md +1 -18
  35. package/.agy/agents/workflow-analyzer.md +1 -1
  36. package/.agy/agents/workflow-external-researcher.md +1 -1
  37. package/.agy/skills/maestro/SKILL.md +61 -27
  38. package/.agy/skills/maestro-analyze/SKILL.md +30 -4
  39. package/.agy/skills/maestro-blueprint/SKILL.md +132 -0
  40. package/.agy/skills/maestro-brainstorm/SKILL.md +119 -103
  41. package/.agy/skills/maestro-help/SKILL.md +48 -14
  42. package/.agy/skills/maestro-help/index/catalog.json +29 -11
  43. package/.agy/skills/maestro-help/phases/01-parse-intent.md +1 -1
  44. package/.agy/skills/maestro-help/phases/02-search-present.md +6 -4
  45. package/.agy/skills/maestro-help/phases/03-workflow-guide.md +60 -33
  46. package/.agy/skills/maestro-init/SKILL.md +3 -3
  47. package/.agy/skills/maestro-milestone-audit/SKILL.md +5 -3
  48. package/.agy/skills/maestro-milestone-complete/SKILL.md +7 -5
  49. package/.agy/skills/maestro-plan/SKILL.md +14 -4
  50. package/.agy/skills/maestro-ralph/SKILL.md +297 -226
  51. package/.agy/skills/maestro-ralph-execute/SKILL.md +81 -67
  52. package/.agy/skills/maestro-roadmap/SKILL.md +42 -81
  53. package/.agy/skills/quality-auto-test/SKILL.md +1 -1
  54. package/.agy/skills/team-lifecycle-v4/roles/analyst/role.md +1 -1
  55. package/.agy/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +2 -2
  56. package/.agy/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  57. package/.agy/skills/team-lifecycle-v4/templates/architecture.md +3 -3
  58. package/.agy/skills/team-lifecycle-v4/templates/epics.md +2 -2
  59. package/.agy/skills/team-lifecycle-v4/templates/product-brief.md +3 -3
  60. package/.agy/skills/team-lifecycle-v4/templates/requirements.md +2 -2
  61. package/.claude/agents/cli-explore-agent.md +1 -3
  62. package/.claude/agents/cross-role-reviewer.md +171 -0
  63. package/.claude/agents/role-design-author.md +216 -0
  64. package/.claude/agents/ui-design-agent.md +1 -18
  65. package/.claude/agents/workflow-analyzer.md +1 -1
  66. package/.claude/agents/workflow-external-researcher.md +1 -1
  67. package/.claude/commands/maestro-analyze.md +30 -4
  68. package/.claude/commands/maestro-blueprint.md +130 -0
  69. package/.claude/commands/maestro-brainstorm.md +132 -116
  70. package/.claude/commands/maestro-init.md +3 -3
  71. package/.claude/commands/maestro-milestone-audit.md +5 -3
  72. package/.claude/commands/maestro-milestone-complete.md +7 -5
  73. package/.claude/commands/maestro-plan.md +14 -4
  74. package/.claude/commands/maestro-ralph-execute.md +81 -67
  75. package/.claude/commands/maestro-ralph.md +297 -226
  76. package/.claude/commands/maestro-roadmap.md +42 -81
  77. package/.claude/commands/maestro.md +61 -27
  78. package/.claude/commands/quality-auto-test.md +1 -1
  79. package/.claude/skills/maestro-help/SKILL.md +48 -14
  80. package/.claude/skills/maestro-help/index/catalog.json +29 -11
  81. package/.claude/skills/maestro-help/phases/01-parse-intent.md +1 -1
  82. package/.claude/skills/maestro-help/phases/02-search-present.md +6 -4
  83. package/.claude/skills/maestro-help/phases/03-workflow-guide.md +60 -33
  84. package/.claude/skills/team-lifecycle-v4/roles/analyst/role.md +1 -1
  85. package/.claude/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +2 -2
  86. package/.claude/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  87. package/.claude/skills/team-lifecycle-v4/templates/architecture.md +3 -3
  88. package/.claude/skills/team-lifecycle-v4/templates/epics.md +2 -2
  89. package/.claude/skills/team-lifecycle-v4/templates/product-brief.md +3 -3
  90. package/.claude/skills/team-lifecycle-v4/templates/requirements.md +2 -2
  91. package/.codex/skills/maestro/SKILL.md +75 -38
  92. package/.codex/skills/maestro-amend/SKILL.md +157 -0
  93. package/.codex/skills/maestro-analyze/SKILL.md +71 -23
  94. package/.codex/skills/maestro-blueprint/SKILL.md +122 -0
  95. package/.codex/skills/maestro-brainstorm/SKILL.md +135 -45
  96. package/.codex/skills/maestro-composer/SKILL.md +1 -1
  97. package/.codex/skills/maestro-execute/SKILL.md +13 -4
  98. package/.codex/skills/maestro-help/SKILL.md +28 -18
  99. package/.codex/skills/maestro-help/catalog.json +29 -11
  100. package/.codex/skills/maestro-init/SKILL.md +7 -7
  101. package/.codex/skills/maestro-plan/SKILL.md +27 -9
  102. package/.codex/skills/maestro-ralph/SKILL.md +740 -601
  103. package/.codex/skills/maestro-roadmap/SKILL.md +55 -72
  104. package/.codex/skills/maestro-update/SKILL.md +169 -0
  105. package/.codex/skills/maestro-verify/SKILL.md +11 -2
  106. package/.codex/skills/manage-codebase-rebuild/SKILL.md +2 -2
  107. package/.codex/skills/manage-harvest/SKILL.md +10 -2
  108. package/.codex/skills/quality-retrospective/SKILL.md +9 -2
  109. package/.codex/skills/team-lifecycle-v4/roles/analyst/role.md +2 -2
  110. package/.codex/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +2 -2
  111. package/.codex/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  112. package/.codex/skills/team-lifecycle-v4/templates/architecture.md +3 -3
  113. package/.codex/skills/team-lifecycle-v4/templates/epics.md +2 -2
  114. package/.codex/skills/team-lifecycle-v4/templates/product-brief.md +3 -3
  115. package/.codex/skills/team-lifecycle-v4/templates/requirements.md +2 -2
  116. package/README.md +8 -8
  117. package/README.zh-CN.md +8 -8
  118. package/dashboard/dist-server/dashboard/src/server/routes/settings.js +3 -3
  119. package/dashboard/dist-server/dashboard/src/server/routes/settings.js.map +1 -1
  120. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  121. package/dist/src/agents/cli-agent-runner.js +13 -7
  122. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  123. package/dist/src/commands/spec.d.ts.map +1 -1
  124. package/dist/src/commands/spec.js +8 -1
  125. package/dist/src/commands/spec.js.map +1 -1
  126. package/dist/src/tools/spec-init.d.ts +16 -2
  127. package/dist/src/tools/spec-init.d.ts.map +1 -1
  128. package/dist/src/tools/spec-init.js +58 -187
  129. package/dist/src/tools/spec-init.js.map +1 -1
  130. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  131. package/dist/src/tools/spec-loader.js +16 -16
  132. package/dist/src/tools/spec-loader.js.map +1 -1
  133. package/dist/src/tools/spec-seeds.d.ts +33 -0
  134. package/dist/src/tools/spec-seeds.d.ts.map +1 -0
  135. package/dist/src/tools/spec-seeds.js +200 -0
  136. package/dist/src/tools/spec-seeds.js.map +1 -0
  137. package/dist/src/tools/spec-writer.d.ts.map +1 -1
  138. package/dist/src/tools/spec-writer.js +7 -9
  139. package/dist/src/tools/spec-writer.js.map +1 -1
  140. package/dist/src/utils/update-notices.js +12 -0
  141. package/dist/src/utils/update-notices.js.map +1 -1
  142. package/package.json +1 -1
  143. package/templates/business-test-report.json +1 -1
  144. package/templates/index.json +1 -1
  145. package/templates/roadmap.md +15 -9
  146. package/templates/state.json +18 -17
  147. package/workflows/analyze.md +79 -11
  148. package/workflows/auto-test.md +6 -6
  149. package/workflows/blueprint.md +431 -0
  150. package/workflows/brainstorm.md +603 -496
  151. package/workflows/business-test.md +7 -7
  152. package/workflows/codebase-rebuild.md +4 -4
  153. package/workflows/harvest.md +184 -10
  154. package/workflows/init.md +9 -8
  155. package/workflows/maestro.md +1 -1
  156. package/workflows/milestone-audit.md +12 -4
  157. package/workflows/milestone-complete.md +11 -6
  158. package/workflows/plan.md +88 -22
  159. package/workflows/roadmap-common.md +1 -1
  160. package/workflows/roadmap.md +13 -3
  161. package/workflows/spec-generate.md +24 -13
  162. package/workflows/ui-design.md +2 -2
  163. package/workflows/ui-style.md +1 -1
  164. package/.agents/agents/conceptual-planning-agent.md +0 -247
  165. package/.agy/agents/conceptual-planning-agent.md +0 -244
  166. package/.claude/agents/conceptual-planning-agent.md +0 -245
@@ -31,19 +31,23 @@ Also read `session.auto_mode` from status.json — if true, treat as `-y`.
31
31
 
32
32
  | Type | Execution | Flow after |
33
33
  |------|-----------|------------|
34
- | decision (ralph-only) | `Skill("maestro-ralph")` — ralph re-evaluates | Execution ends here |
35
- | internal | `Skill({ skill, args })` synchronous | Self-invoke next |
36
- | external | `maestro delegate --to claude --mode write` | STOP → callback self-invoke |
37
-
38
- HARD RULE: External nodes ALWAYS append `-y` to skill args inside the prompt — delegate sessions are non-interactive.
39
- HARD RULE: External nodes ALWAYS delegate to `claude` only Claude Code can execute slash-command skills.
34
+ | decision (ralph-only) | `Skill("maestro-ralph")` | Execution ends here |
35
+ | internal (default) | `view_file({file_path: step.command_path})` + 内联解释执行 | Self-invoke next |
36
+ | external (opt-in) | `maestro delegate --to claude --mode write` (STOP → callback) | Self-invoke next |
37
+
38
+ HARD RULES:
39
+ - internal step MUST 通过 `view_file({command_path})` 把命令 .md 加载进当前会话,再按内容执行;禁止 `Skill({skill})` 调用
40
+ - `command_path` 由 ralph 在 A_BUILD_STEPS 写入 status.json;ralph-execute 不再自行解析(缺失 → 报错 E002)
41
+ - external 仅在 `step.type == "external"` 显式声明时使用,并 always append `-y` 到 prompt args
42
+ - 每个 step 必须产出 `--- COMPLETION STATUS ---` 块,否则视为 NEEDS_RETRY
40
43
  </context>
41
44
 
42
45
  <invariants>
43
- 1. **Every step via Skill() or delegate** — never simulate or inline a skill's work
44
- 2. **External claude only** — `session.cli_tool` is for analysis delegates, NOT execution
45
- 3. **Self-invocation chain** — continues until all steps complete or session paused
46
- 4. **Status.json updated after every change** resume-safe
46
+ 1. **Internal = Read + inline** — 通过 Read 读取 `step.command_path`,按其指令在当前 session 内执行
47
+ 2. **External = explicit only** — `step.type == "external"` 才走 delegate;默认绝不发起
48
+ 3. **必须显式 completion confirmation** — 每个 step 完成时需有 `STATUS: DONE` 且写入 `step.completion_confirmed = true`
49
+ 4. **Self-invocation chain** 持续直到全部 `completion_confirmed` paused
50
+ 5. **status.json 每步骤后写盘** — resume-safe
47
51
  </invariants>
48
52
 
49
53
  <state_machine>
@@ -52,8 +56,8 @@ HARD RULE: External nodes ALWAYS delegate to `claude` — only Claude Code can e
52
56
  S_LOCATE — 定位 session + 找下一个 pending step PERSIST: —
53
57
  S_RESOLVE_ARGS — 解析占位符 + 丰富参数 PERSIST: step.args (enriched)
54
58
  S_EXECUTE — 执行当前 step PERSIST: step.status = "running", session.current_step
55
- S_POST_EXEC — 标记完成 + 传播上下文 PERSIST: step.status, session.context
56
- S_HANDLE_FAIL — 处理失败(重试/跳过/中止) PERSIST: step.status, session.status
59
+ S_POST_EXEC — 标记完成 + 传播上下文 PERSIST: step.completion_*, step.status, session.context
60
+ S_HANDLE_FAIL — 处理失败 PERSIST: step.status, session.status
57
61
  S_COMPLETE — 所有 step 完成 PERSIST: session.status = "completed"
58
62
  S_FALLBACK — 无 session 可执行 PERSIST: —
59
63
  </states>
@@ -125,9 +129,9 @@ S_FALLBACK:
125
129
  | maestro-brainstorm | topic | `"{intent}"` |
126
130
  | maestro-roadmap | description | `"{intent}"` |
127
131
  | maestro-analyze | phase or topic | `{phase}` or `"{intent}"` |
128
- | maestro-plan | phase or --dir | `{phase}`, or `--dir {scratch_dir}` if standalone |
129
- | maestro-execute | phase or --dir | `{phase}`, or `--dir {scratch_dir}` if standalone |
130
- | quality-debug | gap context | Read previous step's error/gap from artifact dir |
132
+ | maestro-plan | phase or --dir | `{phase}`, or `--dir {scratch_dir}` |
133
+ | maestro-execute | phase or --dir | `{phase}`, or `--dir {scratch_dir}` |
134
+ | quality-debug | gap context | Read previous step's error/gap |
131
135
  | quality-* | phase | `{phase}` |
132
136
 
133
137
  **Artifact dir resolution for --dir:**
@@ -137,91 +141,97 @@ plan commands: latest type=="analyze" → --dir .workflow/scratch/{path}
137
141
  execute commands: latest type=="plan" → --dir .workflow/scratch/{path}
138
142
  ```
139
143
 
140
- Write enriched args back to status.json (resume-safe).
144
+ Write enriched args back to status.json.
141
145
 
142
146
  ### A_EXEC_DECISION
143
147
 
144
148
  1. Mark step running, write status.json
145
- 2. Display: `[{index}/{total}] ◆ {skill} [decision] Retry: {retry}/{max}`
146
- 3. `view_file(AbsolutePath="<agy-skills-dir>/maestro-ralph/SKILL.md") + execute inline` — ralph detects running decision → evaluates → handoff
147
- 4. **This execution ends here** — ralph handles the handoff back
149
+ 2. Display: `[{index}/{total}] ◆ {decision} Retry: {retry}/{max}`
150
+ 3. `view_file(AbsolutePath="<agy-skills-dir>/maestro-ralph/SKILL.md") + execute inline` — ralph 评估 + handoff
151
+ 4. 执行在此结束
148
152
 
149
153
  ### A_EXEC_INTERNAL
150
154
 
151
- 1. Mark step running, write status.json
152
- 2. Display: `[{index}/{total}] {skill} [internal]`
153
- 3. Resolve auto flag: `auto ? (flag_map[skill] || "") : ""`
154
- 4. `Skill({ skill: next.skill, args: effective_args })`
155
- 5. Return success/failure
155
+ 1. Validate `step.command_path != null`;否则 raise E002,pause session
156
+ 2. Mark step running, write status.json
157
+ 3. Display: `[{index}/{total}] {step.skill} [internal · {step.command_scope}]`
158
+ 4. `view_file({ file_path: step.command_path })` — 把命令 .md 全文加载进当前会话
159
+ 5. 解析 frontmatter `argument-hint` 与 `<purpose>/<state_machine>/<actions>` 等指令块
160
+ 6. 计算 `effective_args`:`step.args` + auto flag(`auto ? (flag_map[step.skill] || "") : ""`)
161
+ 7. 按读到的指令在本会话中**内联执行**:调用允许的工具完成命令所规定的工作,不再发起 Skill() 或 delegate
162
+ 8. 执行结束:要求最后一段必须包含 `--- COMPLETION STATUS ---` 块(见 A_MARK_COMPLETE)
163
+ 9. Return success / failure
156
164
 
157
- **Auto flag map:** all lifecycle skills → `-y`; `quality-test` → `-y --auto-fix`; unlisted internal no flag
165
+ **Auto flag map**: 所有 lifecycle skill → `-y`; `quality-test` → `-y --auto-fix`; 未列出 flag
158
166
 
159
167
  ### A_EXEC_EXTERNAL
160
168
 
169
+ 仅当 `step.type == "external"` 时使用(默认链路不产生)。
170
+
161
171
  1. Mark step running, write status.json
162
- 2. Display: `[{index}/{total}] ⚡ {skill} [external]`
163
- 3. Always append `-y` to skill args (delegates are non-interactive): `flag = flag_map[skill] || "-y"`
172
+ 2. Display: `[{index}/{total}] ⚡ {step.skill} [external]`
173
+ 3. 始终在 prompt 内追加 `-y`(delegate session 非交互):`flag = flag_map[step.skill] || "-y"`
164
174
  4. Execute:
165
175
  ```
166
176
  run_command({
167
- command: `maestro delegate "/${skill} ${effective_args}" --to claude --mode write`,
177
+ command: `maestro delegate "/${step.skill} ${effective_args}" --to claude --mode write`,
168
178
  run_in_background: true, timeout: 600000
169
179
  })
170
180
  STOP — wait for callback.
171
181
  ```
172
- 5. On callback: retrieve output → S_POST_EXEC or S_HANDLE_FAIL
182
+ 5. On callback: 把回调输出视为 step 的执行结果 → S_POST_EXEC / S_HANDLE_FAIL
173
183
 
174
184
  ### A_MARK_COMPLETE
175
185
 
176
- 1. `step.status = "completed"`, `step.completed_at = now`
177
- 2. Scan output for context signals:
178
- - `PHASE: N` → session.phase
179
- - `scratch_dir: path` → context.scratch_dir
180
- - `SPEC-xxx` → context.spec_session_id
181
- 3. Scan output for `--- COMPLETION STATUS ---` block. If found, parse and map:
182
- - `STATUS: DONE``step.status = "completed"`
183
- - `STATUS: DONE_WITH_CONCERNS` → `step.status = "completed"`, `step.concerns = CONCERNS value`
184
- - `STATUS: NEEDS_RETRY` → trigger retry: set `step.status = "pending"`, `step.retried = true` → S_HANDLE_FAIL
185
- - `STATUS: BLOCKED` → `session.status = "paused"`, display blocker reason from CONCERNS
186
- - `STATUS: NEEDS_CONTEXT` → `session.status = "paused"`, display context gap from CONCERNS
187
- - If no `--- COMPLETION STATUS ---` block found → fall back to existing heuristic (backward compatible)
188
- 4. Write status.json
189
- 5. Display: `[{index}/{total}] ✓ {skill} completed`
186
+ 1. step 输出中提取 `--- COMPLETION STATUS ---` 块(required)
187
+ 2. 解析并写入:
188
+ - `STATUS: DONE` → `step.status = "completed"`, `step.completion_confirmed = true`, `step.completion_status = "DONE"`
189
+ - `STATUS: DONE_WITH_CONCERNS` → `step.status = "completed"`, `step.completion_confirmed = true`, `step.completion_status = "DONE_WITH_CONCERNS"`, `step.concerns = <CONCERNS>`
190
+ - `STATUS: NEEDS_RETRY` → `step.status = "pending"`, `step.retried = true`, `step.completion_confirmed = false`, → S_HANDLE_FAIL
191
+ - `STATUS: BLOCKED` / `NEEDS_CONTEXT` `session.status = "paused"`, `step.completion_status` 记录原因, `step.completion_confirmed = false`
192
+ - 缺失 `--- COMPLETION STATUS ---` 视为 NEEDS_RETRY(不允许 heuristic fallback)
193
+ 3. 写入 `step.completion_evidence`(artifact 路径 / 关键输出节选)
194
+ 4. 扫描输出抓取 context 信号:`PHASE: N` → session.phase;`scratch_dir: path` context.scratch_dir;`BLP-xxx` → context.blueprint_session_id
195
+ 5. `step.completed_at = now`,写 status.json
196
+ 6. **Sub-goal evidence 校验**(task_decomposition 存在时):若 `step.goal_ref` 对应子目标的 `lifecycle` 覆盖当前 stage 且 evidence artifact 已生成 暂不直接置 done,仍交由 post-goal-audit 决策;仅在 step 显式确认时更新 `task_decomposition[*].completion_confirmed = false` 占位(保持 pending)
197
+ 7. Display: `[{index}/{total}] {step.skill} completed (confirmed)`
190
198
 
191
199
  ### A_RETRY
192
200
 
193
- 1. `step.retried = true`, `step.status = "pending"`, `step.error = null`
201
+ 1. `step.retried = true`, `step.status = "pending"`, `step.error = null`, `step.completion_confirmed = false`
194
202
  2. Write status.json
195
203
 
196
204
  ### A_SKIP_STEP
197
205
 
198
- 1. `step.status = "skipped"`
206
+ 1. `step.status = "skipped"`, `step.completion_confirmed = false`
199
207
  2. Write status.json
200
208
 
201
209
  ### A_PAUSE_SESSION
202
210
 
203
211
  1. `session.status = "paused"`, write status.json
204
- 2. Display: `[{index}/{total}] ✗ {skill} 失败,会话已暂停。/maestro-ralph continue 恢复。`
212
+ 2. Display: `[{index}/{total}] ✗ {step.skill} 失败,会话已暂停。/maestro-ralph continue 恢复。`
205
213
 
206
214
  ### A_COMPLETE_SESSION
207
215
 
208
- 1. `session.status = "completed"`, write status.json
209
- 2. Display completion report:
216
+ 1. 校验:所有 step `completion_confirmed == true`(除 skipped);task_decomposition 存在时校验 `task_decomposition_all_done == true`
217
+ 2. 任一校验失败 不标 completed,回 S_LOCATE 或 pause
218
+ 3. `session.status = "completed"`, write status.json
219
+ 4. Display completion report:
210
220
  ```
211
221
  ============================================================
212
222
  SESSION COMPLETE
213
223
  ============================================================
214
224
  Session: {session_id} [{source}]
215
- Steps: {completed}/{total}
225
+ Steps: {completed}/{total} confirmed: {confirmed}/{completed}
216
226
 
217
- [✓] 0. maestro-plan 1 [internal]
218
- [✓] 1.maestro-execute 1 [external]
219
- [✓] 2. maestro-verify 1 [internal]
227
+ [✓] 0. maestro-plan 1 [internal · global]
228
+ [✓] 1. maestro-execute 1 [internal · project]
229
+ [✓] 2. maestro-verify 1 [internal · global]
220
230
  [✓] 3. ◆ post-verify [decision]
221
231
  ...
222
232
  ============================================================
223
233
  ```
224
- Icons: `✓` completed, `—` skipped, `✗` failed, `◆` decision, `⚡` external
234
+ Icons: `✓` confirmed, `—` skipped, `✗` failed, `◆` decision, `⚡` external
225
235
 
226
236
  </actions>
227
237
 
@@ -234,22 +244,26 @@ Write enriched args back to status.json (resume-safe).
234
244
  | Code | Severity | Description | Recovery |
235
245
  |------|----------|-------------|----------|
236
246
  | E001 | error | No running session found | Suggest /maestro or /maestro-ralph |
237
- | E002 | error | status.json corrupt | Show path, suggest manual check |
238
- | E003 | error | Delegate failed + user abort | Mark paused, suggest resume |
239
- | W001 | warning | Step completed with warnings | Log and continue |
247
+ | E002 | error | step.command_path missing for internal step | Pause, ask ralph to rebuild step |
248
+ | E003 | error | status.json corrupt | Show path, manual check |
249
+ | E004 | error | Delegate failed + user abort | Mark paused, suggest resume |
250
+ | E005 | error | COMPLETION STATUS block missing | Trigger NEEDS_RETRY |
251
+ | W001 | warning | Step completed with concerns | Log and continue |
240
252
 
241
253
  ### Success Criteria
242
254
 
243
- - [ ] Session discovery covers both maestro-* and ralph-*
244
- - [ ] `-y` parsed from args OR inherited from session.auto_mode
245
- - [ ] Placeholders resolved from session context
246
- - [ ] Per-skill enrichment provides correct args
247
- - [ ] Decision nodes hand off to maestro-ralph via Skill()
248
- - [ ] Internal nodes execute via Skill() with auto flag
249
- - [ ] External nodes delegate to claude with `-y` in prompt args, run_in_background + STOP
250
- - [ ] Context signals propagate to status.json
251
- - [ ] Auto mode: retry once then pause
252
- - [ ] Interactive: ask_question retry/skip/abort
253
- - [ ] Self-invocation continues until complete or paused
255
+ - [ ] Session discovery covers maestro-* and ralph-*
256
+ - [ ] `-y` parsed from args session.auto_mode
257
+ - [ ] Placeholders resolved;per-skill enrichment 正确
258
+ - [ ] Decision 节点 Skill("maestro-ralph") handoff
259
+ - [ ] Internal 节点通过 view_file({step.command_path}) 内联执行,禁止 Skill()
260
+ - [ ] External 仅在显式声明时走 delegate,prompt 必带 `-y`
261
+ - [ ] 每个 step 强制 `--- COMPLETION STATUS ---`;缺失 NEEDS_RETRY
262
+ - [ ] step.completion_confirmed = true 仅在 STATUS: DONE/DONE_WITH_CONCERNS 时设置
263
+ - [ ] step.completion_evidence 记录 artifact path / 输出节选
264
+ - [ ] Context signals 传播 status.json
265
+ - [ ] Auto mode: retry 一次后 pause;interactive 提供 retry/skip/abort
266
+ - [ ] 自调用持续到全部 completion_confirmed 或 paused
267
+ - [ ] A_COMPLETE_SESSION 校验全部 step confirmed + sub-goal all_done
254
268
 
255
269
  </appendix>
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: maestro-roadmap
3
- description: Generate roadmap from requirements (light or full mode)
4
- argument-hint: <requirement> [--mode light|full] [-y] [-c] [-m progressive|direct|auto] [--from-brainstorm SESSION-ID] [--revise [instructions]] [--review]
3
+ description: Generate roadmap with milestone/phase structure from requirements or upstream context
4
+ argument-hint: <requirement> [-y] [-c] [-m progressive|direct|auto] [--from <source>] [--revise [instructions]] [--review]
5
5
  allowed-tools:
6
6
  - ask_question
7
7
  - define_subagent
@@ -15,16 +15,14 @@ allowed-tools:
15
15
  - write_to_file
16
16
  ---
17
17
  <purpose>
18
- Unified roadmap generation with two execution paths:
18
+ Generate a milestone/phase roadmap from requirements or upstream context. Produces `.workflow/roadmap.md` with Milestone > Phase hierarchy ready for maestro-analyze and maestro-plan.
19
19
 
20
- - **Light mode** (default): Directly from requirements to roadmap. No specification documents.
21
- - **Full mode** (`--mode full`): 7-phase document chain (Product Brief PRD → Architecture → Epics → Roadmap) producing a complete specification package in `.workflow/.spec/` plus `.workflow/roadmap.md`.
22
-
23
- Additional operation modes (light mode only):
20
+ Operation modes:
21
+ - **Create** (default): Build roadmap from requirements or upstream context
24
22
  - **Revise** (`--revise`): Modify existing roadmap while preserving completed phase progress
25
23
  - **Review** (`--review`): Health assessment of current roadmap (read-only)
26
24
 
27
- Both modes produce `.workflow/roadmap.md` with milestone/phase structure ready for maestro-plan.
25
+ For formal specification documents (Product Brief, PRD, Architecture, Epics), use `/maestro-blueprint` instead.
28
26
  </purpose>
29
27
 
30
28
  <required_reading>
@@ -33,73 +31,67 @@ Both modes produce `.workflow/roadmap.md` with milestone/phase structure ready f
33
31
  </required_reading>
34
32
 
35
33
  <deferred_reading>
36
- - [roadmap.md](~/.maestro/workflows/roadmap.md) — read when mode is light (default)
37
- - [spec-generate.md](~/.maestro/workflows/spec-generate.md) — read when mode is full
38
- - [spec-config.json](~/.maestro/templates/spec-config.json) — read when initializing spec configuration (full mode)
34
+ - [roadmap.md](~/.maestro/workflows/roadmap.md) — read for roadmap generation workflow
39
35
  </deferred_reading>
40
36
 
41
37
  <context>
42
- $ARGUMENTS -- requirement text, @file reference, or brainstorm session reference.
38
+ $ARGUMENTS -- requirement text, @file reference, or upstream context source.
43
39
 
44
- **Flags (shared):**
45
- - `--mode light|full`: Execution path (default: light)
40
+ **Flags:**
46
41
  - `-y` / `--yes`: Auto mode — skip interactive questions, use recommended defaults
47
42
  - `-c` / `--continue`: Resume from last checkpoint
48
- - `--from-brainstorm SESSION-ID`: Import guidance-specification.md from a brainstorm session as seed
49
-
50
- **Flags (light mode only):**
51
43
  - `-m progressive|direct|auto`: Decomposition strategy (default: auto)
44
+ - `--from <source>`: Load upstream context package (brainstorm:ID, blueprint:BLP-xxx, analyze:ANL-xxx, @file, or path). Consumes context-package.json
45
+ - `--from-brainstorm SESSION-ID`: (backward compat alias for `--from brainstorm:ID`)
52
46
  - `--revise [instructions]`: Revise existing roadmap. If instructions provided, apply directly. If omitted, ask user. Preserves completed phase progress.
53
47
  - `--review`: Roadmap health assessment (read-only)
54
48
 
55
49
  **Input types:**
56
50
  - Direct text: `"Implement user authentication system with OAuth and 2FA"`
57
51
  - File reference: `@requirements.md`
58
- - Brainstorm import: `--from-brainstorm WFS-xxx`
52
+ - Context import: `--from brainstorm:BRN-001` or `--from analyze:ANL-xxx` or `--from blueprint:BLP-xxx`
59
53
  - No args + `--revise` / `--review`: Operate on existing `.workflow/roadmap.md`
60
54
 
61
55
  **Pipeline position:**
62
56
  ```
63
- maestro-brainstorm (optional upstream)
64
- guidance-specification.md
65
- maestro-init (project setup)
66
- project.md, state.json, config.json
67
- maestro-roadmap [--mode light] → roadmap.md directly
68
- maestro-roadmap --mode full → spec package + roadmap.md
57
+ maestro-brainstorm ─┐
58
+ maestro-blueprint ─┤ (optional upstream, parallel)
59
+ maestro-analyze ─┘ context-package.json
60
+
61
+ maestro-roadmap → .workflow/roadmap.md (Milestone > Phase hierarchy)
69
62
 
70
- maestro-plan → maestro-execute → maestro-verify
63
+ maestro-analyze {phase} → maestro-plan → maestro-execute → maestro-verify
71
64
  ```
72
65
 
73
- **Note (full mode):** `maestro-init` MUST run before `--mode full`. It creates the `.workflow/` directory and project context.
74
-
75
66
  ### Pre-load specs
76
67
  1. **Architecture specs**: Run `maestro spec load --category arch` to load architecture constraints. Use as context for phase decomposition — ensures roadmap respects documented decisions and boundaries.
77
68
  2. Optional — proceed without if unavailable.
78
69
  </context>
79
70
 
80
- <execution>
71
+ <interview_protocol>
72
+ Interview the user relentlessly until shared understanding is reached. Active only in interactive mode; skip when `-y/--yes`, `--revise`, `--review`, `-c/--continue`, or input is already specific (clear requirement + mode).
81
73
 
82
- ### Mode routing
74
+ - One decision per turn via ask_question with 2–4 options + a (Recommended) default; every question must include a `Proceed now` option.
75
+ - Never ask what code can verify — resolve via `state.json`, existing `roadmap.md`, `project.md`, or `maestro spec load`.
76
+ - Walk the decision dependency tree strictly: mode → requirement scope → decomposition strategy → phase dependencies/order. Do not open the next branch until the current one is settled.
77
+ - Scope guard: only decide the shape of the roadmap. Do not pre-resolve intra-phase task breakdown — that belongs to `plan`.
83
78
 
84
- 1. Read `@~/.maestro/workflows/roadmap-common.md` (always shared logic)
85
- 2. Parse `--mode` flag:
86
- - `light` or omitted → read `@~/.maestro/workflows/roadmap.md`, follow its process
87
- - `full` → read `@~/.maestro/workflows/spec-generate.md`, follow its process
88
- 3. If `--revise` or `--review` present → force light mode (these are light-mode-only operations)
79
+ Decision points: scope (MVP / complete / phased) → strategy (progressive / direct / auto) → milestone boundaries → phase dependencies and order.
89
80
 
90
- ### Light mode (default)
81
+ Exit: on consensus or `Proceed now`, append the table below to a `Roadmap Decisions` section at the top of `.workflow/roadmap.md`:
82
+ `| # | Decision | Choice | Source (user / code / default) |`
83
+ </interview_protocol>
91
84
 
92
- Follow `~/.maestro/workflows/roadmap.md` completely.
85
+ <execution>
86
+
87
+ 1. Read `@~/.maestro/workflows/roadmap-common.md` (always — shared logic)
88
+ 2. Read `@~/.maestro/workflows/roadmap.md`, follow its process
93
89
 
94
90
  Sub-modes:
95
- - **Create** (default): Build roadmap from requirements
91
+ - **Create** (default): Build roadmap from requirements or upstream context
96
92
  - **Revise** (`--revise`): Follow workflow roadmap.md "Mode: Revise" section
97
93
  - **Review** (`--review`): Follow workflow roadmap.md "Mode: Review" section
98
94
 
99
- ### Full mode (`--mode full`)
100
-
101
- Follow `~/.maestro/workflows/spec-generate.md` completely.
102
-
103
95
  ### Next-step routing on completion
104
96
 
105
97
  | Condition | Suggestion |
@@ -108,63 +100,32 @@ Follow `~/.maestro/workflows/spec-generate.md` completely.
108
100
  | Simple project, ready to plan | /maestro-plan 1 |
109
101
  | Need UI design first | /maestro-impeccable build |
110
102
  | View project dashboard | /manage-status |
111
- | Need project setup (full mode) | /maestro-init |
103
+ | Need formal spec documents | /maestro-blueprint |
112
104
  </execution>
113
105
 
114
106
  <error_codes>
115
-
116
- **Shared:**
117
107
  | Code | Severity | Condition | Recovery |
118
108
  |------|----------|-----------|----------|
119
109
  | E001 | error | Requirement/idea text or @file required | Prompt user for input |
120
- | E002 | error | Brainstorm session not found (--from-brainstorm) | Show available sessions |
121
- | W001 | warning | CLI analysis failed, using fallback | Continue with available data |
122
- | W005 | warning | External research agent failed | Continue without apiResearchContext |
123
-
124
- **Light mode:**
125
- | Code | Severity | Condition | Recovery |
126
- |------|----------|-----------|----------|
110
+ | E002 | error | Context source not found (--from / --from-brainstorm) | Show available sessions/sources |
127
111
  | E003 | error | Circular dependency detected in phases | Prompt user to re-decompose |
128
112
  | E004 | error | roadmap.md not found (--revise/--review) | Run maestro-roadmap first |
129
113
  | E005 | error | Revision invalidates completed phase work | Warn user, ask to confirm or adjust |
114
+ | W001 | warning | CLI analysis failed, using fallback | Continue with available data |
130
115
  | W002 | warning | Max refinement rounds (5) reached | Force proceed with current roadmap |
131
-
132
- **Full mode:**
133
- | Code | Severity | Condition | Recovery |
134
- |------|----------|-----------|----------|
135
- | E006 | error | `.workflow/` not initialized | Run maestro-init first |
136
- | E007 | error | Phase 6 readiness Fail after 2 auto-fix iterations | Present manual fix options |
137
- | W002 | warning | Codebase exploration failed | Continue without codebase context |
138
- | W003 | warning | Glossary has < 5 terms | Note in readiness check |
139
- | W004 | warning | Review-level readiness score (60-79%) | Proceed with caveats |
116
+ | W005 | warning | External research agent failed | Continue without apiResearchContext |
140
117
  </error_codes>
141
118
 
142
119
  <success_criteria>
143
-
144
- **Light mode:**
120
+ - [ ] Interactive mode: interview decision table appended to `.workflow/roadmap.md` "Roadmap Decisions" section
145
121
  - [ ] Requirement parsed with goal, constraints, stakeholders
122
+ - [ ] Milestones defined with deliverable targets and version tags
146
123
  - [ ] Decomposition strategy selected (progressive or direct)
147
- - [ ] Phases defined with success criteria, dependencies, and requirement mappings
124
+ - [ ] Phases defined within milestones with success criteria, dependencies, and requirement mappings
148
125
  - [ ] Every Active requirement from project.md mapped to exactly one phase
149
126
  - [ ] No circular dependencies in phase ordering
150
127
  - [ ] User approved roadmap (or auto-approved with -y)
151
- - [ ] `.workflow/roadmap.md` written with phase details, scope decisions, and progress table
128
+ - [ ] `.workflow/roadmap.md` written with Milestone > Phase hierarchy, scope decisions, and progress table
152
129
  - [ ] No phase directories created (phases are labels in roadmap, not directories)
153
-
154
- **Full mode (in addition to light mode criteria for roadmap):**
155
- - [ ] `spec-config.json` created with session metadata and phase tracking
156
- - [ ] `product-brief.md` with vision, goals, scope, multi-perspective synthesis
157
- - [ ] `glossary.json` with 5+ core terms for cross-document consistency
158
- - [ ] `requirements/` directory with `_index.md` + individual `REQ-*.md` + `NFR-*.md` files
159
- - [ ] All requirements have RFC 2119 keywords and acceptance criteria
160
- - [ ] `architecture/` directory with `_index.md` + individual `ADR-*.md` files
161
- - [ ] Architecture includes state machine, config model, error handling, observability (service type)
162
- - [ ] `epics/` directory with `_index.md` + individual `EPIC-*.md` files
163
- - [ ] Cross-Epic dependency map (Mermaid) and MVP subset tagged
164
- - [ ] `readiness-report.md` with 4-dimension quality scores and traceability matrix
165
- - [ ] `spec-summary.md` with one-page executive summary
166
- - [ ] All documents have valid YAML frontmatter with session_id
167
- - [ ] Glossary terms used consistently across all documents
168
- - [ ] Readiness gate: Pass (>=80%) or Review (>=60%) with documented caveats
169
- - [ ] `.workflow/roadmap.md` written
130
+ - [ ] Artifact registered in state.json with milestone entries
170
131
  </success_criteria>
@@ -14,7 +14,7 @@ allowed-tools:
14
14
  Run unified automated testing via CSV layer pipeline. Reads project state to auto-select the optimal scenario source — PRD specs (when spec package exists), coverage gaps (when Nyquist audit found gaps), or code exploration (default). All sources converge into a CSV pipeline: discover infrastructure → plan → build scenarios.csv → write tests per layer (spawn_agents_on_csv parallel) → execute → diagnose failures (spawn_agents_on_csv parallel) → iterate → report.
15
15
 
16
16
  Key mechanisms:
17
- - **Intelligent routing**: Reads `.tests/`, `.workflow/.spec/`, `verification.json` to auto-select source — no mode flag needed
17
+ - **Intelligent routing**: Reads `.tests/`, `.workflow/blueprint/`, `verification.json` to auto-select source — no mode flag needed
18
18
  - **CSV parallel test writing**: Per-layer `spawn_agents_on_csv` — each agent writes one test file independently
19
19
  - **CSV parallel failure diagnosis**: Failed scenarios dispatched via `spawn_agents_on_csv` for classification + fix
20
20
  - **Unified iteration engine**: Nested inner loop (fix test_defects via diagnosis CSV, max 3/layer) + outer loop (adaptive strategy, max N iterations)
@@ -75,7 +75,7 @@ After codebase exploration, scan results for context-aware trigger signals (base
75
75
 
76
76
  ## Phase 4: Context Packaging
77
77
 
78
- 1. Write spec-config.json → <session>/spec/
78
+ 1. Write blueprint-config.json → <session>/spec/
79
79
  2. Write discovery-context.json → <session>/spec/
80
80
  3. Inline Discuss (DISCUSS-001):
81
81
  - Artifact: <session>/spec/discovery-context.json
@@ -22,7 +22,7 @@
22
22
  2. Load quality gate thresholds from specs/quality-gates.md
23
23
  3. Score each dimension
24
24
  4. Run cross-document validation
25
- 5. Generate readiness-report.md + spec-summary.md
25
+ 5. Generate readiness-report.md + blueprint-summary.md
26
26
  6. Run DISCUSS-003:
27
27
  - Artifact: <session>/spec/readiness-report.md
28
28
  - Perspectives: product, technical, quality, risk, coverage
@@ -41,4 +41,4 @@
41
41
 
42
42
  Write to <session>/artifacts/:
43
43
  - readiness-report.md: Dimension scores, issue list, traceability matrix
44
- - spec-summary.md: Executive summary of all spec docs
44
+ - blueprint-summary.md: Executive summary of all spec docs
@@ -47,7 +47,7 @@ Template-driven document generation with progressive dependency loading.
47
47
 
48
48
  ### Inputs
49
49
  - Template from routing table
50
- - spec-config.json from <session>/spec/
50
+ - blueprint-config.json from <session>/spec/
51
51
  - discovery-context.json from <session>/spec/
52
52
  - Prior decisions from context_accumulator (inner loop)
53
53
  - Discussion feedback from <session>/discussions/ (if exists)
@@ -32,7 +32,7 @@ status: draft
32
32
  generated_at: {timestamp}
33
33
  version: 1
34
34
  dependencies:
35
- - ../spec-config.json
35
+ - ../blueprint-config.json
36
36
  - ../product-brief.md
37
37
  - ../requirements/_index.md
38
38
  ---
@@ -246,9 +246,9 @@ date: {timestamp}
246
246
 
247
247
  | Variable | Source | Description |
248
248
  |----------|--------|-------------|
249
- | `{session_id}` | spec-config.json | Session identifier |
249
+ | `{session_id}` | blueprint-config.json | Session identifier |
250
250
  | `{timestamp}` | Runtime | ISO8601 generation timestamp |
251
251
  | `{product_name}` | product-brief.md | Product/feature name |
252
252
  | `{NNN}` | Auto-increment | ADR/requirement number |
253
253
  | `{slug}` | Auto-generated | Kebab-case from decision title |
254
- | `{has_codebase}` | spec-config.json | Whether existing codebase exists |
254
+ | `{has_codebase}` | blueprint-config.json | Whether existing codebase exists |
@@ -32,7 +32,7 @@ status: draft
32
32
  generated_at: {timestamp}
33
33
  version: 1
34
34
  dependencies:
35
- - ../spec-config.json
35
+ - ../blueprint-config.json
36
36
  - ../product-brief.md
37
37
  - ../requirements/_index.md
38
38
  - ../architecture/_index.md
@@ -187,7 +187,7 @@ status: draft
187
187
 
188
188
  | Variable | Source | Description |
189
189
  |----------|--------|-------------|
190
- | `{session_id}` | spec-config.json | Session identifier |
190
+ | `{session_id}` | blueprint-config.json | Session identifier |
191
191
  | `{timestamp}` | Runtime | ISO8601 generation timestamp |
192
192
  | `{product_name}` | product-brief.md | Product/feature name |
193
193
  | `{EPIC}` | Auto-increment | Epic number (3 digits) |
@@ -23,7 +23,7 @@ generated_at: {timestamp}
23
23
  stepsCompleted: []
24
24
  version: 1
25
25
  dependencies:
26
- - spec-config.json
26
+ - blueprint-config.json
27
27
  ---
28
28
 
29
29
  # Product Brief: {product_name}
@@ -117,7 +117,7 @@ dependencies:
117
117
 
118
118
  ## References
119
119
 
120
- - Derived from: [spec-config.json](spec-config.json)
120
+ - Derived from: [blueprint-config.json](blueprint-config.json)
121
121
  - Next: [Requirements PRD](requirements.md)
122
122
  ```
123
123
 
@@ -125,7 +125,7 @@ dependencies:
125
125
 
126
126
  | Variable | Source | Description |
127
127
  |----------|--------|-------------|
128
- | `{session_id}` | spec-config.json | Session identifier |
128
+ | `{session_id}` | blueprint-config.json | Session identifier |
129
129
  | `{timestamp}` | Runtime | ISO8601 generation timestamp |
130
130
  | `{product_name}` | Seed analysis | Product/feature name |
131
131
  | `{executive_summary}` | CLI synthesis | 2-3 sentence summary |
@@ -36,7 +36,7 @@ status: draft
36
36
  generated_at: {timestamp}
37
37
  version: 1
38
38
  dependencies:
39
- - ../spec-config.json
39
+ - ../blueprint-config.json
40
40
  - ../product-brief.md
41
41
  ---
42
42
 
@@ -215,7 +215,7 @@ status: draft
215
215
 
216
216
  | Variable | Source | Description |
217
217
  |----------|--------|-------------|
218
- | `{session_id}` | spec-config.json | Session identifier |
218
+ | `{session_id}` | blueprint-config.json | Session identifier |
219
219
  | `{timestamp}` | Runtime | ISO8601 generation timestamp |
220
220
  | `{product_name}` | product-brief.md | Product/feature name |
221
221
  | `{NNN}` | Auto-increment | Requirement number (zero-padded 3 digits) |
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: cli-explore-agent
3
- description: |
4
- Read-only code exploration agent with dual-source analysis strategy (Bash + CLI semantic).
5
- Orchestrates 4-phase workflow: Task Understanding → Analysis Execution → Schema Validation → Output Generation.
3
+ description: Read-only code exploration via Bash + CLI semantic dual-source analysis, with schema-validated structured output.
6
4
  allowed-tools:
7
5
  - Read
8
6
  - Glob