maestro-flow 0.3.46 → 0.3.47

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 (241) hide show
  1. package/.claude/agents/ui-design-agent.md +1 -0
  2. package/.claude/agents/workflow-executor.md +3 -0
  3. package/.claude/commands/learn-decompose.md +91 -146
  4. package/.claude/commands/learn-follow.md +102 -137
  5. package/.claude/commands/learn-investigate.md +102 -167
  6. package/.claude/commands/learn-retro.md +100 -243
  7. package/.claude/commands/learn-second-opinion.md +95 -135
  8. package/.claude/commands/maestro-amend.md +95 -232
  9. package/.claude/commands/maestro-analyze.md +1 -6
  10. package/.claude/commands/maestro-collab.md +104 -265
  11. package/.claude/commands/maestro-composer.md +113 -293
  12. package/.claude/commands/maestro-execute.md +10 -17
  13. package/.claude/commands/maestro-impeccable.md +89 -0
  14. package/.claude/commands/maestro-plan.md +1 -6
  15. package/.claude/commands/maestro-player.md +111 -340
  16. package/.claude/commands/maestro-quick.md +9 -0
  17. package/.claude/commands/maestro-ralph-execute.md +167 -210
  18. package/.claude/commands/maestro-ralph.md +245 -426
  19. package/.claude/commands/maestro-ui-codify.md +13 -0
  20. package/.claude/commands/maestro-ui-craft.md +364 -0
  21. package/.claude/commands/maestro-ui-design.md +12 -1
  22. package/.claude/commands/maestro-verify.md +12 -13
  23. package/.claude/commands/maestro.md +142 -72
  24. package/.claude/commands/manage-knowhow-capture.md +45 -170
  25. package/.claude/commands/quality-auto-test.md +9 -0
  26. package/.claude/commands/quality-debug.md +11 -25
  27. package/.claude/commands/quality-refactor.md +9 -0
  28. package/.claude/commands/quality-review.md +5 -14
  29. package/.claude/commands/spec-add.md +1 -1
  30. package/.claude/commands/spec-load.md +3 -2
  31. package/.claude/skills/maestro-impeccable/SKILL.md +169 -0
  32. package/.codex/skills/learn-decompose/SKILL.md +1 -1
  33. package/.codex/skills/learn-investigate/SKILL.md +2 -1
  34. package/.codex/skills/maestro/SKILL.md +278 -313
  35. package/.codex/skills/maestro-analyze/SKILL.md +126 -417
  36. package/.codex/skills/maestro-brainstorm/SKILL.md +129 -451
  37. package/.codex/skills/maestro-collab/SKILL.md +134 -547
  38. package/.codex/skills/maestro-execute/SKILL.md +3 -1
  39. package/.codex/skills/maestro-impeccable/SKILL.md +112 -0
  40. package/.codex/skills/maestro-plan/SKILL.md +88 -437
  41. package/.codex/skills/maestro-player/SKILL.md +191 -333
  42. package/.codex/skills/maestro-quick/SKILL.md +2 -0
  43. package/.codex/skills/maestro-ralph/SKILL.md +307 -710
  44. package/.codex/skills/maestro-roadmap/SKILL.md +201 -518
  45. package/.codex/skills/maestro-ui-codify/SKILL.md +1 -0
  46. package/.codex/skills/maestro-ui-craft/SKILL.md +341 -0
  47. package/.codex/skills/maestro-ui-design/SKILL.md +10 -0
  48. package/.codex/skills/maestro-verify/SKILL.md +116 -409
  49. package/.codex/skills/quality-auto-test/SKILL.md +145 -443
  50. package/.codex/skills/quality-refactor/SKILL.md +1 -1
  51. package/.codex/skills/quality-test/SKILL.md +229 -517
  52. package/.codex/skills/spec-add/SKILL.md +1 -1
  53. package/README.md +4 -1
  54. package/README.zh-CN.md +3 -1
  55. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +3 -0
  56. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
  57. package/dashboard/dist-server/dashboard/src/server/routes/install.js +110 -1
  58. package/dashboard/dist-server/dashboard/src/server/routes/install.js.map +1 -1
  59. package/dashboard/dist-server/dashboard/src/server/routes/settings.js +56 -0
  60. package/dashboard/dist-server/dashboard/src/server/routes/settings.js.map +1 -1
  61. package/dashboard/dist-server/dashboard/src/server/routes/wiki.js +2 -0
  62. package/dashboard/dist-server/dashboard/src/server/routes/wiki.js.map +1 -1
  63. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js +2 -2
  64. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js.map +1 -1
  65. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +2 -0
  66. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  67. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-types.d.ts +3 -1
  68. package/dashboard/dist-server/dashboard/src/shared/constants.d.ts +2 -0
  69. package/dashboard/dist-server/dashboard/src/shared/constants.js +2 -0
  70. package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
  71. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  72. package/dist/src/agents/cli-agent-runner.js +1 -3
  73. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  74. package/dist/src/agents/cli-history-store.d.ts +5 -0
  75. package/dist/src/agents/cli-history-store.d.ts.map +1 -1
  76. package/dist/src/agents/cli-history-store.js +65 -13
  77. package/dist/src/agents/cli-history-store.js.map +1 -1
  78. package/dist/src/cli.js +13 -0
  79. package/dist/src/cli.js.map +1 -1
  80. package/dist/src/commands/command-help.d.ts +3 -0
  81. package/dist/src/commands/command-help.d.ts.map +1 -0
  82. package/dist/src/commands/command-help.js +60 -0
  83. package/dist/src/commands/command-help.js.map +1 -0
  84. package/dist/src/commands/config.d.ts.map +1 -1
  85. package/dist/src/commands/config.js +17 -0
  86. package/dist/src/commands/config.js.map +1 -1
  87. package/dist/src/commands/delegate.d.ts.map +1 -1
  88. package/dist/src/commands/delegate.js +12 -2
  89. package/dist/src/commands/delegate.js.map +1 -1
  90. package/dist/src/commands/impeccable.d.ts +10 -0
  91. package/dist/src/commands/impeccable.d.ts.map +1 -0
  92. package/dist/src/commands/impeccable.js +181 -0
  93. package/dist/src/commands/impeccable.js.map +1 -0
  94. package/dist/src/commands/spec.js +1 -1
  95. package/dist/src/commands/spec.js.map +1 -1
  96. package/dist/src/commands/wiki.d.ts.map +1 -1
  97. package/dist/src/commands/wiki.js +5 -1
  98. package/dist/src/commands/wiki.js.map +1 -1
  99. package/dist/src/config/cli-tools-config.d.ts.map +1 -1
  100. package/dist/src/config/cli-tools-config.js +10 -7
  101. package/dist/src/config/cli-tools-config.js.map +1 -1
  102. package/dist/src/core/addon-registry.d.ts +31 -0
  103. package/dist/src/core/addon-registry.d.ts.map +1 -0
  104. package/dist/src/core/addon-registry.js +28 -0
  105. package/dist/src/core/addon-registry.js.map +1 -0
  106. package/dist/src/hooks/plugins/spec-injection-plugin.js +2 -0
  107. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  108. package/dist/src/hooks/spec-injector.js +2 -2
  109. package/dist/src/hooks/spec-injector.js.map +1 -1
  110. package/dist/src/index.d.ts +2 -0
  111. package/dist/src/index.d.ts.map +1 -1
  112. package/dist/src/index.js +1 -0
  113. package/dist/src/index.js.map +1 -1
  114. package/dist/src/tools/impeccable/critique-storage.d.ts +28 -0
  115. package/dist/src/tools/impeccable/critique-storage.d.ts.map +1 -0
  116. package/dist/src/tools/impeccable/critique-storage.js +120 -0
  117. package/dist/src/tools/impeccable/critique-storage.js.map +1 -0
  118. package/dist/src/tools/impeccable/design-parser.d.ts +90 -0
  119. package/dist/src/tools/impeccable/design-parser.d.ts.map +1 -0
  120. package/dist/src/tools/impeccable/design-parser.js +696 -0
  121. package/dist/src/tools/impeccable/design-parser.js.map +1 -0
  122. package/dist/src/tools/impeccable/detect-csp.d.ts +6 -0
  123. package/dist/src/tools/impeccable/detect-csp.d.ts.map +1 -0
  124. package/dist/src/tools/impeccable/detect-csp.js +130 -0
  125. package/dist/src/tools/impeccable/detect-csp.js.map +1 -0
  126. package/dist/src/tools/impeccable/is-generated.d.ts +4 -0
  127. package/dist/src/tools/impeccable/is-generated.d.ts.map +1 -0
  128. package/dist/src/tools/impeccable/is-generated.js +56 -0
  129. package/dist/src/tools/impeccable/is-generated.js.map +1 -0
  130. package/dist/src/tools/impeccable/live/accept.d.ts +50 -0
  131. package/dist/src/tools/impeccable/live/accept.d.ts.map +1 -0
  132. package/dist/src/tools/impeccable/live/accept.js +556 -0
  133. package/dist/src/tools/impeccable/live/accept.js.map +1 -0
  134. package/dist/src/tools/impeccable/live/bootstrap.d.ts +2 -0
  135. package/dist/src/tools/impeccable/live/bootstrap.d.ts.map +1 -0
  136. package/dist/src/tools/impeccable/live/bootstrap.js +244 -0
  137. package/dist/src/tools/impeccable/live/bootstrap.js.map +1 -0
  138. package/dist/src/tools/impeccable/live/complete.d.ts +7 -0
  139. package/dist/src/tools/impeccable/live/complete.d.ts.map +1 -0
  140. package/dist/src/tools/impeccable/live/complete.js +67 -0
  141. package/dist/src/tools/impeccable/live/complete.js.map +1 -0
  142. package/dist/src/tools/impeccable/live/completion.d.ts +24 -0
  143. package/dist/src/tools/impeccable/live/completion.d.ts.map +1 -0
  144. package/dist/src/tools/impeccable/live/completion.js +26 -0
  145. package/dist/src/tools/impeccable/live/completion.js.map +1 -0
  146. package/dist/src/tools/impeccable/live/inject.d.ts +41 -0
  147. package/dist/src/tools/impeccable/live/inject.d.ts.map +1 -0
  148. package/dist/src/tools/impeccable/live/inject.js +394 -0
  149. package/dist/src/tools/impeccable/live/inject.js.map +1 -0
  150. package/dist/src/tools/impeccable/live/poll.d.ts +24 -0
  151. package/dist/src/tools/impeccable/live/poll.d.ts.map +1 -0
  152. package/dist/src/tools/impeccable/live/poll.js +180 -0
  153. package/dist/src/tools/impeccable/live/poll.js.map +1 -0
  154. package/dist/src/tools/impeccable/live/resume.d.ts +5 -0
  155. package/dist/src/tools/impeccable/live/resume.d.ts.map +1 -0
  156. package/dist/src/tools/impeccable/live/resume.js +30 -0
  157. package/dist/src/tools/impeccable/live/resume.js.map +1 -0
  158. package/dist/src/tools/impeccable/live/server.d.ts +6 -0
  159. package/dist/src/tools/impeccable/live/server.d.ts.map +1 -0
  160. package/dist/src/tools/impeccable/live/server.js +867 -0
  161. package/dist/src/tools/impeccable/live/server.js.map +1 -0
  162. package/dist/src/tools/impeccable/live/session-store.d.ts +72 -0
  163. package/dist/src/tools/impeccable/live/session-store.d.ts.map +1 -0
  164. package/dist/src/tools/impeccable/live/session-store.js +281 -0
  165. package/dist/src/tools/impeccable/live/session-store.js.map +1 -0
  166. package/dist/src/tools/impeccable/live/static/live-browser-session.js +123 -0
  167. package/dist/src/tools/impeccable/live/static/live-browser.js +4860 -0
  168. package/dist/src/tools/impeccable/live/static/modern-screenshot.umd.js +14 -0
  169. package/dist/src/tools/impeccable/live/status.d.ts +2 -0
  170. package/dist/src/tools/impeccable/live/status.d.ts.map +1 -0
  171. package/dist/src/tools/impeccable/live/status.js +52 -0
  172. package/dist/src/tools/impeccable/live/status.js.map +1 -0
  173. package/dist/src/tools/impeccable/live/wrap.d.ts +33 -0
  174. package/dist/src/tools/impeccable/live/wrap.d.ts.map +1 -0
  175. package/dist/src/tools/impeccable/live/wrap.js +572 -0
  176. package/dist/src/tools/impeccable/live/wrap.js.map +1 -0
  177. package/dist/src/tools/impeccable/load-context.d.ts +13 -0
  178. package/dist/src/tools/impeccable/load-context.d.ts.map +1 -0
  179. package/dist/src/tools/impeccable/load-context.js +79 -0
  180. package/dist/src/tools/impeccable/load-context.js.map +1 -0
  181. package/dist/src/tools/impeccable/paths.d.ts +34 -0
  182. package/dist/src/tools/impeccable/paths.d.ts.map +1 -0
  183. package/dist/src/tools/impeccable/paths.js +102 -0
  184. package/dist/src/tools/impeccable/paths.js.map +1 -0
  185. package/dist/src/tools/spec-entry-parser.d.ts +1 -1
  186. package/dist/src/tools/spec-entry-parser.d.ts.map +1 -1
  187. package/dist/src/tools/spec-entry-parser.js +1 -1
  188. package/dist/src/tools/spec-entry-parser.js.map +1 -1
  189. package/dist/src/tools/spec-init.d.ts.map +1 -1
  190. package/dist/src/tools/spec-init.js +26 -1
  191. package/dist/src/tools/spec-init.js.map +1 -1
  192. package/dist/src/tools/spec-loader.d.ts +1 -1
  193. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  194. package/dist/src/tools/spec-loader.js +2 -0
  195. package/dist/src/tools/spec-loader.js.map +1 -1
  196. package/package.json +2 -2
  197. package/workflows/claude-instructions.md +17 -5
  198. package/workflows/cli-tools-usage.md +10 -3
  199. package/workflows/delegate-usage.md +3 -2
  200. package/workflows/impeccable/adapt.md +190 -0
  201. package/workflows/impeccable/animate.md +175 -0
  202. package/workflows/impeccable/audit.md +133 -0
  203. package/workflows/impeccable/bolder.md +113 -0
  204. package/workflows/impeccable/brand.md +118 -0
  205. package/workflows/impeccable/clarify.md +174 -0
  206. package/workflows/impeccable/codex.md +105 -0
  207. package/workflows/impeccable/cognitive-load.md +106 -0
  208. package/workflows/impeccable/color-and-contrast.md +105 -0
  209. package/workflows/impeccable/colorize.md +154 -0
  210. package/workflows/impeccable/craft.md +123 -0
  211. package/workflows/impeccable/critique.md +261 -0
  212. package/workflows/impeccable/delight.md +302 -0
  213. package/workflows/impeccable/distill.md +111 -0
  214. package/workflows/impeccable/document.md +439 -0
  215. package/workflows/impeccable/extract.md +69 -0
  216. package/workflows/impeccable/harden.md +347 -0
  217. package/workflows/impeccable/heuristics-scoring.md +234 -0
  218. package/workflows/impeccable/interaction-design.md +195 -0
  219. package/workflows/impeccable/layout.md +141 -0
  220. package/workflows/impeccable/live.md +622 -0
  221. package/workflows/impeccable/motion-design.md +109 -0
  222. package/workflows/impeccable/onboard.md +234 -0
  223. package/workflows/impeccable/optimize.md +258 -0
  224. package/workflows/impeccable/overdrive.md +130 -0
  225. package/workflows/impeccable/personas.md +179 -0
  226. package/workflows/impeccable/polish.md +242 -0
  227. package/workflows/impeccable/product.md +62 -0
  228. package/workflows/impeccable/quieter.md +99 -0
  229. package/workflows/impeccable/responsive-design.md +114 -0
  230. package/workflows/impeccable/shape.md +165 -0
  231. package/workflows/impeccable/spatial-design.md +100 -0
  232. package/workflows/impeccable/teach.md +168 -0
  233. package/workflows/impeccable/typeset.md +124 -0
  234. package/workflows/impeccable/typography.md +159 -0
  235. package/workflows/impeccable/ux-writing.md +107 -0
  236. package/workflows/impeccable.md +164 -0
  237. package/workflows/maestro.md +7 -3
  238. package/workflows/skill-authoring.md +265 -0
  239. package/workflows/specs-add.md +3 -2
  240. package/workflows/specs-load.md +2 -1
  241. package/workflows/specs-setup.md +21 -1
