maestro-flow 0.5.3 → 0.5.31

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 (259) hide show
  1. package/.agents/skills/learn-follow/SKILL.md +114 -114
  2. package/.agents/skills/learn-investigate/SKILL.md +138 -139
  3. package/.agents/skills/learn-second-opinion/SKILL.md +105 -109
  4. package/.agents/skills/maestro/SKILL.md +2 -10
  5. package/.agents/skills/maestro-amend/SKILL.md +152 -152
  6. package/.agents/skills/maestro-analyze/SKILL.md +201 -252
  7. package/.agents/skills/maestro-blueprint/SKILL.md +175 -190
  8. package/.agents/skills/maestro-brainstorm/SKILL.md +196 -200
  9. package/.agents/skills/maestro-collab/SKILL.md +159 -159
  10. package/.agents/skills/maestro-companion/SKILL.md +517 -517
  11. package/.agents/skills/maestro-composer/SKILL.md +173 -164
  12. package/.agents/skills/maestro-execute/SKILL.md +169 -170
  13. package/.agents/skills/maestro-fork/SKILL.md +97 -96
  14. package/.agents/skills/maestro-grill/SKILL.md +161 -162
  15. package/.agents/skills/maestro-guard/SKILL.md +93 -92
  16. package/.agents/skills/maestro-impeccable/SKILL.md +296 -253
  17. package/.agents/skills/maestro-init/SKILL.md +117 -118
  18. package/.agents/skills/maestro-merge/SKILL.md +73 -66
  19. package/.agents/skills/maestro-milestone-audit/SKILL.md +4 -10
  20. package/.agents/skills/maestro-milestone-complete/SKILL.md +6 -7
  21. package/.agents/skills/maestro-milestone-release/SKILL.md +122 -131
  22. package/.agents/skills/maestro-next/SKILL.md +241 -245
  23. package/.agents/skills/maestro-overlay/SKILL.md +176 -166
  24. package/.agents/skills/maestro-plan/SKILL.md +211 -197
  25. package/.agents/skills/maestro-player/SKILL.md +167 -167
  26. package/.agents/skills/maestro-quick/SKILL.md +69 -63
  27. package/.agents/skills/maestro-ralph/SKILL.md +2 -36
  28. package/.agents/skills/maestro-ralph-beta/SKILL.md +861 -872
  29. package/.agents/skills/maestro-ralph-execute/SKILL.md +234 -234
  30. package/.agents/skills/maestro-roadmap/SKILL.md +159 -172
  31. package/.agents/skills/maestro-swarm-workflow/SKILL.md +229 -250
  32. package/.agents/skills/maestro-tools-execute/SKILL.md +108 -103
  33. package/.agents/skills/maestro-tools-register/SKILL.md +148 -143
  34. package/.agents/skills/maestro-ui-codify/SKILL.md +103 -86
  35. package/.agents/skills/maestro-universal-workflow/SKILL.md +534 -547
  36. package/.agents/skills/maestro-update/SKILL.md +109 -106
  37. package/.agents/skills/manage-codebase-rebuild/SKILL.md +73 -71
  38. package/.agents/skills/manage-harvest/SKILL.md +83 -81
  39. package/.agents/skills/manage-issue/SKILL.md +59 -60
  40. package/.agents/skills/manage-issue-discover/SKILL.md +70 -68
  41. package/.agents/skills/manage-kg-extractors/SKILL.md +130 -0
  42. package/.agents/skills/manage-knowhow/SKILL.md +70 -66
  43. package/.agents/skills/manage-knowhow-capture/SKILL.md +79 -69
  44. package/.agents/skills/manage-knowledge-audit/SKILL.md +91 -74
  45. package/.agents/skills/manage-status/SKILL.md +52 -42
  46. package/.agents/skills/manage-wiki/SKILL.md +69 -58
  47. package/.agents/skills/odyssey-debug/SKILL.md +445 -459
  48. package/.agents/skills/odyssey-improve/SKILL.md +477 -491
  49. package/.agents/skills/odyssey-planex/SKILL.md +576 -587
  50. package/.agents/skills/odyssey-review-test-fix/SKILL.md +400 -413
  51. package/.agents/skills/odyssey-ui/SKILL.md +431 -448
  52. package/.agents/skills/quality-auto-test/SKILL.md +140 -123
  53. package/.agents/skills/quality-debug/SKILL.md +145 -106
  54. package/.agents/skills/quality-refactor/SKILL.md +91 -53
  55. package/.agents/skills/quality-retrospective/SKILL.md +109 -63
  56. package/.agents/skills/quality-review/SKILL.md +141 -114
  57. package/.agents/skills/quality-sync/SKILL.md +74 -38
  58. package/.agents/skills/quality-test/SKILL.md +133 -103
  59. package/.agents/skills/security-audit/SKILL.md +217 -166
  60. package/.agents/skills/spec-add/SKILL.md +66 -59
  61. package/.agents/skills/spec-load/SKILL.md +68 -68
  62. package/.agents/skills/spec-remove/SKILL.md +42 -42
  63. package/.agents/skills/spec-setup/SKILL.md +38 -41
  64. package/.agy/skills/learn-follow/SKILL.md +114 -114
  65. package/.agy/skills/learn-investigate/SKILL.md +138 -139
  66. package/.agy/skills/learn-second-opinion/SKILL.md +105 -109
  67. package/.agy/skills/maestro/SKILL.md +2 -10
  68. package/.agy/skills/maestro-amend/SKILL.md +152 -152
  69. package/.agy/skills/maestro-analyze/SKILL.md +201 -252
  70. package/.agy/skills/maestro-blueprint/SKILL.md +175 -190
  71. package/.agy/skills/maestro-brainstorm/SKILL.md +196 -200
  72. package/.agy/skills/maestro-collab/SKILL.md +159 -159
  73. package/.agy/skills/maestro-companion/SKILL.md +517 -517
  74. package/.agy/skills/maestro-composer/SKILL.md +173 -164
  75. package/.agy/skills/maestro-execute/SKILL.md +169 -170
  76. package/.agy/skills/maestro-fork/SKILL.md +97 -96
  77. package/.agy/skills/maestro-grill/SKILL.md +161 -162
  78. package/.agy/skills/maestro-guard/SKILL.md +93 -92
  79. package/.agy/skills/maestro-impeccable/SKILL.md +296 -253
  80. package/.agy/skills/maestro-init/SKILL.md +117 -118
  81. package/.agy/skills/maestro-merge/SKILL.md +73 -66
  82. package/.agy/skills/maestro-milestone-audit/SKILL.md +4 -10
  83. package/.agy/skills/maestro-milestone-complete/SKILL.md +6 -7
  84. package/.agy/skills/maestro-milestone-release/SKILL.md +122 -131
  85. package/.agy/skills/maestro-next/SKILL.md +241 -245
  86. package/.agy/skills/maestro-overlay/SKILL.md +176 -166
  87. package/.agy/skills/maestro-plan/SKILL.md +211 -197
  88. package/.agy/skills/maestro-player/SKILL.md +167 -167
  89. package/.agy/skills/maestro-quick/SKILL.md +69 -63
  90. package/.agy/skills/maestro-ralph/SKILL.md +2 -36
  91. package/.agy/skills/maestro-ralph-beta/SKILL.md +861 -872
  92. package/.agy/skills/maestro-ralph-execute/SKILL.md +234 -234
  93. package/.agy/skills/maestro-roadmap/SKILL.md +159 -172
  94. package/.agy/skills/maestro-swarm-workflow/SKILL.md +229 -250
  95. package/.agy/skills/maestro-tools-execute/SKILL.md +108 -103
  96. package/.agy/skills/maestro-tools-register/SKILL.md +148 -143
  97. package/.agy/skills/maestro-ui-codify/SKILL.md +103 -86
  98. package/.agy/skills/maestro-universal-workflow/SKILL.md +534 -547
  99. package/.agy/skills/maestro-update/SKILL.md +109 -106
  100. package/.agy/skills/manage-codebase-rebuild/SKILL.md +73 -71
  101. package/.agy/skills/manage-harvest/SKILL.md +83 -81
  102. package/.agy/skills/manage-issue/SKILL.md +59 -60
  103. package/.agy/skills/manage-issue-discover/SKILL.md +70 -68
  104. package/.agy/skills/manage-kg-extractors/SKILL.md +130 -0
  105. package/.agy/skills/manage-knowhow/SKILL.md +70 -66
  106. package/.agy/skills/manage-knowhow-capture/SKILL.md +79 -69
  107. package/.agy/skills/manage-knowledge-audit/SKILL.md +91 -74
  108. package/.agy/skills/manage-status/SKILL.md +52 -42
  109. package/.agy/skills/manage-wiki/SKILL.md +69 -58
  110. package/.agy/skills/odyssey-debug/SKILL.md +445 -459
  111. package/.agy/skills/odyssey-improve/SKILL.md +477 -491
  112. package/.agy/skills/odyssey-planex/SKILL.md +576 -587
  113. package/.agy/skills/odyssey-review-test-fix/SKILL.md +400 -413
  114. package/.agy/skills/odyssey-ui/SKILL.md +431 -448
  115. package/.agy/skills/quality-auto-test/SKILL.md +140 -123
  116. package/.agy/skills/quality-debug/SKILL.md +145 -106
  117. package/.agy/skills/quality-refactor/SKILL.md +91 -53
  118. package/.agy/skills/quality-retrospective/SKILL.md +109 -63
  119. package/.agy/skills/quality-review/SKILL.md +141 -114
  120. package/.agy/skills/quality-sync/SKILL.md +74 -38
  121. package/.agy/skills/quality-test/SKILL.md +133 -103
  122. package/.agy/skills/security-audit/SKILL.md +217 -166
  123. package/.agy/skills/spec-add/SKILL.md +66 -59
  124. package/.agy/skills/spec-load/SKILL.md +68 -68
  125. package/.agy/skills/spec-remove/SKILL.md +42 -42
  126. package/.agy/skills/spec-setup/SKILL.md +38 -41
  127. package/.claude/commands/learn-follow.md +127 -127
  128. package/.claude/commands/learn-investigate.md +151 -152
  129. package/.claude/commands/learn-second-opinion.md +118 -122
  130. package/.claude/commands/maestro-amend.md +164 -164
  131. package/.claude/commands/maestro-analyze.md +215 -266
  132. package/.claude/commands/maestro-blueprint.md +189 -204
  133. package/.claude/commands/maestro-brainstorm.md +209 -213
  134. package/.claude/commands/maestro-collab.md +172 -172
  135. package/.claude/commands/maestro-companion.md +531 -531
  136. package/.claude/commands/maestro-composer.md +188 -179
  137. package/.claude/commands/maestro-execute.md +183 -184
  138. package/.claude/commands/maestro-fork.md +111 -110
  139. package/.claude/commands/maestro-grill.md +175 -176
  140. package/.claude/commands/maestro-guard.md +103 -102
  141. package/.claude/commands/maestro-impeccable.md +311 -268
  142. package/.claude/commands/maestro-init.md +130 -131
  143. package/.claude/commands/maestro-merge.md +87 -80
  144. package/.claude/commands/maestro-milestone-audit.md +4 -10
  145. package/.claude/commands/maestro-milestone-complete.md +6 -7
  146. package/.claude/commands/maestro-milestone-release.md +136 -145
  147. package/.claude/commands/maestro-next.md +253 -257
  148. package/.claude/commands/maestro-overlay.md +188 -178
  149. package/.claude/commands/maestro-plan.md +225 -211
  150. package/.claude/commands/maestro-player.md +182 -182
  151. package/.claude/commands/maestro-quick.md +83 -77
  152. package/.claude/commands/maestro-ralph-beta.md +875 -886
  153. package/.claude/commands/maestro-ralph-execute.md +247 -247
  154. package/.claude/commands/maestro-ralph.md +2 -36
  155. package/.claude/commands/maestro-roadmap.md +173 -186
  156. package/.claude/commands/maestro-swarm-workflow.md +243 -264
  157. package/.claude/commands/maestro-tools-execute.md +122 -117
  158. package/.claude/commands/maestro-tools-register.md +162 -157
  159. package/.claude/commands/maestro-ui-codify.md +117 -100
  160. package/.claude/commands/maestro-universal-workflow.md +548 -561
  161. package/.claude/commands/maestro-update.md +122 -119
  162. package/.claude/commands/maestro.md +2 -10
  163. package/.claude/commands/manage-codebase-rebuild.md +87 -85
  164. package/.claude/commands/manage-harvest.md +97 -95
  165. package/.claude/commands/manage-issue-discover.md +83 -81
  166. package/.claude/commands/manage-issue.md +72 -73
  167. package/.claude/commands/manage-kg-extractors.md +128 -0
  168. package/.claude/commands/manage-knowhow-capture.md +92 -82
  169. package/.claude/commands/manage-knowhow.md +83 -79
  170. package/.claude/commands/manage-knowledge-audit.md +105 -88
  171. package/.claude/commands/manage-status.md +62 -52
  172. package/.claude/commands/manage-wiki.md +82 -71
  173. package/.claude/commands/odyssey-debug.md +459 -473
  174. package/.claude/commands/odyssey-improve.md +491 -505
  175. package/.claude/commands/odyssey-planex.md +590 -601
  176. package/.claude/commands/odyssey-review-test-fix.md +414 -427
  177. package/.claude/commands/odyssey-ui.md +445 -462
  178. package/.claude/commands/quality-auto-test.md +153 -136
  179. package/.claude/commands/quality-debug.md +159 -120
  180. package/.claude/commands/quality-refactor.md +105 -67
  181. package/.claude/commands/quality-retrospective.md +123 -77
  182. package/.claude/commands/quality-review.md +155 -128
  183. package/.claude/commands/quality-sync.md +88 -52
  184. package/.claude/commands/quality-test.md +147 -117
  185. package/.claude/commands/security-audit.md +230 -179
  186. package/.claude/commands/spec-add.md +77 -70
  187. package/.claude/commands/spec-load.md +78 -78
  188. package/.claude/commands/spec-remove.md +55 -55
  189. package/.claude/commands/spec-setup.md +49 -52
  190. package/dist/src/cli.js +1 -1
  191. package/dist/src/cli.js.map +1 -1
  192. package/dist/src/commands/kg.d.ts.map +1 -1
  193. package/dist/src/commands/kg.js +11 -5
  194. package/dist/src/commands/kg.js.map +1 -1
  195. package/dist/src/graph/kg/extraction/code/code-extractor.d.ts +2 -0
  196. package/dist/src/graph/kg/extraction/code/code-extractor.d.ts.map +1 -1
  197. package/dist/src/graph/kg/extraction/code/code-extractor.js +32 -3
  198. package/dist/src/graph/kg/extraction/code/code-extractor.js.map +1 -1
  199. package/dist/src/graph/kg/extraction/code/plugin-engine.d.ts +35 -0
  200. package/dist/src/graph/kg/extraction/code/plugin-engine.d.ts.map +1 -0
  201. package/dist/src/graph/kg/extraction/code/plugin-engine.js +573 -0
  202. package/dist/src/graph/kg/extraction/code/plugin-engine.js.map +1 -0
  203. package/dist/src/graph/kg/extraction/code/plugin-types.d.ts +95 -0
  204. package/dist/src/graph/kg/extraction/code/plugin-types.d.ts.map +1 -0
  205. package/dist/src/graph/kg/extraction/code/plugin-types.js +5 -0
  206. package/dist/src/graph/kg/extraction/code/plugin-types.js.map +1 -0
  207. package/dist/src/graph/kg/extraction/orchestrator.d.ts.map +1 -1
  208. package/dist/src/graph/kg/extraction/orchestrator.js +17 -5
  209. package/dist/src/graph/kg/extraction/orchestrator.js.map +1 -1
  210. package/dist/src/graph/kg/schema.sql +16 -11
  211. package/dist/src/graph/kg/surface/cli.d.ts.map +1 -1
  212. package/dist/src/graph/kg/surface/cli.js +153 -56
  213. package/dist/src/graph/kg/surface/cli.js.map +1 -1
  214. package/dist/src/hooks/workspace.d.ts +4 -2
  215. package/dist/src/hooks/workspace.d.ts.map +1 -1
  216. package/dist/src/hooks/workspace.js +6 -2
  217. package/dist/src/hooks/workspace.js.map +1 -1
  218. package/package.json +91 -91
  219. package/workflows/analyze.md +25 -49
  220. package/workflows/auto-test.md +699 -699
  221. package/workflows/blueprint.md +403 -431
  222. package/workflows/brainstorm.md +54 -195
  223. package/workflows/business-test.md +570 -570
  224. package/workflows/claude-instructions.md +23 -51
  225. package/workflows/codex-instructions.md +27 -77
  226. package/workflows/coding-philosophy.md +69 -69
  227. package/workflows/command-authoring.md +823 -823
  228. package/workflows/debug.md +43 -98
  229. package/workflows/delegate-usage.md +39 -241
  230. package/workflows/execute.md +4 -53
  231. package/workflows/grill.md +12 -56
  232. package/workflows/harvest.md +22 -68
  233. package/workflows/init.md +148 -148
  234. package/workflows/instruction-authoring-guide.md +97 -0
  235. package/workflows/issue-execute.md +110 -110
  236. package/workflows/issue-gaps-analyze.codex.md +260 -260
  237. package/workflows/issue-gaps-analyze.md +216 -216
  238. package/workflows/issue-plan.md +110 -110
  239. package/workflows/issue.md +338 -346
  240. package/workflows/knowhow.md +0 -32
  241. package/workflows/learn.md +277 -277
  242. package/workflows/maestro-chain-execute.md +20 -20
  243. package/workflows/refactor.md +22 -44
  244. package/workflows/retrospective.md +16 -65
  245. package/workflows/review.md +446 -486
  246. package/workflows/roadmap.md +35 -132
  247. package/workflows/skill-authoring.md +265 -265
  248. package/workflows/spec-generate.md +470 -470
  249. package/workflows/specs-remove.md +104 -104
  250. package/workflows/sync.md +11 -41
  251. package/workflows/test-gen.md +226 -226
  252. package/workflows/test.md +385 -475
  253. package/workflows/ui-design.md +391 -391
  254. package/workflows/ui-style.md +199 -199
  255. package/workflows/wiki-connect.md +151 -151
  256. package/workflows/wiki-digest.md +178 -178
  257. package/workflows/wiki-manage.md +109 -109
  258. package/workflows/cli-tools-usage.md +0 -252
  259. package/workflows/delegate-protocol.codex.md +0 -65
