maestro-flow 0.4.11 → 0.4.13

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 (253) 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 +220 -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/learn-decompose/SKILL.md +6 -6
  8. package/.agents/skills/learn-follow/SKILL.md +4 -4
  9. package/.agents/skills/learn-investigate/SKILL.md +6 -6
  10. package/.agents/skills/learn-retro/SKILL.md +7 -7
  11. package/.agents/skills/learn-second-opinion/SKILL.md +4 -4
  12. package/.agents/skills/maestro/SKILL.md +61 -27
  13. package/.agents/skills/maestro-amend/SKILL.md +1 -0
  14. package/.agents/skills/maestro-analyze/SKILL.md +37 -4
  15. package/.agents/skills/maestro-blueprint/SKILL.md +133 -0
  16. package/.agents/skills/maestro-brainstorm/SKILL.md +120 -103
  17. package/.agents/skills/maestro-fork/SKILL.md +1 -1
  18. package/.agents/skills/maestro-guard/SKILL.md +3 -2
  19. package/.agents/skills/maestro-help/SKILL.md +48 -14
  20. package/.agents/skills/maestro-help/index/catalog.json +29 -11
  21. package/.agents/skills/maestro-help/phases/01-parse-intent.md +1 -1
  22. package/.agents/skills/maestro-help/phases/02-search-present.md +6 -4
  23. package/.agents/skills/maestro-help/phases/03-workflow-guide.md +60 -33
  24. package/.agents/skills/maestro-impeccable/SKILL.md +13 -11
  25. package/.agents/skills/maestro-init/SKILL.md +3 -3
  26. package/.agents/skills/maestro-milestone-audit/SKILL.md +5 -3
  27. package/.agents/skills/maestro-milestone-complete/SKILL.md +7 -5
  28. package/.agents/skills/maestro-milestone-release/SKILL.md +1 -1
  29. package/.agents/skills/maestro-plan/SKILL.md +16 -4
  30. package/.agents/skills/maestro-ralph/SKILL.md +297 -226
  31. package/.agents/skills/maestro-ralph-execute/SKILL.md +82 -67
  32. package/.agents/skills/maestro-roadmap/SKILL.md +43 -81
  33. package/.agents/skills/manage-harvest/SKILL.md +1 -0
  34. package/.agents/skills/manage-issue-discover/SKILL.md +1 -1
  35. package/.agents/skills/manage-knowhow/SKILL.md +1 -1
  36. package/.agents/skills/manage-learn/SKILL.md +4 -4
  37. package/.agents/skills/quality-auto-test/SKILL.md +6 -6
  38. package/.agents/skills/quality-refactor/SKILL.md +1 -1
  39. package/.agents/skills/quality-retrospective/SKILL.md +2 -2
  40. package/.agents/skills/security-audit/SKILL.md +24 -0
  41. package/.agents/skills/spec-remove/SKILL.md +6 -2
  42. package/.agents/skills/team-lifecycle-v4/roles/analyst/role.md +1 -1
  43. package/.agents/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +2 -2
  44. package/.agents/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  45. package/.agents/skills/team-lifecycle-v4/templates/architecture.md +3 -3
  46. package/.agents/skills/team-lifecycle-v4/templates/epics.md +2 -2
  47. package/.agents/skills/team-lifecycle-v4/templates/product-brief.md +3 -3
  48. package/.agents/skills/team-lifecycle-v4/templates/requirements.md +2 -2
  49. package/.agy/agents/cli-explore-agent.md +1 -3
  50. package/.agy/agents/cross-role-reviewer.md +170 -0
  51. package/.agy/agents/role-design-author.md +217 -0
  52. package/.agy/agents/ui-design-agent.md +1 -18
  53. package/.agy/agents/workflow-analyzer.md +1 -1
  54. package/.agy/agents/workflow-external-researcher.md +1 -1
  55. package/.agy/skills/learn-decompose/SKILL.md +6 -6
  56. package/.agy/skills/learn-follow/SKILL.md +4 -4
  57. package/.agy/skills/learn-investigate/SKILL.md +6 -6
  58. package/.agy/skills/learn-retro/SKILL.md +7 -7
  59. package/.agy/skills/learn-second-opinion/SKILL.md +4 -4
  60. package/.agy/skills/maestro/SKILL.md +61 -27
  61. package/.agy/skills/maestro-amend/SKILL.md +1 -0
  62. package/.agy/skills/maestro-analyze/SKILL.md +37 -4
  63. package/.agy/skills/maestro-blueprint/SKILL.md +133 -0
  64. package/.agy/skills/maestro-brainstorm/SKILL.md +120 -103
  65. package/.agy/skills/maestro-fork/SKILL.md +1 -1
  66. package/.agy/skills/maestro-guard/SKILL.md +3 -2
  67. package/.agy/skills/maestro-help/SKILL.md +48 -14
  68. package/.agy/skills/maestro-help/index/catalog.json +29 -11
  69. package/.agy/skills/maestro-help/phases/01-parse-intent.md +1 -1
  70. package/.agy/skills/maestro-help/phases/02-search-present.md +6 -4
  71. package/.agy/skills/maestro-help/phases/03-workflow-guide.md +60 -33
  72. package/.agy/skills/maestro-impeccable/SKILL.md +13 -11
  73. package/.agy/skills/maestro-init/SKILL.md +3 -3
  74. package/.agy/skills/maestro-milestone-audit/SKILL.md +5 -3
  75. package/.agy/skills/maestro-milestone-complete/SKILL.md +7 -5
  76. package/.agy/skills/maestro-milestone-release/SKILL.md +1 -1
  77. package/.agy/skills/maestro-plan/SKILL.md +16 -4
  78. package/.agy/skills/maestro-ralph/SKILL.md +297 -226
  79. package/.agy/skills/maestro-ralph-execute/SKILL.md +82 -67
  80. package/.agy/skills/maestro-roadmap/SKILL.md +43 -81
  81. package/.agy/skills/manage-harvest/SKILL.md +1 -0
  82. package/.agy/skills/manage-issue-discover/SKILL.md +1 -1
  83. package/.agy/skills/manage-knowhow/SKILL.md +1 -1
  84. package/.agy/skills/manage-learn/SKILL.md +4 -4
  85. package/.agy/skills/quality-auto-test/SKILL.md +6 -6
  86. package/.agy/skills/quality-refactor/SKILL.md +1 -1
  87. package/.agy/skills/quality-retrospective/SKILL.md +2 -2
  88. package/.agy/skills/security-audit/SKILL.md +24 -0
  89. package/.agy/skills/spec-remove/SKILL.md +6 -2
  90. package/.agy/skills/team-lifecycle-v4/roles/analyst/role.md +1 -1
  91. package/.agy/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +2 -2
  92. package/.agy/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  93. package/.agy/skills/team-lifecycle-v4/templates/architecture.md +3 -3
  94. package/.agy/skills/team-lifecycle-v4/templates/epics.md +2 -2
  95. package/.agy/skills/team-lifecycle-v4/templates/product-brief.md +3 -3
  96. package/.agy/skills/team-lifecycle-v4/templates/requirements.md +2 -2
  97. package/.claude/agents/cli-explore-agent.md +1 -3
  98. package/.claude/agents/cross-role-reviewer.md +171 -0
  99. package/.claude/agents/role-design-author.md +218 -0
  100. package/.claude/agents/ui-design-agent.md +1 -18
  101. package/.claude/agents/workflow-analyzer.md +1 -1
  102. package/.claude/agents/workflow-external-researcher.md +1 -1
  103. package/.claude/commands/learn-decompose.md +6 -6
  104. package/.claude/commands/learn-follow.md +4 -4
  105. package/.claude/commands/learn-investigate.md +6 -6
  106. package/.claude/commands/learn-retro.md +7 -7
  107. package/.claude/commands/learn-second-opinion.md +4 -4
  108. package/.claude/commands/maestro-amend.md +1 -0
  109. package/.claude/commands/maestro-analyze.md +37 -4
  110. package/.claude/commands/maestro-blueprint.md +131 -0
  111. package/.claude/commands/maestro-brainstorm.md +133 -116
  112. package/.claude/commands/maestro-fork.md +1 -1
  113. package/.claude/commands/maestro-guard.md +3 -2
  114. package/.claude/commands/maestro-impeccable.md +13 -11
  115. package/.claude/commands/maestro-init.md +3 -3
  116. package/.claude/commands/maestro-milestone-audit.md +5 -3
  117. package/.claude/commands/maestro-milestone-complete.md +7 -5
  118. package/.claude/commands/maestro-milestone-release.md +1 -1
  119. package/.claude/commands/maestro-plan.md +16 -4
  120. package/.claude/commands/maestro-ralph-execute.md +82 -67
  121. package/.claude/commands/maestro-ralph.md +297 -226
  122. package/.claude/commands/maestro-roadmap.md +43 -81
  123. package/.claude/commands/maestro.md +61 -27
  124. package/.claude/commands/manage-harvest.md +1 -0
  125. package/.claude/commands/manage-issue-discover.md +1 -1
  126. package/.claude/commands/manage-knowhow.md +1 -1
  127. package/.claude/commands/manage-learn.md +4 -4
  128. package/.claude/commands/quality-auto-test.md +6 -6
  129. package/.claude/commands/quality-refactor.md +1 -1
  130. package/.claude/commands/quality-retrospective.md +2 -2
  131. package/.claude/commands/security-audit.md +24 -0
  132. package/.claude/commands/spec-remove.md +6 -2
  133. package/.claude/skills/maestro-help/SKILL.md +48 -14
  134. package/.claude/skills/maestro-help/index/catalog.json +29 -11
  135. package/.claude/skills/maestro-help/phases/01-parse-intent.md +1 -1
  136. package/.claude/skills/maestro-help/phases/02-search-present.md +6 -4
  137. package/.claude/skills/maestro-help/phases/03-workflow-guide.md +60 -33
  138. package/.claude/skills/team-lifecycle-v4/roles/analyst/role.md +1 -1
  139. package/.claude/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +2 -2
  140. package/.claude/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  141. package/.claude/skills/team-lifecycle-v4/templates/architecture.md +3 -3
  142. package/.claude/skills/team-lifecycle-v4/templates/epics.md +2 -2
  143. package/.claude/skills/team-lifecycle-v4/templates/product-brief.md +3 -3
  144. package/.claude/skills/team-lifecycle-v4/templates/requirements.md +2 -2
  145. package/.codex/skills/learn-decompose/SKILL.md +4 -4
  146. package/.codex/skills/learn-follow/SKILL.md +3 -3
  147. package/.codex/skills/learn-investigate/SKILL.md +3 -3
  148. package/.codex/skills/learn-retro/SKILL.md +3 -3
  149. package/.codex/skills/learn-second-opinion/SKILL.md +3 -3
  150. package/.codex/skills/maestro/SKILL.md +75 -38
  151. package/.codex/skills/maestro-amend/SKILL.md +157 -0
  152. package/.codex/skills/maestro-analyze/SKILL.md +72 -23
  153. package/.codex/skills/maestro-blueprint/SKILL.md +123 -0
  154. package/.codex/skills/maestro-brainstorm/SKILL.md +277 -46
  155. package/.codex/skills/maestro-composer/SKILL.md +1 -1
  156. package/.codex/skills/maestro-execute/SKILL.md +13 -4
  157. package/.codex/skills/maestro-fork/SKILL.md +2 -0
  158. package/.codex/skills/maestro-guard/SKILL.md +3 -2
  159. package/.codex/skills/maestro-help/SKILL.md +28 -18
  160. package/.codex/skills/maestro-help/catalog.json +29 -11
  161. package/.codex/skills/maestro-impeccable/SKILL.md +13 -11
  162. package/.codex/skills/maestro-init/SKILL.md +7 -7
  163. package/.codex/skills/maestro-plan/SKILL.md +27 -9
  164. package/.codex/skills/maestro-ralph/SKILL.md +740 -601
  165. package/.codex/skills/maestro-roadmap/SKILL.md +56 -72
  166. package/.codex/skills/maestro-update/SKILL.md +169 -0
  167. package/.codex/skills/maestro-verify/SKILL.md +11 -2
  168. package/.codex/skills/manage-codebase-rebuild/SKILL.md +9 -5
  169. package/.codex/skills/manage-harvest/SKILL.md +11 -3
  170. package/.codex/skills/manage-issue-discover/SKILL.md +1 -1
  171. package/.codex/skills/manage-knowhow/SKILL.md +1 -1
  172. package/.codex/skills/manage-learn/SKILL.md +3 -3
  173. package/.codex/skills/quality-refactor/SKILL.md +2 -2
  174. package/.codex/skills/quality-retrospective/SKILL.md +12 -5
  175. package/.codex/skills/security-audit/SKILL.md +24 -0
  176. package/.codex/skills/spec-remove/SKILL.md +8 -2
  177. package/.codex/skills/team-lifecycle-v4/roles/analyst/role.md +2 -2
  178. package/.codex/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +2 -2
  179. package/.codex/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  180. package/.codex/skills/team-lifecycle-v4/templates/architecture.md +3 -3
  181. package/.codex/skills/team-lifecycle-v4/templates/epics.md +2 -2
  182. package/.codex/skills/team-lifecycle-v4/templates/product-brief.md +3 -3
  183. package/.codex/skills/team-lifecycle-v4/templates/requirements.md +2 -2
  184. package/README.md +8 -8
  185. package/README.zh-CN.md +8 -8
  186. package/dashboard/dist-server/dashboard/src/server/routes/settings.js +3 -3
  187. package/dashboard/dist-server/dashboard/src/server/routes/settings.js.map +1 -1
  188. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  189. package/dist/src/agents/cli-agent-runner.js +13 -7
  190. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  191. package/dist/src/commands/spec.d.ts.map +1 -1
  192. package/dist/src/commands/spec.js +8 -1
  193. package/dist/src/commands/spec.js.map +1 -1
  194. package/dist/src/tools/spec-init.d.ts +16 -2
  195. package/dist/src/tools/spec-init.d.ts.map +1 -1
  196. package/dist/src/tools/spec-init.js +58 -187
  197. package/dist/src/tools/spec-init.js.map +1 -1
  198. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  199. package/dist/src/tools/spec-loader.js +16 -16
  200. package/dist/src/tools/spec-loader.js.map +1 -1
  201. package/dist/src/tools/spec-seeds.d.ts +33 -0
  202. package/dist/src/tools/spec-seeds.d.ts.map +1 -0
  203. package/dist/src/tools/spec-seeds.js +200 -0
  204. package/dist/src/tools/spec-seeds.js.map +1 -0
  205. package/dist/src/tools/spec-writer.d.ts.map +1 -1
  206. package/dist/src/tools/spec-writer.js +7 -9
  207. package/dist/src/tools/spec-writer.js.map +1 -1
  208. package/dist/src/utils/update-notices.js +12 -0
  209. package/dist/src/utils/update-notices.js.map +1 -1
  210. package/package.json +1 -1
  211. package/templates/business-test-report.json +1 -1
  212. package/templates/index.json +1 -1
  213. package/templates/roadmap.md +15 -9
  214. package/templates/state.json +18 -17
  215. package/workflows/agy-instructions.md +2 -0
  216. package/workflows/analyze.md +79 -11
  217. package/workflows/auto-test.md +12 -7
  218. package/workflows/blueprint.md +431 -0
  219. package/workflows/brainstorm.md +617 -496
  220. package/workflows/business-test.md +7 -7
  221. package/workflows/claude-instructions.md +2 -0
  222. package/workflows/codebase-rebuild.md +4 -4
  223. package/workflows/codex-instructions.md +16 -83
  224. package/workflows/debug.md +1 -1
  225. package/workflows/harvest.md +184 -10
  226. package/workflows/impeccable.md +2 -0
  227. package/workflows/init.md +9 -8
  228. package/workflows/issue-analyze.md +14 -100
  229. package/workflows/issue-discover.md +2 -3
  230. package/workflows/issue-execute.md +1 -1
  231. package/workflows/issue-gaps-analyze.md +2 -0
  232. package/workflows/learn.md +1 -1
  233. package/workflows/maestro-chain-execute.md +10 -228
  234. package/workflows/maestro.md +2 -1
  235. package/workflows/milestone-audit.md +12 -4
  236. package/workflows/milestone-complete.md +14 -9
  237. package/workflows/milestone-release.md +82 -0
  238. package/workflows/plan.md +91 -25
  239. package/workflows/retrospective.md +1 -1
  240. package/workflows/roadmap-common.md +1 -1
  241. package/workflows/roadmap.md +14 -4
  242. package/workflows/spec-generate.md +26 -13
  243. package/workflows/specs-add.md +6 -1
  244. package/workflows/specs-load.md +6 -1
  245. package/workflows/specs-setup.md +6 -1
  246. package/workflows/sync.md +13 -0
  247. package/workflows/tools-spec.md +4 -0
  248. package/workflows/ui-design.md +5 -5
  249. package/workflows/ui-style.md +1 -1
  250. package/workflows/wiki-manage.md +2 -0
  251. package/.agents/agents/conceptual-planning-agent.md +0 -247
  252. package/.agy/agents/conceptual-planning-agent.md +0 -244
  253. package/.claude/agents/conceptual-planning-agent.md +0 -245
