maestro-flow 0.3.46 → 0.3.48

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 +420 -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 +327 -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
@@ -6,626 +6,213 @@ allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, request
6
6
  ---
7
7
 
8
8
  <purpose>
9
- Wave-based multi-CLI collaboration using `spawn_agents_on_csv`. Diamond topology: parallel CLI fan-out (Wave 1), cross-verification (Wave 2), then unified synthesis (Wave 3).
10
-
11
- Each CLI tool independently analyzes the same requirement from its own perspective. Results are cross-verified for conflicts, then synthesized into a single actionable output.
12
-
13
- **Core workflow**: Parse Requirement -> CLI Fan-Out -> Cross-Verify -> Synthesize
14
-
15
- ```
16
- +---------------------------------------------------------------------------+
17
- | COLLAB CSV WAVE WORKFLOW |
18
- +---------------------------------------------------------------------------+
19
- | |
20
- | Phase 1: Requirement Resolution -> CSV |
21
- | +-- Parse requirement and flags from arguments |
22
- | +-- Select CLI tools (explicit --tools or auto-select) |
23
- | +-- Load project context (project.md, specs, codebase) |
24
- | +-- Generate tasks.csv with fan-out + verify + synthesis rows |
25
- | +-- User validates tool selection (skip if -y) |
26
- | |
27
- | Phase 2: Wave Execution Engine |
28
- | +-- Wave 1: CLI Fan-Out (parallel, 2-5 agents) |
29
- | | +-- Each agent delegates to one CLI tool via exec_command |
30
- | | +-- Same requirement, different CLI perspective |
31
- | | +-- Results: per-tool findings + recommendations |
32
- | +-- Wave 2: Cross-Verification (single agent) |
33
- | | +-- Compare all CLI outputs for consensus/conflicts |
34
- | | +-- Tag: [CONSENSUS] / [CONFLICT] / [UNIQUE] |
35
- | | +-- Results: conflict matrix + agreement areas |
36
- | +-- Wave 3: Synthesis (single agent) |
37
- | | +-- Merge verified findings into actionable output |
38
- | | +-- Resolve conflicts with evidence-weighted voting |
39
- | | +-- Generate final collab-report.md |
40
- | +-- discoveries.ndjson shared across all waves (append-only) |
41
- | |
42
- | Phase 3: Results Aggregation |
43
- | +-- Export results.csv + collab-report.md |
44
- | +-- Display summary with consensus level + next steps |
45
- | |
46
- +---------------------------------------------------------------------------+
47
- ```
9
+ Wave-based multi-CLI collaboration via `spawn_agents_on_csv`. Diamond topology:
10
+ Wave 1 (parallel CLI fan-out) → Wave 2 (cross-verify) → Wave 3 (synthesis).
48
11
 
12
+ Each CLI tool independently analyzes the requirement. Results cross-verified for consensus/conflicts, synthesized into unified report.
49
13
  </purpose>
50
14
 
51
15
  <context>
52
- ```bash
53
- $maestro-collab "analyze the auth module for security vulnerabilities"
54
- $maestro-collab "design a caching strategy for the API layer" --tools gemini,qwen,claude
55
- $maestro-collab -y "review error handling patterns across the codebase"
56
- $maestro-collab "refactor user service to use repository pattern" --mode write --tools gemini,claude
57
- ```
16
+ $ARGUMENTS — requirement text and optional flags.
58
17
 
59
18
  **Flags**:
60
- - `--tools <list>`: Comma-separated CLI tools (default: auto-select top 3 enabled from cli-tools.json)
19
+ - `--tools <list>`: Comma-separated CLI tools (default: first 3 enabled)
61
20
  - `--mode analysis|write`: Delegate mode (default: analysis)
62
- - `--rule <template>`: Shared rule template for all delegates
63
- - `-y, --yes`: Skip all confirmations (auto mode)
64
- - `-c, --concurrency N`: Max concurrent agents within each wave (default: 5)
65
-
66
- **Auto-select logic** (when `--tools` omitted):
67
- 1. Read `~/.maestro/cli-tools.json`
68
- 2. Filter `enabled == true`
69
- 3. Take first 3 tools in config order
70
- 4. Exclude `api-endpoint` type tools when `--mode write`
71
-
72
- **Output Directory**: `.workflow/.csv-wave/{session-id}/`
73
- **Core Output**: `tasks.csv` + `results.csv` + `discoveries.ndjson` + `collab-report.md`
21
+ - `--rule <template>`: Shared rule template
22
+ - `-y`: Skip confirmations
23
+ - `-c N`: Max concurrency per wave (default: 5)
24
+
25
+ **Auto-select** (no --tools): read `~/.maestro/cli-tools.json` → filter enabled + eligible → first 3. Exclude api-endpoint when --mode write. Minimum 2 required.
26
+
27
+ **Session**: `.workflow/.csv-wave/{YYYYMMDD}-collab-{slug}/`
28
+ **Scratch**: `.workflow/scratch/{YYYYMMDD}-collab-{slug}/`
29
+
30
+ **Output files**:
31
+ - `collab-report.md` — merged findings (Consensus/Conflicts/Unique/Recommendations)
32
+ - `context.md` Locked/Free/Deferred decisions (plan compatible)
33
+ - `conclusions.json` — session_id, tools[], consensus_level, recommendation, confidence, dimensions[], decisions[]
34
+ - `per-tool/{tool}-output.md` — raw outputs
74
35
  </context>