@@ -14,253 +14,232 @@ allowed-tools:
14
14
  ---
15
15
  <!-- Open-standard mirror generated by scripts/build-agents-standard.mjs — do not edit; re-run after editing .claude/ source. -->
16
16
 
17
- <purpose>
18
- Parallel accelerator layer for maestro commands. Routes user intent to pre-built Workflow scripts
19
- that leverage `parallel()` / `pipeline()` for multi-agent concurrent execution.
20
-
21
- Complements maestro-ralph (sequential decision chain) — ralph manages state + decisions,
22
- swarm-workflow provides parallel compute bursts within individual steps.
23
-
24
- Scripts: `~/.maestro/workflows/swarm/wf-*.js`
25
-
26
- | Script | Accelerates | Adversarial Pattern |
27
- |--------|-------------|---------------------|
28
- | `wf-analyze` | maestro-analyze | explore → 6-dim scoring → **skeptic cross-verify** → **3-way advocacy (go/no-go/conditional) + referee** |
29
- | `wf-brainstorm` | maestro-brainstorm | multi-role analysis → **3-specialist cross-review** → **3-proposal competition** → **arbitrator** |
30
- | `wf-review` | quality-review | 6-dim scan **3-vote adversarial verify (prosecutor/defense/judge)** → **3-perspective report + arbitrated verdict** |
31
- | `wf-verify` | maestro-execute (verification gate) | 3-layer + antipattern + convergence **prosecutor vs defender debate** → **judge verdict** |
32
- | `wf-grill` | maestro-grill | explore parallel branch stress → **meta-skeptic challenge** → **3-vote verdict (optimist/pessimist/realist)** |
33
- | `wf-plan` | maestro-plan | parallel context **3-strategy competing proposals** → **judge panel scoring** → **3-critic adversarial check** |
34
- | `wf-execute` | maestro-execute | wave-based parallel execution → **adversarial convergence spot-check** → **3-vote status determination** |
35
- | `wf-milestone-audit` | maestro-milestone-audit | parallel 3-dim audit → **adversarial dimension challenge** → **3-vote verdict (strict/lenient/objective)** |
36
-
37
- Integration modes:
38
- - **Standalone**: `/maestro-swarm-workflow "analyze auth module"` — direct invocation
39
- - **Ralph step**: ralph chain 中某个 step 可指定 `swarm-workflow` 作为加速执行器
40
- - **Chained**: 输出 JSON 可被下游命令通过 `--from` 消费
41
- </purpose>
42
-
43
- <context>
44
- $ARGUMENTS intent text with optional flags.
45
-
46
- **Parse:**
47
- ```
48
- --script <name> → 强制指定脚本(wf-analyze, wf-brainstorm, wf-review, wf-verify)
49
- --dims <d1,d2> → 限定分析维度(analyze: architecture,complexity,patterns,risk,testability,performance)
50
- --roles <r1,r2> → 限定角色(brainstorm: system-architect,product-manager,test-strategist,ux-expert,security-analyst,data-architect)
51
- --count N → 角色数量(brainstorm 默认 3)
52
- --tier <level> → review 层级(quick=2 维度, standard=4 维度)
53
- --resume <runId> → 从之前的 workflow 运行恢复(增量重跑)
54
- Remaining intent
55
- ```
56
-
57
- **Script inventory** (`~/.maestro/workflows/swarm/`):
58
-
59
- | Script | args 接口 |
60
- |--------|-----------|
61
- | `wf-analyze` | `{ target, scope, context, phase?, dimensions? }` |
62
- | `wf-brainstorm` | `{ topic, context, count?, roles? }` |
63
- | `wf-review` | `{ target, scope, specs?, tier?, dimensions? }` |
64
- | `wf-verify` | `{ goals, plan_dir?, scope?, task_files?, must_haves?, skip_antipattern? }` |
65
- | `wf-grill` | `{ topic, context?, depth?: "shallow"\|"standard"\|"deep" }` |
66
- | `wf-plan` | `{ context_dir?, from?, phase?, scope?, specs?, gaps?, quick? }` |
67
- | `wf-execute` | `{ plan_dir, specs?, codebase_context?, wiki_context?, auto_commit? }` |
68
- | `wf-milestone-audit` | `{ milestone?, is_adhoc? }` |
69
- </context>
70
-
71
- <state_machine>
72
-
73
- <states>
74
- S_PARSE — 解析参数和意图 PERSIST:
75
- S_ROUTE — 路由到目标脚本 PERSIST:
76
- S_CONTEXT — 组装 context payload PERSIST: —
77
- S_DISPATCH — 调用 Workflow 工具 PERSIST: —
78
- S_INGEST — 处理返回结果 PERSIST:
79
- S_FALLBACK — 无法路由 PERSIST:
80
- </states>
81
-
82
- <transitions>
83
-
84
- S_PARSE:
85
- → S_ROUTE WHEN: intent parsed DO: A_PARSE_ARGS
86
- → S_FALLBACK WHEN: no intent
87
-
88
- S_ROUTE:
89
- S_CONTEXT WHEN: script resolved DO: A_ROUTE_SCRIPT
90
- → S_FALLBACK WHEN: ambiguous intent DO: ask_user
91
-
92
- S_CONTEXT:
93
- S_DISPATCH DO: A_ASSEMBLE_CONTEXT
94
-
95
- S_DISPATCH:
96
- → S_INGEST WHEN: workflow completed DO: A_DISPATCH_WORKFLOW
97
- S_FALLBACK WHEN: workflow failed
98
-
99
- S_INGEST:
100
- → END DO: A_INGEST_RESULTS
101
-
102
- S_FALLBACK:
103
- S_PARSE WHEN: user provides input
104
- END WHEN: user cancels
105
-
106
- </transitions>
107
-
108
- <actions>
109
-
110
- ### A_PARSE_ARGS
111
-
112
- 1. 提取 flags(--script, --dims, --roles, --count, --tier, --resume)
113
- 2. 剩余文本作为 intent
114
- 3. 若有 --resume,记录 resumeRunId
115
-
116
- ### A_ROUTE_SCRIPT
117
-
118
- Intent-to-script routing(按关键词匹配,--script 优先级最高):
119
-
120
- | Keywords | Script |
121
- |----------|--------|
122
- | 分析 / analyze / 探索 / explore / 架构 / architecture / 复杂度 / 风险 | `wf-analyze` |
123
- | 头脑风暴 / brainstorm / 方案 / 设计 / 评估 / evaluate / 多角度 | `wf-brainstorm` |
124
- | 审查 / review / 代码审查 / code review / 质量 / quality | `wf-review` |
125
- | 验证 / verify / 检查 / check / 反模式 / antipattern | `wf-verify` |
126
- | 拷问 / grill / 压力测试 / stress-test / 挑战 / challenge | `wf-grill` |
127
- | 规划 / plan / 任务分解 / decompose / 分波 / wave | `wf-plan` |
128
- | 执行 / execute / 实现 / implement / 开发 / develop | `wf-execute` |
129
- | 里程碑审计 / milestone-audit / 集成检查 / integration | `wf-milestone-audit` |
130
-
131
- 多命中 ask_user 让用户选择。
132
-
133
- ### A_ASSEMBLE_CONTEXT
134
-
135
- 根据目标脚本组装 args payload:
136
-
137
- **wf-analyze:**
138
- 1. Read `.workflow/state.json` 获取当前 phase/milestone 信息
139
- 2. `target` = intent 中的目标描述
140
- 3. `scope` = 从 intent 推断文件范围,或读 roadmap 获取 phase scope
141
- 4. `context` = 拼接相关上下文(上游 artifact 摘要、specs)
142
- 5. `dimensions` = --dims 解析结果(可选)
143
-
144
- **wf-brainstorm:**
145
- 1. `topic` = intent 文本
146
- 2. `context` = 读取相关代码文件摘要 + 已有 specs
147
- 3. `count` = --count 或默认 3
148
- 4. `roles` = --roles 解析结果(可选)
149
-
150
- **wf-review:**
151
- 1. `target` = 读 git diff 描述变更范围
152
- 2. `scope` = 变更文件列表
153
- 3. `tier` = --tier 或 "standard"
154
- 4. `dimensions` = --dims 解析结果(可选)
155
-
156
- **wf-verify:**
157
- 1. `goals` = 读最近的 plan artifact 提取目标列表
158
- 2. `plan_dir` = 定位最近的 plan scratch 目录
159
- 3. `scope` = plan 涉及的文件范围
160
- 4. `skip_tests` / `skip_antipattern` = flags 提取
161
-
162
- ### A_DISPATCH_WORKFLOW
163
-
164
- 1. 确定 scriptPath = `~/.maestro/workflows/swarm/{script}.js`(展开为绝对路径)
165
- 2. 构建 Workflow 调用:
166
- ```
167
- Workflow({
168
- scriptPath: absoluteScriptPath,
169
- args: assembledArgs,
170
- resumeFromRunId: resumeRunId // 若有
171
- })
172
- ```
173
- 3. 等待 Workflow 返回结果
174
- 4. 记录 runId 用于潜在的后续 resume
175
-
176
- ### A_INGEST_RESULTS
177
-
178
- Workflow 返回 JSON 后:
179
-
180
- 1. **摘要输出**:按脚本类型格式化关键指标(含对抗决策结果)
181
- - analyze: overall_score, scope_verdict, adversarial_outcome (go/no-go/conditional advocacy + referee), scores_challenged count
182
- - brainstorm: role count, conflict/synergy count, 3-proposal competition result, arbitration notes
183
- - review: verdict (APPROVE/REQUEST_CHANGES/BLOCK), 3-vote tally, confirmed vs false-positive count, adversarial_verdict
184
- - verify: overall_status, prosecutor vs defender confidence, adversarial_outcome, gap count
185
- - grill: overall_verdict, meta-skeptic quality rating, 3-vote verdict tally, overblown findings count
186
- - plan: selected_strategy (breadth/depth/risk), judge panel scores, 3-critic adversarial check verdict
187
- - execute: 3-vote status (DONE/DONE_WITH_CONCERNS/NEEDS_RETRY), convergence trust %, discrepancy count
188
- - milestone-audit: 3-vote verdict, dimensions_overturned count, next_step
189
-
190
- 2. **Artifact 写入**(可选):
191
- - 若当前在 ralph session 中(检测 `.workflow/.maestro/ralph-*/status.json` 状态为 running):
192
- 将结果写入对应 step scratch 目录,格式兼容命令产出
193
- - 否则写入 `.workflow/scratch/{YYYYMMDD}-swarm-{script}-{slug}/results.json`
194
-
195
- 3. **Ralph 兼容产出**:
196
- - analyze → `analysis.md` + `context.md`(decisions)+ `conclusions.json` + `adversarial-debate.json`
197
- - brainstorm → `guidance-specification.md` + `proposals-competition.json`
198
- - review → `review.json`(含 adversarial_verdict + 3-vote tally)
199
- - verify → `verification.json`(含 adversarial_outcome: prosecutor/defender debate)
200
- - grill → `grill-results.json`(含 meta-challenge + 3-vote verdict)
201
- - plan `plan.json`(含 competition scores + critic feedback)
202
- - execute → `execution-report.json`(含 convergence_checks + 3-vote status)
203
- - milestone-audit `audit-report.json`(含 dimension challenges + 3-vote verdict)
204
-
205
- 4. **RunId 提示**:显示 `Resume: /maestro-swarm-workflow --resume {runId}` 用于增量重跑
206
-
207
- </actions>
208
-
209
- </state_machine>
210
-
211
- <invariants>
212
- 1. **只做并行加速,不做状态决策** 不修改 ralph status.json,不推进 step
213
- 2. **args 预编译** — 所有 FS 读取在 A_ASSEMBLE_CONTEXT 完成,脚本内 agent 通过工具自行读取补充
214
- 3. **产出格式兼容** — 写入的 artifact 格式必须与对应命令(analyze/brainstorm/review/verify)的产出一致
215
- 4. **resume 透传** — resumeFromRunId 直接透传给 Workflow 工具,利用内置缓存机制
216
- 5. **脚本只读** 路由命令不修改 `~/.maestro/workflows/swarm/wf-*.js` 脚本文件
217
- 6. **结果必须展示** — Workflow 返回后必须向用户展示格式化摘要,不得静默完成
218
- </invariants>
219
-
220
- <appendix>
221
-
222
- ### Ralph 集成
223
-
224
- Ralph 可以在 A_BUILD_STEPS 中将某些 step 的执行方式标记为 `swarm-workflow`:
225
-
226
- ```json
227
- {
228
- "index": 2,
229
- "skill": "maestro-swarm-workflow",
230
- "args": "--script wf-analyze {phase}",
231
- "stage": "analyze",
232
- "command_scope": "project",
233
- "command_path": "<resolved by maestro ralph skills --platform agent>"
234
- }
235
- ```
236
-
237
- ralph-execute 正常通过 `maestro ralph next` 加载并执行,swarm-workflow 内部再调 Workflow 工具。
238
-
239
- ### 输出示例
240
-
241
- ```
242
- ┌─ wf-analyze ──────────────────────────────────────┐
243
- │ Explore [████████████████████] 6/6 dimensions │
244
- │ Synthesize [████████████████] done │
245
- ├────────────────────────────────────────────────────┤
246
- │ Score: 7.2/10 Scope: medium Verdict: go │
247
- │ Findings: 23 total (2 critical, 5 high) │
248
- │ Cross-cutting: 3 themes │
249
- │ Decisions: 4 locked, 2 free, 1 deferred │
250
- ├────────────────────────────────────────────────────┤
251
- │ Output: .workflow/scratch/20260530-swarm-analyze/ │
252
- │ Resume: /maestro-swarm-workflow --resume wf_abc123 │
253
- └────────────────────────────────────────────────────┘
254
- ```
255
-
256
- ### Error Codes
257
-
258
- | Code | Description | Recovery |
259
- |------|-------------|----------|
260
- | E001 | No intent and no --script | Prompt for intent |
261
- | E002 | Ambiguous routing | ask_user |
262
- | E003 | Script file not found | Check .claude/workflows/ |
263
- | E004 | Workflow execution failed | Show error, suggest --resume |
264
- | E005 | Result ingestion failed | Write raw JSON to scratch |
265
-
266
- </appendix>
17
+ <purpose>
18
+ Parallel accelerator: route intent to pre-built Workflow scripts (`wf-*.js`) for multi-agent
19
+ concurrent execution with adversarial decision patterns. Complements ralph's sequential chain.
20
+ </purpose>
21
+
22
+ <context>
23
+ $ARGUMENTS — intent text with optional flags.
24
+
25
+ **Parse:**
26
+ ```
27
+ --script <name> → 强制指定脚本(wf-analyze, wf-brainstorm, wf-review, wf-verify)
28
+ --dims <d1,d2> → 限定分析维度(analyze: architecture,complexity,patterns,risk,testability,performance)
29
+ --roles <r1,r2> → 限定角色(brainstorm: system-architect,product-manager,test-strategist,ux-expert,security-analyst,data-architect)
30
+ --count N 角色数量(brainstorm 默认 3
31
+ --tier <level> review 层级(quick=2 维度, standard=4 维度)
32
+ --resume <runId>从之前的 workflow 运行恢复(增量重跑)
33
+ Remaining intent
34
+ ```
35
+
36
+ **Script inventory** (`~/.maestro/workflows/swarm/`):
37
+
38
+ | Script | args 接口 |
39
+ |--------|-----------|
40
+ | `wf-analyze` | `{ target, scope, context, phase?, dimensions? }` |
41
+ | `wf-brainstorm` | `{ topic, context, count?, roles? }` |
42
+ | `wf-review` | `{ target, scope, specs?, tier?, dimensions? }` |
43
+ | `wf-verify` | `{ goals, plan_dir?, scope?, task_files?, must_haves?, skip_antipattern? }` |
44
+ | `wf-grill` | `{ topic, context?, depth?: "shallow"\|"standard"\|"deep" }` |
45
+ | `wf-plan` | `{ context_dir?, from?, phase?, scope?, specs?, gaps?, quick? }` |
46
+ | `wf-execute` | `{ plan_dir, specs?, codebase_context?, wiki_context?, auto_commit? }` |
47
+ | `wf-milestone-audit` | `{ milestone?, is_adhoc? }` |
48
+ </context>
49
+
50
+ <state_machine>
51
+
52
+ <states>
53
+ S_PARSE — 解析参数和意图 PERSIST:
54
+ S_ROUTE 路由到目标脚本 PERSIST: —
55
+ S_CONTEXT — 组装 context payload PERSIST: —
56
+ S_DISPATCH — 调用 Workflow 工具 PERSIST: —
57
+ S_INGEST — 处理返回结果 PERSIST:
58
+ S_FALLBACK — 无法路由 PERSIST: —
59
+ </states>
60
+
61
+ <transitions>
62
+
63
+ S_PARSE:
64
+ S_ROUTE WHEN: intent parsed DO: A_PARSE_ARGS
65
+ S_FALLBACK WHEN: no intent
66
+
67
+ S_ROUTE:
68
+ S_CONTEXT WHEN: script resolved DO: A_ROUTE_SCRIPT
69
+ → S_FALLBACK WHEN: ambiguous intent DO: ask_user
70
+
71
+ S_CONTEXT:
72
+ → S_DISPATCH DO: A_ASSEMBLE_CONTEXT
73
+
74
+ S_DISPATCH:
75
+ S_INGEST WHEN: workflow completed DO: A_DISPATCH_WORKFLOW
76
+ S_FALLBACK WHEN: workflow failed
77
+
78
+ S_INGEST:
79
+ END DO: A_INGEST_RESULTS
80
+
81
+ S_FALLBACK:
82
+ → S_PARSE WHEN: user provides input
83
+ → END WHEN: user cancels
84
+
85
+ </transitions>
86
+
87
+ <actions>
88
+
89
+ ### A_PARSE_ARGS
90
+
91
+ 1. 提取 flags(--script, --dims, --roles, --count, --tier, --resume)
92
+ 2. 剩余文本作为 intent
93
+ 3. 若有 --resume,记录 resumeRunId
94
+
95
+ ### A_ROUTE_SCRIPT
96
+
97
+ Intent-to-script routing(按关键词匹配,--script 优先级最高):
98
+
99
+ | Keywords | Script |
100
+ |----------|--------|
101
+ | 分析 / analyze / 探索 / explore / 架构 / architecture / 复杂度 / 风险 | `wf-analyze` |
102
+ | 头脑风暴 / brainstorm / 方案 / 设计 / 评估 / evaluate / 多角度 | `wf-brainstorm` |
103
+ | 审查 / review / 代码审查 / code review / 质量 / quality | `wf-review` |
104
+ | 验证 / verify / 检查 / check / 反模式 / antipattern | `wf-verify` |
105
+ | 拷问 / grill / 压力测试 / stress-test / 挑战 / challenge | `wf-grill` |
106
+ | 规划 / plan / 任务分解 / decompose / 分波 / wave | `wf-plan` |
107
+ | 执行 / execute / 实现 / implement / 开发 / develop | `wf-execute` |
108
+ | 里程碑审计 / milestone-audit / 集成检查 / integration | `wf-milestone-audit` |
109
+
110
+ 多命中 → ask_user 让用户选择。
111
+
112
+ ### A_ASSEMBLE_CONTEXT
113
+
114
+ 根据目标脚本组装 args payload:
115
+
116
+ **wf-analyze:**
117
+ 1. Read `.workflow/state.json` 获取当前 phase/milestone 信息
118
+ 2. `target` = intent 中的目标描述
119
+ 3. `scope` = 从 intent 推断文件范围,或读 roadmap 获取 phase scope
120
+ 4. `context` = 拼接相关上下文(上游 artifact 摘要、specs)
121
+ 5. `dimensions` = --dims 解析结果(可选)
122
+
123
+ **wf-brainstorm:**
124
+ 1. `topic` = intent 文本
125
+ 2. `context` = 读取相关代码文件摘要 + 已有 specs
126
+ 3. `count` = --count 或默认 3
127
+ 4. `roles` = --roles 解析结果(可选)
128
+
129
+ **wf-review:**
130
+ 1. `target` = 读 git diff 描述变更范围
131
+ 2. `scope` = 变更文件列表
132
+ 3. `tier` = --tier 或 "standard"
133
+ 4. `dimensions` = --dims 解析结果(可选)
134
+
135
+ **wf-verify:**
136
+ 1. `goals` = 读最近的 plan artifact 提取目标列表
137
+ 2. `plan_dir` = 定位最近的 plan scratch 目录
138
+ 3. `scope` = plan 涉及的文件范围
139
+ 4. `skip_tests` / `skip_antipattern` = flags 提取
140
+
141
+ ### A_DISPATCH_WORKFLOW
142
+
143
+ 1. 确定 scriptPath = `~/.maestro/workflows/swarm/{script}.js`(展开为绝对路径)
144
+ 2. 构建 Workflow 调用:
145
+ ```
146
+ Workflow({
147
+ scriptPath: absoluteScriptPath,
148
+ args: assembledArgs,
149
+ resumeFromRunId: resumeRunId // 若有
150
+ })
151
+ ```
152
+ 3. 等待 Workflow 返回结果
153
+ 4. 记录 runId 用于潜在的后续 resume
154
+
155
+ ### A_INGEST_RESULTS
156
+
157
+ Workflow 返回 JSON 后:
158
+
159
+ 1. **摘要输出**:按脚本类型格式化关键指标(含对抗决策结果)
160
+ - analyze: overall_score, scope_verdict, adversarial_outcome (go/no-go/conditional advocacy + referee), scores_challenged count
161
+ - brainstorm: role count, conflict/synergy count, 3-proposal competition result, arbitration notes
162
+ - review: verdict (APPROVE/REQUEST_CHANGES/BLOCK), 3-vote tally, confirmed vs false-positive count, adversarial_verdict
163
+ - verify: overall_status, prosecutor vs defender confidence, adversarial_outcome, gap count
164
+ - grill: overall_verdict, meta-skeptic quality rating, 3-vote verdict tally, overblown findings count
165
+ - plan: selected_strategy (breadth/depth/risk), judge panel scores, 3-critic adversarial check verdict
166
+ - execute: 3-vote status (DONE/DONE_WITH_CONCERNS/NEEDS_RETRY), convergence trust %, discrepancy count
167
+ - milestone-audit: 3-vote verdict, dimensions_overturned count, next_step
168
+
169
+ 2. **Artifact 写入**(可选):
170
+ - 若当前在 ralph session 中(检测 `.workflow/.maestro/ralph-*/status.json` 状态为 running):
171
+ 将结果写入对应 step 的 scratch 目录,格式兼容命令产出
172
+ - 否则写入 `.workflow/scratch/{YYYYMMDD}-swarm-{script}-{slug}/results.json`
173
+
174
+ 3. **Ralph 兼容产出**:
175
+ - analyze → `analysis.md` + `context.md`(decisions)+ `conclusions.json` + `adversarial-debate.json`
176
+ - brainstorm → `guidance-specification.md` + `proposals-competition.json`
177
+ - review → `review.json`(含 adversarial_verdict + 3-vote tally)
178
+ - verify `verification.json`(含 adversarial_outcome: prosecutor/defender debate)
179
+ - grill → `grill-results.json`(含 meta-challenge + 3-vote verdict)
180
+ - plan → `plan.json`(含 competition scores + critic feedback)
181
+ - execute `execution-report.json`(含 convergence_checks + 3-vote status)
182
+ - milestone-audit `audit-report.json`(含 dimension challenges + 3-vote verdict)
183
+
184
+ 4. **RunId 提示**:显示 `Resume: /maestro-swarm-workflow --resume {runId}` 用于增量重跑
185
+
186
+ </actions>
187
+
188
+ </state_machine>
189
+
190
+ <invariants>
191
+ 1. **只做并行加速,不做状态决策** 不修改 ralph status.json,不推进 step
192
+ 2. **args 预编译** 所有 FS 读取在 A_ASSEMBLE_CONTEXT 完成,脚本内 agent 通过工具自行读取补充
193
+ 3. **产出格式兼容** — 写入的 artifact 格式必须与对应命令(analyze/brainstorm/review/verify)的产出一致
194
+ 4. **resume 透传** — resumeFromRunId 直接透传给 Workflow 工具,利用内置缓存机制
195
+ 5. **脚本只读** — 路由命令不修改 `~/.maestro/workflows/swarm/wf-*.js` 脚本文件
196
+ 6. **结果必须展示** Workflow 返回后必须向用户展示格式化摘要,不得静默完成
197
+ </invariants>
198
+
199
+ <appendix>
200
+
201
+ ### Ralph 集成
202
+
203
+ Ralph 可以在 A_BUILD_STEPS 中将某些 step 的执行方式标记为 `swarm-workflow`:
204
+
205
+ ```json
206
+ {
207
+ "index": 2,
208
+ "skill": "maestro-swarm-workflow",
209
+ "args": "--script wf-analyze {phase}",
210
+ "stage": "analyze",
211
+ "command_scope": "project",
212
+ "command_path": "<resolved by maestro ralph skills --platform agent>"
213
+ }
214
+ ```
215
+
216
+ ralph-execute 正常通过 `maestro ralph next` 加载并执行,swarm-workflow 内部再调 Workflow 工具。
217
+
218
+ ### 输出示例
219
+
220
+ ```
221
+ ┌─ wf-analyze ──────────────────────────────────────┐
222
+ │ Explore [████████████████████] 6/6 dimensions │
223
+ │ Synthesize [████████████████] done │
224
+ ├────────────────────────────────────────────────────┤
225
+ │ Score: 7.2/10 Scope: medium Verdict: go │
226
+ │ Findings: 23 total (2 critical, 5 high) │
227
+ │ Cross-cutting: 3 themes │
228
+ Decisions: 4 locked, 2 free, 1 deferred │
229
+ ├────────────────────────────────────────────────────┤
230
+ Output: .workflow/scratch/20260530-swarm-analyze/ │
231
+ Resume: /maestro-swarm-workflow --resume wf_abc123 │
232
+ └────────────────────────────────────────────────────┘
233
+ ```
234
+
235
+ ### Error Codes
236
+
237
+ | Code | Description | Recovery |
238
+ |------|-------------|----------|
239
+ | E001 | No intent and no --script | Prompt for intent |
240
+ | E002 | Ambiguous routing | ask_user |
241
+ | E003 | Script file not found | Check .claude/workflows/ |
242
+ | E004 | Workflow execution failed | Show error, suggest --resume |
243
+ | E005 | Result ingestion failed | Write raw JSON to scratch |
244
+
245
+ </appendix>