maestro-flow 0.3.10 → 0.3.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 (311) hide show
  1. package/.claude/agents/conceptual-planning-agent.md +1 -0
  2. package/.claude/agents/workflow-analyzer.md +114 -114
  3. package/.claude/agents/workflow-collab-planner.md +144 -144
  4. package/.claude/agents/workflow-debugger.md +102 -103
  5. package/.claude/agents/workflow-executor.md +127 -128
  6. package/.claude/agents/workflow-integration-checker.md +82 -82
  7. package/.claude/agents/workflow-nyquist-auditor.md +85 -84
  8. package/.claude/agents/workflow-phase-researcher.md +85 -85
  9. package/.claude/agents/workflow-plan-checker.md +90 -90
  10. package/.claude/agents/workflow-planner.md +178 -178
  11. package/.claude/agents/workflow-roadmapper.md +81 -83
  12. package/.claude/agents/workflow-verifier.md +119 -119
  13. package/.claude/commands/learn-decompose.md +176 -176
  14. package/.claude/commands/learn-follow.md +167 -167
  15. package/.claude/commands/learn-retro.md +3 -3
  16. package/.claude/commands/learn-second-opinion.md +2 -2
  17. package/.claude/commands/maestro-brainstorm.md +1 -0
  18. package/.claude/commands/maestro-coordinate.md +1 -3
  19. package/.claude/commands/maestro-fork.md +133 -111
  20. package/.claude/commands/maestro-merge.md +85 -77
  21. package/.claude/commands/maestro-plan.md +88 -2
  22. package/.claude/commands/maestro-roadmap.md +113 -2
  23. package/.claude/commands/maestro.md +1 -0
  24. package/.claude/commands/manage-harvest.md +131 -131
  25. package/.claude/commands/manage-issue.md +2 -2
  26. package/.claude/commands/quality-business-test.md +5 -5
  27. package/.claude/commands/quality-debug.md +3 -2
  28. package/.claude/commands/quality-retrospective.md +6 -4
  29. package/.claude/commands/quality-review.md +1 -1
  30. package/.claude/commands/quality-test-gen.md +5 -4
  31. package/.claude/commands/spec-add.md +67 -56
  32. package/.claude/commands/spec-load.md +66 -64
  33. package/.claude/commands/spec-setup.md +5 -9
  34. package/.codex/skills/learn-decompose/SKILL.md +119 -0
  35. package/.codex/skills/learn-follow/SKILL.md +83 -0
  36. package/.codex/skills/learn-investigate/SKILL.md +83 -0
  37. package/.codex/skills/learn-retro/SKILL.md +83 -0
  38. package/.codex/skills/learn-second-opinion/SKILL.md +86 -0
  39. package/.codex/skills/maestro/SKILL.md +151 -279
  40. package/.codex/skills/maestro-analyze/SKILL.md +59 -71
  41. package/.codex/skills/maestro-brainstorm/SKILL.md +452 -463
  42. package/.codex/skills/maestro-chain/SKILL.md +95 -110
  43. package/.codex/skills/maestro-coordinate/SKILL.md +68 -234
  44. package/.codex/skills/maestro-execute/SKILL.md +435 -446
  45. package/.codex/skills/maestro-fork/SKILL.md +98 -0
  46. package/.codex/skills/maestro-init/SKILL.md +172 -167
  47. package/.codex/skills/maestro-learn/SKILL.md +80 -0
  48. package/.codex/skills/maestro-link-coordinate/SKILL.md +224 -220
  49. package/.codex/skills/maestro-merge/SKILL.md +69 -0
  50. package/.codex/skills/maestro-milestone-audit/SKILL.md +108 -103
  51. package/.codex/skills/maestro-milestone-complete/SKILL.md +155 -149
  52. package/.codex/skills/maestro-milestone-release/SKILL.md +70 -0
  53. package/.codex/skills/maestro-overlay/SKILL.md +188 -185
  54. package/.codex/skills/maestro-plan/SKILL.md +58 -69
  55. package/.codex/skills/maestro-quick/SKILL.md +26 -23
  56. package/.codex/skills/maestro-roadmap/SKILL.md +65 -73
  57. package/.codex/skills/maestro-spec-generate/SKILL.md +66 -74
  58. package/.codex/skills/maestro-ui-design/SKILL.md +35 -32
  59. package/.codex/skills/maestro-verify/SKILL.md +556 -566
  60. package/.codex/skills/manage-codebase-rebuild/SKILL.md +397 -405
  61. package/.codex/skills/manage-codebase-refresh/SKILL.md +93 -82
  62. package/.codex/skills/manage-harvest/SKILL.md +82 -0
  63. package/.codex/skills/manage-issue/SKILL.md +80 -65
  64. package/.codex/skills/manage-issue-discover/SKILL.md +491 -503
  65. package/.codex/skills/manage-learn/SKILL.md +190 -186
  66. package/.codex/skills/manage-memory/SKILL.md +95 -72
  67. package/.codex/skills/manage-memory-capture/SKILL.md +99 -86
  68. package/.codex/skills/manage-status/SKILL.md +102 -89
  69. package/.codex/skills/quality-business-test/SKILL.md +228 -223
  70. package/.codex/skills/quality-debug/SKILL.md +54 -66
  71. package/.codex/skills/quality-integration-test/SKILL.md +532 -544
  72. package/.codex/skills/quality-refactor/SKILL.md +197 -191
  73. package/.codex/skills/quality-retrospective/SKILL.md +512 -505
  74. package/.codex/skills/quality-review/SKILL.md +95 -107
  75. package/.codex/skills/quality-sync/SKILL.md +101 -89
  76. package/.codex/skills/quality-test/SKILL.md +202 -198
  77. package/.codex/skills/quality-test-gen/SKILL.md +94 -105
  78. package/.codex/skills/spec-add/SKILL.md +58 -39
  79. package/.codex/skills/spec-load/SKILL.md +45 -40
  80. package/.codex/skills/spec-map/SKILL.md +180 -182
  81. package/.codex/skills/spec-setup/SKILL.md +94 -76
  82. package/.codex/skills/team-coordinate/SKILL.md +346 -357
  83. package/.codex/skills/team-executor/SKILL.md +70 -112
  84. package/.codex/skills/team-lifecycle-v4/SKILL.md +311 -299
  85. package/.codex/skills/team-quality-assurance/SKILL.md +234 -227
  86. package/.codex/skills/team-review/SKILL.md +232 -225
  87. package/.codex/skills/team-tech-debt/SKILL.md +78 -100
  88. package/.codex/skills/team-testing/SKILL.md +242 -235
  89. package/.codex/skills/wiki-connect/SKILL.md +75 -0
  90. package/.codex/skills/wiki-digest/SKILL.md +87 -0
  91. package/README.md +9 -4
  92. package/README.zh-CN.md +9 -4
  93. package/dashboard/dist/assets/{ArtifactsPage-DZNCi6tn.js → ArtifactsPage-CUrrDGgN.js} +1 -1
  94. package/dashboard/dist/assets/ChatInput-pUOLJIKE.js +49 -0
  95. package/dashboard/dist/assets/ChatPage-B8Xqkt0v.js +27 -0
  96. package/dashboard/dist/assets/{CollabPage-B4NAHXS2.js → CollabPage-DIUXeazv.js} +1 -1
  97. package/dashboard/dist/assets/{ExecutionPanel-CFt4LJyq.js → ExecutionPanel-VmYeADFj.js} +1 -1
  98. package/dashboard/dist/assets/KanbanPage-DLq8v7hg.js +21 -0
  99. package/dashboard/dist/assets/{MarkdownRenderer-X4af_WNb.js → MarkdownRenderer-D7AehrnR.js} +1 -1
  100. package/dashboard/dist/assets/{McpPage-BKfCVIyU.js → McpPage-BY0SjTgw.js} +2 -2
  101. package/dashboard/dist/assets/{OutputPanel-BlBQFJSW.js → OutputPanel-B-Rjwgmv.js} +1 -1
  102. package/dashboard/dist/assets/{ProblemsPanel-De3DLvoI.js → ProblemsPanel-GEpF-oi4.js} +1 -1
  103. package/dashboard/dist/assets/RequirementBoardPage-xs8uDM7I.js +6 -0
  104. package/dashboard/dist/assets/{RequirementPage-Bllxe2XI.js → RequirementPage-BKDSFwjA.js} +5 -10
  105. package/dashboard/dist/assets/SpecsPage-DLFb9ZH0.js +36 -0
  106. package/dashboard/dist/assets/SupervisorPage-SOki_kgz.js +6 -0
  107. package/dashboard/dist/assets/TeamsPage-BO2kP70F.js +11 -0
  108. package/dashboard/dist/assets/{TreeBrowser-Q12qobZs.js → TreeBrowser-B9DHdULE.js} +1 -1
  109. package/dashboard/dist/assets/{WorkflowPage-D_Fzdy3_.js → WorkflowPage-C8hWbYim.js} +1 -1
  110. package/dashboard/dist/assets/{check-u6fGOwQO.js → check-DJDk3A2a.js} +1 -1
  111. package/dashboard/dist/assets/{chevron-right-Csu22t58.js → chevron-right-C7bVDreZ.js} +1 -1
  112. package/dashboard/dist/assets/{circle-CMrkbRNg.js → circle-Qfgy4LB_.js} +1 -1
  113. package/dashboard/dist/assets/{circle-alert-c3tH1P4z.js → circle-alert-Na1vf6qQ.js} +1 -1
  114. package/dashboard/dist/assets/{circle-check-gYxxSYuH.js → circle-check-CEGgy3NV.js} +1 -1
  115. package/dashboard/dist/assets/{circle-check-big-TDSeWstm.js → circle-check-big-3JB8zRYj.js} +1 -1
  116. package/dashboard/dist/assets/{code-CFN2uX9V.js → code-Ble63Idz.js} +1 -1
  117. package/dashboard/dist/assets/{columns-3-38xIDlzy.js → columns-3-BUcKlxve.js} +1 -1
  118. package/dashboard/dist/assets/{download-DC7KkKyP.js → download-CMqkfn8x.js} +1 -1
  119. package/dashboard/dist/assets/{folder-CWq_lAnf.js → folder-B9ewx9LL.js} +1 -1
  120. package/dashboard/dist/assets/index-C2Mcb4TJ.js +231 -0
  121. package/dashboard/dist/assets/index-DyBbPc18.css +1 -0
  122. package/dashboard/dist/assets/{index-Do71weNR.js → index-JTmGteaT.js} +1 -1
  123. package/dashboard/dist/assets/{list-CgIP_2A-.js → list-DI8Wn2aT.js} +1 -1
  124. package/dashboard/dist/assets/loader-B5F6PzFT.js +11 -0
  125. package/dashboard/dist/assets/{minus-DYoN5UGk.js → minus-Lp_BfctG.js} +1 -1
  126. package/dashboard/dist/assets/{pen-line-Bh_WKYHm.js → pen-line-Ch7sphzZ.js} +1 -1
  127. package/dashboard/dist/assets/pencil-_yRMHmGT.js +6 -0
  128. package/dashboard/dist/assets/{proxy-BKxDAKTj.js → proxy-D72Y8a4Y.js} +1 -1
  129. package/dashboard/dist/assets/{search-SieXnOgr.js → search-BS6fI6Bg.js} +1 -1
  130. package/dashboard/dist/assets/{shallow-Bme1JY57.js → shallow-BXasQBvr.js} +1 -1
  131. package/dashboard/dist/assets/table-CeGlFjlP.js +6 -0
  132. package/dashboard/dist/assets/{terminal-BB3Xfuv5.js → terminal-BJic2yW-.js} +1 -1
  133. package/dashboard/dist/assets/{trash-2-C8f4vFFM.js → trash-2-Czz4X8Fb.js} +1 -1
  134. package/dashboard/dist/assets/{zap-4uwlzVm0.js → zap-C3H0jVFA.js} +1 -1
  135. package/dashboard/dist/index.html +2 -2
  136. package/dashboard/dist-server/dashboard/src/server/agents/agent-manager.js +16 -1
  137. package/dashboard/dist-server/dashboard/src/server/agents/agent-manager.js.map +1 -1
  138. package/dashboard/dist-server/dashboard/src/server/agents/delegate-broker-monitor.js +1 -2
  139. package/dashboard/dist-server/dashboard/src/server/agents/delegate-broker-monitor.js.map +1 -1
  140. package/dashboard/dist-server/dashboard/src/server/commander/commander-prompts.d.ts +1 -1
  141. package/dashboard/dist-server/dashboard/src/server/commander/commander-prompts.js +2 -1
  142. package/dashboard/dist-server/dashboard/src/server/commander/commander-prompts.js.map +1 -1
  143. package/dashboard/dist-server/dashboard/src/server/index.js +3 -0
  144. package/dashboard/dist-server/dashboard/src/server/index.js.map +1 -1
  145. package/dashboard/dist-server/dashboard/src/server/routes/collab.js +124 -0
  146. package/dashboard/dist-server/dashboard/src/server/routes/collab.js.map +1 -1
  147. package/dashboard/dist-server/dashboard/src/server/routes/specs.d.ts +1 -1
  148. package/dashboard/dist-server/dashboard/src/server/routes/specs.js +75 -30
  149. package/dashboard/dist-server/dashboard/src/server/routes/specs.js.map +1 -1
  150. package/dashboard/dist-server/dashboard/src/server/state/event-bus.d.ts +5 -0
  151. package/dashboard/dist-server/dashboard/src/server/state/event-bus.js +5 -0
  152. package/dashboard/dist-server/dashboard/src/server/state/event-bus.js.map +1 -1
  153. package/dashboard/dist-server/dashboard/src/server/ws/handlers/team-handler.d.ts +10 -0
  154. package/dashboard/dist-server/dashboard/src/server/ws/handlers/team-handler.js +73 -0
  155. package/dashboard/dist-server/dashboard/src/server/ws/handlers/team-handler.js.map +1 -0
  156. package/dashboard/dist-server/dashboard/src/shared/collab-types.d.ts +31 -0
  157. package/dashboard/dist-server/dashboard/src/shared/collab-types.js +28 -0
  158. package/dashboard/dist-server/dashboard/src/shared/collab-types.js.map +1 -1
  159. package/dashboard/dist-server/dashboard/src/shared/constants.js +10 -0
  160. package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
  161. package/dashboard/dist-server/dashboard/src/shared/coordinate-types.d.ts +22 -0
  162. package/dashboard/dist-server/dashboard/src/shared/issue-types.d.ts +12 -0
  163. package/dashboard/dist-server/dashboard/src/shared/issue-types.js +12 -0
  164. package/dashboard/dist-server/dashboard/src/shared/issue-types.js.map +1 -1
  165. package/dashboard/dist-server/dashboard/src/shared/team-types.d.ts +22 -0
  166. package/dashboard/dist-server/dashboard/src/shared/team-types.js +7 -0
  167. package/dashboard/dist-server/dashboard/src/shared/team-types.js.map +1 -1
  168. package/dashboard/dist-server/dashboard/src/shared/types.d.ts +3 -2
  169. package/dashboard/dist-server/dashboard/src/shared/ws-protocol.d.ts +28 -2
  170. package/dashboard/dist-server/dashboard/src/shared/ws-protocol.js.map +1 -1
  171. package/dashboard/dist-server/shared/agent-types.d.ts +4 -0
  172. package/dashboard/dist-server/src/hooks/constants.d.ts +3 -1
  173. package/dashboard/dist-server/src/hooks/constants.js +4 -2
  174. package/dashboard/dist-server/src/hooks/constants.js.map +1 -1
  175. package/dist/shared/agent-types.d.ts +4 -0
  176. package/dist/shared/agent-types.d.ts.map +1 -1
  177. package/dist/src/commands/collab.js +4 -4
  178. package/dist/src/commands/collab.js.map +1 -1
  179. package/dist/src/commands/hooks.d.ts.map +1 -1
  180. package/dist/src/commands/hooks.js +66 -1
  181. package/dist/src/commands/hooks.js.map +1 -1
  182. package/dist/src/commands/install-backend.d.ts.map +1 -1
  183. package/dist/src/commands/install-backend.js +29 -18
  184. package/dist/src/commands/install-backend.js.map +1 -1
  185. package/dist/src/commands/spec.d.ts.map +1 -1
  186. package/dist/src/commands/spec.js +7 -2
  187. package/dist/src/commands/spec.js.map +1 -1
  188. package/dist/src/hooks/__tests__/statusline-visual-test.js +23 -1
  189. package/dist/src/hooks/__tests__/statusline-visual-test.js.map +1 -1
  190. package/dist/src/hooks/constants.d.ts +3 -1
  191. package/dist/src/hooks/constants.d.ts.map +1 -1
  192. package/dist/src/hooks/constants.js +4 -2
  193. package/dist/src/hooks/constants.js.map +1 -1
  194. package/dist/src/hooks/guards/index.d.ts +1 -0
  195. package/dist/src/hooks/guards/index.d.ts.map +1 -1
  196. package/dist/src/hooks/guards/index.js +1 -0
  197. package/dist/src/hooks/guards/index.js.map +1 -1
  198. package/dist/src/hooks/guards/spec-validator.d.ts +25 -0
  199. package/dist/src/hooks/guards/spec-validator.d.ts.map +1 -0
  200. package/dist/src/hooks/guards/spec-validator.js +66 -0
  201. package/dist/src/hooks/guards/spec-validator.js.map +1 -0
  202. package/dist/src/hooks/keyword-spec-injector.d.ts +21 -0
  203. package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -0
  204. package/dist/src/hooks/keyword-spec-injector.js +96 -0
  205. package/dist/src/hooks/keyword-spec-injector.js.map +1 -0
  206. package/dist/src/hooks/plugins/spec-injection-plugin.d.ts +2 -1
  207. package/dist/src/hooks/plugins/spec-injection-plugin.d.ts.map +1 -1
  208. package/dist/src/hooks/plugins/spec-injection-plugin.js +21 -12
  209. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  210. package/dist/src/hooks/skill-context.d.ts +3 -0
  211. package/dist/src/hooks/skill-context.d.ts.map +1 -1
  212. package/dist/src/hooks/skill-context.js +95 -9
  213. package/dist/src/hooks/skill-context.js.map +1 -1
  214. package/dist/src/hooks/spec-bridge.d.ts +40 -0
  215. package/dist/src/hooks/spec-bridge.d.ts.map +1 -0
  216. package/dist/src/hooks/spec-bridge.js +97 -0
  217. package/dist/src/hooks/spec-bridge.js.map +1 -0
  218. package/dist/src/hooks/spec-injector.d.ts.map +1 -1
  219. package/dist/src/hooks/spec-injector.js +18 -12
  220. package/dist/src/hooks/spec-injector.js.map +1 -1
  221. package/dist/src/hooks/statusline.d.ts.map +1 -1
  222. package/dist/src/hooks/statusline.js +6 -3
  223. package/dist/src/hooks/statusline.js.map +1 -1
  224. package/dist/src/team/phase-orchestrator.d.ts +52 -0
  225. package/dist/src/team/phase-orchestrator.d.ts.map +1 -0
  226. package/dist/src/team/phase-orchestrator.js +165 -0
  227. package/dist/src/team/phase-orchestrator.js.map +1 -0
  228. package/dist/src/team/phase-types.d.ts +51 -0
  229. package/dist/src/team/phase-types.d.ts.map +1 -0
  230. package/dist/src/team/phase-types.js +41 -0
  231. package/dist/src/team/phase-types.js.map +1 -0
  232. package/dist/src/tools/index.d.ts.map +1 -1
  233. package/dist/src/tools/index.js +6 -0
  234. package/dist/src/tools/index.js.map +1 -1
  235. package/dist/src/tools/merge-validator.d.ts.map +1 -1
  236. package/dist/src/tools/merge-validator.js +114 -16
  237. package/dist/src/tools/merge-validator.js.map +1 -1
  238. package/dist/src/tools/spec-entry-parser.d.ts +56 -0
  239. package/dist/src/tools/spec-entry-parser.d.ts.map +1 -0
  240. package/dist/src/tools/spec-entry-parser.js +196 -0
  241. package/dist/src/tools/spec-entry-parser.js.map +1 -0
  242. package/dist/src/tools/spec-init.d.ts.map +1 -1
  243. package/dist/src/tools/spec-init.js +66 -92
  244. package/dist/src/tools/spec-init.js.map +1 -1
  245. package/dist/src/tools/spec-keyword-index.d.ts +30 -0
  246. package/dist/src/tools/spec-keyword-index.d.ts.map +1 -0
  247. package/dist/src/tools/spec-keyword-index.js +101 -0
  248. package/dist/src/tools/spec-keyword-index.js.map +1 -0
  249. package/dist/src/tools/spec-loader.d.ts +3 -3
  250. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  251. package/dist/src/tools/spec-loader.js +49 -23
  252. package/dist/src/tools/spec-loader.js.map +1 -1
  253. package/dist/src/tools/team-agents.d.ts +27 -0
  254. package/dist/src/tools/team-agents.d.ts.map +1 -0
  255. package/dist/src/tools/team-agents.js +362 -0
  256. package/dist/src/tools/team-agents.js.map +1 -0
  257. package/dist/src/tools/team-mailbox.d.ts +40 -0
  258. package/dist/src/tools/team-mailbox.d.ts.map +1 -0
  259. package/dist/src/tools/team-mailbox.js +384 -0
  260. package/dist/src/tools/team-mailbox.js.map +1 -0
  261. package/dist/src/tools/team-msg.d.ts +17 -8
  262. package/dist/src/tools/team-msg.d.ts.map +1 -1
  263. package/dist/src/tools/team-msg.js +110 -13
  264. package/dist/src/tools/team-msg.js.map +1 -1
  265. package/dist/src/tools/team-tasks-mcp.d.ts +27 -0
  266. package/dist/src/tools/team-tasks-mcp.d.ts.map +1 -0
  267. package/dist/src/tools/team-tasks-mcp.js +408 -0
  268. package/dist/src/tools/team-tasks-mcp.js.map +1 -0
  269. package/package.json +2 -1
  270. package/shared/agent-types.ts +4 -0
  271. package/templates/worktree-scope.json +9 -10
  272. package/templates/worktrees.json +26 -27
  273. package/workflows/analyze.md +816 -816
  274. package/workflows/brainstorm.md +480 -471
  275. package/workflows/codebase-rebuild.md +332 -332
  276. package/workflows/codebase-refresh.md +240 -240
  277. package/workflows/debug.md +16 -6
  278. package/workflows/execute.md +1 -1
  279. package/workflows/fork.md +100 -36
  280. package/workflows/harvest.md +420 -420
  281. package/workflows/integration-test.md +355 -343
  282. package/workflows/issue-discover.md +414 -414
  283. package/workflows/issue.md +14 -4
  284. package/workflows/learn.md +19 -5
  285. package/workflows/maestro.md +1 -0
  286. package/workflows/map.md +111 -111
  287. package/workflows/merge.md +113 -55
  288. package/workflows/milestone-complete.md +176 -176
  289. package/workflows/plan.md +1 -1
  290. package/workflows/quick.md +497 -497
  291. package/workflows/refactor.md +300 -300
  292. package/workflows/retrospective.md +61 -22
  293. package/workflows/review.md +17 -4
  294. package/workflows/roadmap.md +335 -335
  295. package/workflows/spec-generate.md +640 -640
  296. package/workflows/specs-add.md +46 -81
  297. package/workflows/specs-load.md +15 -17
  298. package/workflows/specs-setup.md +40 -161
  299. package/workflows/test.md +12 -2
  300. package/workflows/ui-style.md +9 -2
  301. package/dashboard/dist/assets/ChatInput-Bvr-FeEq.js +0 -49
  302. package/dashboard/dist/assets/ChatPage-D9zTkJZo.js +0 -22
  303. package/dashboard/dist/assets/KanbanPage-C8USth6H.js +0 -21
  304. package/dashboard/dist/assets/RequirementBoardPage-Bf1trzqs.js +0 -11
  305. package/dashboard/dist/assets/SpecsPage-9lwxKT27.js +0 -36
  306. package/dashboard/dist/assets/SupervisorPage-SusdfHFq.js +0 -6
  307. package/dashboard/dist/assets/TeamsPage-DsuM6OwC.js +0 -6
  308. package/dashboard/dist/assets/arrow-left-Bqtb2hle.js +0 -6
  309. package/dashboard/dist/assets/index-DWG-WrzT.js +0 -231
  310. package/dashboard/dist/assets/index-GUNJodSR.css +0 -1
  311. package/dashboard/dist/assets/table-llyEtj-7.js +0 -6