75
36
 
76
37
  <csv_schema>
77
38
 
78
- ### tasks.csv (Master State)
39
+ ### tasks.csv
79
40
 
80
41
  ```csv
81
42
  id,title,description,tool,role,prompt,mode,rule,deps,context_from,wave,status,findings,recommendations,confidence,error
82
- "1","CLI: gemini","Analyze requirement via gemini CLI","gemini","analyze","<full prompt>","analysis","","","","1","","","","",""
83
- "2","CLI: qwen","Analyze requirement via qwen CLI","qwen","analyze","<full prompt>","analysis","","","","1","","","","",""
84
- "3","CLI: claude","Analyze requirement via claude CLI","claude","analyze","<full prompt>","analysis","","","","1","","","","",""
85
- "4","Cross-Verify","Compare all CLI outputs: tag consensus, conflicts, unique findings","","","","","","1;2;3","1;2;3","2","","","","",""
86
- "5","Synthesis","Merge verified findings into actionable collab-report.md","","","","","","4","4","3","","","","",""
43
+ "1","CLI: gemini","...","gemini","analyze","<prompt>","analysis","","","","1","","","","",""
44
+ "2","CLI: claude","...","claude","analyze","<prompt>","analysis","","","","1","","","","",""
45
+ "3","Cross-Verify","Compare CLI outputs: CONSENSUS/CONFLICT/UNIQUE","","","","","","1;2","1;2","2","","","","",""
46
+ "4","Synthesis","Merge verified findings collab-report.md + context.md + conclusions.json","","","","","","3","3","3","","","","",""
87
47
  ```
88
48
 
89
- **Columns**:
90
-
91
- | Column | Phase | Description |
92
- |--------|-------|-------------|
93
- | `id` | Input | Unique task identifier |
94
- | `title` | Input | Short task title |
95
- | `description` | Input | Detailed instructions for this task |
96
- | `tool` | Input | CLI tool name (wave 1 only) |
97
- | `role` | Input | Delegate --role value |
98
- | `prompt` | Input | Full 6-field prompt for delegate |
99
- | `mode` | Input | analysis or write |
100
- | `rule` | Input | --rule template name (optional) |
101
- | `deps` | Input | Semicolon-separated dependency task IDs |
102
- | `context_from` | Input | Semicolon-separated task IDs for prev_context |
103
- | `wave` | Computed | Wave number (1=fan-out, 2=verify, 3=synthesis) |
104
- | `status` | Output | pending -> completed / failed |
105
- | `findings` | Output | Key findings summary (max 500 chars) |
106
- | `recommendations` | Output | Per-tool recommendations |
107
- | `confidence` | Output | Self-assessed confidence (0-100) |
108
- | `error` | Output | Error message if failed |
109
-
110
- ### Session Structure
111
-
112
- ```
113
- .workflow/.csv-wave/{YYYYMMDD}-collab-{slug}/
114
- +-- tasks.csv
115
- +-- results.csv
116
- +-- discoveries.ndjson
117
- +-- collab-report.md
118
- +-- context.md ← standard Locked/Free/Deferred format (downstream compatible)
119
- +-- conclusions.json ← structured conclusions (plan fast-track compatible)
120
- +-- wave-{N}.csv (temporary)
121
- +-- per-tool/
122
- +-- gemini-output.md
123
- +-- qwen-output.md
124
- +-- claude-output.md
125
- ```
49
+ Input columns: id, title, description, tool, role, prompt, mode, rule, deps, context_from, wave.
50
+ Output columns: status (pending→completed/failed), findings, recommendations, confidence, error.
126
51
 
127
52
  ### Downstream Compatibility
128
53
 
129
- | Consumer | Consumption Path | Artifact |
130
- |----------|-----------------|----------|
131
- | **maestro-plan** | `$maestro-plan "N --dir .workflow/scratch/{collab-session}/"` | `context.md` + `conclusions.json` |
132
- | **maestro-analyze** | auto via `state.json.artifacts[]` (type=collab) | `context.md` as prior context |
133
- | **maestro-brainstorm** | auto via `state.json.artifacts[]` (type=collab) | `context.md` as supplementary context |
134
- | **maestro-ralph** | auto — lifecycle position inference includes collab | artifact chain lookup |
54
+ | Consumer | Artifact |
55
+ |----------|----------|
56
+ | maestro-plan | context.md + conclusions.json (via --dir) |
57
+ | maestro-analyze | context.md as prior context (via state.json) |
58
+ | maestro-ralph | artifact chain lookup (type=collab) |
135
59
 