@@ -51,8 +51,13 @@ $ARGUMENTS — user intent text, or special keywords.
51
51
  1. **All chains dispatch via maestro-ralph-execute** — maestro never executes steps directly
52
52
  2. **Session before execution** — status.json created before any step runs
53
53
  3. **Auto flags only to supporting commands** — unlisted commands execute as-is
54
- 4. **Decomposition contract shared with maestro-ralph** — broad/lifecycle intents run S_DECOMPOSE producing the SAME additive block (`boundary_contract`, `execution_criteria`, `task_decomposition`, `goal_checklist_path`) + `goal-checklist.md`, then EMIT the `/goal` bind prompt. Reference maestro-ralph `A_DECOMPOSE_TASKS` for the full spec; do not duplicate logic
55
- 5. **Status JSON: schema-additive + step-dynamic** decomposition fields OPTIONAL (absent → old flat-chain behavior); `steps[]` is a living array grown at runtime by ralph-execute's `post-goal-audit`. Never remove/rename existing fields
54
+ 4. **Decomposition contract shared with maestro-ralph** — broad/lifecycle intents run S_DECOMPOSE producing the SAME additive block (`boundary_contract`, `execution_criteria`, `task_decomposition`)Reference maestro-ralph `A_DECOMPOSE_TASKS`
55
+ 5. **status.json 唯一真源**不生成 `goal-checklist.md` 或外部清单
56
+ 6. **Default step type = internal** — chain 内每个 step 解析 `command_scope`/`command_path`(全局优先 `~/.claude/commands/{name}.md`,fallback 项目)
57
+ 7. **Topology awareness** — chain catalog 含 brainstorm / blueprint / analyze-macro(text) / analyze(numeric phase) / roadmap / plan(三路径) / execute / verify / ...;scope_verdict 路由由 ralph 在 `post-analyze-scope` 决定
58
+ 8. **D-007 milestone 反查** — 数字 phase 步骤的 `milestone_id` 由 `state.json.milestones[].phase_slugs` 反查得出
59
+ 9. **每个 step 必须 `completion_confirmed: true`** — 基于 `--- COMPLETION STATUS ---` 的 `STATUS: DONE`
60
+ 10. **schema 向后兼容** — 新增字段全部可选;既有字段名不删不改
56
61
  </invariants>