@@ -1,451 +1,129 @@
1
- ---
2
- name: maestro-brainstorm
3
- description: Brainstorm with auto pipeline or single-role analysis
4
- argument-hint: "[topic] [-y|--yes] [-c|--concurrency N] [--continue] [--count N] [--skip-questions]"
5
- allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, request_user_input
6
- ---
7
-
8
- <purpose>
9
- Wave-based multi-role brainstorming using `spawn_agents_on_csv`. Diamond topology: guidance specification generation (Wave 1), parallel role analysis agents (Wave 2), then synthesis + feature-index generation (Wave 3).
10
-
11
- **Core workflow**: Parse Topic -> Generate Guidance Spec -> Parallel Role Analysis -> Synthesis + Feature Index
12
-
13
- ```
14
- +---------------------------------------------------------------------------+
15
- | BRAINSTORM CSV WAVE WORKFLOW |
16
- +---------------------------------------------------------------------------+
17
- | |
18
- | Phase 1: Topic Resolution -> CSV |
19
- | +-- Parse topic and flags from arguments |
20
- | +-- Detect mode (phase / scratch) |
21
- | +-- Resolve output directory |
22
- | +-- Select roles (interactive or auto, --count N) |
23
- | +-- Load project specs for architecture-aware analysis |
24
- | +-- Generate tasks.csv with guidance + role + synthesis rows |
25
- | +-- User validates role breakdown (skip if -y) |
26
- | |
27
- | Phase 2: Wave Execution Engine |
28
- | +-- Wave 1: Guidance Specification (single agent) |
29
- | | +-- Analyze topic, extract terminology, define boundaries |
30
- | | +-- Generate guidance-specification.md with RFC 2119 keywords |
31
- | | +-- Feature decomposition (max 8 features) |
32
- | | +-- Discoveries shared via board (terms, non-goals, features) |
33
- | | +-- Results: guidance_spec content + analysis_file path |
34
- | +-- [CHECKPOINT] User reviews guidance spec (skip if -y) |
35
- | +-- Wave 2: Role Analysis (parallel, 3-9 agents) |
36
- | | +-- Each role agent analyzes topic through its lens |
37
- | | +-- Receives guidance-specification.md via prev_context |
38
- | | +-- Feature-point organization when feature list available |
39
- | | +-- Discoveries shared via board (role insights, conflicts) |
40
- | | +-- Results: analysis_file path per role |
41
- | +-- [CHECKPOINT] User reviews role analyses (skip if -y) |
42
- | +-- Wave 3: Synthesis + Feature Index (single agent) |
43
- | | +-- Cross-role analysis: consensus, conflicts, unique insights |
44
- | | +-- Generate feature specs or synthesis-specification.md |
45
- | | +-- Build feature-index.json + synthesis-changelog.md |
46
- | | +-- Discoveries shared via board (cross-role patterns) |
47
- | +-- discoveries.ndjson shared across all waves (append-only) |
48
- | |
49
- | Phase 3: Results Aggregation |
50
- | +-- Export results.csv |
51
- | +-- Generate context.md with all findings |
52
- | +-- Copy artifacts to .brainstorming/ directory |
53
- | +-- Update phase index.json with brainstorm status |
54
- | +-- [ROUTING] Offer ui-design when UI features detected |
55
- | +-- Display summary with next steps |
56
- | |
57
- +---------------------------------------------------------------------------+
58
- ```
59
-
60
- </purpose>
61
-
62
- <context>
63
- ```bash
64
- $maestro-brainstorm "Build real-time collaboration platform"
65
- $maestro-brainstorm -y "Build real-time collaboration platform"
66
- $maestro-brainstorm -c 6 "Build real-time collaboration platform --count 5"
67
- $maestro-brainstorm --continue "20260318-brainstorm-collab"
68
- ```
69
-
70
- **Flags**:
71
- - `-y, --yes`: Skip all confirmations (auto mode)
72
- - `-c, --concurrency N`: Max concurrent agents within each wave (default: 6)
73
- - `--continue`: Resume existing session
74
- - `--count N`: Number of roles to select (default 3, max 9)
75
- - `--skip-questions`: Skip context gathering questions
76
-
77
- When `--yes` or `-y`: Auto-confirm role selection, skip interactive questions, use defaults for count and role selection.
78
-
79
- **Output Directory**: `.workflow/.csv-wave/{session-id}/`
80
- **Core Output**: `tasks.csv` (master state) + `results.csv` (final) + `discoveries.ndjson` (shared exploration) + `context.md` (human-readable report) + `.brainstorming/` (role analyses + synthesis artifacts)
81
- </context>
82
-
83
- <csv_schema>
84
-
85
- ### tasks.csv (Master State)
86
-
87
- ```csv
88
- id,title,description,role,topic,guidance_spec,deps,context_from,wave,status,findings,analysis_file,error
89
- "1","Guidance Specification","Analyze topic and generate guidance-specification.md: extract 5-10 core terms, define non-goals, decompose into features (max 8), apply RFC 2119 keywords. Output: guidance-specification.md with sections for positioning, terminology, non-goals, feature decomposition.","guidance-generator","Build real-time collaboration platform","","","","1","","","",""
90
- "2","System Architect Analysis","Analyze topic from system-architect perspective: technical architecture, scalability, integration patterns. Must include Data Model (3-5 entities), State Machine, Error Handling, Observability (5+ metrics), Configuration Model. Use RFC 2119 keywords. Reference guidance-specification.md for framework.","system-architect","Build real-time collaboration platform","","1","1","2","","","",""
91
- "3","UI Designer Analysis","Analyze topic from ui-designer perspective: visual design, layout systems, component hierarchy, design tokens, responsive breakpoints. Reference guidance-specification.md for framework and feature decomposition.","ui-designer","Build real-time collaboration platform","","1","1","2","","","",""
92
- "4","Product Manager Analysis","Analyze topic from product-manager perspective: product strategy, prioritization, user value proposition, competitive analysis, roadmap alignment. Reference guidance-specification.md for framework.","product-manager","Build real-time collaboration platform","","1","1","2","","","",""
93
- "5","Synthesis + Feature Index","Cross-role synthesis: analyze all role outputs for consensus, conflicts, unique contributions. Generate feature specs (F-001 through F-00N) or synthesis-specification.md. Build feature-index.json and synthesis-changelog.md. Resolve conflicts with [RESOLVED]/[SUGGESTED]/[UNRESOLVED] tags.","synthesis","Build real-time collaboration platform","","2;3;4","2;3;4","3","","","",""
94
- ```
95
-
96
- **Columns**:
97
-
98
- | Column | Phase | Description |
99
- |--------|-------|-------------|
100
- | `id` | Input | Unique task identifier (string) |
101
- | `title` | Input | Short task title |
102
- | `description` | Input | Detailed instructions for this task |
103
- | `role` | Input | Role identifier: guidance-generator, system-architect, ui-designer, product-manager, ..., synthesis |
104
- | `topic` | Input | Brainstorm topic text |
105
- | `guidance_spec` | Input | Guidance-specification.md content reference (populated for wave 2+ from wave 1) |
106
- | `deps` | Input | Semicolon-separated dependency task IDs |
107
- | `context_from` | Input | Semicolon-separated task IDs whose findings this task needs |
108
- | `wave` | Computed | Wave number (1 = guidance, 2 = role analysis, 3 = synthesis) |
109
- | `status` | Output | `pending` -> `completed` / `failed` / `skipped` |
110
- | `findings` | Output | Key findings summary (max 500 chars) |
111
- | `analysis_file` | Output | Path to generated analysis file |
112
- | `error` | Output | Error message if failed |
113
-
114
- ### Per-Wave CSV (Temporary)
115
-
116
- Each wave generates `wave-{N}.csv` with extra `prev_context` column.
117
-
118
- ### Output Artifacts
119
-
120
- | File | Purpose | Lifecycle |
121
- |------|---------|-----------|
122
- | `tasks.csv` | Master state -- all tasks with status/findings | Updated after each wave |
123
- | `wave-{N}.csv` | Per-wave input (temporary) | Created before wave, deleted after |
124
- | `results.csv` | Final export of all task results | Created in Phase 3 |
125
- | `discoveries.ndjson` | Shared exploration board | Append-only, carries across waves |
126
- | `context.md` | Human-readable brainstorm report | Created in Phase 3 |
127
- | `.brainstorming/` | Role analyses + synthesis artifacts | Populated in Phase 3 |
128
-
129
- ### Session Structure
130
-
131
- ```
132
- .workflow/.csv-wave/{YYYYMMDD}-brainstorm-{slug}/
133
- +-- tasks.csv
134
- +-- results.csv
135
- +-- discoveries.ndjson
136
- +-- context.md
137
- +-- wave-{N}.csv (temporary)
138
- +-- .brainstorming/
139
- +-- guidance-specification.md
140
- +-- feature-index.json
141
- +-- synthesis-changelog.md
142
- +-- feature-specs/
143
- | +-- F-001-{slug}.md
144
- | +-- F-00N-{slug}.md
145
- +-- {role}/
146
- | +-- analysis.md
147
- | +-- analysis-cross-cutting.md
148
- | +-- analysis-F-{id}-{slug}.md
149
- +-- synthesis-specification.md (fallback mode)
150
- ```
151
- </csv_schema>
152
-
153
- <invariants>
154
- 1. **Start Immediately**: First action is session initialization, then Phase 1
155
- 2. **Wave Order is Sacred**: Never execute wave 2 before wave 1 completes and results are merged
156
- 3. **CSV is Source of Truth**: Master tasks.csv holds all state
157
- 4. **Context Propagation**: prev_context built from master CSV, not from memory
158
- 5. **Guidance First**: Wave 1 (guidance) MUST complete before any role analysis begins
159
- 6. **Discovery Board is Append-Only**: Never clear, modify, or recreate discoveries.ndjson
160
- 7. **Skip on Failure**: If guidance fails, abort. If all roles fail, skip synthesis.
161
- 8. **Cleanup Temp Files**: Remove wave-{N}.csv after results are merged
162
- 9. **DO NOT STOP**: Continuous execution until all waves complete — only pause at [CHECKPOINT] interaction points (skipped with -y)
163
- 10. **9 Valid Roles Only**: data-architect, product-manager, product-owner, scrum-master, subject-matter-expert, system-architect, test-strategist, ui-designer, ux-expert
164
- </invariants>
165
-
166
- <execution>
167
-
168
- ### Session Initialization
169
-
170
- ```
171
- Parse from $ARGUMENTS:
172
- AUTO_YES ← --yes | -y
173
- continueMode ← --continue
174
- maxConcurrency ← --concurrency | -c N (default: 6)
175
- roleCount ← --count N (default: 3, max: 9)
176
- skipQuestions ← --skip-questions
177
- topicArg ← remaining text after flag removal
178
-
179
- Derive:
180
- slug ← topicArg kebab-cased, max 40 chars
181
- dateStr ← UTC+8 YYYYMMDD
182
- sessionId ← "{dateStr}-brainstorm-{slug}"
183
- sessionFolder ← ".workflow/.csv-wave/{sessionId}"
184
-
185
- mkdir -p {sessionFolder}/.brainstorming
186
- ```
187
-
188
- ### Phase 1: Topic Resolution -> CSV
189
-
190
- **Objective**: Parse topic, select roles, generate tasks.csv.
191
-
192
- **Decomposition Rules**:
193
-
194
- 1. **Mode detection**: Number = phase mode (resolve via state.json artifact registry to `.workflow/scratch/{YYYYMMDD}-{type}-{slug}/`), text = scratch mode
195
- 2. **Project specs loading**: Run `maestro spec load --category arch` for architecture-aware analysis context and discoverable knowhow tools
196
- 3. **Role selection**:
197
-
198
- | Condition | Action |
199
- |-----------|--------|
200
- | `--yes` flag | Auto-select top `roleCount` roles based on topic relevance |
201
- | Interactive | `request_user_input` with recommended roles + rationale |
202
-
203
- 4. **Valid roles** (9 total):
204
-
205
- | Role ID | Focus Area |
206
- |---------|------------|
207
- | `data-architect` | Data models, storage strategies, data flow |
208
- | `product-manager` | Product strategy, roadmap, prioritization |
209
- | `product-owner` | Backlog management, user stories, acceptance criteria |
210
- | `scrum-master` | Process facilitation, impediment removal |
211
- | `subject-matter-expert` | Domain knowledge, business rules, compliance |
212
- | `system-architect` | Technical architecture, scalability, integration |
213
- | `test-strategist` | Test strategy, quality assurance |
214
- | `ui-designer` | Visual design, mockups, design systems |
215
- | `ux-expert` | User research, information architecture, journey |
216
-
217
- 5. **CSV generation**: 1 guidance row (wave 1) + N role rows (wave 2) + 1 synthesis row (wave 3).
218
-
219
- **Wave computation**: 3-wave diamond -- guidance = wave 1, all role tasks = wave 2, synthesis = wave 3.
220
-
221
- **User validation**: Display task breakdown (skip if AUTO_YES).
222
-
223
- ### Phase 2: Wave Execution Engine
224
-
225
- **Objective**: Execute brainstorm pipeline wave-by-wave via spawn_agents_on_csv.
226
-
227
- #### Wave 1: Guidance Specification (Single Agent)
228
-
229
- 1. Extract wave 1 pending rows from master `tasks.csv` into `wave-1.csv` (no prev_context needed)
230
- 2. Execute:
231
-
232
- ```javascript
233
- spawn_agents_on_csv({
234
- csv_path: `${sessionFolder}/wave-1.csv`,
235
- id_column: "id",
236
- instruction: buildGuidanceInstruction(sessionFolder, topicArg),
237
- max_concurrency: 1, max_runtime_seconds: 3600,
238
- output_csv_path: `${sessionFolder}/wave-1-results.csv`,
239
- output_schema: { id, status: [completed|failed], findings, analysis_file, error }
240
- })
241
- ```
242
-
243
- 3. Merge results into master `tasks.csv`, delete `wave-1.csv`
244
- 4. Read generated `guidance-specification.md` for wave 2 context propagation
245
- 5. **Interaction Checkpoint** (skip if AUTO_YES):
246
- - Display guidance-specification summary: terminology count, feature list, non-goals
247
- - `request_user_input`:
248
- ```json
249
- { "questions": [{ "id": "guidance_review", "header": "Guidance", "question": "Guidance specification generated. How to proceed?", "options": [
250
- { "label": "Proceed (Recommended)", "description": "Continue to parallel role analysis with current guidance." },
251
- { "label": "Revise", "description": "Provide feedback to directly edit guidance-specification.md." },
252
- { "label": "Abort", "description": "Stop pipeline, output partial results (guidance only)." }
253
- ]}] }
254
- ```
255
- - **Proceed** → continue to Wave 2
256
- - **Revise** → user provides feedback, directly edit guidance-specification.md to incorporate changes
257
- - **Abort** → stop pipeline, output partial results (guidance only)
258
-
259
- **Guidance agent responsibilities**:
260
- - Analyze topic, extract 5-10 core domain terms
261
- - Define non-goals and scope boundaries
262
- - Decompose into features (max 8): F-{3-digit} ID, kebab-case slug, description, related roles, priority
263
- - Apply RFC 2119 keywords (MUST, SHOULD, MAY, MUST NOT, SHOULD NOT)
264
- - Write `guidance-specification.md` to `.brainstorming/`
265
-
266
- #### Wave 2: Role Analysis (Parallel, 3-9 Agents)
267
-
268
- 1. Extract wave 2 pending rows from master `tasks.csv`
269
- 2. Build `prev_context` from wave 1 findings + `guidance-specification.md` content
270
- 3. Write `wave-2.csv` with `prev_context` column
271
- 4. Execute:
272
-
273
- ```javascript
274
- spawn_agents_on_csv({
275
- csv_path: `${sessionFolder}/wave-2.csv`,
276
- id_column: "id",
277
- instruction: buildRoleAnalysisInstruction(sessionFolder), // agent: ~/.codex/agents/conceptual-planning-agent.toml
278
- max_concurrency: maxConcurrency, max_runtime_seconds: 3600,
279
- output_csv_path: `${sessionFolder}/wave-2-results.csv`,
280
- output_schema: { id, status: [completed|failed], findings, analysis_file, error }
281
- })
282
- ```
283
-
284
- 5. Merge results into master `tasks.csv`, delete `wave-2.csv`
285
- 6. **Interaction Checkpoint** (skip if AUTO_YES):
286
- - Display per-role findings summary (role name + key insight, 1-2 lines each)
287
- - Show success/failure counts: "{N} roles completed, {M} failed"
288
- - `request_user_input`:
289
- ```json
290
- { "questions": [{ "id": "role_review", "header": "Roles", "question": "Role analyses complete. How to proceed?", "options": [
291
- { "label": "Proceed (Recommended)", "description": "Continue to cross-role synthesis." },
292
- { "label": "Add Roles", "description": "Select additional roles and run only the new ones." },
293
- { "label": "Revise", "description": "Pick role(s) to directly edit analysis files with feedback." }
294
- ]}] }
295
- ```
296
- - **Proceed** → continue to Wave 3 (synthesis)
297
- - **Add Roles** → select additional roles, generate new wave-2 rows, execute only new roles
298
- - **Revise** → user picks specific role(s), directly edit its analysis files to incorporate feedback
299
-
300
- **Role agent responsibilities**:
301
- - Read guidance-specification.md for framework context
302
- - Analyze topic through role-specific lens
303
- - Feature-point organization when feature list available:
304
- - `analysis.md` -- Role overview INDEX only (< 1500 words)
305
- - `analysis-cross-cutting.md` -- Cross-feature decisions (< 2000 words)
306
- - `analysis-F-{id}-{slug}.md` -- Per-feature analysis (< 2000 words each)
307
- - Fallback organization (no feature list):
308
- - `analysis.md` -- Main analysis (< 3000 words)
309
- - system-architect MUST include: Data Model, State Machine, Error Handling, Observability, Configuration Model
310
- - Write analysis files to `.brainstorming/{role}/`
311
-
312
- #### Wave 3: Synthesis + Feature Index (Single Agent)
313
-
314
- 1. If all wave 2 tasks failed, skip synthesis entirely
315
- 2. Extract wave 3 pending rows, build `prev_context` from wave 2 findings
316
- 3. Write `wave-3.csv`, execute `spawn_agents_on_csv` for synthesis agent (same output_schema pattern)
317
- 4. Merge results into master `tasks.csv`, delete `wave-3.csv`
318
-
319
- **Synthesis agent responsibilities**:
320
- - Cross-role analysis: consensus, conflicts, unique contributions
321
- - Conflict resolution with [RESOLVED]/[SUGGESTED]/[UNRESOLVED] tags
322
- - Feature mode: generate `feature-specs/F-{id}-{slug}.md` per feature (7 sections, 1500-2500 words)
323
- - Fallback mode: generate `synthesis-specification.md`
324
- - Build `feature-index.json` and `synthesis-changelog.md`
325
- - Four-Layer Aggregation: Direct Reference, Structured Extraction, Conflict Distillation, Cross-Feature Annotation
326
-
327
- ### Phase 3: Results Aggregation
328
-
329
- **Objective**: Generate final results and human-readable report.
330
-
331
- 1. Export final `tasks.csv` as `results.csv`
332
- 2. Generate `context.md`:
333
-
334
- ```markdown
335
- # Brainstorm Report -- {topic}
336
-
337
- ## Summary
338
- - Topic: {topic}
339
- - Roles analyzed: {role_count}
340
- - Features decomposed: {feature_count}
341
- - Conflicts resolved: {resolved_count}
342
-
343
- ## Guidance Specification
344
- {summary of guidance-specification.md}
345
-
346
- ## Role Analysis Results
347
- ### {role_name}
348
- {findings summary}
349
- **Analysis file**: {analysis_file path}
350
-
351
- ## Synthesis
352
- {synthesis summary}
353
- - Consensus areas: {list}
354
- - Resolved conflicts: {list}
355
- - Unresolved items: {list}
356
-
357
- ## Feature Index
358
- {feature-index.json summary}
359
-
360
- ## Next Steps
361
- - Skill: maestro-ui-design {topic} -- Generate UI prototypes (when UI features detected)
362
- - Skill: maestro-analyze -- Evaluate feasibility + lock decisions
363
- - Skill: maestro-plan -- Plan directly if scope is clear
364
- - Skill: maestro-roadmap --mode full -- Generate full spec package from brainstorm
365
- ```
366
-
367
- 4. **Brainstorm confidence scoring**:
368
-
369
- Dimensions (5): role_coverage, cross_role_consistency, feature_completeness, spec_quality, design_feasibility. Factors (weights): analysis_depth(.30), evidence_strength(.25), coverage_breadth(.20), user_validation(.15, 0 if --yes), consistency(.10). Append confidence summary to `synthesis-changelog.md`.
370
-
371
- **Conflict-based quality gate**: >3 `[UNRESOLVED]` conflicts → warn before artifact registration.
372
-
373
- 5. Copy artifacts to output `.brainstorming/` directory (phase mode or scratch mode target)
374
- 6. Update phase `index.json` with brainstorm status (if phase mode)
375
- 7. **Next-Step Routing** (skip if AUTO_YES — default to first applicable):
376
- - Detect UI features: scan feature-index.json for UI/frontend-related features (keywords: ui, interface, page, component, dashboard, form, layout)
377
- - `request_user_input` (include UI Design option only when UI features detected):
378
- ```json
379
- { "questions": [{ "id": "next_step", "header": "Next Step", "question": "Brainstorm complete. What next?", "options": [
380
- { "label": "UI Design (Recommended)", "description": "Generate UI prototypes from brainstorm features." },
381
- { "label": "Analyze", "description": "Evaluate feasibility and lock architectural decisions." },
382
- { "label": "Plan", "description": "Create execution plan directly if scope is clear." }
383
- ]}] }
384
- ```
385
- - **UI Design** → invoke `maestro-ui-design` with topic + brainstorm session context
386
- - **Analyze** → invoke `maestro-analyze` for feasibility evaluation
387
- - **Plan** → invoke `maestro-plan` directly if scope is clear
388
- - When no UI features detected, replace UI Design with Roadmap: `{ "label": "Roadmap (Recommended)", "description": "Generate full spec package from brainstorm." }`
389
-
390
- ### Shared Discovery Board Protocol
391
-
392
- #### Standard Discovery Types
393
-
394
- | Type | Dedup Key | Data Schema | Description |
395
- |------|-----------|-------------|-------------|
396
- | `code_pattern` | `data.name` | `{name, file, description}` | Reusable code pattern found |
397
- | `integration_point` | `data.file` | `{file, description, exports[]}` | Module connection point |
398
- | `convention` | singleton | `{naming, imports, formatting}` | Project code conventions |
399
- | `blocker` | `data.issue` | `{issue, severity, impact}` | Blocking issue found |
400
- | `tech_stack` | singleton | `{framework, language, tools[]}` | Technology stack info |
401
-
402
- #### Domain Discovery Types
403
-
404
- | Type | Dedup Key | Data Schema | Description |
405
- |------|-----------|-------------|-------------|
406
- | `terminology` | `data.term` | `{term, definition, aliases[], category}` | Domain term extracted |
407
- | `non_goal` | `data.title` | `{title, rationale}` | Scope exclusion identified |
408
- | `feature_candidate` | `data.id` | `{id, slug, description, roles[], priority}` | Feature decomposed from topic |
409
- | `role_insight` | `data.role+data.topic` | `{role, topic, insight, confidence}` | Role-specific finding |
410
- | `cross_role_conflict` | `data.area` | `{area, roles[], positions[], resolution}` | Cross-role disagreement |
411
-
412
- #### Protocol
413
-
414
- Read `discoveries.ndjson` before analysis. Append-only: dedup by type+key before writing, never modify/delete.
415
-
416
- ```bash
417
- echo '{"ts":"<ISO>","worker":"{id}","type":"terminology","data":{"term":"CRDT","definition":"Conflict-free Replicated Data Type","aliases":["conflict-free"],"category":"technical"}}' >> {session_folder}/discoveries.ndjson
418
- ```
419
- </execution>
420
-
421
- <error_codes>
422
-
423
- | Error | Resolution |
424
- |-------|------------|
425
- | Topic argument missing | Abort with error: "Topic text required" |
426
- | Invalid role name in selection | Filter to valid roles, warn user |
427
- | Role count exceeds 9 | Cap at 9 with warning |
428
- | Guidance agent timeout | Mark as failed, abort pipeline (wave 2 depends on guidance) |
429
- | Role agent timeout | Mark as failed, continue with remaining roles |
430
- | All role agents failed | Skip synthesis (wave 3), report partial results |
431
- | Synthesis agent failed | Use wave 2 results directly, no feature index |
432
- | CSV parse error | Validate format, show line number |
433
- | discoveries.ndjson corrupt | Ignore malformed lines |
434
- | Continue mode: no session found | List available sessions |
435
- | Phase directory not found | Abort with error: "Phase {N} not found" |
436
- </error_codes>
437
-
438
- <success_criteria>
439
- - [ ] Session folder created with valid tasks.csv
440
- - [ ] All 3 waves executed in order
441
- - [ ] guidance-specification.md produced in .brainstorming/
442
- - [ ] Role analysis files produced per selected role
443
- - [ ] Synthesis artifacts produced (feature specs or synthesis-specification.md)
444
- - [ ] feature-index.json and synthesis-changelog.md produced
445
- - [ ] context.md produced with full brainstorm report
446
- - [ ] Artifacts copied to target .brainstorming/ directory
447
- - [ ] discoveries.ndjson append-only throughout
448
- - [ ] Confidence scored per role and after cross-role synthesis
449
- - [ ] Conflict-based quality gate evaluated (> 3 unresolved = warning)
450
- - [ ] Confidence summary appended to synthesis-changelog.md
451
- </success_criteria>
1
+ ---
2
+ name: maestro-brainstorm
3
+ description: Brainstorm with auto pipeline or single-role analysis
4
+ argument-hint: "[topic] [-y|--yes] [-c|--concurrency N] [--continue] [--count N] [--skip-questions]"
5
+ allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, request_user_input
6
+ ---
7
+
8
+ <purpose>
9
+ Wave-based multi-role brainstorming via `spawn_agents_on_csv`. Diamond topology:
10
+ Wave 1 (guidance spec) → Wave 2 (parallel role analysis, 3-9 agents) → Wave 3 (synthesis + feature index).
11
+ </purpose>
12
+
13
+ <context>
14
+ $ARGUMENTS — topic text and optional flags.
15
+
16
+ **Flags**: `-y` (auto), `-c N` (concurrency, default 6), `--continue` (resume), `--count N` (roles, default 3 max 9), `--skip-questions`
17
+
18
+ **9 valid roles**: data-architect, product-manager, product-owner, scrum-master, subject-matter-expert, system-architect, test-strategist, ui-designer, ux-expert
19
+
20
+ **Session**: `.workflow/.csv-wave/{YYYYMMDD}-brainstorm-{slug}/`
21
+ **Output**: tasks.csv, results.csv, discoveries.ndjson, context.md, `.brainstorming/` (guidance-specification.md, feature-index.json, synthesis-changelog.md, feature-specs/, {role}/analysis*.md)
22
+ </context>
23
+
24
+ <csv_schema>
25
+ ```csv
26
+ id,title,description,role,topic,guidance_spec,deps,context_from,wave,status,findings,analysis_file,error
27
+ "1","Guidance Spec","...","guidance-generator","<topic>","","","","1","","","",""
28
+ "2","System Architect","...","system-architect","<topic>","","1","1","2","","","",""
29
+ "3","UI Designer","...","ui-designer","<topic>","","1","1","2","","","",""
30
+ "4","Synthesis","...","synthesis","<topic>","","2;3","2;3","3","","","",""
31
+ ```
32
+ Wave 1: 1 guidance row. Wave 2: N role rows (parallel). Wave 3: 1 synthesis row.
33
+ </csv_schema>
34
+
35
+ <invariants>
36
+ 1. **Wave order sacred**: Guidance (W1) MUST complete before roles (W2)
37
+ 2. **CSV source of truth**: Master tasks.csv holds all state
38
+ 3. **Discovery board append-only**: Never modify/delete discoveries.ndjson
39
+ 4. **Skip on failure**: Guidance fails abort. All roles fail → skip synthesis.
40
+ 5. **9 valid roles only**: data-architect, product-manager, product-owner, scrum-master, subject-matter-expert, system-architect, test-strategist, ui-designer, ux-expert
41
+ 6. **DO NOT STOP**: Continuous until all waves complete; only pause at [CHECKPOINT] (skipped with -y)
42
+ </invariants>
43
+
44
+ <state_machine>
45
+
46
+ <states>
47
+ S_PARSE — 解析 topic、flags、mode PERSIST:
48
+ S_ROLES — 选择 roles(-y auto / interactive) PERSIST: —
49
+ S_CSV_GEN — 生成 tasks.csv PERSIST: tasks.csv
50
+ S_WAVE_1 Guidance Spec (single agent) PERSIST: guidance-specification.md
51
+ S_CHECK_1 — Checkpoint: 用户审阅 guidance(-y 跳过) PERSIST:
52
+ S_WAVE_2 Role Analysis (parallel spawn) PERSIST: role analyses
53
+ S_CHECK_2 — Checkpoint: 用户审阅 roles(-y 跳过) PERSIST:
54
+ S_WAVE_3 Synthesis + Feature Index (single agent) PERSIST: synthesis artifacts
55
+ S_AGGREGATE — 生成报告、注册 artifact PERSIST: context.md + results.csv
56
+ </states>
57
+
58
+ <transitions>
59
+ S_PARSE → S_ROLES DO: parse args, detect mode (phase/scratch), load specs
60
+ S_ROLES → S_CSV_GEN DO: select roles (-y: auto top N; interactive: request_user_input)
61
+ S_CSV_GEN → S_WAVE_1 DO: generate tasks.csv (1 guidance + N roles + 1 synthesis)
62
+
63
+ S_WAVE_1 → S_CHECK_1 WHEN: completed DO: spawn wave-1, merge results, read guidance-spec
64
+ S_WAVE_1 END WHEN: failed DO: abort pipeline
65
+
66
+ S_CHECK_1 S_WAVE_2 WHEN: -y OR user "Proceed"
67
+ S_CHECK_1 S_CHECK_1 WHEN: user "Revise" DO: edit guidance-spec, re-display
68
+ S_CHECK_1 → END WHEN: user "Abort"
69
+
70
+ S_WAVE_2 → S_CHECK_2 DO: spawn wave-2 (parallel), merge results
71
+ S_WAVE_2 S_WAVE_3 WHEN: all failed DO: skip synthesis
72
+
73
+ S_CHECK_2 → S_WAVE_3 WHEN: -y OR user "Proceed"
74
+ S_CHECK_2 S_WAVE_2 WHEN: user "Add Roles" DO: add new role rows, spawn only new
75
+
76
+ S_WAVE_3 → S_AGGREGATE DO: spawn wave-3, merge results
77
+
78
+ S_AGGREGATE → END DO: A_AGGREGATE
79
+ </transitions>
80
+
81
+ <actions>
82
+
83
+ ### Wave agent responsibilities
84
+
85
+ **Guidance (W1)**: Analyze topic → extract 5-10 terms → define non-goals → decompose features (max 8, F-{3digit}) → RFC 2119 keywords → write guidance-specification.md
86
+
87
+ **Role (W2)**: Read guidance-spec → analyze through role lens → feature-point organization (analysis.md index + analysis-cross-cutting.md + per-feature analysis-F-{id}.md) or fallback single analysis.md. system-architect MUST include: Data Model, State Machine, Error Handling, Observability, Config Model.
88
+
89
+ **Synthesis (W3)**: Cross-role consensus/conflicts/unique conflict tags [RESOLVED]/[SUGGESTED]/[UNRESOLVED] feature-specs or synthesis-specification.md feature-index.json + synthesis-changelog.md. Four-layer: Direct Reference Structured Extraction Conflict Distillation → Cross-Feature Annotation.
90
+
91
+ ### A_AGGREGATE
92
+
93
+ 1. Export results.csv
94
+ 2. Generate context.md (summary, guidance, per-role findings, synthesis, feature index, next steps)
95
+ 3. Confidence scoring: 5 dimensions (role_coverage, cross_role_consistency, feature_completeness, spec_quality, design_feasibility). Quality gate: >3 UNRESOLVED → warn.
96
+ 4. Copy artifacts to target .brainstorming/
97
+ 5. Next-step routing: UI features detected → maestro-ui-design; else → maestro-analyze / maestro-plan / maestro-roadmap
98
+
99
+ </actions>
100
+ </state_machine>
101
+
102
+ <discovery_board>
103
+ | Type | Dedup Key | Data |
104
+ |------|-----------|------|
105
+ | terminology | term | {term, definition, aliases[], category} |
106
+ | non_goal | title | {title, rationale} |
107
+ | feature_candidate | id | {id, slug, description, roles[], priority} |
108
+ | role_insight | role+topic | {role, topic, insight, confidence} |
109
+ | cross_role_conflict | area | {area, roles[], positions[], resolution} |
110
+
111
+ Protocol: read before analysis, append-only, dedup by type+key.
112
+ </discovery_board>
113
+
114
+ <error_codes>
115
+ | Condition | Recovery |
116
+ |-----------|----------|
117
+ | Guidance agent failed | Abort pipeline (W2 depends on guidance) |
118
+ | All role agents failed | Skip synthesis, report partial |
119
+ | Synthesis failed | Use W2 results directly |
120
+ | Role count > 9 | Cap at 9 with warning |
121
+ </error_codes>
122
+
123
+ <success_criteria>
124
+ - [ ] 3 waves executed: guidance parallel roles synthesis
125
+ - [ ] guidance-specification.md + role analyses + synthesis artifacts produced
126
+ - [ ] feature-index.json + context.md generated
127
+ - [ ] discoveries.ndjson append-only throughout
128
+ - [ ] Confidence scored, conflict quality gate evaluated
129
+ </success_criteria>