@@ -1,471 +1,480 @@
1
- # Workflow: Brainstorm
2
-
3
- Unified brainstorming workflow with dual-mode operation: auto pipeline (full multi-role analysis) and single role analysis mode.
4
-
5
- ## Architecture
6
-
7
- ```
8
- ┌─────────────────────────────────────────────────────────┐
9
- │ /maestro-brainstorm │
10
- │ Unified Entry Point + Interactive Routing │
11
- └───────────────────────┬─────────────────────────────────┘
12
-
13
- ┌─────────┴─────────┐
14
- ↓ ↓
15
- ┌─────────────────┐ ┌──────────────────┐
16
- │ Auto Mode │ │ Single Role Mode │
17
- └────────┬────────┘ └────────┬─────────┘
18
- │ │
19
- ┌────────┼────────┐ │
20
- ↓ ↓ ↓ ↓
21
- Phase 2 Phase 3 Phase 4 Phase 3
22
- Artifacts N×Role Synthesis 1×Role
23
- 并行 Analysis
24
- ```
25
-
26
- ## Dual-Mode Routing
27
-
28
- ### Auto Mode (full pipeline)
29
- Triggered by `--yes`/`-y` flag or user selection.
30
-
31
- ```
32
- Phase 1: Mode Detection → Parse args, detect mode
33
- Phase 1.5: Terminology & Boundary → Extract terms, collect Non-Goals
34
- Phase 2: Interactive Framework → 7 sub-phases (context → topic → roles → questions → conflicts → check → spec)
35
- Phase 3: Parallel Role Analysis → N concurrent role analyses via conceptual-planning-agent
36
- Phase 4: Synthesis Integration → Cross-role analysis → user clarification → spec generation
37
- ```
38
-
39
- ### Single Role Mode
40
- Triggered when first arg is a valid role name.
41
-
42
- ```
43
- Phase 1: Mode Detection → Parse args, detect mode
44
- Phase 3: Single Role Analysis → Detection → Context → Agent → Validation
45
- ```
46
-
47
- ## Input
48
-
49
- - `$ARGUMENTS`: topic text (auto mode) or role name (single role mode)
50
- - All output goes to `.workflow/scratch/brainstorm-{slug}-{date}/`
51
- - Registers artifact (type=brainstorm) in state.json on completion
52
-
53
- ### Parameters
54
-
55
- | Parameter | Description | Default |
56
- |-----------|-------------|---------|
57
- | `--yes`, `-y` | Auto mode, skip all questions | - |
58
- | `--count N` | Number of roles to select | 3 |
59
- | `--session ID` | Use existing session | - |
60
- | `--update` | Update existing analysis | - |
61
- | `--include-questions` | Interactive context gathering | - |
62
- | `--skip-questions` | Use default answers | - |
63
- | `--style-skill PKG` | Style package for ui-designer | - |
64
-
65
- ### Available Roles
66
-
67
- | Role ID | Title | Focus Area |
68
- |---------|-------|------------|
69
- | `data-architect` | 数据架构师 | Data models, storage strategies, data flow |
70
- | `product-manager` | 产品经理 | Product strategy, roadmap, prioritization |
71
- | `product-owner` | 产品负责人 | Backlog management, user stories, acceptance criteria |
72
- | `scrum-master` | 敏捷教练 | Process facilitation, impediment removal |
73
- | `subject-matter-expert` | 领域专家 | Domain knowledge, business rules, compliance |
74
- | `system-architect` | 系统架构师 | Technical architecture, scalability, integration |
75
- | `test-strategist` | 测试策略师 | Test strategy, quality assurance |
76
- | `ui-designer` | UI设计师 | Visual design, mockups, design systems |
77
- | `ux-expert` | UX专家 | User research, information architecture, journey |
78
-
79
- ## Output
80
-
81
- ### Directory Structure
82
-
83
- All brainstorm output goes to scratch:
84
- ```
85
- .workflow/scratch/brainstorm-{slug}-{date}/
86
- ├── guidance-specification.md # Phase 2 output
87
- ├── feature-index.json # Phase 4 output
88
- ├── synthesis-changelog.md # Phase 4 audit trail
89
- ├── feature-specs/ # Phase 4 feature specs
90
- │ ├── F-001-{slug}.md
91
- │ └── F-00N-{slug}.md
92
- ├── {role}/ # Phase 3 role analyses (immutable)
93
- │ ├── {role}-context.md
94
- │ ├── analysis.md
95
- │ ├── analysis-cross-cutting.md
96
- │ └── analysis-F-{id}-{slug}.md
97
- └── synthesis-specification.md # Non-feature mode fallback
98
- ```
99
-
100
- ---
101
-
102
- ## Process
103
-
104
- ### Step 1: Parse & Route (Mode Detection)
105
-
106
- Parse $ARGUMENTS to determine execution mode:
107
-
108
- **Mode Detection (ordered by priority)**:
109
- 1. `--yes` or `-y` flag → **Auto Mode** (no question asked)
110
- 2. First non-flag arg matches valid role name → **Single Role Mode**
111
- 3. First non-flag arg is a number → **Phase Mode** (resolve phase dir, then auto)
112
- 4. Text provided without flags → Ask user via AskUserQuestion:
113
- - "自动模式 (推荐)" — 完整流程:框架生成 → 多角色并行分析 → 跨角色综合
114
- - "单角色分析" — 为单个角色生成分析文档
115
-
116
- **Parameter Parsing**:
117
- - `--count N`: cap at 9, default 3
118
- - `--session ID`: target specific session
119
- - `--style-skill PKG`: validate `.claude/skills/style-{PKG}/SKILL.md` exists
120
- - Missing/empty args without flags = error E001
121
-
122
- **Session Detection**:
123
- - Check `.workflow/scratch/brainstorm-*/` for existing sessions
124
- - Multiple → AskUserQuestion to select | Single → use it
125
- - None + auto mode → will create new session
126
- - None + single role mode → error E002
127
-
128
- **Output Directory Resolution**:
129
- - Phase mode (number): `.workflow/phases/{NN}-{slug}/.brainstorming/`
130
- - All output: `.workflow/scratch/brainstorm-{slug}-{date}/`
131
- - Existing session: use existing session directory
132
-
133
- ---
134
-
135
- ### Step 1.5: Load Project Specs
136
-
137
- ```
138
- specs_content = maestro spec load --category planning
139
- ```
140
-
141
- Pass to conceptual-planning-agent in Step 4 for architecture-aware role analysis.
142
-
143
- ---
144
-
145
- ### Auto Mode Steps (Phase 1.5 → Phase 1.7 → Phase 2 → Phase 3 → Phase 4)
146
-
147
- ### Step 1.7: External Research Design Routes (Auto Mode, Optional)
148
-
149
- Spawn `workflow-external-researcher` agent to discover design alternatives, architecture patterns, and competitive approaches for the brainstorm topic. This enriches the framework generation and role analyses with external knowledge.
150
-
151
- **Trigger**: Always in auto mode. Skip if `--skip-questions` and no tech keywords detected.
152
-
153
- **Auto-suggest when**: Topic contains technology keywords, architecture terms, or "design" / "pattern" / "alternative" in the description.
154
-
155
- ```
156
- // Step 1.7.1: Spawn external researcher for design routes
157
- Agent(
158
- subagent_type="workflow-external-researcher",
159
- prompt="""
160
- <objective>
161
- Research design alternatives and architecture patterns for: {topic}
162
- Mode: Design Research
163
- </objective>
164
-
165
- <context>
166
- Project specs: {specs_content or "none"}
167
- Topic keywords: {extracted_keywords}
168
- </context>
169
-
170
- <task>
171
- Search for:
172
- 1. Reference projects — how 2-3 similar projects/products solve this problem (architecture, key decisions, what worked)
173
- 2. Extractable patterns — reusable design patterns distilled from those projects, with applicability notes
174
- 3. Architecture approaches (at least 2-3 alternatives with trade-offs)
175
- 4. UX/UI patterns if applicable (interaction models, layout strategies)
176
- 5. Common design pitfalls and anti-patterns to avoid
177
-
178
- IMPORTANT: Output MUST include "Reference Projects / Implementations" and "Extractable Patterns" sections.
179
- Focus on design ROUTES — alternative approaches the brainstorm roles can evaluate.
180
- Be prescriptive where evidence is strong, present alternatives where trade-offs exist.
181
- Return structured markdown only do NOT write files.
182
- </task>
183
- """,
184
- run_in_background=false
185
- )
186
-
187
- // Step 1.7.2: Store as designResearchContext (in-memory)
188
- designResearchContext = agent_output
189
- ```
190
-
191
- `designResearchContext` is passed into:
192
- - Step 2 (Terminology): enriches domain term extraction
193
- - Step 3 Phase 1 (Topic Analysis): provides external design alternatives
194
- - Step 4 (Parallel Role Analysis): each role agent receives design research as additional context
195
-
196
- If research fails (W005): `designResearchContext = null`, continue without external context.
197
-
198
- ---
199
-
200
- ### Step 1.8: Load Project Context (if `.workflow/` exists)
201
-
202
- Load existing project history to ground brainstorming in what's already been built:
203
-
204
- ```
205
- IF .workflow/project.md exists:
206
- Read project.md:
207
- - "### Validated" → already_shipped (features already delivered)
208
- - "### Active" → current_scope
209
- - "## Context" project_history (milestone summaries)
210
-
211
- IF .workflow/state.json exists:
212
- Read state.json.accumulated_context:
213
- - deferred[] → deferred_items (candidates for brainstorming focus)
214
- - key_decisions[] → existing_constraints
215
-
216
- ```
217
-
218
- Pass `project_context` into Step 2 (terminology) and Step 3 (framework generation):
219
- - `already_shipped` informs what exists — brainstorm should explore extensions, not re-invent
220
- - `deferred_items` are high-value brainstorming seeds
221
- - `lessons_learned` surface pitfalls to avoid
222
-
223
- ---
224
-
225
- ### Step 2: Terminology & Boundary Definition (Auto Mode)
226
-
227
- Extract core terminology and define scope boundaries before framework generation.
228
-
229
- 1. Analyze topic description and any project context (project.md, roadmap.md, project_context from Step 1.8)
230
- 2. Extract 5-10 core domain terms:
231
- - term (canonical), definition, aliases, category (core|technical|business)
232
- 3. AskUserQuestion for Non-Goals (multiSelect=true):
233
- - Generate 4-5 context-aware exclusion candidates based on topic
234
- - Include "其他(请补充)" option for custom exclusions
235
- - If user selects "其他", follow up with free-text question
236
- 4. Store terminology table and non_goals to session state
237
-
238
- **Skip if**: `--yes` flag (use auto-generated terms, empty non-goals)
239
-
240
- ### Step 3: Interactive Framework Generation (Auto Mode)
241
-
242
- Seven sub-phases producing guidance-specification.md:
243
-
244
- **Phase 0: Context Collection**
245
- - Read init outputs directly: `.workflow/project.md` (tech stack, requirements, decisions), `.workflow/state.json` (project state), `.workflow/specs/` (conventions)
246
- - If `.workflow/` does not exist: continue without project context
247
-
248
- **Phase 1: Topic Analysis**
249
- - Load Phase 0 context (tech_stack, modules, conflict_risk)
250
- - Deep topic analysis (entities, challenges, constraints, metrics)
251
- - Generate 2-4 context-aware probing questions via AskUserQuestion
252
- - Questions MUST reference topic keywords (no generic questions)
253
- - Store to `session.intent_context`
254
-
255
- **Phase 2: Role Selection**
256
- - Analyze Phase 1 keywords → recommend count+2 roles with rationale
257
- - AskUserQuestion (multiSelect=true) for user to select `count` roles
258
- - If `--yes`: auto-select recommended roles
259
- - Store to `session.selected_roles`
260
-
261
- **Phase 3: Role-Specific Questions**
262
- - FOR each selected role, generate 3-4 deep questions mapping role expertise to Phase 1 challenges
263
- - AskUserQuestion per role (sequential, one role at a time)
264
- - Questions must include: implementation depth, trade-offs, edge cases
265
- - Store to `session.role_decisions[role]`
266
- - If `--yes`: skip all role questions
267
-
268
- **Phase 4: Conflict Resolution**
269
- - Analyze Phase 3 answers for contradictions, missing integrations, implicit dependencies
270
- - Generate clarification questions referencing SPECIFIC Phase 3 choices
271
- - AskUserQuestion (max 4 per round)
272
- - If NO conflicts detected: skip with notification
273
- - Store to `session.cross_role_decisions`
274
-
275
- **Phase 4.5: Final Clarification + Feature Decomposition**
276
- - Ask: "是否有前面未澄清的重点需要补充?" (无需补充 / 需要补充)
277
- - If "需要补充": progressive questions until resolved
278
- - Extract candidate features from all Phase 1-4 decisions (max 8)
279
- - Each feature: F-{3-digit} ID, kebab-case slug, description, related roles, priority
280
- - Validate: independence, completeness, granularity balance, boundary clarity
281
- - AskUserQuestion for user to confirm or adjust feature list
282
- - Store to `session.feature_list`
283
-
284
- **Phase 5: Generate Specification**
285
- - Load all decisions + terminology + non_goals + feature_list
286
- - Transform Q&A to declarative statements (CONFIRMED/SELECTED)
287
- - Apply RFC 2119 keywords (MUST, SHOULD, MAY, MUST NOT, SHOULD NOT)
288
- - Write `guidance-specification.md` with sections:
289
- 1. Project Positioning & Goals
290
- 2. Concepts & Terminology (table)
291
- 3. Non-Goals (Out of Scope)
292
- 4-N. [Role] Decisions (with RFC 2119)
293
- Cross-Role Integration
294
- Risks & Constraints
295
- Feature Decomposition (table)
296
- Appendix: Decision Tracking
297
- - Validate: no interrogative sentences, all decisions traceable, RFC keywords applied
298
-
299
- **Output**: `{output_dir}/guidance-specification.md`, session metadata (workflow-session.json)
300
-
301
- ### Step 4: Parallel Role Analysis (Auto Mode)
302
-
303
- For EACH selected role, spawn a conceptual-planning-agent in parallel:
304
-
305
- ```
306
- Agent({
307
- subagent_type: "conceptual-planning-agent",
308
- prompt: "[role analysis prompt with framework + role template]",
309
- run_in_background: false
310
- })
311
- ```
312
-
313
- Each agent receives:
314
- - `guidance-specification.md` for framework context
315
- - Role-specific template from `~/.maestro/templates/planning-roles/{role}.md`
316
- - Feature list for feature-point organization
317
- - `--skip-questions` flag (context already gathered in Phase 2)
318
- - For ui-designer: `--style-skill {package}` if provided
319
- - If `designResearchContext` is set: include as "External Design Research" section in agent prompt (design alternatives, patterns, competitive analysis for the role to evaluate and reference)
320
-
321
- **Feature-Point Organization** (when feature list available):
322
- - `analysis.md` — Role overview INDEX only (< 1500 words)
323
- - `analysis-cross-cutting.md` Cross-feature decisions (< 2000 words)
324
- - `analysis-F-{id}-{slug}.md` — Per-feature analysis (< 2000 words each)
325
-
326
- **Fallback Organization** (no feature list):
327
- - `analysis.md` Main analysis (< 3000 words)
328
- - Optional `analysis-{slug}.md` sub-documents (max 5)
329
-
330
- **system-architect specific requirements**:
331
- - MUST include: Data Model (3-5 entities), State Machine (ASCII + transition table), Error Handling, Observability (5+ metrics), Configuration Model, Boundary Scenarios
332
- - All constraints MUST use RFC 2119 keywords
333
-
334
- **Quality Validation** (after each role completes, orchestrator self-check):
335
- - Verify `analysis.md` exists and is non-empty
336
- - Feature mode: verify `analysis-cross-cutting.md` + `analysis-F-*.md` files match feature list
337
- - Grep for RFC 2119 keywords (MUST/SHOULD/MAY) — warn if < 5 occurrences
338
- - Check word count (wc -w) against limits — warn if exceeded
339
- - system-architect: verify Data Model and State Machine sections exist
340
-
341
- **Parallel Safety**: Each role operates on its own directory. No cross-agent dependencies.
342
-
343
- ### Step 5: Synthesis Integration (Auto Mode)
344
-
345
- Six sub-phases producing feature specs from cross-role analysis:
346
-
347
- **Sub-phase 1: Discovery**
348
- - Detect session, validate analysis files exist
349
- - Load user intent from session metadata
350
- - Detect feature mode (feature decomposition table + analysis-F-*.md files)
351
-
352
- **Sub-phase 2: File Discovery**
353
- - Glob `{output_dir}/{role}/analysis*.md`
354
- - Extract role_analysis_paths and participating_roles
355
- - Feature mode optimization: read only analysis.md index files (~4.5K total) not sub-documents
356
-
357
- **Sub-phase 3A: Cross-Role Analysis Agent**
358
- - Spawn conceptual-planning-agent for cross-role analysis
359
- - Input: analysis index files (feature mode) or all analysis files (fallback)
360
- - Output: `enhancement_recommendations` (EP-001, EP-002, ...) + `feature_conflict_map` (per-feature consensus/conflicts/cross_refs)
361
- - Conflict resolution quality: actionable, justified ("because...tradeoff:..."), scoped, confidence-tagged ([RESOLVED]|[SUGGESTED]|[UNRESOLVED])
362
-
363
- **Sub-phase 4: User Interaction**
364
- - Enhancement selection: AskUserQuestion (multiSelect=true, batched by 4)
365
- - Clarification questions: 9-category taxonomy scan, AskUserQuestion (single-select, multi-round)
366
- - Build spec_context: selected_enhancements + clarification_answers + original_user_intent
367
- - If `--yes`: auto-select all enhancements, skip clarifications
368
-
369
- **Sub-phase 5: Spec Generation + Conditional Review**
370
- - Single conceptual-planning-agent generates all specs sequentially:
371
- - Feature mode: one `feature-specs/F-{id}-{slug}.md` per feature (7 sections, 1500-2500 words)
372
- - Fallback mode: single `synthesis-specification.md`
373
- - `feature-index.json` (feature mode only)
374
- - `synthesis-changelog.md` (enhancements applied, clarifications resolved, conflicts resolved)
375
- - Self-evaluate complexity_score (0-8 scale: feature count, unresolved conflicts, roles, cross-deps)
376
- - If complexity_score >= 4: trigger review agent for cross-feature consistency check
377
- - Minor fixes applied directly, major issues flagged with [REVIEW-FLAG]
378
-
379
- **Feature Spec Template (7 Sections)**:
380
- 1. Requirements Summary (RFC 2119 keywords)
381
- 2. Design Decisions [CORE — 40%+ word count]
382
- 3. Interface Contract
383
- 4. Constraints & Risks
384
- 5. Acceptance Criteria
385
- 6. Detailed Analysis References (@-links)
386
- 7. Cross-Feature Dependencies
387
-
388
- **Four-Layer Aggregation Rules**:
389
- - Layer 1: Direct Reference (consensus quote roles)
390
- - Layer 2: Structured Extraction (complementary merge, de-duplicate)
391
- - Layer 3: Conflict Distillation ([RESOLVED] → decision, [SUGGESTED] → recommended, [UNRESOLVED] → [DECISION NEEDED])
392
- - Layer 4: Cross-Feature Annotation (dependency notes, integration points)
393
-
394
- **Sub-phase 6: Finalization**
395
- - Update context-package.json with spec paths
396
- - Update session metadata (enhancements_applied, questions_asked, complexity_score, review results)
397
- - Completion report with next step suggestion
398
-
399
- ---
400
-
401
- ### Single Role Mode Steps
402
-
403
- ### Step 6: Single Role Analysis
404
-
405
- Execute analysis for ONE specified role with optional interactive context gathering.
406
-
407
- **Step 6.1: Detection & Validation**
408
- - Validate role_name against VALID_ROLES list
409
- - Detect session (--session or find existing)
410
- - Check for guidance-specification.md → framework_mode
411
- - Extract feature list → feature_mode
412
- - Check existing analysis update_mode (ask: update/regenerate/cancel)
413
-
414
- **Step 6.2: Interactive Context Gathering**
415
- - Skip if `--skip-questions`
416
- - Force if `--include-questions`
417
- - Generate 3-5 role-specific questions (Chinese, with business context)
418
- - AskUserQuestion per batch (max 4 per round)
419
- - Save context to `{role}/{role}-context.md`
420
-
421
- **Step 6.3: Agent Execution**
422
- - Spawn conceptual-planning-agent with:
423
- - Role name, framework (if exists), feature list (if exists)
424
- - User context (if gathered), session metadata
425
- - Role-specific template
426
- - For ui-designer: style-skill package
427
- - Agent generates analysis files in `{output_dir}/{role}/`
428
-
429
- **Step 6.4: Validation**
430
- - Verify `analysis.md` exists
431
- - Check framework reference if framework_mode
432
- - Update session metadata with completion status
433
- - Report results with next step suggestions
434
-
435
- ---
436
-
437
- ### Step 7: Final Report
438
-
439
- **Auto mode report:**
440
- - Session ID and output directory
441
- - Roles analyzed (N)
442
- - Features specified (N)
443
- - Enhancements applied (EP-IDs)
444
- - Complexity score and review status
445
- - Next:
446
- Skill({ skill: "maestro-spec-generate", args: "--from-brainstorm {sessionId}" }) — Generate full spec package
447
- Skill({ skill: "maestro-analyze", args: "{topic}" }) — Evaluate feasibility + lock decisions
448
- Skill({ skill: "maestro-analyze", args: "{phase} -q" }) — Quick decision extraction only
449
- Skill({ skill: "maestro-plan", args: "{phase}" }) — Plan directly (if scope is clear)
450
-
451
- **Single role mode report:**
452
- - Role analyzed
453
- - Framework alignment status
454
- - Context questions answered
455
- - Output file location
456
- - Next: run more roles or Skill({ skill: "maestro-brainstorm", args: "--session {sessionId}" }) for synthesis
457
-
458
- ---
459
-
460
- ## Quality Criteria
461
-
462
- - If `designResearchContext` is set: guidance-specification.md references external design findings
463
- - guidance-specification.md uses RFC 2119 keywords (MUST/SHOULD/MAY)
464
- - Concepts & Terminology section with 5-10 core terms
465
- - Non-Goals section with rationale
466
- - Feature Decomposition table (max 8 features, independently implementable)
467
- - Role analyses follow role-specific templates
468
- - system-architect includes: Data Model, State Machine, Error Handling, Observability
469
- - Feature specs have 7 sections, Section 2 (Design Decisions) is 40%+ of content
470
- - All conflicts resolved or marked [DECISION NEEDED]
471
- - synthesis-changelog.md records all synthesis decisions as audit trail
1
+ # Workflow: Brainstorm
2
+
3
+ Unified brainstorming workflow with dual-mode operation: auto pipeline (full multi-role analysis) and single role analysis mode.
4
+
5
+ ## Architecture
6
+
7
+ ```
8
+ ┌─────────────────────────────────────────────────────────┐
9
+ │ /maestro-brainstorm │
10
+ │ Unified Entry Point + Interactive Routing │
11
+ └───────────────────────┬─────────────────────────────────┘
12
+
13
+ ┌─────────┴─────────┐
14
+ ↓ ↓
15
+ ┌─────────────────┐ ┌──────────────────┐
16
+ │ Auto Mode │ │ Single Role Mode │
17
+ └────────┬────────┘ └────────┬─────────┘
18
+ │ │
19
+ ┌────────┼────────┐ │
20
+ ↓ ↓ ↓ ↓
21
+ Phase 2 Phase 3 Phase 4 Phase 3
22
+ Artifacts N×Role Synthesis 1×Role
23
+ 并行 Analysis
24
+ ```
25
+
26
+ ## Dual-Mode Routing
27
+
28
+ ### Auto Mode (full pipeline)
29
+ Triggered by `--yes`/`-y` flag or user selection.
30
+
31
+ ```
32
+ Phase 1: Mode Detection → Parse args, detect mode
33
+ Phase 1.5: Terminology & Boundary → Extract terms, collect Non-Goals
34
+ Phase 2: Interactive Framework → 7 sub-phases (context → topic → roles → questions → conflicts → check → spec)
35
+ Phase 3: Parallel Role Analysis → N concurrent role analyses via conceptual-planning-agent
36
+ Phase 4: Synthesis Integration → Cross-role analysis → user clarification → spec generation
37
+ ```
38
+
39
+ ### Single Role Mode
40
+ Triggered when first arg is a valid role name.
41
+
42
+ ```
43
+ Phase 1: Mode Detection → Parse args, detect mode
44
+ Phase 3: Single Role Analysis → Detection → Context → Agent → Validation
45
+ ```
46
+
47
+ ## Input
48
+
49
+ - `$ARGUMENTS`: topic text (auto mode) or role name (single role mode)
50
+ - All output goes to `.workflow/scratch/brainstorm-{slug}-{date}/`
51
+ - Registers artifact (type=brainstorm) in state.json on completion
52
+
53
+ ### Parameters
54
+
55
+ | Parameter | Description | Default |
56
+ |-----------|-------------|---------|
57
+ | `--yes`, `-y` | Auto mode, skip all questions | - |
58
+ | `--count N` | Number of roles to select | 3 |
59
+ | `--session ID` | Use existing session | - |
60
+ | `--update` | Update existing analysis | - |
61
+ | `--include-questions` | Interactive context gathering | - |
62
+ | `--skip-questions` | Use default answers | - |
63
+ | `--style-skill PKG` | Style package for ui-designer | - |
64
+
65
+ ### Available Roles
66
+
67
+ | Role ID | Title | Focus Area |
68
+ |---------|-------|------------|
69
+ | `data-architect` | 数据架构师 | Data models, storage strategies, data flow |
70
+ | `product-manager` | 产品经理 | Product strategy, roadmap, prioritization |
71
+ | `product-owner` | 产品负责人 | Backlog management, user stories, acceptance criteria |
72
+ | `scrum-master` | 敏捷教练 | Process facilitation, impediment removal |
73
+ | `subject-matter-expert` | 领域专家 | Domain knowledge, business rules, compliance |
74
+ | `system-architect` | 系统架构师 | Technical architecture, scalability, integration |
75
+ | `test-strategist` | 测试策略师 | Test strategy, quality assurance |
76
+ | `ui-designer` | UI设计师 | Visual design, mockups, design systems |
77
+ | `ux-expert` | UX专家 | User research, information architecture, journey |
78
+
79
+ ## Output
80
+
81
+ ### Directory Structure
82
+
83
+ All brainstorm output goes to scratch:
84
+ ```
85
+ .workflow/scratch/brainstorm-{slug}-{date}/
86
+ ├── guidance-specification.md # Phase 2 output
87
+ ├── feature-index.json # Phase 4 output
88
+ ├── synthesis-changelog.md # Phase 4 audit trail
89
+ ├── feature-specs/ # Phase 4 feature specs
90
+ │ ├── F-001-{slug}.md
91
+ │ └── F-00N-{slug}.md
92
+ ├── {role}/ # Phase 3 role analyses (immutable)
93
+ │ ├── {role}-context.md
94
+ │ ├── analysis.md
95
+ │ ├── analysis-cross-cutting.md
96
+ │ └── analysis-F-{id}-{slug}.md
97
+ └── synthesis-specification.md # Non-feature mode fallback
98
+ ```
99
+
100
+ ---
101
+
102
+ ## Process
103
+
104
+ ### Step 1: Parse & Route (Mode Detection)
105
+
106
+ Parse $ARGUMENTS to determine execution mode:
107
+
108
+ **Mode Detection (ordered by priority)**:
109
+ 1. `--yes` or `-y` flag → **Auto Mode** (no question asked)
110
+ 2. First non-flag arg matches valid role name → **Single Role Mode**
111
+ 3. First non-flag arg is a number → **Phase Mode** (resolve phase dir, then auto)
112
+ 4. Text provided without flags → Ask user via AskUserQuestion:
113
+ - "自动模式 (推荐)" — 完整流程:框架生成 → 多角色并行分析 → 跨角色综合
114
+ - "单角色分析" — 为单个角色生成分析文档
115
+
116
+ **Parameter Parsing**:
117
+ - `--count N`: cap at 9, default 3
118
+ - `--session ID`: target specific session
119
+ - `--style-skill PKG`: validate `.claude/skills/style-{PKG}/SKILL.md` exists
120
+ - Missing/empty args without flags = error E001
121
+
122
+ **Session Detection**:
123
+ - Check `.workflow/scratch/brainstorm-*/` for existing sessions
124
+ - Multiple → AskUserQuestion to select | Single → use it
125
+ - None + auto mode → will create new session
126
+ - None + single role mode → error E002
127
+
128
+ **Output Directory Resolution**:
129
+ - Phase mode (number):
130
+ ```
131
+ Read .workflow/state.json state
132
+ artifacts = state.artifacts ?? []
133
+ IF artifacts.length > 0:
134
+ art = artifacts.find(a => a.phase === phaseNum)
135
+ output_dir = ".workflow/" + art.path + "/.brainstorming/"
136
+ ELSE:
137
+ output_dir = ".workflow/phases/{NN}-{slug}/.brainstorming/"
138
+ ```
139
+ - All output: `.workflow/scratch/brainstorm-{slug}-{date}/`
140
+ - Existing session: use existing session directory
141
+
142
+ ---
143
+
144
+ ### Step 1.5: Load Project Specs
145
+
146
+ ```
147
+ specs_content = maestro spec load --category arch
148
+ ```
149
+
150
+ Pass to conceptual-planning-agent in Step 4 for architecture-aware role analysis.
151
+
152
+ ---
153
+
154
+ ### Auto Mode Steps (Phase 1.5 → Phase 1.7 → Phase 2 → Phase 3 → Phase 4)
155
+
156
+ ### Step 1.7: External Research Design Routes (Auto Mode, Optional)
157
+
158
+ Spawn `workflow-external-researcher` agent to discover design alternatives, architecture patterns, and competitive approaches for the brainstorm topic. This enriches the framework generation and role analyses with external knowledge.
159
+
160
+ **Trigger**: Always in auto mode. Skip if `--skip-questions` and no tech keywords detected.
161
+
162
+ **Auto-suggest when**: Topic contains technology keywords, architecture terms, or "design" / "pattern" / "alternative" in the description.
163
+
164
+ ```
165
+ // Step 1.7.1: Spawn external researcher for design routes
166
+ Agent(
167
+ subagent_type="workflow-external-researcher",
168
+ prompt="""
169
+ <objective>
170
+ Research design alternatives and architecture patterns for: {topic}
171
+ Mode: Design Research
172
+ </objective>
173
+
174
+ <context>
175
+ Project specs: {specs_content or "none"}
176
+ Topic keywords: {extracted_keywords}
177
+ </context>
178
+
179
+ <task>
180
+ Search for:
181
+ 1. Reference projectshow 2-3 similar projects/products solve this problem (architecture, key decisions, what worked)
182
+ 2. Extractable patterns — reusable design patterns distilled from those projects, with applicability notes
183
+ 3. Architecture approaches (at least 2-3 alternatives with trade-offs)
184
+ 4. UX/UI patterns if applicable (interaction models, layout strategies)
185
+ 5. Common design pitfalls and anti-patterns to avoid
186
+
187
+ IMPORTANT: Output MUST include "Reference Projects / Implementations" and "Extractable Patterns" sections.
188
+ Focus on design ROUTES — alternative approaches the brainstorm roles can evaluate.
189
+ Be prescriptive where evidence is strong, present alternatives where trade-offs exist.
190
+ Return structured markdown only — do NOT write files.
191
+ </task>
192
+ """,
193
+ run_in_background=false
194
+ )
195
+
196
+ // Step 1.7.2: Store as designResearchContext (in-memory)
197
+ designResearchContext = agent_output
198
+ ```
199
+
200
+ `designResearchContext` is passed into:
201
+ - Step 2 (Terminology): enriches domain term extraction
202
+ - Step 3 Phase 1 (Topic Analysis): provides external design alternatives
203
+ - Step 4 (Parallel Role Analysis): each role agent receives design research as additional context
204
+
205
+ If research fails (W005): `designResearchContext = null`, continue without external context.
206
+
207
+ ---
208
+
209
+ ### Step 1.8: Load Project Context (if `.workflow/` exists)
210
+
211
+ Load existing project history to ground brainstorming in what's already been built:
212
+
213
+ ```
214
+ IF .workflow/project.md exists:
215
+ Read project.md:
216
+ - "### Validated" → already_shipped (features already delivered)
217
+ - "### Active" → current_scope
218
+ - "## Context" project_history (milestone summaries)
219
+
220
+ IF .workflow/state.json exists:
221
+ Read state.json.accumulated_context:
222
+ - deferred[] → deferred_items (candidates for brainstorming focus)
223
+ - key_decisions[] → existing_constraints
224
+
225
+ ```
226
+
227
+ Pass `project_context` into Step 2 (terminology) and Step 3 (framework generation):
228
+ - `already_shipped` informs what exists — brainstorm should explore extensions, not re-invent
229
+ - `deferred_items` are high-value brainstorming seeds
230
+ - `lessons_learned` surface pitfalls to avoid
231
+
232
+ ---
233
+
234
+ ### Step 2: Terminology & Boundary Definition (Auto Mode)
235
+
236
+ Extract core terminology and define scope boundaries before framework generation.
237
+
238
+ 1. Analyze topic description and any project context (project.md, roadmap.md, project_context from Step 1.8)
239
+ 2. Extract 5-10 core domain terms:
240
+ - term (canonical), definition, aliases, category (core|technical|business)
241
+ 3. AskUserQuestion for Non-Goals (multiSelect=true):
242
+ - Generate 4-5 context-aware exclusion candidates based on topic
243
+ - Include "其他(请补充)" option for custom exclusions
244
+ - If user selects "其他", follow up with free-text question
245
+ 4. Store terminology table and non_goals to session state
246
+
247
+ **Skip if**: `--yes` flag (use auto-generated terms, empty non-goals)
248
+
249
+ ### Step 3: Interactive Framework Generation (Auto Mode)
250
+
251
+ Seven sub-phases producing guidance-specification.md:
252
+
253
+ **Phase 0: Context Collection**
254
+ - Read init outputs directly: `.workflow/project.md` (tech stack, requirements, decisions), `.workflow/state.json` (project state), `.workflow/specs/` (conventions)
255
+ - If `.workflow/` does not exist: continue without project context
256
+
257
+ **Phase 1: Topic Analysis**
258
+ - Load Phase 0 context (tech_stack, modules, conflict_risk)
259
+ - Deep topic analysis (entities, challenges, constraints, metrics)
260
+ - Generate 2-4 context-aware probing questions via AskUserQuestion
261
+ - Questions MUST reference topic keywords (no generic questions)
262
+ - Store to `session.intent_context`
263
+
264
+ **Phase 2: Role Selection**
265
+ - Analyze Phase 1 keywords → recommend count+2 roles with rationale
266
+ - AskUserQuestion (multiSelect=true) for user to select `count` roles
267
+ - If `--yes`: auto-select recommended roles
268
+ - Store to `session.selected_roles`
269
+
270
+ **Phase 3: Role-Specific Questions**
271
+ - FOR each selected role, generate 3-4 deep questions mapping role expertise to Phase 1 challenges
272
+ - AskUserQuestion per role (sequential, one role at a time)
273
+ - Questions must include: implementation depth, trade-offs, edge cases
274
+ - Store to `session.role_decisions[role]`
275
+ - If `--yes`: skip all role questions
276
+
277
+ **Phase 4: Conflict Resolution**
278
+ - Analyze Phase 3 answers for contradictions, missing integrations, implicit dependencies
279
+ - Generate clarification questions referencing SPECIFIC Phase 3 choices
280
+ - AskUserQuestion (max 4 per round)
281
+ - If NO conflicts detected: skip with notification
282
+ - Store to `session.cross_role_decisions`
283
+
284
+ **Phase 4.5: Final Clarification + Feature Decomposition**
285
+ - Ask: "是否有前面未澄清的重点需要补充?" (无需补充 / 需要补充)
286
+ - If "需要补充": progressive questions until resolved
287
+ - Extract candidate features from all Phase 1-4 decisions (max 8)
288
+ - Each feature: F-{3-digit} ID, kebab-case slug, description, related roles, priority
289
+ - Validate: independence, completeness, granularity balance, boundary clarity
290
+ - AskUserQuestion for user to confirm or adjust feature list
291
+ - Store to `session.feature_list`
292
+
293
+ **Phase 5: Generate Specification**
294
+ - Load all decisions + terminology + non_goals + feature_list
295
+ - Transform Q&A to declarative statements (CONFIRMED/SELECTED)
296
+ - Apply RFC 2119 keywords (MUST, SHOULD, MAY, MUST NOT, SHOULD NOT)
297
+ - Write `guidance-specification.md` with sections:
298
+ 1. Project Positioning & Goals
299
+ 2. Concepts & Terminology (table)
300
+ 3. Non-Goals (Out of Scope)
301
+ 4-N. [Role] Decisions (with RFC 2119)
302
+ Cross-Role Integration
303
+ Risks & Constraints
304
+ Feature Decomposition (table)
305
+ Appendix: Decision Tracking
306
+ - Validate: no interrogative sentences, all decisions traceable, RFC keywords applied
307
+
308
+ **Output**: `{output_dir}/guidance-specification.md`, session metadata (workflow-session.json)
309
+
310
+ ### Step 4: Parallel Role Analysis (Auto Mode)
311
+
312
+ For EACH selected role, spawn a conceptual-planning-agent in parallel:
313
+
314
+ ```
315
+ Agent({
316
+ subagent_type: "conceptual-planning-agent",
317
+ prompt: "[role analysis prompt with framework + role template]",
318
+ run_in_background: false
319
+ })
320
+ ```
321
+
322
+ Each agent receives:
323
+ - `guidance-specification.md` for framework context
324
+ - Role-specific template from `~/.maestro/templates/planning-roles/{role}.md`
325
+ - Feature list for feature-point organization
326
+ - `--skip-questions` flag (context already gathered in Phase 2)
327
+ - For ui-designer: `--style-skill {package}` if provided
328
+ - If `designResearchContext` is set: include as "External Design Research" section in agent prompt (design alternatives, patterns, competitive analysis for the role to evaluate and reference)
329
+
330
+ **Feature-Point Organization** (when feature list available):
331
+ - `analysis.md` Role overview INDEX only (< 1500 words)
332
+ - `analysis-cross-cutting.md` Cross-feature decisions (< 2000 words)
333
+ - `analysis-F-{id}-{slug}.md` — Per-feature analysis (< 2000 words each)
334
+
335
+ **Fallback Organization** (no feature list):
336
+ - `analysis.md` Main analysis (< 3000 words)
337
+ - Optional `analysis-{slug}.md` sub-documents (max 5)
338
+
339
+ **system-architect specific requirements**:
340
+ - MUST include: Data Model (3-5 entities), State Machine (ASCII + transition table), Error Handling, Observability (5+ metrics), Configuration Model, Boundary Scenarios
341
+ - All constraints MUST use RFC 2119 keywords
342
+
343
+ **Quality Validation** (after each role completes, orchestrator self-check):
344
+ - Verify `analysis.md` exists and is non-empty
345
+ - Feature mode: verify `analysis-cross-cutting.md` + `analysis-F-*.md` files match feature list
346
+ - Grep for RFC 2119 keywords (MUST/SHOULD/MAY) — warn if < 5 occurrences
347
+ - Check word count (wc -w) against limits — warn if exceeded
348
+ - system-architect: verify Data Model and State Machine sections exist
349
+
350
+ **Parallel Safety**: Each role operates on its own directory. No cross-agent dependencies.
351
+
352
+ ### Step 5: Synthesis Integration (Auto Mode)
353
+
354
+ Six sub-phases producing feature specs from cross-role analysis:
355
+
356
+ **Sub-phase 1: Discovery**
357
+ - Detect session, validate analysis files exist
358
+ - Load user intent from session metadata
359
+ - Detect feature mode (feature decomposition table + analysis-F-*.md files)
360
+
361
+ **Sub-phase 2: File Discovery**
362
+ - Glob `{output_dir}/{role}/analysis*.md`
363
+ - Extract role_analysis_paths and participating_roles
364
+ - Feature mode optimization: read only analysis.md index files (~4.5K total) not sub-documents
365
+
366
+ **Sub-phase 3A: Cross-Role Analysis Agent**
367
+ - Spawn conceptual-planning-agent for cross-role analysis
368
+ - Input: analysis index files (feature mode) or all analysis files (fallback)
369
+ - Output: `enhancement_recommendations` (EP-001, EP-002, ...) + `feature_conflict_map` (per-feature consensus/conflicts/cross_refs)
370
+ - Conflict resolution quality: actionable, justified ("because...tradeoff:..."), scoped, confidence-tagged ([RESOLVED]|[SUGGESTED]|[UNRESOLVED])
371
+
372
+ **Sub-phase 4: User Interaction**
373
+ - Enhancement selection: AskUserQuestion (multiSelect=true, batched by 4)
374
+ - Clarification questions: 9-category taxonomy scan, AskUserQuestion (single-select, multi-round)
375
+ - Build spec_context: selected_enhancements + clarification_answers + original_user_intent
376
+ - If `--yes`: auto-select all enhancements, skip clarifications
377
+
378
+ **Sub-phase 5: Spec Generation + Conditional Review**
379
+ - Single conceptual-planning-agent generates all specs sequentially:
380
+ - Feature mode: one `feature-specs/F-{id}-{slug}.md` per feature (7 sections, 1500-2500 words)
381
+ - Fallback mode: single `synthesis-specification.md`
382
+ - `feature-index.json` (feature mode only)
383
+ - `synthesis-changelog.md` (enhancements applied, clarifications resolved, conflicts resolved)
384
+ - Self-evaluate complexity_score (0-8 scale: feature count, unresolved conflicts, roles, cross-deps)
385
+ - If complexity_score >= 4: trigger review agent for cross-feature consistency check
386
+ - Minor fixes applied directly, major issues flagged with [REVIEW-FLAG]
387
+
388
+ **Feature Spec Template (7 Sections)**:
389
+ 1. Requirements Summary (RFC 2119 keywords)
390
+ 2. Design Decisions [CORE 40%+ word count]
391
+ 3. Interface Contract
392
+ 4. Constraints & Risks
393
+ 5. Acceptance Criteria
394
+ 6. Detailed Analysis References (@-links)
395
+ 7. Cross-Feature Dependencies
396
+
397
+ **Four-Layer Aggregation Rules**:
398
+ - Layer 1: Direct Reference (consensus → quote roles)
399
+ - Layer 2: Structured Extraction (complementary → merge, de-duplicate)
400
+ - Layer 3: Conflict Distillation ([RESOLVED] → decision, [SUGGESTED] → recommended, [UNRESOLVED] → [DECISION NEEDED])
401
+ - Layer 4: Cross-Feature Annotation (dependency notes, integration points)
402
+
403
+ **Sub-phase 6: Finalization**
404
+ - Update context-package.json with spec paths
405
+ - Update session metadata (enhancements_applied, questions_asked, complexity_score, review results)
406
+ - Completion report with next step suggestion
407
+
408
+ ---
409
+
410
+ ### Single Role Mode Steps
411
+
412
+ ### Step 6: Single Role Analysis
413
+
414
+ Execute analysis for ONE specified role with optional interactive context gathering.
415
+
416
+ **Step 6.1: Detection & Validation**
417
+ - Validate role_name against VALID_ROLES list
418
+ - Detect session (--session or find existing)
419
+ - Check for guidance-specification.md → framework_mode
420
+ - Extract feature list → feature_mode
421
+ - Check existing analysis → update_mode (ask: update/regenerate/cancel)
422
+
423
+ **Step 6.2: Interactive Context Gathering**
424
+ - Skip if `--skip-questions`
425
+ - Force if `--include-questions`
426
+ - Generate 3-5 role-specific questions (Chinese, with business context)
427
+ - AskUserQuestion per batch (max 4 per round)
428
+ - Save context to `{role}/{role}-context.md`
429
+
430
+ **Step 6.3: Agent Execution**
431
+ - Spawn conceptual-planning-agent with:
432
+ - Role name, framework (if exists), feature list (if exists)
433
+ - User context (if gathered), session metadata
434
+ - Role-specific template
435
+ - For ui-designer: style-skill package
436
+ - Agent generates analysis files in `{output_dir}/{role}/`
437
+
438
+ **Step 6.4: Validation**
439
+ - Verify `analysis.md` exists
440
+ - Check framework reference if framework_mode
441
+ - Update session metadata with completion status
442
+ - Report results with next step suggestions
443
+
444
+ ---
445
+
446
+ ### Step 7: Final Report
447
+
448
+ **Auto mode report:**
449
+ - Session ID and output directory
450
+ - Roles analyzed (N)
451
+ - Features specified (N)
452
+ - Enhancements applied (EP-IDs)
453
+ - Complexity score and review status
454
+ - Next:
455
+ Skill({ skill: "maestro-spec-generate", args: "--from-brainstorm {sessionId}" }) — Generate full spec package
456
+ Skill({ skill: "maestro-analyze", args: "{topic}" }) Evaluate feasibility + lock decisions
457
+ Skill({ skill: "maestro-analyze", args: "{phase} -q" }) — Quick decision extraction only
458
+ Skill({ skill: "maestro-plan", args: "{phase}" }) — Plan directly (if scope is clear)
459
+
460
+ **Single role mode report:**
461
+ - Role analyzed
462
+ - Framework alignment status
463
+ - Context questions answered
464
+ - Output file location
465
+ - Next: run more roles or Skill({ skill: "maestro-brainstorm", args: "--session {sessionId}" }) for synthesis
466
+
467
+ ---
468
+
469
+ ## Quality Criteria
470
+
471
+ - If `designResearchContext` is set: guidance-specification.md references external design findings
472
+ - guidance-specification.md uses RFC 2119 keywords (MUST/SHOULD/MAY)
473
+ - Concepts & Terminology section with 5-10 core terms
474
+ - Non-Goals section with rationale
475
+ - Feature Decomposition table (max 8 features, independently implementable)
476
+ - Role analyses follow role-specific templates
477
+ - system-architect includes: Data Model, State Machine, Error Handling, Observability
478
+ - Feature specs have 7 sections, Section 2 (Design Decisions) is 40%+ of content
479
+ - All conflicts resolved or marked [DECISION NEEDED]
480
+ - synthesis-changelog.md records all synthesis decisions as audit trail