136
- `context.md` uses the standard Locked/Free/Deferred decision format. `conclusions.json` follows the same schema as maestro-analyze's output. This allows plan to skip wave 1 exploration when collab has already produced structured conclusions.
137
60
  </csv_schema>
138
61
 
139
62
  <invariants>
140
- 1. **Plan Before Execute**: Present collaboration plan with tool selection for user approval before any CLI invocation
141
- 2. **Wave Order is Sacred**: Never execute wave 2 before wave 1 completes
142
- 3. **CSV is Source of Truth**: Master tasks.csv holds all state
143
- 4. **Context Propagation**: prev_context built from master CSV, not from memory
144
- 5. **Discovery Board is Append-Only**: Never modify or delete discoveries.ndjson
145
- 6. **Same Prompt, Different Tool**: Wave 1 agents all use the same base prompt, only --to differs
146
- 7. **Minimum 2 Tools**: Collaboration requires at least 2 CLI tools; abort if fewer enabled
147
- 8. **Delegate Protocol**: All exec_command calls follow delegate-protocol.codex.md (yield_time + poll)
148
- 9. **DO NOT STOP**: Continuous execution until all waves complete
149
- 10. **Partial Degradation**: If 1+ tool fails in wave 1, continue with available results
63
+ 1. **Wave order sacred**: Never execute wave N+1 before wave N completes
64
+ 2. **CSV is source of truth**: Master tasks.csv holds all state
65
+ 3. **Same prompt, different tool**: Wave 1 agents all use same base prompt, only --to differs
66
+ 4. **Minimum 2 tools**: Abort if fewer eligible
67
+ 5. **Delegate protocol**: All exec_command calls follow delegate-protocol.codex.md (yield_time + poll)
68
+ 6. **Partial degradation**: If 1+ tool fails in wave 1, continue with remaining
69
+ 7. **Discovery board append-only**: Never modify/delete discoveries.ndjson
150
70
  </invariants>
151
71
 
152
- <execution>
153
-
154
- ### Session Initialization
155
-
156
- **Parse from `$ARGUMENTS`**:
157
-
158
- | Variable | Source | Default |
159
- |----------|--------|---------|
160
- | `AUTO_YES` | `--yes` or `-y` | false |
161
- | `maxConcurrency` | `--concurrency N` or `-c N` | 5 |
162
- | `selectedTools` | `--tools <list>` | auto-select |
163
- | `delegateMode` | `--mode` | `analysis` |
164
- | `ruleTemplate` | `--rule` | null |
165
- | `requirement` | remaining text after flag removal | "" (E001 if empty) |
166
-
167
- **Auto-bootstrap**: If `.workflow/` missing, create minimal structure.
168
-
169
- **Session paths** (UTC+8 date prefix):
170
- - `slug` ← requirement kebab-cased, max 40 chars
171
- - `sessionFolder`: `.workflow/.csv-wave/{YYYYMMDD}-collab-{slug}/`
72
+ <state_machine>
172
73
 
173
- - `scratchDir`: `.workflow/scratch/{YYYYMMDD}-collab-{slug}/`
74
+ <states>
75
+ S_PARSE — 解析参数、发现工具 PERSIST: —
76
+ S_CONFIRM — 展示计划、用户确认(-y 跳过) PERSIST: —
77
+ S_CSV_GEN — 生成 tasks.csv PERSIST: tasks.csv
78
+ S_WAVE_1 — CLI Fan-Out (parallel spawn) PERSIST: per-tool outputs + tasks.csv
79
+ S_WAVE_2 — Cross-Verify (single agent spawn) PERSIST: tasks.csv
80
+ S_WAVE_3 — Synthesis (single agent spawn) PERSIST: reports + tasks.csv
81
+ S_AGGREGATE — 注册 artifact、输出摘要 PERSIST: state.json + results.csv
82
+ </states>
174
83
 
175
- Create `sessionFolder` + `sessionFolder/per-tool/` + `scratchDir`.
84
+ <transitions>
176
85
 
177
- ### Phase 1: Requirement Resolution -> CSV
86
+ S_PARSE:
87
+ → S_CONFIRM WHEN: eligible tools >= 2 DO: A_PARSE_AND_DISCOVER
88
+ → ERROR(E002) WHEN: eligible tools < 2
178
89
 
179
- **Objective**: Parse requirement, discover available tools, present plan for user approval, generate tasks.csv.
90
+ S_CONFIRM:
91
+ → S_CSV_GEN WHEN: -y OR user confirms "执行"
92
+ → S_PARSE WHEN: user modifies tools DO: re-select, validate >= 2
93
+ → END WHEN: user cancels
180
94
 
181
- **1. Discover available CLI tools**:
95
+ S_CSV_GEN:
96
+ → S_WAVE_1 DO: A_GENERATE_CSV (N tool rows wave 1 + 1 verify wave 2 + 1 synthesis wave 3)
182
97
 
183
- Read `~/.maestro/cli-tools.json` → extract all tool entries. Build `availableTools[]`:
98
+ S_WAVE_1:
99
+ → S_WAVE_2 WHEN: 1+ agents completed DO: A_SPAWN_WAVE_1
100
+ → ERROR(E004) WHEN: all failed
184
101
 