57
62
 
58
63
  <state_machine>
@@ -129,9 +134,16 @@ S_FALLBACK:
129
134
  ### A_CLASSIFY_INTENT
130
135
 
131
136
  1. Read `~/.maestro/workflows/maestro.md` from deferred_reading
132
- 2. Match intent to best task_type via chain catalog (semantic, AI-driven)
133
- 3. Select chain from chainMap
134
- 4. Determine per-step type: `internal` (Skill) or `external` (delegate)
137
+ 2. Match intent to task_type via chain catalog (semantic)
138
+ 3. Select chain from chainMap,遵循拓扑约束:
139
+ - 头脑风暴/探索 `brainstorm`
140
+ - 正式规格/spec-generate/7-phase → `blueprint`
141
+ - 项目初始化 → `init`
142
+ - 宽/中等意图 + 无数字 phase → `analyze-macro`(产 scope_verdict,由 ralph 在 `post-analyze-scope` 决定是否插入 roadmap+analyze 或直跳 plan --from analyze)
143
+ - 数字 phase 上下文 → `analyze {phase}` → `plan {phase}` → `execute {phase}` → `verify {phase}` → quality pipeline
144
+ - 已有 analyze artifact 想直达执行 → `plan --from analyze:{ANL_ID}` → execute → verify
145
+ - 已有 blueprint artifact → `plan --from blueprint:{BLP_ID}` → execute → verify
146
+ 4. 每个 step 默认 `type: "internal"`;解析 `command_scope` + `command_path`(全局优先 fallback 项目);写入 `step.stage` / `step.scope` / `step.source_artifact_ref`(如 `--from` 注入时)
135
147
 
136
148
  ### A_CLARIFY
137
149
 
@@ -140,36 +152,52 @@ S_FALLBACK:
140
152
 
141
153
  ### A_DECOMPOSE_TASKS
142
154
 
143
- 与 maestro-ralph `A_DECOMPOSE_TASKS` 共享分解契约 —— 引用该规范,不重复表格。Condensed:
155
+ 与 maestro-ralph `A_DECOMPOSE_TASKS` 共享分解契约。Condensed:
144
156
 
145
- 1. 分类意图广度(broad: 重构/全面/重写/迁移/overhaul/migrate/rewrite;narrow: 单文件/函数/bug)。narrow / 单步 / `{status,init,quick}` 链直接跳过
146
- 2. broad/medium → `ask_user` ≤3 轮:Scope(in/out)| Constraints(兼容/API/perf/test)| Definition of Done
147
- 3. 派生 `execution_criteria`(3-6 条命令式规则)+ `task_decomposition`(outcome 子目标,`done_when` 客观可校验,绑定到 ralph 产物:verification.json / review.json / uat.md / test path)
148
- 4. **status.json 为唯一真源**:写入 `boundary_contract` / `execution_criteria` / `task_decomposition` / `goal_checklist_path`;从 status.json 投影渲染 `{session_dir}/goal-checklist.md`(同 maestro-ralph 的 Sync Rule,含 Resume 区块指向 `/maestro-ralph continue`)
149
- 5. 在链路末尾(evidence 产出步骤之后、milestone-complete/close-out 之前)追加 `{ type: "decision", decision: "post-goal-audit", retry_count: 0, max_retries: 2 }`。ralph-execute 在该节点动态生长 `steps[]` 以收敛未达成子目标
150
- 6. **输出 `/goal` 绑定提示词(参考文档 + 内嵌 ralph 调用):**
157
+ 1. 分类意图广度。narrow / 单步 / `{status,init,quick}` 链跳过
158
+ 2. broad/medium → `ask_user` ≤3 轮:Scope / Constraints / Definition of Done
159
+ 3. 派生 `execution_criteria` + `task_decomposition`(每个 sub-goal 含 `done_when` + `evidence` + `lifecycle` + `completion_confirmed: false`)
160
+ 4. **status.json 唯一真源**:写入 `boundary_contract` / `execution_criteria` / `task_decomposition`;不生成 markdown 清单
161
+ 5. 在最后一个 evidence-producing stage(verify/review/test)之后、`milestone-complete` 之前追加 `decision:post-goal-audit`。ralph-execute 在该节点按需动态生长 `steps[]`
162
+ 6. **输出 `/goal` 绑定提示词:**
151
163
  ```
152
164
  📋 任务分解完成。复制下面一行设定目标,会话在子目标全部达成前不停:
153
165
 
154
- /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 或越界。
166
+ /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。
155
167
  ```
