maestro-flow 0.4.19 → 0.4.21
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.
- package/.agents/agents/workflow-collab-planner.md +4 -1
- package/.agents/agents/workflow-plan-checker.md +11 -1
- package/.agents/agents/workflow-planner.md +4 -1
- package/.agents/skills/maestro/SKILL.md +8 -5
- package/.agents/skills/maestro-analyze/SKILL.md +1 -1
- package/.agents/skills/maestro-brainstorm/SKILL.md +2 -1
- package/.agents/skills/maestro-companion/SKILL.md +533 -0
- package/.agents/skills/maestro-grill/SKILL.md +116 -0
- package/.agents/skills/maestro-plan/SKILL.md +4 -0
- package/.agents/skills/maestro-ralph/SKILL.md +11 -7
- package/.agents/skills/maestro-ralph-execute/SKILL.md +2 -1
- package/.agents/skills/maestro-swarm-workflow/SKILL.md +266 -0
- package/.agents/skills/maestro-universal-workflow/SKILL.md +563 -0
- package/.agents/skills/manage-codebase-rebuild/SKILL.md +13 -1
- package/.agents/skills/manage-codebase-refresh/SKILL.md +3 -0
- package/.agents/skills/spec-setup/SKILL.md +9 -5
- package/.agents/skills/team-adversarial-swarm/SKILL.md +235 -0
- package/.agents/skills/team-adversarial-swarm/scripts/aco.py +473 -0
- package/.agents/skills/team-adversarial-swarm/scripts/pheromone.py +144 -0
- package/.agents/skills/team-adversarial-swarm/scripts/scoring.py +92 -0
- package/.agents/skills/team-adversarial-swarm/scripts/test_aco.py +475 -0
- package/.agents/skills/team-adversarial-swarm/specs/ant-output-schema.md +115 -0
- package/.agents/skills/team-adversarial-swarm/specs/convergence-criteria.md +75 -0
- package/.agents/skills/team-adversarial-swarm/specs/pheromone-schema.md +90 -0
- package/.agents/skills/team-adversarial-swarm/specs/swarm-config-template.json +66 -0
- package/.agents/skills/team-adversarial-swarm/specs/swarm-protocol.md +105 -0
- package/.agents/skills/team-adversarial-swarm/workflows/wf-swarm-converge.js +197 -0
- package/.agents/skills/team-adversarial-swarm/workflows/wf-swarm-explore.js +194 -0
- package/.agents/skills/team-adversarial-swarm/workflows/wf-swarm-score.js +188 -0
- package/.agents/skills/team-adversarial-swarm/workflows/wf-swarm-synthesize.js +248 -0
- package/.agy/agents/workflow-collab-planner.md +4 -1
- package/.agy/agents/workflow-plan-checker.md +11 -1
- package/.agy/agents/workflow-planner.md +4 -1
- package/.agy/skills/maestro/SKILL.md +8 -5
- package/.agy/skills/maestro-analyze/SKILL.md +1 -1
- package/.agy/skills/maestro-brainstorm/SKILL.md +2 -1
- package/.agy/skills/maestro-companion/SKILL.md +529 -0
- package/.agy/skills/maestro-grill/SKILL.md +116 -0
- package/.agy/skills/maestro-plan/SKILL.md +4 -0
- package/.agy/skills/maestro-ralph/SKILL.md +11 -7
- package/.agy/skills/maestro-ralph-execute/SKILL.md +2 -1
- package/.agy/skills/maestro-swarm-workflow/SKILL.md +263 -0
- package/.agy/skills/maestro-universal-workflow/SKILL.md +560 -0
- package/.agy/skills/manage-codebase-rebuild/SKILL.md +13 -1
- package/.agy/skills/manage-codebase-refresh/SKILL.md +3 -0
- package/.agy/skills/spec-setup/SKILL.md +9 -5
- package/.agy/skills/team-adversarial-swarm/SKILL.md +244 -0
- package/.agy/skills/team-adversarial-swarm/scripts/aco.py +473 -0
- package/.agy/skills/team-adversarial-swarm/scripts/pheromone.py +144 -0
- package/.agy/skills/team-adversarial-swarm/scripts/scoring.py +92 -0
- package/.agy/skills/team-adversarial-swarm/scripts/test_aco.py +475 -0
- package/.agy/skills/team-adversarial-swarm/specs/ant-output-schema.md +115 -0
- package/.agy/skills/team-adversarial-swarm/specs/convergence-criteria.md +75 -0
- package/.agy/skills/team-adversarial-swarm/specs/pheromone-schema.md +90 -0
- package/.agy/skills/team-adversarial-swarm/specs/swarm-config-template.json +66 -0
- package/.agy/skills/team-adversarial-swarm/specs/swarm-protocol.md +105 -0
- package/.agy/skills/team-adversarial-swarm/workflows/wf-swarm-converge.js +197 -0
- package/.agy/skills/team-adversarial-swarm/workflows/wf-swarm-explore.js +194 -0
- package/.agy/skills/team-adversarial-swarm/workflows/wf-swarm-score.js +188 -0
- package/.agy/skills/team-adversarial-swarm/workflows/wf-swarm-synthesize.js +248 -0
- package/.claude/agents/workflow-collab-planner.md +4 -1
- package/.claude/agents/workflow-plan-checker.md +11 -1
- package/.claude/agents/workflow-planner.md +4 -1
- package/.claude/commands/maestro-analyze.md +1 -1
- package/.claude/commands/maestro-brainstorm.md +2 -1
- package/.claude/commands/maestro-companion.md +531 -0
- package/.claude/commands/maestro-grill.md +114 -0
- package/.claude/commands/maestro-plan.md +4 -0
- package/.claude/commands/maestro-ralph-execute.md +2 -1
- package/.claude/commands/maestro-ralph.md +11 -7
- package/.claude/commands/maestro-swarm-workflow.md +264 -0
- package/.claude/commands/maestro-universal-workflow.md +561 -0
- package/.claude/commands/maestro.md +8 -5
- package/.claude/commands/manage-codebase-rebuild.md +13 -1
- package/.claude/commands/manage-codebase-refresh.md +3 -0
- package/.claude/commands/spec-setup.md +9 -5
- package/.claude/skills/team-adversarial-swarm/SKILL.md +233 -0
- package/.claude/skills/team-adversarial-swarm/scripts/aco.py +473 -0
- package/.claude/skills/team-adversarial-swarm/scripts/pheromone.py +144 -0
- package/.claude/skills/team-adversarial-swarm/scripts/scoring.py +92 -0
- package/.claude/skills/team-adversarial-swarm/scripts/test_aco.py +475 -0
- package/.claude/skills/team-adversarial-swarm/specs/ant-output-schema.md +115 -0
- package/.claude/skills/team-adversarial-swarm/specs/convergence-criteria.md +75 -0
- package/.claude/skills/team-adversarial-swarm/specs/pheromone-schema.md +90 -0
- package/.claude/skills/team-adversarial-swarm/specs/swarm-config-template.json +66 -0
- package/.claude/skills/team-adversarial-swarm/specs/swarm-protocol.md +105 -0
- package/.claude/skills/team-adversarial-swarm/workflows/wf-swarm-converge.js +197 -0
- package/.claude/skills/team-adversarial-swarm/workflows/wf-swarm-explore.js +194 -0
- package/.claude/skills/team-adversarial-swarm/workflows/wf-swarm-score.js +188 -0
- package/.claude/skills/team-adversarial-swarm/workflows/wf-swarm-synthesize.js +248 -0
- package/.codex/skills/maestro/SKILL.md +7 -2
- package/.codex/skills/maestro-companion/SKILL.md +485 -0
- package/.codex/skills/maestro-grill/SKILL.md +111 -0
- package/.codex/skills/maestro-ralph/SKILL.md +11 -7
- package/.codex/skills/manage-codebase-rebuild/SKILL.md +6 -0
- package/.codex/skills/manage-codebase-refresh/SKILL.md +6 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/graph-analysis.d.ts +36 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/graph-analysis.js +138 -2
- package/dashboard/dist-server/dashboard/src/server/wiki/graph-analysis.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/search.js +13 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/search.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.d.ts +11 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js +178 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.d.ts +1 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +39 -23
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
- package/dashboard/dist-server/src/graph/types.d.ts +111 -0
- package/dashboard/dist-server/src/graph/types.js +2 -0
- package/dashboard/dist-server/src/graph/types.js.map +1 -0
- package/dist/src/cli.js +1 -0
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/kg.d.ts +11 -0
- package/dist/src/commands/kg.d.ts.map +1 -0
- package/dist/src/commands/kg.js +486 -0
- package/dist/src/commands/kg.js.map +1 -0
- package/dist/src/graph/analyzers/fs-analyzer.d.ts +10 -0
- package/dist/src/graph/analyzers/fs-analyzer.d.ts.map +1 -0
- package/dist/src/graph/analyzers/fs-analyzer.js +959 -0
- package/dist/src/graph/analyzers/fs-analyzer.js.map +1 -0
- package/dist/src/graph/index.d.ts +6 -0
- package/dist/src/graph/index.d.ts.map +1 -0
- package/dist/src/graph/index.js +6 -0
- package/dist/src/graph/index.js.map +1 -0
- package/dist/src/graph/loader.d.ts +3 -0
- package/dist/src/graph/loader.d.ts.map +1 -0
- package/dist/src/graph/loader.js +12 -0
- package/dist/src/graph/loader.js.map +1 -0
- package/dist/src/graph/merger.d.ts +56 -0
- package/dist/src/graph/merger.d.ts.map +1 -0
- package/dist/src/graph/merger.js +896 -0
- package/dist/src/graph/merger.js.map +1 -0
- package/dist/src/graph/query.d.ts +7 -0
- package/dist/src/graph/query.d.ts.map +1 -0
- package/dist/src/graph/query.js +126 -0
- package/dist/src/graph/query.js.map +1 -0
- package/dist/src/graph/types.d.ts +112 -0
- package/dist/src/graph/types.d.ts.map +1 -0
- package/dist/src/graph/types.js +2 -0
- package/dist/src/graph/types.js.map +1 -0
- package/dist/src/tui/install-ui/KgVendorConfig.d.ts +7 -0
- package/dist/src/tui/install-ui/KgVendorConfig.d.ts.map +1 -0
- package/dist/src/tui/install-ui/KgVendorConfig.js +9 -0
- package/dist/src/tui/install-ui/KgVendorConfig.js.map +1 -0
- package/dist/src/utils/update-notices.js +23 -0
- package/dist/src/utils/update-notices.js.map +1 -1
- package/package.json +1 -1
- package/workflows/analyze.md +2 -1
- package/workflows/brainstorm.md +24 -1
- package/workflows/codebase-rebuild.md +141 -1
- package/workflows/codebase-refresh.md +20 -0
- package/workflows/finish-work.md +7 -2
- package/workflows/grill.md +513 -0
- package/workflows/plan.md +7 -4
- package/workflows/specs-setup.md +99 -3
- package/workflows/swarm/wf-analyze.js +347 -0
- package/workflows/swarm/wf-brainstorm.js +456 -0
- package/workflows/swarm/wf-execute.js +379 -0
- package/workflows/swarm/wf-grill.js +359 -0
- package/workflows/swarm/wf-milestone-audit.js +385 -0
- package/workflows/swarm/wf-plan.js +468 -0
- package/workflows/swarm/wf-review.js +341 -0
- package/workflows/swarm/wf-verify.js +395 -0
|
@@ -73,6 +73,10 @@ If exit code is 1, present warnings and ask whether to proceed.
|
|
|
73
73
|
|
|
74
74
|
Follow '~/.maestro/workflows/plan.md' completely.
|
|
75
75
|
|
|
76
|
+
### P3 Agent Constraint (MANDATORY)
|
|
77
|
+
|
|
78
|
+
Main flow **MUST** spawn a planner agent (Agent tool) for P3 planning — inline planning by main flow is FORBIDDEN. The agent produces both `plan.json` and `.task/TASK-*.json` files. Main flow only passes context and validates output.
|
|
79
|
+
|
|
76
80
|
### Codebase Docs Loading (P1 addition)
|
|
77
81
|
|
|
78
82
|
During P1 Context Collection, after loading context files, load codebase documentation if available:
|
|
@@ -52,6 +52,7 @@ HARD RULES:
|
|
|
52
52
|
6. **Self-invocation chain** — 持续直到全部 `completion_confirmed` 或 paused
|
|
53
53
|
7. **status.json 每步骤后由 CLI 原子写盘** — resume-safe
|
|
54
54
|
8. **STATUS 枚举受限** — 仅 `DONE | DONE_WITH_CONCERNS | NEEDS_RETRY | BLOCKED`;`NEEDS_CONTEXT` 已废除
|
|
55
|
+
9. **CLI 输出禁止截断** — `maestro ralph next` 的 stdout 包含完整 skill prompt,必须全量捕获。**严禁** `| head`、`| tail`、`2>&1 | head -N` 等任何截断管道。Bash timeout 可加长但不可截断输出
|
|
55
56
|
</invariants>
|
|
56
57
|
|
|
57
58
|
<state_machine>
|
|
@@ -155,7 +156,7 @@ Write enriched args back to status.json.
|
|
|
155
156
|
|
|
156
157
|
### A_EXEC_STEP
|
|
157
158
|
|
|
158
|
-
1. **Load** — `Bash("maestro ralph next")`
|
|
159
|
+
1. **Load** — `Bash("maestro ralph next --session <session_id>")` — **必须全量捕获 stdout,严禁 `| head`/`| tail` 等截断管道**(stdout 含完整 skill prompt,截断会导致执行内容不完整)
|
|
159
160
|
- 退出码 0 → 按 stdout 内联执行
|
|
160
161
|
- 退出码 2 → 交给 S_LOCATE
|
|
161
162
|
- 退出码 3 → active_step_index 已被占用
|
|
@@ -129,20 +129,20 @@ S_INFER:
|
|
|
129
129
|
|
|
130
130
|
S_RESOLVE_SCOPE:
|
|
131
131
|
→ S_QUALITY_MODE DO: A_RESOLVE_SCOPE_VERDICT
|
|
132
|
-
GUARD: position ∈ {brainstorm, blueprint, init} → skip (scope_verdict = null)
|
|
132
|
+
GUARD: position ∈ {grill, brainstorm, blueprint, init} → skip (scope_verdict = null)
|
|
133
133
|
|
|
134
134
|
S_QUALITY_MODE:
|
|
135
135
|
→ S_PLANNING_MODE DO: A_DETERMINE_QUALITY_MODE
|
|
136
136
|
|
|
137
137
|
S_PLANNING_MODE:
|
|
138
138
|
→ S_DECOMPOSE DO: A_DETERMINE_PLANNING_MODE
|
|
139
|
-
GUARD: lifecycle_position ∈ {brainstorm, blueprint, init, analyze-macro, roadmap} → skip (force independent)
|
|
139
|
+
GUARD: lifecycle_position ∈ {grill, brainstorm, blueprint, init, analyze-macro, roadmap} → skip (force independent)
|
|
140
140
|
|
|
141
141
|
S_DECOMPOSE:
|
|
142
142
|
→ S_BUILD_CHAIN DO: A_DECOMPOSE_TASKS
|
|
143
143
|
GUARD: broad intent → MUST clarify boundary even if auto_confirm
|
|
144
144
|
GUARD: narrow intent → auto-derive, skip questions
|
|
145
|
-
GUARD: position ∈ {brainstorm, blueprint, init} → skip decomposition
|
|
145
|
+
GUARD: position ∈ {grill, brainstorm, blueprint, init} → skip decomposition
|
|
146
146
|
|
|
147
147
|
S_BUILD_CHAIN:
|
|
148
148
|
→ S_CREATE_SESSION DO: A_BUILD_STEPS
|
|
@@ -242,6 +242,7 @@ resolve_milestone(phase_number):
|
|
|
242
242
|
|
|
243
243
|
| Pattern | Position |
|
|
244
244
|
|---------|----------|
|
|
245
|
+
| 压力测试 / 拷问 / 验证假设 / grill / stress-test | `grill`(**auto_confirm=true 时跳过,直接 `brainstorm`**) |
|
|
245
246
|
| brainstorm / 头脑风暴 / 探索 / ideate / 设计思路 | `brainstorm` |
|
|
246
247
|
| blueprint / 规格 / 正式文档 / spec-generate / 7-phase | `blueprint` |
|
|
247
248
|
| broad/medium intent 无数字 phase (重构/全面/重写/迁移/新功能 X) | `analyze-macro` |
|
|
@@ -262,7 +263,7 @@ resolve_milestone(phase_number):
|
|
|
262
263
|
| `phase_is_new == true` (新 phase) | `analyze` |
|
|
263
264
|
| no milestones AND no roadmap.md AND has analyze macro artifact | `roadmap` |
|
|
264
265
|
| no milestones AND no roadmap.md AND no analyze artifact | `analyze-macro` |
|
|
265
|
-
| `phase == null` (brainstorm/blueprint/init/roadmap/analyze-macro override 已定) | n/a |
|
|
266
|
+
| `phase == null` (grill/brainstorm/blueprint/init/roadmap/analyze-macro override 已定) | n/a |
|
|
266
267
|
| phase 已存在 + 无任何 artifact | `analyze` |
|
|
267
268
|
| phase 已存在 + 最新 artifact = analyze | `plan` |
|
|
268
269
|
| phase 已存在 + 最新 artifact = plan | `execute` |
|
|
@@ -317,7 +318,7 @@ resolve_milestone(phase_number):
|
|
|
317
318
|
|
|
318
319
|
| Condition | Mode | Reason |
|
|
319
320
|
|-----------|------|--------|
|
|
320
|
-
| lifecycle_position ∈ {brainstorm, init, roadmap} | `independent` | 前期阶段不涉及多 phase 规划 |
|
|
321
|
+
| lifecycle_position ∈ {grill, brainstorm, init, roadmap} | `independent` | 前期阶段不涉及多 phase 规划 |
|
|
321
322
|
| `phase_is_new == true` | `independent` | 新 phase 尚无里程碑上下文 |
|
|
322
323
|
| intent 显式指定 phase 编号(如 "phase 2"、"P3") | `independent` | 用户明确针对单个 phase |
|
|
323
324
|
| milestone 仅含 1 个 phase(读 state.json) | `independent` | 统一无意义 |
|
|
@@ -380,7 +381,8 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`.
|
|
|
380
381
|
|
|
381
382
|
| Stage | Skill (independent) | Skill (unified) | Decision after | quality_mode |
|
|
382
383
|
|-------|---------------------|-----------------|----------------|--------------|
|
|
383
|
-
|
|
|
384
|
+
| grill | `maestro-grill "{intent}"` | *(same)* | — | all (**skip when auto_confirm**) |
|
|
385
|
+
| brainstorm | `maestro-brainstorm "{intent}" --from grill:{grill_id}` *(if grill ran)* / `maestro-brainstorm "{intent}"` *(otherwise)* | *(same)* | — | all |
|
|
384
386
|
| blueprint | `maestro-blueprint "{intent}"` | *(same)* | — | all |
|
|
385
387
|
| init | `maestro-init` | *(same)* | — | all |
|
|
386
388
|
| analyze-macro | `maestro-analyze "{intent}"` | *(same)* | `post-analyze-scope` | all |
|
|
@@ -405,6 +407,7 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`.
|
|
|
405
407
|
1. **起点**:从 `session.lifecycle_position` 开始
|
|
406
408
|
2. **跳过已完成**:跳过当前 milestone+phase 下已有 completed artifact 的 stage(按 `session.phase` 过滤);unified 按 milestone 过滤
|
|
407
409
|
3. **quality_mode 过滤**:按 `session.quality_mode` 排除不匹配 stage
|
|
410
|
+
3.5. **grill auto_confirm 跳过**:`auto_confirm == true` 时删除 `grill` stage(grill 为交互式苏格拉底拷问,不支持自动模式);brainstorm args 不含 `--from grill:*`
|
|
408
411
|
4. **决策节点**:每个 Decision after 非空的 stage 之后插入 `{ decision: "<gate>", retry_count: 0, max_retries: 2, command_scope: null, command_path: null }`
|
|
409
412
|
5. **goal-audit 插入**:`task_decomposition` 存在时,在最后一个 evidence-producing stage(verify/review/test)之后、`milestone-complete` 之前插入 `decision:post-goal-audit`
|
|
410
413
|
6. **终点硬约束**:chain 以 `milestone-complete` 结尾
|
|
@@ -741,7 +744,8 @@ decision:post-goal-audit {retry+1}
|
|
|
741
744
|
- [ ] Phase 先于 position 解析;phase_is_new 标记写入 session
|
|
742
745
|
- [ ] D-007 反查:phase 数字 → `session.milestone`,禁止读 current_milestone;写入 step.milestone_id
|
|
743
746
|
- [ ] phase_is_new=true → lifecycle_position 强制 `analyze`
|
|
744
|
-
- [ ] Intent overrides 识别 brainstorm / blueprint / analyze-macro
|
|
747
|
+
- [ ] Intent overrides 识别 grill / brainstorm / blueprint / analyze-macro
|
|
748
|
+
- [ ] auto_confirm=true 时 grill stage 跳过(交互式拷问不支持自动模式)
|
|
745
749
|
- [ ] A_RESOLVE_SCOPE_VERDICT 读 macro analyze conclusions.scope_verdict,写入 session.scope_verdict + analyze_macro_id
|
|
746
750
|
- [ ] 链路起点 = analyze-macro 时:large→roadmap+analyze+plan(phase);medium/small→直跳 plan --from analyze:{ANL_ID}(跳过 roadmap+analyze)
|
|
747
751
|
- [ ] post-analyze-scope decision 节点在 macro analyze 之后插入;A_SCOPE_EVALUATE/A_APPLY_SCOPE_VERDICT 重塑链路
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maestro-swarm-workflow
|
|
3
|
+
description: Parallel workflow accelerator — route intent to fixed Workflow scripts for multi-agent concurrent execution
|
|
4
|
+
argument-hint: "<intent> [--script <name>] [--dims <d1,d2>] [--roles <r1,r2>] [--count N] [--tier quick|standard] [--resume <runId>]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Bash
|
|
10
|
+
- Glob
|
|
11
|
+
- Grep
|
|
12
|
+
- Workflow
|
|
13
|
+
- AskUserQuestion
|
|
14
|
+
---
|
|
15
|
+
<purpose>
|
|
16
|
+
Parallel accelerator layer for maestro commands. Routes user intent to pre-built Workflow scripts
|
|
17
|
+
that leverage `parallel()` / `pipeline()` for multi-agent concurrent execution.
|
|
18
|
+
|
|
19
|
+
Complements maestro-ralph (sequential decision chain) — ralph manages state + decisions,
|
|
20
|
+
swarm-workflow provides parallel compute bursts within individual steps.
|
|
21
|
+
|
|
22
|
+
Scripts: `~/.maestro/workflows/swarm/wf-*.js`
|
|
23
|
+
|
|
24
|
+
| Script | Accelerates | Adversarial Pattern |
|
|
25
|
+
|--------|-------------|---------------------|
|
|
26
|
+
| `wf-analyze` | maestro-analyze | explore → 6-dim scoring → **skeptic cross-verify** → **3-way advocacy (go/no-go/conditional) + referee** |
|
|
27
|
+
| `wf-brainstorm` | maestro-brainstorm | multi-role analysis → **3-specialist cross-review** → **3-proposal competition** → **arbitrator** |
|
|
28
|
+
| `wf-review` | quality-review | 6-dim scan → **3-vote adversarial verify (prosecutor/defense/judge)** → **3-perspective report + arbitrated verdict** |
|
|
29
|
+
| `wf-verify` | maestro-verify | 3-layer + antipattern + convergence → **prosecutor vs defender debate** → **judge verdict** |
|
|
30
|
+
| `wf-grill` | maestro-grill | explore → parallel branch stress → **meta-skeptic challenge** → **3-vote verdict (optimist/pessimist/realist)** |
|
|
31
|
+
| `wf-plan` | maestro-plan | parallel context → **3-strategy competing proposals** → **judge panel scoring** → **3-critic adversarial check** |
|
|
32
|
+
| `wf-execute` | maestro-execute | wave-based parallel execution → **adversarial convergence spot-check** → **3-vote status determination** |
|
|
33
|
+
| `wf-milestone-audit` | maestro-milestone-audit | parallel 3-dim audit → **adversarial dimension challenge** → **3-vote verdict (strict/lenient/objective)** |
|
|
34
|
+
|
|
35
|
+
Integration modes:
|
|
36
|
+
- **Standalone**: `/maestro-swarm-workflow "analyze auth module"` — direct invocation
|
|
37
|
+
- **Ralph step**: ralph chain 中某个 step 可指定 `swarm-workflow` 作为加速执行器
|
|
38
|
+
- **Chained**: 输出 JSON 可被下游命令通过 `--from` 消费
|
|
39
|
+
</purpose>
|
|
40
|
+
|
|
41
|
+
<context>
|
|
42
|
+
$ARGUMENTS — intent text with optional flags.
|
|
43
|
+
|
|
44
|
+
**Parse:**
|
|
45
|
+
```
|
|
46
|
+
--script <name> → 强制指定脚本(wf-analyze, wf-brainstorm, wf-review, wf-verify)
|
|
47
|
+
--dims <d1,d2> → 限定分析维度(analyze: architecture,complexity,patterns,risk,testability,performance)
|
|
48
|
+
--roles <r1,r2> → 限定角色(brainstorm: system-architect,product-manager,test-strategist,ux-expert,security-analyst,data-architect)
|
|
49
|
+
--count N → 角色数量(brainstorm 默认 3)
|
|
50
|
+
--tier <level> → review 层级(quick=2 维度, standard=4 维度)
|
|
51
|
+
--resume <runId> → 从之前的 workflow 运行恢复(增量重跑)
|
|
52
|
+
Remaining → intent
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Script inventory** (`~/.maestro/workflows/swarm/`):
|
|
56
|
+
|
|
57
|
+
| Script | args 接口 |
|
|
58
|
+
|--------|-----------|
|
|
59
|
+
| `wf-analyze` | `{ target, scope, context, phase?, dimensions? }` |
|
|
60
|
+
| `wf-brainstorm` | `{ topic, context, count?, roles? }` |
|
|
61
|
+
| `wf-review` | `{ target, scope, specs?, tier?, dimensions? }` |
|
|
62
|
+
| `wf-verify` | `{ goals, plan_dir?, scope?, task_files?, must_haves?, skip_antipattern? }` |
|
|
63
|
+
| `wf-grill` | `{ topic, context?, depth?: "shallow"\|"standard"\|"deep" }` |
|
|
64
|
+
| `wf-plan` | `{ context_dir?, from?, phase?, scope?, specs?, gaps?, quick? }` |
|
|
65
|
+
| `wf-execute` | `{ plan_dir, specs?, codebase_context?, wiki_context?, auto_commit? }` |
|
|
66
|
+
| `wf-milestone-audit` | `{ milestone?, is_adhoc? }` |
|
|
67
|
+
</context>
|
|
68
|
+
|
|
69
|
+
<state_machine>
|
|
70
|
+
|
|
71
|
+
<states>
|
|
72
|
+
S_PARSE — 解析参数和意图 PERSIST: —
|
|
73
|
+
S_ROUTE — 路由到目标脚本 PERSIST: —
|
|
74
|
+
S_CONTEXT — 组装 context payload PERSIST: —
|
|
75
|
+
S_DISPATCH — 调用 Workflow 工具 PERSIST: —
|
|
76
|
+
S_INGEST — 处理返回结果 PERSIST: —
|
|
77
|
+
S_FALLBACK — 无法路由 PERSIST: —
|
|
78
|
+
</states>
|
|
79
|
+
|
|
80
|
+
<transitions>
|
|
81
|
+
|
|
82
|
+
S_PARSE:
|
|
83
|
+
→ S_ROUTE WHEN: intent parsed DO: A_PARSE_ARGS
|
|
84
|
+
→ S_FALLBACK WHEN: no intent
|
|
85
|
+
|
|
86
|
+
S_ROUTE:
|
|
87
|
+
→ S_CONTEXT WHEN: script resolved DO: A_ROUTE_SCRIPT
|
|
88
|
+
→ S_FALLBACK WHEN: ambiguous intent DO: AskUserQuestion
|
|
89
|
+
|
|
90
|
+
S_CONTEXT:
|
|
91
|
+
→ S_DISPATCH DO: A_ASSEMBLE_CONTEXT
|
|
92
|
+
|
|
93
|
+
S_DISPATCH:
|
|
94
|
+
→ S_INGEST WHEN: workflow completed DO: A_DISPATCH_WORKFLOW
|
|
95
|
+
→ S_FALLBACK WHEN: workflow failed
|
|
96
|
+
|
|
97
|
+
S_INGEST:
|
|
98
|
+
→ END DO: A_INGEST_RESULTS
|
|
99
|
+
|
|
100
|
+
S_FALLBACK:
|
|
101
|
+
→ S_PARSE WHEN: user provides input
|
|
102
|
+
→ END WHEN: user cancels
|
|
103
|
+
|
|
104
|
+
</transitions>
|
|
105
|
+
|
|
106
|
+
<actions>
|
|
107
|
+
|
|
108
|
+
### A_PARSE_ARGS
|
|
109
|
+
|
|
110
|
+
1. 提取 flags(--script, --dims, --roles, --count, --tier, --resume)
|
|
111
|
+
2. 剩余文本作为 intent
|
|
112
|
+
3. 若有 --resume,记录 resumeRunId
|
|
113
|
+
|
|
114
|
+
### A_ROUTE_SCRIPT
|
|
115
|
+
|
|
116
|
+
Intent-to-script routing(按关键词匹配,--script 优先级最高):
|
|
117
|
+
|
|
118
|
+
| Keywords | Script |
|
|
119
|
+
|----------|--------|
|
|
120
|
+
| 分析 / analyze / 探索 / explore / 架构 / architecture / 复杂度 / 风险 | `wf-analyze` |
|
|
121
|
+
| 头脑风暴 / brainstorm / 方案 / 设计 / 评估 / evaluate / 多角度 | `wf-brainstorm` |
|
|
122
|
+
| 审查 / review / 代码审查 / code review / 质量 / quality | `wf-review` |
|
|
123
|
+
| 验证 / verify / 检查 / check / 反模式 / antipattern | `wf-verify` |
|
|
124
|
+
| 拷问 / grill / 压力测试 / stress-test / 挑战 / challenge | `wf-grill` |
|
|
125
|
+
| 规划 / plan / 任务分解 / decompose / 分波 / wave | `wf-plan` |
|
|
126
|
+
| 执行 / execute / 实现 / implement / 开发 / develop | `wf-execute` |
|
|
127
|
+
| 里程碑审计 / milestone-audit / 集成检查 / integration | `wf-milestone-audit` |
|
|
128
|
+
|
|
129
|
+
多命中 → AskUserQuestion 让用户选择。
|
|
130
|
+
|
|
131
|
+
### A_ASSEMBLE_CONTEXT
|
|
132
|
+
|
|
133
|
+
根据目标脚本组装 args payload:
|
|
134
|
+
|
|
135
|
+
**wf-analyze:**
|
|
136
|
+
1. Read `.workflow/state.json` 获取当前 phase/milestone 信息
|
|
137
|
+
2. `target` = intent 中的目标描述
|
|
138
|
+
3. `scope` = 从 intent 推断文件范围,或读 roadmap 获取 phase scope
|
|
139
|
+
4. `context` = 拼接相关上下文(上游 artifact 摘要、specs)
|
|
140
|
+
5. `dimensions` = --dims 解析结果(可选)
|
|
141
|
+
|
|
142
|
+
**wf-brainstorm:**
|
|
143
|
+
1. `topic` = intent 文本
|
|
144
|
+
2. `context` = 读取相关代码文件摘要 + 已有 specs
|
|
145
|
+
3. `count` = --count 或默认 3
|
|
146
|
+
4. `roles` = --roles 解析结果(可选)
|
|
147
|
+
|
|
148
|
+
**wf-review:**
|
|
149
|
+
1. `target` = 读 git diff 描述变更范围
|
|
150
|
+
2. `scope` = 变更文件列表
|
|
151
|
+
3. `tier` = --tier 或 "standard"
|
|
152
|
+
4. `dimensions` = --dims 解析结果(可选)
|
|
153
|
+
|
|
154
|
+
**wf-verify:**
|
|
155
|
+
1. `goals` = 读最近的 plan artifact 提取目标列表
|
|
156
|
+
2. `plan_dir` = 定位最近的 plan scratch 目录
|
|
157
|
+
3. `scope` = plan 涉及的文件范围
|
|
158
|
+
4. `skip_tests` / `skip_antipattern` = 从 flags 提取
|
|
159
|
+
|
|
160
|
+
### A_DISPATCH_WORKFLOW
|
|
161
|
+
|
|
162
|
+
1. 确定 scriptPath = `~/.maestro/workflows/swarm/{script}.js`(展开为绝对路径)
|
|
163
|
+
2. 构建 Workflow 调用:
|
|
164
|
+
```
|
|
165
|
+
Workflow({
|
|
166
|
+
scriptPath: absoluteScriptPath,
|
|
167
|
+
args: assembledArgs,
|
|
168
|
+
resumeFromRunId: resumeRunId // 若有
|
|
169
|
+
})
|
|
170
|
+
```
|
|
171
|
+
3. 等待 Workflow 返回结果
|
|
172
|
+
4. 记录 runId 用于潜在的后续 resume
|
|
173
|
+
|
|
174
|
+
### A_INGEST_RESULTS
|
|
175
|
+
|
|
176
|
+
Workflow 返回 JSON 后:
|
|
177
|
+
|
|
178
|
+
1. **摘要输出**:按脚本类型格式化关键指标(含对抗决策结果)
|
|
179
|
+
- analyze: overall_score, scope_verdict, adversarial_outcome (go/no-go/conditional advocacy + referee), scores_challenged count
|
|
180
|
+
- brainstorm: role count, conflict/synergy count, 3-proposal competition result, arbitration notes
|
|
181
|
+
- review: verdict (APPROVE/REQUEST_CHANGES/BLOCK), 3-vote tally, confirmed vs false-positive count, adversarial_verdict
|
|
182
|
+
- verify: overall_status, prosecutor vs defender confidence, adversarial_outcome, gap count
|
|
183
|
+
- grill: overall_verdict, meta-skeptic quality rating, 3-vote verdict tally, overblown findings count
|
|
184
|
+
- plan: selected_strategy (breadth/depth/risk), judge panel scores, 3-critic adversarial check verdict
|
|
185
|
+
- execute: 3-vote status (DONE/DONE_WITH_CONCERNS/NEEDS_RETRY), convergence trust %, discrepancy count
|
|
186
|
+
- milestone-audit: 3-vote verdict, dimensions_overturned count, next_step
|
|
187
|
+
|
|
188
|
+
2. **Artifact 写入**(可选):
|
|
189
|
+
- 若当前在 ralph session 中(检测 `.workflow/.maestro/ralph-*/status.json` 状态为 running):
|
|
190
|
+
将结果写入对应 step 的 scratch 目录,格式兼容命令产出
|
|
191
|
+
- 否则写入 `.workflow/scratch/{YYYYMMDD}-swarm-{script}-{slug}/results.json`
|
|
192
|
+
|
|
193
|
+
3. **Ralph 兼容产出**:
|
|
194
|
+
- analyze → `analysis.md` + `context.md`(decisions)+ `conclusions.json` + `adversarial-debate.json`
|
|
195
|
+
- brainstorm → `guidance-specification.md` + `proposals-competition.json`
|
|
196
|
+
- review → `review.json`(含 adversarial_verdict + 3-vote tally)
|
|
197
|
+
- verify → `verification.json`(含 adversarial_outcome: prosecutor/defender debate)
|
|
198
|
+
- grill → `grill-results.json`(含 meta-challenge + 3-vote verdict)
|
|
199
|
+
- plan → `plan.json`(含 competition scores + critic feedback)
|
|
200
|
+
- execute → `execution-report.json`(含 convergence_checks + 3-vote status)
|
|
201
|
+
- milestone-audit → `audit-report.json`(含 dimension challenges + 3-vote verdict)
|
|
202
|
+
|
|
203
|
+
4. **RunId 提示**:显示 `Resume: /maestro-swarm-workflow --resume {runId}` 用于增量重跑
|
|
204
|
+
|
|
205
|
+
</actions>
|
|
206
|
+
|
|
207
|
+
</state_machine>
|
|
208
|
+
|
|
209
|
+
<invariants>
|
|
210
|
+
1. **只做并行加速,不做状态决策** — 不修改 ralph status.json,不推进 step
|
|
211
|
+
2. **args 预编译** — 所有 FS 读取在 A_ASSEMBLE_CONTEXT 完成,脚本内 agent 通过工具自行读取补充
|
|
212
|
+
3. **产出格式兼容** — 写入的 artifact 格式必须与对应命令(analyze/brainstorm/review/verify)的产出一致
|
|
213
|
+
4. **resume 透传** — resumeFromRunId 直接透传给 Workflow 工具,利用内置缓存机制
|
|
214
|
+
5. **脚本只读** — 路由命令不修改 `~/.maestro/workflows/swarm/wf-*.js` 脚本文件
|
|
215
|
+
6. **结果必须展示** — Workflow 返回后必须向用户展示格式化摘要,不得静默完成
|
|
216
|
+
</invariants>
|
|
217
|
+
|
|
218
|
+
<appendix>
|
|
219
|
+
|
|
220
|
+
### 与 Ralph 集成
|
|
221
|
+
|
|
222
|
+
Ralph 可以在 A_BUILD_STEPS 中将某些 step 的执行方式标记为 `swarm-workflow`:
|
|
223
|
+
|
|
224
|
+
```json
|
|
225
|
+
{
|
|
226
|
+
"index": 2,
|
|
227
|
+
"skill": "maestro-swarm-workflow",
|
|
228
|
+
"args": "--script wf-analyze {phase}",
|
|
229
|
+
"stage": "analyze",
|
|
230
|
+
"command_scope": "project",
|
|
231
|
+
"command_path": "<resolved by maestro ralph skills>"
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
ralph-execute 正常通过 `maestro ralph next` 加载并执行,swarm-workflow 内部再调 Workflow 工具。
|
|
236
|
+
|
|
237
|
+
### 输出示例
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
┌─ wf-analyze ──────────────────────────────────────┐
|
|
241
|
+
│ Explore [████████████████████] 6/6 dimensions │
|
|
242
|
+
│ Synthesize [████████████████] done │
|
|
243
|
+
├────────────────────────────────────────────────────┤
|
|
244
|
+
│ Score: 7.2/10 Scope: medium Verdict: go │
|
|
245
|
+
│ Findings: 23 total (2 critical, 5 high) │
|
|
246
|
+
│ Cross-cutting: 3 themes │
|
|
247
|
+
│ Decisions: 4 locked, 2 free, 1 deferred │
|
|
248
|
+
├────────────────────────────────────────────────────┤
|
|
249
|
+
│ Output: .workflow/scratch/20260530-swarm-analyze/ │
|
|
250
|
+
│ Resume: /maestro-swarm-workflow --resume wf_abc123 │
|
|
251
|
+
└────────────────────────────────────────────────────┘
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Error Codes
|
|
255
|
+
|
|
256
|
+
| Code | Description | Recovery |
|
|
257
|
+
|------|-------------|----------|
|
|
258
|
+
| E001 | No intent and no --script | Prompt for intent |
|
|
259
|
+
| E002 | Ambiguous routing | AskUserQuestion |
|
|
260
|
+
| E003 | Script file not found | Check .claude/workflows/ |
|
|
261
|
+
| E004 | Workflow execution failed | Show error, suggest --resume |
|
|
262
|
+
| E005 | Result ingestion failed | Write raw JSON to scratch |
|
|
263
|
+
|
|
264
|
+
</appendix>
|