185
- ```
186
- For each tool in config.tools:
187
- availableTools.push({
188
- name: tool.name,
189
- enabled: tool.enabled,
190
- type: tool.type, // builtin | cli-wrapper | api-endpoint
191
- model: tool.primaryModel,
192
- tags: tool.tags, // [fullstack, frontend, backend, ...]
193
- eligible: tool.enabled
194
- && (delegateMode != "write" || tool.type != "api-endpoint")
195
- })
196
- ```
102
+ S_WAVE_2:
103
+ S_WAVE_3 DO: A_SPAWN_WAVE_2
197
104
 
198
- Validate: at least 2 eligible tools required (E002 if fewer).
105
+ S_WAVE_3:
106
+ → S_AGGREGATE DO: A_SPAWN_WAVE_3
199
107
 
200
- **2. Auto-recommend tool selection**:
108
+ S_AGGREGATE:
109
+ → END DO: A_AGGREGATE_RESULTS
201
110
 
202
- | Source | Logic |
203
- |--------|-------|
204
- | `--tools` explicit | Use provided list, validate each is eligible |
205
- | No `--tools` | Take first 3 eligible tools in config order |
111
+ </transitions>
206
112
 
207
- Mark each eligible tool as `recommended: true/false` based on auto-selection.
113
+ <actions>
208
114
 
209
- **3. Context loading**:
210
- - Read `.workflow/project.md` if exists
211
- - Load project specs: `maestro spec load --category coding` (if available)
212
- - Grep for relevant codebase files based on requirement keywords
115
+ ### A_PARSE_AND_DISCOVER
213
116
 
214
- **4. Build delegate prompt** (shared across all tools):
117
+ 1. Parse flags: requirement, tools, mode, rule, autoYes, concurrency
118
+ 2. Read cli-tools.json → build eligible tool list
119
+ 3. Auto-select if no --tools: first 3 eligible in config order
120
+ 4. Load context: project.md + `maestro spec load --category arch` + `maestro wiki list --category arch`
121
+ 5. Build shared delegate prompt (6-field format: PURPOSE/TASK/MODE/CONTEXT/EXPECTED/CONSTRAINTS)
215
122
 
216
- ```
217
- PURPOSE: {requirement}; success = actionable findings with evidence
218
- TASK: {auto-decomposed from requirement into 3-5 specific verbs}
219
- MODE: {delegateMode}
220
- CONTEXT: @**/* | Memory: {project context if available}
221
- EXPECTED: Structured findings with file:line references, confidence score (0-100), prioritized recommendations
222
- CONSTRAINTS: {from requirement} | Output findings as structured text with sections: ## Findings, ## Recommendations, ## Confidence
223
- ```
123
+ ### A_GENERATE_CSV
224
124
 
225
- **5. Present Collaboration Plan** (skip if AUTO_YES):
125
+ Create session + scratch dirs. Write tasks.csv:
126
+ - Wave 1: one row per selected tool (parallel)
127
+ - Wave 2: cross-verify row (deps on all wave 1 IDs)
128
+ - Wave 3: synthesis row (deps on wave 2 ID)
226
129
 
227
- Display plan summary, then `request_user_input` for approval:
130
+ ### A_SPAWN_WAVE_1
228
131
 
229
- ```
230
- ============================================================
231
- COLLABORATION PLAN
232
- ============================================================
233
- Requirement: {requirement}
234
- Mode: {delegateMode}
235
- Rule: {ruleTemplate || "none"}
236
-
237
- Available CLI Tools (from cli-tools.json):
238
- [✓] gemini — gemini-3.1-pro-preview [fullstack, frontend]
239
- [✓] claude — claude-sonnet-4-6 [fullstack]
240
- [✓] codex — gpt-5.5 [fullstack, backend]
241
- [ ] opencode — (no model) [fullstack]
242
-
243
- Selected: gemini, claude, codex (3 tools)
244
-
245
- Pipeline:
246
- Wave 1: Fan-out → gemini + claude + codex (parallel)
247
- Wave 2: Cross-verification (conflicts/consensus)
248
- Wave 3: Synthesis → context.md + conclusions.json
249
-
250
- Prompt Preview:
251
- PURPOSE: {first 80 chars}...
252
- TASK: {task verbs}
253
- ============================================================
254
- ```
132
+ Filter wave==1 from CSV → write wave-1.csv.
255
133
 
256
- ```json
257
- request_user_input({
258
- "questions": [{
259
- "id": "collab_plan",
260
- "header": "Collaboration Plan",
261
- "question": "以上为协作计划。如何继续?",
262
- "options": [
263
- {
264
- "label": "执行 (Recommended)",
265
- "description": "使用选中的 {N} 个 CLI 工具开始协作分析"
266
- },
267
- {
268
- "label": "修改工具选择",
269
- "description": "更改参与协作的 CLI 工具组合"
270
- },
271
- {
272
- "label": "取消",
273
- "description": "中止协作,不执行任何调用"
274
- }
275
- ]
276
- }]
277
- })
278
134
  ```