156
- `/goal` 仅用户可输入;判据以 status.json 为权威,哨兵为等价信号。
157
168
 
158
169
  ### A_CREATE_SESSION
159
170
 
160
- 1. Read `.workflow/state.json` for project context (phase, milestone)
161
- 2. Create `.workflow/.maestro/maestro-{YYYYMMDD-HHMMSS}/status.json`:
171
+ 1. Read `.workflow/state.json` 获取 phase / milestone(含 D-007 反查 `phase_slugs`);读最新 macro analyze artifact 注入 `scope_verdict` + `analyze_macro_id`(如存在);读最新 blueprint artifact 注入 `blueprint_id`
172
+ 2. Create `.workflow/.maestro/maestro-{YYYYMMDD-HHMMSS}/status.json`(与 ralph 共用 schema):
162
173
  ```json
163
- { "session_id", "source": "maestro", "intent", "task_type", "chain_name",
164
- "phase", "milestone", "auto_mode", "exec_mode", "cli_tool",
165
- "context": { ... }, "steps": [{ "index", "skill", "args", "type", "status": "pending", "goal_ref": null }],
174
+ {
175
+ "session_id", "source": "maestro", "intent", "task_type", "chain_name",
176
+ "phase", "phase_is_new": false, "milestone": "",
177
+ "scope_verdict": null, "analyze_macro_id": null, "blueprint_id": null,
178
+ "auto_mode": false, "exec_mode": "auto", "cli_tool": "claude",
179
+ "context": { "scratch_dir": null, "plan_dir": null, "analysis_dir": null,
180
+ "brainstorm_dir": null, "blueprint_dir": null, "issue_id": null },
181
+ "steps": [{
182
+ "index": 0, "type": "internal|external|decision",
183
+ "skill": "", "args": "",
184
+ "stage": "", "scope": null,
185
+ "command_scope": "global|project|missing|null",
186
+ "command_path": "~/.claude/commands/{name}.md | .claude/commands/{name}.md | null",
187
+ "milestone_id": null, "source_artifact_ref": null,
188
+ "status": "pending", "goal_ref": null,
189
+ "completion_confirmed": false, "completion_status": null,
190
+ "completion_evidence": null, "completed_at": null
191
+ }],
166
192
  "waves": [], "current_step": 0, "status": "running",
167
- "_comment": " OPTIONAL additive block — present only if S_DECOMPOSE ran; absent → old flat-chain behavior",
168
- "boundary_contract": {}, "execution_criteria": [], "task_decomposition": [], "goal_checklist_path": "" }
193
+ "boundary_contract": {}, "execution_criteria": [],
194
+ "task_decomposition": [], "task_decomposition_all_done": false
195
+ }
169
196
  ```