279
-
280
- **Handle user response**:
281
-
282
- | Response | Action |
283
- |----------|--------|
284
- | **执行** | Proceed to step 6 (CSV generation) |
285
- | **修改工具选择** | → Tool Modification Interaction (step 5a) |
286
- | **取消** | Abort with message "协作已取消" |
287
-
288
- #### 5a. Tool Modification Interaction
289
-
290
- Present all eligible tools as toggleable options:
291
-
292
- ```json
293
- request_user_input({
294
- "questions": [{
295
- "id": "tool_selection",
296
- "header": "CLI Tool Selection",
297
- "question": "选择参与协作的 CLI 工具(至少 2 个):",
298
- "options": [
299
- { "label": "gemini", "description": "gemini-3.1-pro-preview — fullstack, frontend" },
300
- { "label": "claude", "description": "claude-sonnet-4-6 — fullstack" },
301
- { "label": "codex", "description": "gpt-5.5 — fullstack, backend" },
302
- { "label": "opencode", "description": "(no model) — fullstack" }
303
- ]
304
- }]
305
- })
135
+ spawn_agents_on_csv({ csv_path: "wave-1.csv", max_concurrency: N })
306
136
  ```
307
137
 
308
- Options are **dynamically built** from `availableTools.filter(t => t.eligible)`:
309
- - `label` = tool name
310
- - `description` = `{primaryModel} — {tags.join(", ")}`
311
-
312
- Parse user selection → update `selectedTools`. Validate minimum 2 (re-prompt if fewer).
313
- Return to step 5 to re-display updated plan.
314
-
315
- **6. CSV generation**:
316
- - N tool rows (wave 1, one per selected tool)
317
- - 1 cross-verify row (wave 2, deps on all wave 1)
318
- - 1 synthesis row (wave 3, deps on wave 2)
319
-
320
- ### Phase 2: Wave Execution Engine
321
-
322
- #### Wave 1: CLI Fan-Out (Parallel)
323
-
324
- Filter `wave == 1 && status == pending` from master CSV. Write `wave-1.csv`.
325
-
326
- Each wave 1 agent:
327
-
328
- 1. Read task row: extract `tool`, `prompt`, `mode`, `rule`
329
- 2. Execute delegate (blocking):
330
-
331
- ```
332
- exec_command({
333
- cmd: `maestro delegate "${prompt}" --to ${tool} --mode ${mode} ${rule ? '--rule ' + rule : ''}`,
334
- yield_time_ms: 30000,
335
- max_output_tokens: 6000
336
- })
337
- // If session_id returned -> poll write_stdin until completion
338
- // See @~/.maestro/workflows/delegate-protocol.codex.md
339
- ```
138
+ **Agent instruction**: Execute `maestro delegate "<prompt>" --to <tool> --mode <mode>` via exec_command (delegate-protocol.codex.md). Write output to per-tool/{tool}-output.md. Extract findings/recommendations/confidence. Append discoveries.ndjson.
340
139
 
341
- 3. Parse delegate output
342
- 4. Write per-tool output to `per-tool/{tool}-output.md`
343
- 5. Share findings via discovery board
344
-
345
- ```javascript
346
- spawn_agents_on_csv({
347
- csv_path: `${sessionFolder}/wave-1.csv`,
348
- id_column: "id",
349
- instruction: buildFanOutInstruction(sessionFolder),
350
- max_concurrency: maxConcurrency,
351
- max_runtime_seconds: 3600,
352
- output_csv_path: `${sessionFolder}/wave-1-results.csv`,
353
- output_schema: { id, status: ["completed"|"failed"], findings, recommendations, confidence, error }
354
- })
355
- ```
140
+ Merge results master tasks.csv.
356
141
 
357
- Merge results into master `tasks.csv`, delete `wave-1.csv`.
142
+ ### A_SPAWN_WAVE_2
358
143
 
359
- **Fan-Out Agent Instruction**:
144
+ Filter wave==2 → write wave-2.csv. Build prev_context from wave 1 findings.
360
145
 
361
146
  ```
362
- You are a CLI collaboration agent. Your task is to delegate analysis to a specific CLI tool and capture its output.
363
-
364
- 1. Read your task row for: tool, prompt, mode, rule
365
- 2. Execute the delegate call using exec_command (follow delegate-protocol.codex.md):
366
- exec_command({
367
- cmd: `maestro delegate "<prompt>" --to <tool> --mode <mode> [--rule <rule>]`,
368
- yield_time_ms: 30000, max_output_tokens: 6000
369
- })
370
- 3. If session_id returned, poll via write_stdin until completion
371
- 4. Write full output to {sessionFolder}/per-tool/{tool}-output.md
372
- 5. Extract: findings (key points), recommendations (actionable items), confidence (0-100)
373
- 6. Share via discoveries.ndjson: type="cli_finding", data={tool, dimension, finding, confidence}
374
- 7. Report result with findings, recommendations, confidence
147
+ spawn_agents_on_csv({ csv_path: "wave-2.csv", max_concurrency: 1 })
375
148
  ```
376
149
 
377
- #### Wave 2: Cross-Verification (Single Agent)
378
-
379
- Filter `wave == 2 && status == pending`. Build `prev_context` from wave 1 findings.
150
+ **Agent instruction**: Read all per-tool outputs + discoveries.ndjson. Classify each finding:
380
151
 
381
- ```javascript
382
- spawn_agents_on_csv({
383
- csv_path: `${sessionFolder}/wave-2.csv`,
384
- id_column: "id",
385
- instruction: buildCrossVerifyInstruction(sessionFolder),
386
- max_concurrency: 1,
387
- max_runtime_seconds: 3600,
388
- output_csv_path: `${sessionFolder}/wave-2-results.csv`,
389
- output_schema: { id, status: ["completed"|"failed"], findings, recommendations, confidence, error }
390
- })
391
- ```
152
+ | Condition | Tag |
153
+ |-----------|-----|
154
+ | 2+ tools agree | CONSENSUS |
155
+ | Tools disagree | CONFLICT |
156
+ | 1 tool only | UNIQUE |
392
157
 
393
- **Cross-Verify Agent Instruction**:
158
+ Compute consensus_level = consensus_count / total * 100.
394
159
 
395
- ```
396
- You are a cross-verification agent. Compare outputs from multiple CLI tools.
397
-
398
- 1. Read all per-tool outputs from {sessionFolder}/per-tool/
399
- 2. Read discoveries.ndjson for shared findings
400
- 3. For each finding across tools, classify:
401
- - [CONSENSUS]: 2+ tools agree on same finding/recommendation
402
- - [CONFLICT]: Tools disagree on approach/assessment
403
- - [UNIQUE]: Finding from only one tool (may be valuable or noise)
404
- 4. For [CONFLICT] items: note each tool's position and evidence strength
405
- 5. Compute consensus_level: (consensus_count / total_findings) * 100
406
- 6. Write findings as structured text:
407
- ## Consensus Areas
408
- ## Conflicts (with per-tool positions)
409
- ## Unique Findings (with source tool)
410
- ## Consensus Level: {N}%
411
- ```
160
+ Merge results → master tasks.csv.
412
161
 
413
- Merge results into master `tasks.csv`, delete `wave-2.csv`.
162
+ ### A_SPAWN_WAVE_3
414
163
 
415
- #### Wave 3: Synthesis (Single Agent)
164
+ Filter wave==3 → write wave-3.csv. Build prev_context from wave 2 findings.
416
165
 
417
- Filter `wave == 3 && status == pending`. Build `prev_context` from wave 2 findings.
418
-
419
- ```javascript
420
- spawn_agents_on_csv({
421
- csv_path: `${sessionFolder}/wave-3.csv`,
422
- id_column: "id",
423
- instruction: buildSynthesisInstruction(sessionFolder),
424
- max_concurrency: 1,
425
- max_runtime_seconds: 3600,
426
- output_csv_path: `${sessionFolder}/wave-3-results.csv`,
427
- output_schema: { id, status: ["completed"|"failed"], findings, recommendations, confidence, error }
428
- })
429
166
  ```