170
- Decomposition fields written ONLY if A_DECOMPOSE_TASKS produced them (additive; never break flat-chain readers)
171
- 3. Initialize tracking via `track_tasks`. The decomposition goal is bound by the user via the emitted `/goal` prompt
172
- 4. If `--super`: read `maestro-super.md`, follow it completely
197
+ Decomposition 字段仅在 A_DECOMPOSE_TASKS 产出时写入(additive
198
+ 3. Validate: 所有 step `command_scope != "missing"`;否则 raise E005 列出缺失 skill
199
+ 4. Initialize tracking via `track_tasks`
200
+ 5. If `--super`: read `maestro-super.md`, follow it completely
173
201
 
174
202
  </actions>
175
203
 
@@ -184,6 +212,7 @@ S_FALLBACK:
184
212
  | maestro-init | `-y` | Skip interactive questioning |
185
213
  | maestro-analyze | `-y` | Skip scoping, auto-deepen |
186
214
  | maestro-brainstorm | `-y` | Skip questions, use defaults |
215
+ | maestro-blueprint | `-y` | Skip interview, use recommended defaults |
187
216
  | maestro-roadmap | `-y` | Skip questions (create/revise/review) |
188
217
  | maestro-impeccable | `-y` | Auto-select design variant + skip confirmations |
189
218
  | maestro-plan | `-y` | Skip confirmations and clarification |
@@ -203,6 +232,7 @@ Unlisted commands have no auto flags.
203
232
  | E002 | error | Clarity too low after 2 rounds | Show parsed intent, ask rephrase |
204
233
  | E003 | error | Chain step failed + user abort | Record partial, suggest -c resume |
205
234
  | E004 | error | Resume session not found | Show available sessions |
235
+ | E005 | error | command_scope == "missing" for one or more steps | List missing skills, abort build |
206
236
  | W001 | warning | Ambiguous intent, multiple chains | Present options |
207
237
  | W002 | warning | Step completed with warnings | Log and continue |
208
238
  | W003 | warning | State suggests different chain | Show discrepancy |
@@ -210,11 +240,15 @@ Unlisted commands have no auto flags.
210
240
  ### Success Criteria
211
241
 
212
242
  - [ ] Intent classified with task_type, complexity, clarity_score
213
- - [ ] Broad lifecycle intents decomposed (S_DECOMPOSE, ≤3 boundary questions) sharing maestro-ralph contract; narrow/single-step skip
214
- - [ ] status.json 为唯一真源;goal-checklist.md 为投影视图(Resume 区块内嵌 `/maestro-ralph continue`);post-goal-audit 节点追加;/goal 提示词内含"读 checklist + 调 /maestro-ralph continue"双重指引
243
+ - [ ] Chain catalog 覆盖 brainstorm / blueprint / analyze-macro / analyze / roadmap / plan(三路径) / execute / verify / quality pipeline
244
+ - [ ] D-007: 数字 phase 步骤的 `milestone_id` 通过 `state.json.milestones[].phase_slugs` 反查
245
+ - [ ] macro analyze 后跟 `decision:post-analyze-scope`(由 ralph 评估 scope_verdict 决定下游链路)
246
+ - [ ] plan 支持 `{phase}` / `--from analyze:{ANL_ID}` / `--from blueprint:{BLP_ID}` 三路径;`source_artifact_ref` 写入 step
247
+ - [ ] Broad lifecycle intents decomposed (≤3 boundary questions); narrow/single-step skip
248
+ - [ ] status.json 唯一真源;无 markdown 清单;post-goal-audit 节点在 decomposed 时追加;/goal 提示词以 status.json 为判据
215
249
  - [ ] Chain selected and confirmed (or auto-confirmed)
216
250
  - [ ] Session dir created with status.json before execution; decomposition fields additive-only
217
- - [ ] Tracking via track_tasks (Claude); status.json steps[] grown dynamically by ralph-execute post-goal-audit
251
+ - [ ] 每个 step `command_scope` + `command_path` + `completion_confirmed` 字段
218
252
  - [ ] Auto flags propagated to supporting commands only
219
253
  - [ ] All chains dispatched via maestro-ralph-execute
220
254
  - [ ] Low-complexity intents routed to maestro-quick
@@ -150,6 +150,7 @@ On validation failure: fix JSON, retry (max 2).
150
150
  | Code | Condition | Recovery |
151
151
  |------|-----------|----------|
152
152
  | E001 | No signals from any source | Verify artifact paths or provide description |
153
+ | E002 | Signal source path invalid or unreadable | Check `--from-*` path; ensure artifact exists |
153
154
  | E003 | All signals are code bugs, not command gaps | Use /maestro-quick or /maestro-plan --gaps |
154
155
  | E004 | Overlay validation failed after 2 retries | Review JSON manually |
155
156
  | W001 | Some signals skipped (code bugs) | Route to appropriate fix command |
@@ -34,12 +34,23 @@ Use `--gaps` for issue-focused root cause analysis (replaces manage-issue-analyz
34
34
  </deferred_reading>
35
35
 
36
36
  <context>
37
- $ARGUMENTS -- phase number for milestone-scoped, topic text for adhoc/standalone mode, no args for milestone-wide.
37
+ $ARGUMENTS -- phase number for micro mode, topic text for macro/adhoc mode, no args for milestone-wide.
38
+
39
+ **Dual-layer mode:**
40
+ - **Macro mode** (text argument): Explore impact surface of a topic/requirement. Produces coarse-grained context with `scope_verdict` to route next step. Use before roadmap or for standalone analysis.
41
+ - **Micro mode** (numeric argument): Phase-level deep analysis within an existing roadmap. Produces fine-grained context for plan consumption. `analyze 1` = Phase 1 of current milestone.
42
+
43
+ **Disambiguation rule (mode selection):**
44
+ - First positional arg matches `^\d+$` (pure digits, e.g. `1`, `42`) → **micro mode** (treat as phase number)
45
+ - First positional arg is non-numeric text (e.g. `auth-refactor`, `improve search`) → **macro mode** (treat as topic)
46
+ - No positional arg → milestone-wide micro mode (when roadmap present) else macro fallback
47
+ - Mixed input like `"1 phase"` is treated as text → macro mode (only bare numerics trigger micro)
38
48
 
39
49
  **Flags:**
40
50
  - `-y` / `--yes`: Auto mode — skip interactive scoping, use recommended defaults, auto-deepen
41
51
  - `-c` / `--continue`: Resume from existing session (auto-detect session folder + discussion.md)
42
52
  - `-q` / `--quick`: Quick mode — skip exploration + scoring, go straight to decision extraction (context.md only)
53
+ - `--from <source>`: Load upstream context package (brainstorm:ID, blueprint:BLP-xxx, @file, or path)
43
54
  - `--gaps [ISS-ID]`: Issue root cause analysis mode. If ISS-ID provided, analyze single issue. If omitted, analyze all open/registered issues from issues.jsonl.
44
55
 
45
56
  Scope routing, output directory format, artifact registration schema, and output artifact listing are defined in workflow analyze.md (Scope Routing and Output Structure sections).
@@ -48,6 +59,21 @@ Scope routing, output directory format, artifact registration schema, and output
48
59
  `maestro wiki list --category debug` → select relevant → `maestro wiki load`
49
60
  </context>
50
61
 
62
+ <interview_protocol>
63
+ Interview the user relentlessly until shared understanding is reached. Active only in interactive mode; skip when `-y/--yes`, `-c/--continue`, or input is already specific (explicit phase number or unambiguous topic).
64
+
65
+ - One decision per turn via ask_user with 2–4 options + a (Recommended) default. The user controls termination — keep interviewing until convergence; they can interrupt naturally or via `Other` at any time.
66
+ - Search-first when uncertain: before asking, resolve via `state.json`, `roadmap.md`, `issues.jsonl`, `maestro spec load`, `maestro wiki search`, Grep, Read, or — for open-ended multi-file scans — spawn `delegate_subagent(subagent_type: Explore)` / `maestro delegate ... --role explore`. Never ask what code or memory can verify; never bounce your own ambiguity back to the user — search first, then ask only what truly needs human judgment.
67
+ - Writeback cadence: each settled decision is immediately appended/updated in `discussion.md` (top table) and mirrored into `context.md` "Interview Decisions". Do NOT batch writeback to the end — partial decisions must already be on disk before the next question.
68
+ - Walk the decision dependency tree strictly: scope → depth → dimensions → Go/No-Go threshold. Do not open the next branch until the current one is settled.
69
+ - Scope guard: only ask about decisions owned by `analyze`. Do not prejudge plan/execute concerns.
70
+
71
+ Decision points: scope (phase / topic / milestone-wide / adhoc / --gaps) → depth (quick / standard / deep) → dimensions (which of the 6 to keep) → Go/No-Go threshold.
72
+
73
+ Exit: when all decision points are settled (or user explicitly signals to proceed), finalize session metadata. The decision table (populated incrementally during interview) uses this schema:
74
+ `| # | Decision | Choice | Source (user / code / default) |`
75
+ </interview_protocol>
76
+
51
77
  <execution>
52
78
  Follow '~/.maestro/workflows/analyze.md' completely.
53
79
 
@@ -78,15 +104,21 @@ Phase 4: Output context.md for downstream plan --gaps
78
104
 
79
105
  **Handoff:** context.md is consumed by maestro-plan (loads Locked/Free/Deferred decisions). In --gaps mode, context.md contains issue root causes for `plan --gaps` consumption.
80
106
 
107
+ **scope_verdict** (added to context.md in Step 6 Synthesis for macro/adhoc/standalone scopes):
108
+ - `large` (3+ independent subsystems or hard serial dependencies) → suggest `/maestro-roadmap --from analyze:ANL-xxx`
109
+ - `medium` (1-2 subsystems, parallelizable) → suggest `/maestro-plan --from analyze:ANL-xxx`
110
+ - `small` (single-file or few-file change) → suggest `/maestro-plan --from analyze:ANL-xxx`
111
+
81
112
  **Next-step routing on completion:**
82
113
 
83
- Phase/Milestone scope:
114
+ Phase/Milestone scope (micro mode):
84
115
  - Go recommendation, UI work needed → `/maestro-impeccable build {target}`
85
116
  - Go recommendation, ready to plan → `/maestro-plan` or `/maestro-plan {phase}`
86
117
  - No-Go recommendation → revisit requirements or `/maestro-brainstorm {topic}`
87
118
 
88
- Adhoc/Standalone scope:
89
- - Ready to plan → `/maestro-plan --dir {scratch_dir}`
119
+ Macro/Adhoc/Standalone scope:
120
+ - scope_verdict = large → `/maestro-roadmap --from analyze:ANL-xxx`
121
+ - scope_verdict = medium/small → `/maestro-plan --from analyze:ANL-xxx`
90
122
  - Need more exploration → `/maestro-analyze {topic} -c`
91
123
 
92
124
  Gaps scope:
@@ -125,6 +157,7 @@ Gaps mode:
125
157
  - [ ] context.md written with aggregated root causes for plan --gaps
126
158
 
127
159
  Both modes (full + quick):
160
+ - [ ] Interactive mode: interview decision table written to `discussion.md` and mirrored into `context.md` "Interview Decisions"
128
161
  - [ ] context.md written with all decisions classified as Locked/Free/Deferred
129
162
  - [ ] Gray areas identified through phase-specific analysis
130
163
  - [ ] Decision Recording Protocol applied to all decisions
@@ -0,0 +1,133 @@
1
+ ---
2
+ name: maestro-blueprint
3
+ description: Generate formal specification package (Product Brief, PRD, Architecture, Epics) through 6-phase document chain
4
+ argument-hint: "<idea or @file> [-y] [-c] [--from <source>]"
5
+ allowed-tools:
6
+ - read_file
7
+ - write_file
8
+ - edit_file
9
+ - shell
10
+ - find_files
11
+ - search
12
+ - delegate_subagent
13
+ - ask_user
14
+ ---
15
+ <!-- Open-standard mirror generated by scripts/build-agents-standard.mjs — do not edit; re-run after editing .claude/ source. -->
16
+
17
+ <purpose>
18
+ Formal specification document chain producing a complete specification package through 6 sequential phases with multi-CLI analysis and interactive refinement. Pure documentation — no code generation, no roadmap generation.
19
+
20
+ Parallel to `brainstorm` as an upstream origin command:
21
+ - **brainstorm** = divergent exploration (lightweight, multi-role creative)
22
+ - **blueprint** = convergent documentation (heavyweight, 6-phase formal spec chain)
23
+
24
+ Output: `.workflow/blueprint/BLP-{slug}-{date}/` containing Product Brief, PRD, Architecture, and Epics.
25
+ </purpose>
26
+
27
+ <required_reading>
28
+ @~/.maestro/workflows/blueprint.md
29
+ </required_reading>
30
+
31
+ <deferred_reading>
32
+ - [blueprint-config.json](~/.maestro/templates/blueprint-config.json) — read when initializing blueprint configuration
33
+ </deferred_reading>
34
+
35
+ <context>
36
+ $ARGUMENTS -- idea text, @file reference, or upstream context source.
37
+
38
+ **Flags:**
39
+ - `-y` / `--yes`: Auto mode — skip interactive questions, use recommended defaults
40
+ - `-c` / `--continue`: Resume from last checkpoint (reads blueprint-config.json)
41
+ - `--from <source>`: Load upstream context package (brainstorm:ID, @file, or path). Consumes context-package.json
42
+ - `--from-brainstorm SESSION-ID`: (backward compat alias for `--from brainstorm:ID`)
43
+
44
+ **Input types:**
45
+ - Direct text: `"Build a real-time collaboration platform with WebSocket"`
46
+ - File reference: `@requirements.md`
47
+ - Context import: `--from brainstorm:BRN-001` or `--from @requirements.md` or `--from path/`
48
+ - Resume: `-c` (resumes from first incomplete phase)
49
+
50
+ **Pipeline position:**
51
+ ```
52
+ maestro-brainstorm (optional upstream)
53
+ ↓ guidance-specification.md / context-package.json
54
+ maestro-blueprint
55
+ ↓ .workflow/blueprint/BLP-{slug}-{date}/
56
+ maestro-analyze → maestro-roadmap → maestro-plan
57
+ ```
58
+
59
+ **Output boundary**: ALL file writes MUST target `.workflow/blueprint/BLP-{slug}-{date}/` or `.workflow/state.json` only. NEVER modify source code or files outside these paths.
60
+
61
+ ### Pre-load specs
62
+ 1. **Architecture specs**: Run `maestro spec load --category arch` to load architecture constraints. Use as context for architecture decisions (Phase 4).
63
+ 2. Optional — proceed without if unavailable.
64
+ </context>
65
+
66
+ <interview_protocol>
67
+ Interview the user relentlessly about every aspect of the spec until shared understanding is reached. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one; if a question can be answered by exploring the codebase, explore the codebase instead. Active only in interactive mode; skip when `-y/--yes`, `-c/--continue`, or input is already specific (clear idea + scope).
68
+
69
+ - Ask one question per turn via ask_user and wait for the user's feedback before continuing; every question must carry a recommended answer marked `(Recommended)`, 2–4 options total. The user controls termination — keep interviewing until convergence; they can interrupt naturally or via `Other` at any time.
70
+ - Search-first when uncertain: before asking, resolve via `state.json`, existing artifacts, `maestro spec load`, direct codebase exploration (Glob/Grep/Read), or — for open-ended multi-file scans — spawn `delegate_subagent(subagent_type: Explore)` / `maestro delegate ... --role explore`. Never ask what code or memory can verify; never bounce your own ambiguity back to the user — search first, then ask only what truly needs human judgment.
71
+ - Writeback cadence: each settled decision is immediately persisted into `blueprint-config.json` before the next question. Do NOT batch writeback to the end — partial decisions must already be on disk.
72
+ - Walk the decision dependency tree depth-first: scope → spec type → focus areas → requirement priorities. Do not open the next branch until the current one is settled.
73
+ - Scope guard: only decide the shape of the specification. Do not pre-resolve roadmap phases or plan tasks — those belong to downstream commands.
74
+
75
+ Decision points: scope (full product / feature set / single feature) → spec type (service / api / library / platform) → focus areas → whether to run codebase exploration.
76
+
77
+ Exit: on consensus or explicit user signal to proceed, finalize blueprint-config.json (decisions already written incrementally) and proceed to Phase 1.
78
+ </interview_protocol>
79
+
80
+ <execution>
81
+ Follow `~/.maestro/workflows/blueprint.md` completely.
82
+
83
+ ### Phase chain
84
+
85
+ ```
86
+ P0: Spec Study → P1: Discovery → P1.5: Req Expansion → P2: Product Brief → P3: PRD → P4: Architecture → P5: Epics → P6: Readiness Check
87
+ ```
88
+
89
+ P6 gate: Pass (>=80%) → Handoff | Review (60-79%) → Handoff w/caveats | Fail (<60%) → P6.5 Auto-Fix (max 2 iter) → re-check
90
+
91
+ ### Next-step routing on completion
92
+
93
+ | Condition | Suggestion |
94
+ |-----------|-----------|
95
+ | Need codebase analysis | /maestro-analyze {topic} --from blueprint:BLP-xxx |
96
+ | Ready for roadmap | /maestro-roadmap --from blueprint:BLP-xxx |
97
+ | Small scope, direct plan | /maestro-plan --from blueprint:BLP-xxx |
98
+ | Need project setup | /maestro-init |
99
+ </execution>
100
+
101
+ <error_codes>
102
+ | Code | Severity | Condition | Recovery |
103
+ |------|----------|-----------|----------|
104
+ | E001 | error | Idea text or @file required | Prompt user for input |
105
+ | E002 | error | Context source not found (--from) | Show available sessions/sources |
106
+ | E006 | error | `.workflow/` not initialized | Run maestro-init first |
107
+ | E007 | error | Phase 6 readiness Fail after 2 auto-fix iterations | Present manual fix options |
108
+ | W001 | warning | CLI analysis failed, using fallback | Continue with available data |
109
+ | W002 | warning | Codebase exploration failed | Continue without codebase context |
110
+ | W003 | warning | Glossary has < 5 terms | Note in readiness check |
111
+ | W004 | warning | Review-level readiness score (60-79%) | Proceed with caveats |
112
+ | W005 | warning | External research agent failed | Continue without apiResearchContext |
113
+ </error_codes>
114
+
115
+ <success_criteria>
116
+ - [ ] Interactive mode: interview decisions persisted in blueprint-config.json
117
+ - [ ] `blueprint-config.json` created with session metadata and phase tracking
118
+ - [ ] `product-brief.md` with vision, goals, scope, multi-perspective synthesis
119
+ - [ ] `glossary.json` with 5+ core terms for cross-document consistency
120
+ - [ ] `requirements/` directory with `_index.md` + individual `REQ-*.md` + `NFR-*.md` files
121
+ - [ ] All requirements have RFC 2119 keywords and acceptance criteria
122
+ - [ ] `architecture/` directory with `_index.md` + individual `ADR-*.md` files
123
+ - [ ] Architecture includes state machine, config model, error handling, observability (service type)
124
+ - [ ] `epics/` directory with `_index.md` + individual `EPIC-*.md` files
125
+ - [ ] Cross-Epic dependency map (Mermaid) and MVP subset tagged
126
+ - [ ] `readiness-report.md` with 4-dimension quality scores and traceability matrix
127
+ - [ ] `blueprint-summary.md` with one-page executive summary
128
+ - [ ] All documents have valid YAML frontmatter with session_id
129
+ - [ ] Glossary terms used consistently across all documents
130
+ - [ ] Readiness gate: Pass (>=80%) or Review (>=60%) with documented caveats
131
+ - [ ] Artifact registered in state.json (type=blueprint)
132
+ - [ ] context-package.json generated for downstream consumption
133
+ </success_criteria>
@@ -13,106 +13,123 @@ allowed-tools:
13
13
  ---
14
14
  <!-- Open-standard mirror generated by scripts/build-agents-standard.mjs — do not edit; re-run after editing .claude/ source. -->
15
15
 
16
- <purpose>
17
- Unified brainstorming combining interactive framework generation, multi-role parallel analysis, and cross-role synthesis. Two modes: Auto (full pipeline with guidance-specification → parallel role analysis → synthesis) and Single Role (individual role analysis for an existing session). Outputs structured artifacts in .brainstorming/ directory ready for downstream planning.
18
- </purpose>
19
-
20
- <required_reading>
21
- @~/.maestro/workflows/brainstorm.md
22
- </required_reading>
23
-
24
- <deferred_reading>
25
- - [scratch-index.json](~/.maestro/templates/scratch-index.json) — read when operating in scratch mode
26
- - [index.json](~/.maestro/templates/index.json) — read when operating in phase mode
27
- - [brainstorm-visualize.md](~/.maestro/workflows/brainstorm-visualize.md) — read when html-prototypes/ produced and user wants to browse them
28
- </deferred_reading>
29
-
30
- <context>
31
- $ARGUMENTS -- topic text for auto mode, or role name for single role mode.
32
-
33
- **Auto mode**: topic text (e.g., "Build real-time collaboration platform") triggers full pipeline.
34
- **Single role mode**: valid role name (e.g., "system-architect") runs one role analysis.
35
- **All output** goes to `.workflow/scratch/{YYYYMMDD}-brainstorm-{slug}/`.
36
- **Artifact registration**: On completion, registers artifact (type=brainstorm) in state.json.
37
- **Output boundary**: ALL file writes MUST target `{output_dir}/` or `.workflow/state.json` only. NEVER modify source code or files outside these paths.
38
-
39
- **Valid roles**: data-architect, product-manager, product-owner, scrum-master, subject-matter-expert, system-architect, test-strategist, ui-designer, ux-expert
40
-
41
- **Flags**:
42
- - `--yes` / `-y`: Auto mode, skip interactive questions, use defaults
43
- - `--count N`: Number of roles to select (default 3, max 9)
44
- - `--session ID`: Use existing session
45
- - `--update`: Update existing analysis (single role)
46
- - `--skip-questions`: Skip context gathering questions
47
- - `--include-questions`: Force context gathering even if analysis exists
48
- - `--style-skill PKG`: Style package for ui-designer role
49
-
50
- ### Pre-load specs
51
- 1. **Architecture specs**: Run `maestro spec load --category arch` to load architecture constraints. Use as context for multi-role analysis — ensures roles respect documented decisions.
52
- 2. Optionalproceed without if unavailable.
53
-
54
- ### Role Knowledge
55
- 1. Browse accumulated knowledge for this role:
56
- `maestro wiki list --category arch`
57
- 2. Analyze the index, identify entries relevant to the current task
58
- 3. Load selected documents:
59
- `maestro wiki load <id1> [id2] [id3...]`
60
- 4. Review loaded knowledge before proceeding
61
- </context>
62
-
63
- <execution>
64
- Follow '~/.maestro/workflows/brainstorm.md' completely.
65
-
66
- **Next-step routing on completion:**
67
-
68
- Auto mode:
69
- - Project not initialized invoke_skill({ skill: "maestro-init" })
70
- - Project initialized, need spec package invoke_skill({ skill: "maestro-roadmap", args: "--mode full --from-brainstorm {session_id}" })
71
- - Project initialized, quick roadmap invoke_skill({ skill: "maestro-roadmap", args: "--from-brainstorm {session_id}" })
72
- - Need deeper analysis first → invoke_skill({ skill: "maestro-analyze", args: "{topic}" })
73
- - `html-prototypes/` produced with 2+ files and user wants to browse load `~/.maestro/workflows/brainstorm-visualize.md` and launch visualizer server (optional, user-triggered)
74
- - DESIGN.md established during Step 3.5 → suggest: "Run `/maestro-impeccable build <feature-description>` to build with the established design system"
75
-
76
- Single role mode:
77
- - More roles needed → invoke_skill({ skill: "maestro-brainstorm", args: "{next_role} --session {session_id}" })
78
- - All roles done, run synthesis → invoke_skill({ skill: "maestro-brainstorm", args: "{topic} --session {session_id}" })
79
- </execution>
80
-
81
- <error_codes>
82
- | Code | Severity | Condition | Recovery |
83
- |------|----------|-----------|----------|
84
- | E001 | error | Topic or role argument required | Prompt user for topic text or role name |
85
- | E002 | error | No active session for single role mode | Guide user to run auto mode first |
86
- | E003 | error | Invalid role name | Show valid roles list |
87
- | W001 | warning | Fewer than 10 ideas in divergent phase | Proceed with available ideas |
88
- | W002 | warning | Project context (.workflow/) not found | Continue without project context |
89
- | W003 | warning | Role template not found | Use generic analysis structure |
90
- | W004 | warning | Validation score < 60 | Log warning, suggest manual review |
91
- | W005 | warning | External research agent failed | Continue without designResearchContext |
92
- </error_codes>
93
-
94
- <success_criteria>
95
- **Auto mode**:
96
- - [ ] guidance-specification.md with RFC 2119 keywords, terminology, non-goals, feature decomposition
97
- - [ ] design-research.md persisted when Step 1.7 external research ran (fail-soft: absence not a failure)
98
- - [ ] Spec Review Gate passed (Step 3.5) or `--yes` bypassed
99
- - [ ] Role analysis files for each selected NON-UI role in `.brainstorming/{role}/`
100
- - [ ] If `ui-designer` in selected_roles AND Step 3.5 ran: `.workflow/impeccable/DESIGN.md` exists (visual style established via impeccable explore)
101
- - [ ] If `ui-designer` in selected_roles: `ui-designer/analysis.md` exists with UX analysis (interaction flows, state design, information architecture)
102
- - [ ] Feature specs in `.brainstorming/feature-specs/` (or synthesis-specification.md)
103
- - [ ] UI-bearing feature specs reference DESIGN.md for visual constraints in Section 3 (Interface Contract)
104
- - [ ] feature-index.json and synthesis-changelog.md
105
- - [ ] Final Output Gate passed (Step 5.5) or `--yes` bypassed
106
- - [ ] All user decisions captured with Decision Recording Protocol
107
- - [ ] Session metadata updated with completion status
108
- - [ ] Confidence scored per role completion and after cross-role analysis
109
- - [ ] Readiness gate checked before spec generation
110
- - [ ] Pressure pass completed on at least 1 feature spec
111
- - [ ] Confidence summary appended to synthesis-changelog.md
112
-
113
- **Single role mode**:
114
- - [ ] analysis.md written to `{output_dir}/{role}/`
115
- - [ ] Feature-point organization used when feature list available
116
- - [ ] Framework reference included when guidance-specification.md exists
117
- - [ ] Session metadata updated
118
- </success_criteria>
16
+ <purpose>
17
+ Unified brainstorming combining interactive framework generation, multi-role parallel analysis, cross-role review, and resolution writeback. Two modes: Auto (full pipeline: guidance-specification → parallel {role}/ multi-file analysis → cross-role-reviewer compares Decision Digests for conflicts/gaps/synergies → user-confirmed resolutions patched into role files + logged in guidance §12) and Single Role (individual role analysis for an existing session). Outputs structured artifacts in `.workflow/scratch/brainstorm-{slug}-{date}/` ready for downstream planning (roadmap / analyze / blueprint consume `guidance-specification.md`).
18
+ </purpose>
19
+
20
+ <required_reading>
21
+ @~/.maestro/workflows/brainstorm.md
22
+ </required_reading>
23
+
24
+ <deferred_reading>
25
+ - [scratch-index.json](~/.maestro/templates/scratch-index.json) — read when operating in scratch mode
26
+ - [index.json](~/.maestro/templates/index.json) — read when operating in phase mode
27
+ - [brainstorm-visualize.md](~/.maestro/workflows/brainstorm-visualize.md) — read when html-prototypes/ produced and user wants to browse them
28
+ </deferred_reading>
29
+
30
+ <context>
31
+ $ARGUMENTS -- topic text for auto mode, or role name for single role mode.
32
+
33
+ **Auto mode**: topic text (e.g., "Build real-time collaboration platform") triggers full pipeline.
34
+ **Single role mode**: valid role name (e.g., "system-architect") runs one role analysis.
35
+ **All output** goes to `.workflow/scratch/brainstorm-{slug}-{YYYYMMDD}/` (orchestrator MUST resolve this to an absolute path before passing to sub-agents).
36
+ **Artifact registration**: On completion, registers artifact (type=brainstorm) in state.json.
37
+ **Output boundary**: ALL file writes MUST target `{output_dir}/` or `.workflow/state.json` only. NEVER modify source code or files outside these paths.
38
+ **Produced files**: `guidance-specification.md`, `design-research.md` (optional), `{role}/analysis.md` + `{role}/analysis-F-*.md` + `{role}/findings-*.md` (per selected role).
39
+
40
+ **Valid roles**: data-architect, product-manager, product-owner, scrum-master, subject-matter-expert, system-architect, test-strategist, ui-designer, ux-expert
41
+
42
+ **Flags**:
43
+ - `--yes` / `-y`: Auto mode, skip interactive questions, use defaults
44
+ - `--count N`: Number of roles to select (default 3, max 9)
45
+ - `--session ID`: Use existing session
46
+ - `--update`: Update existing analysis (single role)
47
+ - `--skip-questions`: Skip context gathering questions
48
+ - `--include-questions`: Force context gathering even if analysis exists
49
+ - `--style-skill PKG`: Style package for ui-designer role
50
+
51
+ ### Pre-load specs
52
+ 1. **Architecture specs**: Run `maestro spec load --category arch` to load architecture constraints. Use as context for multi-role analysis ensures roles respect documented decisions.
53
+ 2. Optional — proceed without if unavailable.
54
+
55
+ ### Role Knowledge
56
+ 1. Browse accumulated knowledge for this role:
57
+ `maestro wiki list --category arch`
58
+ 2. Analyze the index, identify entries relevant to the current task
59
+ 3. Load selected documents:
60
+ `maestro wiki load <id1> [id2] [id3...]`
61
+ 4. Review loaded knowledge before proceeding
62
+ </context>
63
+
64
+ <interview_protocol>
65
+ Interview the user relentlessly until shared understanding is reached. Active only in interactive mode; skip when `--yes/-y`, `--skip-questions`, `--session` (existing session), or input is already specific.
66
+
67
+ - One decision per turn via ask_user with 2–4 options + a (Recommended) default. The user controls termination — keep interviewing until convergence; they can interrupt naturally or via `Other` at any time.
68
+ - Search-first when uncertain: before asking, resolve via `state.json`, the session directory, `maestro spec load`, `maestro wiki search`, Glob/Grep/Read, or — for open-ended multi-file scans — spawn `delegate_subagent(subagent_type: Explore)` / `maestro delegate ... --role explore`. Never ask what code or memory can verify; never bounce your own ambiguity back to the user — search first, then ask only what truly needs human judgment.
69
+ - Writeback cadence: each time a decision settles, immediately append/update its row in `guidance-specification.md` §11 (create the section if absent). Do NOT batch writeback to the end — partial decisions must already be on disk before the next question.
70
+ - Branch jumps allowed: the user may switch freely between mode / role / upstream / sub-pipeline branches; sequence is not enforced, but every decision point must end with a definite answer.
71
+ - Scope guard: only ask about decisions owned by `brainstorm`. Do not pre-resolve roadmap/plan choices.
72
+
73
+ Decision points: mode (auto / single-role / review-only) / role selection and `--count` / `--from` upstream source / whether to enable design-research and the DESIGN.md sub-pipeline.
74
+
75
+ Exit: on consensus or explicit user signal to proceed, finalize session metadata. The §11 table (already populated incrementally) uses this schema:
76
+ `| # | Decision | Choice | Source (user / code / default) |`
77
+ </interview_protocol>
78
+
79
+ <execution>
80
+ Follow '~/.maestro/workflows/brainstorm.md' completely.
81
+
82
+ **Next-step routing on completion:**
83
+
84
+ Auto mode:
85
+ - Project not initialized invoke_skill({ skill: "maestro-init" })
86
+ - Project initialized, need formal spec package invoke_skill({ skill: "maestro-blueprint", args: "--from brainstorm:{artifact_id}" })
87
+ - Project initialized, quick roadmap invoke_skill({ skill: "maestro-roadmap", args: "--from brainstorm:{artifact_id}" })
88
+ - Need deeper analysis first invoke_skill({ skill: "maestro-analyze", args: "{topic} --from brainstorm:{artifact_id}" })
89
+ - `html-prototypes/` produced with 2+ files and user wants to browse load `~/.maestro/workflows/brainstorm-visualize.md` and launch visualizer server (optional, user-triggered)
90
+ - DESIGN.md established during Step 3.5 suggest: "Run `/maestro-impeccable build <feature-description>` to build with the established design system"
91
+
92
+ Single role mode:
93
+ - More roles needed → invoke_skill({ skill: "maestro-brainstorm", args: "{next_role} --session {session_id}" })
94
+ - All roles done, run synthesis → invoke_skill({ skill: "maestro-brainstorm", args: "{topic} --session {session_id}" })
95
+ </execution>
96
+
97
+ <error_codes>
98
+ | Code | Severity | Condition | Recovery |
99
+ |------|----------|-----------|----------|
100
+ | E001 | error | Topic or role argument required | Prompt user for topic text or role name |
101
+ | E002 | error | No active session for single role mode | Guide user to run auto mode first |
102
+ | E003 | error | Invalid role name | Show valid roles list |
103
+ | E006 | error | `--review-only` but no `{role}/analysis.md` found | Run auto or single-role mode first |
104
+ | E007 | error | `--review-only` but `guidance-specification.md` missing | Run auto mode to generate guidance first |
105
+ | W001 | warning | Fewer than 10 ideas in divergent phase | Proceed with available ideas |
106
+ | W002 | warning | Project context (.workflow/) not found | Continue without project context |
107
+ | W003 | warning | Role template not found | Use generic analysis structure |
108
+ | W004 | warning | Validation score < 60 | Log warning, suggest manual review |
109
+ | W005 | warning | External research agent failed | Continue without designResearchContext |
110
+ | W006 | warning | Reviewer patch_targets heading drift (no match) | Skip that patch; report in final summary |
111
+ </error_codes>
112
+
113
+ <success_criteria>
114
+ **Auto mode**:
115
+ - [ ] Interactive mode: interview decision table written to `guidance-specification.md` §11 and session metadata
116
+ - [ ] `guidance-specification.md` with RFC 2119 keywords, terminology, non-goals, feature decomposition (§10), decision tracking (§11), cross-role resolutions placeholder (§12)
117
+ - [ ] `design-research.md` persisted when Step 1.7 external research ran (fail-soft: absence not a failure)
118
+ - [ ] If `ui-designer` in selected_roles AND Step 3.5 ran: `.workflow/impeccable/DESIGN.md` exists (visual style established via impeccable explore)
119
+ - [ ] `{role}/analysis.md` written for each selected role, containing §2 Decision Digest (4 tables) + §3 Cross-Cutting Foundations + §4 File Index
120
+ - [ ] `{role}/analysis-F-{id}-{slug}.md` written per feature (one file per feature, < 2000 words)
121
+ - [ ] `system-architect/analysis.md` §3 includes Data Model + State Machine when system-architect is selected
122
+ - [ ] `ui-designer/analysis.md` references DESIGN.md visual constraints when ui-designer is selected
123
+ - [ ] Each `{role}/analysis.md` §2 Decisions table has ≥ 1 row per feature
124
+ - [ ] Cross-role review (Step 4.5) executed; reviewer compares §2 Decision Digests; output includes `patch_targets[]` for every finding
125
+ - [ ] If findings exist: each accepted resolution applied via edit_file(annotate / strikeout / append) AND logged in `guidance-specification.md` §12 "Cross-Role Resolutions"
126
+ - [ ] If zero findings: final report explicitly states "No cross-role issues detected"; guidance §12 unchanged
127
+ - [ ] Heading-drift patch failures surfaced in final report (if any)
128
+ - [ ] Session metadata updated with completion status (review_findings_count, resolutions_applied, patches_skipped)
129
+
130
+ **Single role mode**:
131
+ - [ ] `{role}/analysis.md` written with §2 Decision Digest + §4 File Index
132
+ - [ ] `{role}/analysis-F-*.md` written when guidance §10 feature list available
133
+ - [ ] §2 Decisions table references guidance decision IDs
134
+ - [ ] Session metadata updated
135
+ </success_criteria>