430
-
431
- **Synthesis Agent Instruction**:
432
-
167
+ spawn_agents_on_csv({ csv_path: "wave-3.csv", max_concurrency: 1 })
433
168
  ```
434
- You are a synthesis agent. Merge cross-verified findings into a final report.
435
-
436
- 1. Read cross-verification results from prev_context
437
- 2. Read all per-tool outputs from {sessionFolder}/per-tool/
438
- 3. Read discoveries.ndjson
439
- 4. Resolve [CONFLICT] items via evidence-weighted voting:
440
- - Higher confidence tool's position wins
441
- - More specific evidence (file:line refs) wins over general statements
442
- - If tied: present both with [SUGGESTED] tag
443
- 5. Generate collab-report.md:
444
-
445
- # Multi-CLI Collaboration Report -- {requirement}
446
-
447
- ## Summary
448
- - Tools: {tool_list}
449
- - Consensus level: {N}%
450
- - Key finding: {top finding}
451
-
452
- ## Consensus Findings
453
- {merged findings agreed by 2+ tools}
454
-
455
- ## Resolved Conflicts
456
- {conflicts resolved with rationale}
457
-
458
- ## Unresolved Items
459
- {items requiring human judgment}
460
-
461
- ## Unique Insights
462
- {valuable unique findings with source attribution}
463
-
464
- ## Recommendations
465
- {prioritized, merged recommendations}
466
-
467
- ## Per-Tool Confidence
468
- | Tool | Confidence | Key Strength |
469
- |------|-----------|--------------|
470
169
 
471
- 6. Generate context.md (standard downstream format):
170
+ **Agent instruction**: Resolve conflicts via evidence-weighted voting (higher confidence wins, specific evidence > general). Generate 3 files:
171
+ 1. **collab-report.md**: Summary, Consensus Findings, Resolved Conflicts, Unresolved Items, Unique Insights, Recommendations, Per-Tool Confidence table
172
+ 2. **context.md**: Locked (CONSENSUS), Free (UNIQUE w/ strong evidence), Deferred (UNRESOLVED). Standard Locked/Free/Deferred format.
173
+ 3. **conclusions.json**: session_id, subject, mode, tools[], consensus_level, recommendation (Go/No-Go/Conditional), confidence, dimensions[], decisions[]
472
174
 
473
- # Context: {requirement}
175
+ Merge results → master tasks.csv.
474
176
 
475
- **Date**: {date}
476
- **Mode**: collab ({tool_list})
477
- **Consensus Level**: {N}%
177
+ ### A_AGGREGATE_RESULTS
478
178
 
479
- ## Decisions
179
+ 1. Export tasks.csv → results.csv
180
+ 2. Verify outputs exist (fallback: build minimal from available findings)
181
+ 3. Copy collab-report.md + context.md + conclusions.json → scratchDir
182
+ 4. Register CLB artifact in state.json (type: collab, scope: adhoc)
183
+ 5. Spec enrichment: for each Locked decision → `maestro spec add arch`
184
+ 6. Display summary (requirement, tools, consensus_level, per-tool status, artifact ID, next steps)
480
185
 
481
- ### Decision N: {TITLE}
482
- - **Context**: {what and why}
483
- - **Options**: 1. {opt1} 2. {opt2}
484
- - **Chosen**: {selected — from consensus or evidence-weighted resolution}
485
- - **Reason**: {rationale — include which tools agreed/disagreed}
186
+ </actions>
486
187
 
487
- ## Constraints
188
+ </state_machine>
488
189
 
489
- ### Locked
490
- {[CONSENSUS] items — agreed by 2+ tools, treat as confirmed decisions}
190
+ <discovery_board>
491
191
 
492
- ### Free
493
- {[UNIQUE] items with strong evidence — implementer may adopt or skip}
192
+ | Type | Dedup Key | Data |
193
+ |------|-----------|------|
194
+ | cli_finding | tool+dimension | {tool, dimension, finding, confidence, evidence} |
195
+ | consensus | area | {area, tools[], finding, confidence} |
196
+ | conflict | area | {area, positions[{tool, stance, evidence}], resolution} |
197
+ | unique_insight | tool+finding | {tool, finding, significance, actionable} |
494
198
 
495
- ### Deferred
496
- {[UNRESOLVED] conflicts — require human judgment before proceeding}
497
-
498
- ## Code Context
499
- {file:line references from per-tool findings}
500
-
501
- 7. Generate conclusions.json (plan fast-track compatible):
502
-
503
- {
504
- "session_id": "<session>",
505
- "subject": "<requirement>",
506
- "mode": "collab",
507
- "tools": ["gemini", "qwen", "claude"],
508
- "consensus_level": 85,
509
- "recommendation": "Go|No-Go|Conditional",
510
- "confidence": "high|medium|low",
511
- "dimensions": [
512
- { "name": "<tool>", "score": 80, "findings": "...", "recommendations": "..." }
513
- ],
514
- "decisions": [
515
- { "title": "...", "classification": "locked|free|deferred", "source_tools": ["gemini","qwen"], "rationale": "..." }
516
- ],
517
- "timestamp": "<ISO>"
518
- }
519
-
520
- 8. Write collab-report.md, context.md, conclusions.json to {sessionFolder}/
521
- ```
522
-
523
- Merge results into master `tasks.csv`, delete `wave-3.csv`.
524
-
525
- ### Phase 3: Results Aggregation
526
-
527
- 1. Export final `tasks.csv` as `results.csv`
528
- 2. Verify `collab-report.md` + `context.md` + `conclusions.json` exist (if synthesis failed, build minimal versions from available findings)
529
- 3. Copy final outputs to `scratchDir`:
530
- - `collab-report.md` → `{scratchDir}/collab-report.md`
531
- - `context.md` → `{scratchDir}/context.md`
532
- - `conclusions.json` → `{scratchDir}/conclusions.json`
533
-
534
- 4. **Register artifact in state.json**:
535
- ```json
536
- {
537
- "id": "CLB-{next_id}",
538
- "type": "collab",
539
- "milestone": "{current_milestone}",
540
- "phase": null,
541
- "scope": "adhoc",
542
- "path": "scratch/{YYYYMMDD}-collab-{slug}",
543
- "status": "completed",
544
- "depends_on": null,
545
- "harvested": false,
546
- "created_at": "<ISO>",
547
- "completed_at": "<ISO>"
548
- }
549
- ```
550
-
551
- 5. **Spec Enrichment**: For each Locked decision in context.md:
552
- - `maestro spec add arch "<decision.title>" "<decision.rationale>" --keywords ... --source collab:{sessionId}`
553
-
554
- 6. Display summary:
555
-
556
- ```
557
- ============================================================
558
- MULTI-CLI COLLABORATION COMPLETE
559
- ============================================================
560
- Requirement: {requirement}
561
- Tools: {tool_list}
562
- Consensus Level: {N}%
563
- Wave Results: {completed}/{total} tasks
564
-
565
- Per-Tool:
566
- gemini: {status} (confidence: {N}%)
567
- qwen: {status} (confidence: {N}%)
568
- claude: {status} (confidence: {N}%)
569
-
570
- Artifact: CLB-{id} registered in state.json
571
- Output: {scratchDir}/
572
-
573
- Next steps:
574
- $maestro-analyze "{topic}" -- Deep feasibility analysis
575
- $maestro-plan "{phase} --dir {scratchDir}" -- Plan from collab conclusions
576
- $maestro-brainstorm "{topic}" -- Expand with multi-role brainstorm
577
- ============================================================
578
- ```
579
-
580
- ### Shared Discovery Board Protocol
581
-
582
- #### Domain Discovery Types
583
-
584
- | Type | Dedup Key | Data Schema | Description |
585
- |------|-----------|-------------|-------------|
586
- | `cli_finding` | `data.tool+data.dimension` | `{tool, dimension, finding, confidence, evidence}` | Per-tool finding |
587
- | `consensus` | `data.area` | `{area, tools[], finding, confidence}` | Cross-tool agreement |
588
- | `conflict` | `data.area` | `{area, positions[{tool, stance, evidence}], resolution}` | Cross-tool disagreement |
589
- | `unique_insight` | `data.tool+data.finding` | `{tool, finding, significance, actionable}` | Single-tool unique finding |
590
-
591
- #### Protocol
592
-
593
- Read `discoveries.ndjson` before analysis. Append-only: dedup by type+key, never modify/delete.
594
-
595
- </execution>
199
+ Protocol: read before analysis, append-only, dedup by type+key.
200
+ </discovery_board>
596
201
 
597
202
  <error_codes>
598
-
599
- | Code | Severity | Description | Recovery |
600
- |------|----------|-------------|----------|
601
- | E001 | error | Requirement argument missing | Prompt for requirement |
602
- | E002 | error | Fewer than 2 CLI tools available | Check cli-tools.json, enable more tools |
603
- | E003 | error | Specified tool not found/enabled | Show available tools |
604
- | E004 | error | All wave 1 delegates failed | Abort with per-tool error details |
605
- | W001 | warning | One tool failed in wave 1 | Continue with remaining tools |
606
- | W002 | warning | Cross-verify found >50% conflicts | Highlight in report, recommend manual review |
607
- | W003 | warning | Synthesis agent failed | Use cross-verify output as fallback report |
608
- | W004 | warning | Low consensus level (<40%) | Flag in summary, tools may need different prompts |
609
-
203
+ | Code | Condition | Recovery |
204
+ |------|-----------|----------|
205
+ | E002 | Fewer than 2 eligible tools | Check cli-tools.json |
206
+ | E004 | All wave 1 delegates failed | Abort with per-tool error details |
207
+ | W001 | One tool failed wave 1 | Continue with remaining |
208
+ | W003 | Synthesis failed | Use cross-verify output as fallback |
209
+ | W004 | consensus_level < 40% | Flag in summary |
610
210
  </error_codes>
611
211
 
612
212
  <success_criteria>
613
- - [ ] Session folder created with valid tasks.csv
614
- - [ ] Available CLI tools discovered from cli-tools.json with eligibility filtering
615
- - [ ] Collaboration plan presented via request_user_input (tool list, pipeline, prompt preview)
616
- - [ ] User approved or modified tool selection before execution
617
- - [ ] CLI tools finalized (auto or user-modified) with minimum 2
618
- - [ ] All wave 1 delegates executed via delegate-protocol.codex.md (blocking poll)
619
- - [ ] Per-tool outputs written to per-tool/{tool}-output.md
620
- - [ ] Cross-verification completed with consensus/conflict/unique classification
621
- - [ ] Synthesis produced collab-report.md with merged findings
622
- - [ ] context.md produced in standard Locked/Free/Deferred format (downstream compatible)
623
- - [ ] conclusions.json produced with per-tool dimensions and decision trail (plan fast-track compatible)
624
- - [ ] Consensus level computed and displayed
625
- - [ ] Results.csv exported with all task statuses
626
- - [ ] CLB artifact registered in state.json
627
- - [ ] Final outputs copied to scratchDir (collab-report.md, context.md, conclusions.json)
628
- - [ ] Spec enrichment applied for Locked decisions
629
- - [ ] discoveries.ndjson append-only throughout
630
- - [ ] Partial degradation: continue if 1+ tools succeed in wave 1
213
+ - [ ] Wave 1: all delegates via delegate-protocol.codex.md, per-tool outputs written
214
+ - [ ] Wave 2: consensus/conflict/unique classified, consensus_level computed
215
+ - [ ] Wave 3: collab-report.md + context.md + conclusions.json produced
216
+ - [ ] CLB artifact registered, outputs copied to scratchDir
217
+ - [ ] Partial degradation: continued if 1+ tools succeeded
631
218
  </success_criteria>