swarm-engine 1.1.1 → 1.38.0
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/CLAUDE.md +1 -1
- package/README.md +145 -30
- package/commands/diff-review.md +27 -15
- package/commands/discover.md +102 -0
- package/commands/dynamic.md +136 -0
- package/commands/fix-pr.md +30 -24
- package/commands/postmortem.md +106 -0
- package/commands/red-team.md +41 -26
- package/commands/research.md +22 -1
- package/commands/review-cycle.md +38 -20
- package/commands/spike.md +108 -0
- package/commands/swarm.md +68 -60
- package/commands/tdd.md +44 -24
- package/dist/cli/commands/acp.d.ts.map +1 -1
- package/dist/cli/commands/acp.js +12 -2
- package/dist/cli/commands/acp.js.map +1 -1
- package/dist/cli/commands/agents.d.ts.map +1 -1
- package/dist/cli/commands/agents.js +16 -13
- package/dist/cli/commands/agents.js.map +1 -1
- package/dist/cli/commands/completions.d.ts.map +1 -1
- package/dist/cli/commands/completions.js +21 -9
- package/dist/cli/commands/completions.js.map +1 -1
- package/dist/cli/commands/compound.d.ts.map +1 -1
- package/dist/cli/commands/compound.js +1 -2
- package/dist/cli/commands/compound.js.map +1 -1
- package/dist/cli/commands/configure.d.ts.map +1 -1
- package/dist/cli/commands/configure.js +24 -8
- package/dist/cli/commands/configure.js.map +1 -1
- package/dist/cli/commands/convert.d.ts +1 -1
- package/dist/cli/commands/convert.d.ts.map +1 -1
- package/dist/cli/commands/convert.js +22 -48
- package/dist/cli/commands/convert.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/doctor.js +1 -3
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +17 -7
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +1 -1
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/learn.js +6 -6
- package/dist/cli/commands/learn.js.map +1 -1
- package/dist/cli/commands/mcp.d.ts.map +1 -1
- package/dist/cli/commands/mcp.js +1 -2
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/memory.d.ts.map +1 -1
- package/dist/cli/commands/memory.js +118 -2
- package/dist/cli/commands/memory.js.map +1 -1
- package/dist/cli/commands/orchestrate.d.ts.map +1 -1
- package/dist/cli/commands/orchestrate.js +20 -7
- package/dist/cli/commands/orchestrate.js.map +1 -1
- package/dist/cli/commands/plan.d.ts.map +1 -1
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/plugin.d.ts.map +1 -1
- package/dist/cli/commands/plugin.js +8 -5
- package/dist/cli/commands/plugin.js.map +1 -1
- package/dist/cli/commands/resume.js +1 -1
- package/dist/cli/commands/resume.js.map +1 -1
- package/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +20 -6
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/share.d.ts.map +1 -1
- package/dist/cli/commands/share.js +6 -1
- package/dist/cli/commands/share.js.map +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +15 -7
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/template.d.ts.map +1 -1
- package/dist/cli/commands/template.js +14 -6
- package/dist/cli/commands/template.js.map +1 -1
- package/dist/cli/commands/vault.d.ts.map +1 -1
- package/dist/cli/commands/vault.js +14 -9
- package/dist/cli/commands/vault.js.map +1 -1
- package/dist/cli/commands/verify.d.ts.map +1 -1
- package/dist/cli/commands/verify.js +2 -2
- package/dist/cli/commands/verify.js.map +1 -1
- package/dist/cli/commands/watch.js +1 -1
- package/dist/cli/commands/watch.js.map +1 -1
- package/dist/cli/index.js +14 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/core/checkpoint.js +1 -1
- package/dist/core/checkpoint.js.map +1 -1
- package/dist/core/event-bus.d.ts.map +1 -1
- package/dist/core/event-bus.js +9 -3
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/lifecycle.js.map +1 -1
- package/dist/core/patterns.d.ts.map +1 -1
- package/dist/core/patterns.js +31 -8
- package/dist/core/patterns.js.map +1 -1
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +21 -10
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/registry.d.ts.map +1 -1
- package/dist/core/registry.js +10 -6
- package/dist/core/registry.js.map +1 -1
- package/dist/core/snapshots.d.ts.map +1 -1
- package/dist/core/snapshots.js +17 -5
- package/dist/core/snapshots.js.map +1 -1
- package/dist/core/types.d.ts +33 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.d.ts +114 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +92 -4
- package/dist/index.js.map +1 -1
- package/dist/memory/index.d.ts +38 -0
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +136 -24
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/schema.d.ts +1 -0
- package/dist/memory/schema.d.ts.map +1 -1
- package/dist/memory/schema.js +20 -19
- package/dist/memory/schema.js.map +1 -1
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js.map +1 -1
- package/dist/runtime/acp.d.ts.map +1 -1
- package/dist/runtime/acp.js +71 -41
- package/dist/runtime/acp.js.map +1 -1
- package/dist/runtime/adaptive.d.ts.map +1 -1
- package/dist/runtime/adaptive.js +30 -31
- package/dist/runtime/adaptive.js.map +1 -1
- package/dist/runtime/agent-runner.d.ts +62 -0
- package/dist/runtime/agent-runner.d.ts.map +1 -0
- package/dist/runtime/agent-runner.js +224 -0
- package/dist/runtime/agent-runner.js.map +1 -0
- package/dist/runtime/autonomy.d.ts +1 -0
- package/dist/runtime/autonomy.d.ts.map +1 -1
- package/dist/runtime/autonomy.js +37 -19
- package/dist/runtime/autonomy.js.map +1 -1
- package/dist/runtime/backends/claude.d.ts.map +1 -1
- package/dist/runtime/backends/claude.js +2 -2
- package/dist/runtime/backends/claude.js.map +1 -1
- package/dist/runtime/backends/codex.d.ts.map +1 -1
- package/dist/runtime/backends/codex.js +8 -11
- package/dist/runtime/backends/codex.js.map +1 -1
- package/dist/runtime/backends/gemini.d.ts.map +1 -1
- package/dist/runtime/backends/gemini.js +11 -7
- package/dist/runtime/backends/gemini.js.map +1 -1
- package/dist/runtime/backends/index.js +1 -1
- package/dist/runtime/backends/index.js.map +1 -1
- package/dist/runtime/backends/mock.d.ts.map +1 -1
- package/dist/runtime/backends/mock.js +1 -1
- package/dist/runtime/backends/mock.js.map +1 -1
- package/dist/runtime/backends/vercel-ai.d.ts.map +1 -1
- package/dist/runtime/backends/vercel-ai.js +41 -9
- package/dist/runtime/backends/vercel-ai.js.map +1 -1
- package/dist/runtime/cache-optimizer.d.ts.map +1 -1
- package/dist/runtime/cache-optimizer.js +3 -9
- package/dist/runtime/cache-optimizer.js.map +1 -1
- package/dist/runtime/cascade.d.ts.map +1 -1
- package/dist/runtime/cascade.js +34 -7
- package/dist/runtime/cascade.js.map +1 -1
- package/dist/runtime/chunker.d.ts.map +1 -1
- package/dist/runtime/chunker.js +12 -6
- package/dist/runtime/chunker.js.map +1 -1
- package/dist/runtime/compounder.d.ts +1 -1
- package/dist/runtime/compounder.d.ts.map +1 -1
- package/dist/runtime/compounder.js +30 -11
- package/dist/runtime/compounder.js.map +1 -1
- package/dist/runtime/cost-model.d.ts.map +1 -1
- package/dist/runtime/cost-model.js +1 -1
- package/dist/runtime/cost-model.js.map +1 -1
- package/dist/runtime/database.d.ts +16 -0
- package/dist/runtime/database.d.ts.map +1 -0
- package/dist/runtime/database.js +39 -0
- package/dist/runtime/database.js.map +1 -0
- package/dist/runtime/distiller.d.ts.map +1 -1
- package/dist/runtime/distiller.js +6 -3
- package/dist/runtime/distiller.js.map +1 -1
- package/dist/runtime/engine.d.ts +25 -9
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +417 -378
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/execution-graph.d.ts +86 -0
- package/dist/runtime/execution-graph.d.ts.map +1 -0
- package/dist/runtime/execution-graph.js +441 -0
- package/dist/runtime/execution-graph.js.map +1 -0
- package/dist/runtime/executor.d.ts +1 -2
- package/dist/runtime/executor.d.ts.map +1 -1
- package/dist/runtime/executor.js +45 -14
- package/dist/runtime/executor.js.map +1 -1
- package/dist/runtime/graph-adversarial.d.ts +88 -0
- package/dist/runtime/graph-adversarial.d.ts.map +1 -0
- package/dist/runtime/graph-adversarial.js +378 -0
- package/dist/runtime/graph-adversarial.js.map +1 -0
- package/dist/runtime/graph-analyzer.d.ts +106 -0
- package/dist/runtime/graph-analyzer.d.ts.map +1 -0
- package/dist/runtime/graph-analyzer.js +321 -0
- package/dist/runtime/graph-analyzer.js.map +1 -0
- package/dist/runtime/graph-causal.d.ts +91 -0
- package/dist/runtime/graph-causal.d.ts.map +1 -0
- package/dist/runtime/graph-causal.js +292 -0
- package/dist/runtime/graph-causal.js.map +1 -0
- package/dist/runtime/graph-context-router.d.ts +73 -0
- package/dist/runtime/graph-context-router.d.ts.map +1 -0
- package/dist/runtime/graph-context-router.js +162 -0
- package/dist/runtime/graph-context-router.js.map +1 -0
- package/dist/runtime/graph-discovery.d.ts +71 -0
- package/dist/runtime/graph-discovery.d.ts.map +1 -0
- package/dist/runtime/graph-discovery.js +367 -0
- package/dist/runtime/graph-discovery.js.map +1 -0
- package/dist/runtime/graph-dropout.d.ts +59 -0
- package/dist/runtime/graph-dropout.d.ts.map +1 -0
- package/dist/runtime/graph-dropout.js +196 -0
- package/dist/runtime/graph-dropout.js.map +1 -0
- package/dist/runtime/graph-embeddings.d.ts +58 -0
- package/dist/runtime/graph-embeddings.d.ts.map +1 -0
- package/dist/runtime/graph-embeddings.js +301 -0
- package/dist/runtime/graph-embeddings.js.map +1 -0
- package/dist/runtime/graph-feedback.d.ts +30 -0
- package/dist/runtime/graph-feedback.d.ts.map +1 -0
- package/dist/runtime/graph-feedback.js +82 -0
- package/dist/runtime/graph-feedback.js.map +1 -0
- package/dist/runtime/graph-gnn.d.ts +120 -0
- package/dist/runtime/graph-gnn.d.ts.map +1 -0
- package/dist/runtime/graph-gnn.js +524 -0
- package/dist/runtime/graph-gnn.js.map +1 -0
- package/dist/runtime/graph-learner.d.ts +70 -0
- package/dist/runtime/graph-learner.d.ts.map +1 -0
- package/dist/runtime/graph-learner.js +265 -0
- package/dist/runtime/graph-learner.js.map +1 -0
- package/dist/runtime/graph-meta-adversarial.d.ts +113 -0
- package/dist/runtime/graph-meta-adversarial.d.ts.map +1 -0
- package/dist/runtime/graph-meta-adversarial.js +366 -0
- package/dist/runtime/graph-meta-adversarial.js.map +1 -0
- package/dist/runtime/graph-meta.d.ts +115 -0
- package/dist/runtime/graph-meta.d.ts.map +1 -0
- package/dist/runtime/graph-meta.js +437 -0
- package/dist/runtime/graph-meta.js.map +1 -0
- package/dist/runtime/graph-self-evolve.d.ts +92 -0
- package/dist/runtime/graph-self-evolve.d.ts.map +1 -0
- package/dist/runtime/graph-self-evolve.js +422 -0
- package/dist/runtime/graph-self-evolve.js.map +1 -0
- package/dist/runtime/graph-synthesis.d.ts +47 -0
- package/dist/runtime/graph-synthesis.d.ts.map +1 -0
- package/dist/runtime/graph-synthesis.js +232 -0
- package/dist/runtime/graph-synthesis.js.map +1 -0
- package/dist/runtime/graph-trajectory.d.ts +88 -0
- package/dist/runtime/graph-trajectory.d.ts.map +1 -0
- package/dist/runtime/graph-trajectory.js +339 -0
- package/dist/runtime/graph-trajectory.js.map +1 -0
- package/dist/runtime/heuristics.d.ts +1 -0
- package/dist/runtime/heuristics.d.ts.map +1 -1
- package/dist/runtime/heuristics.js +44 -22
- package/dist/runtime/heuristics.js.map +1 -1
- package/dist/runtime/learning-engine.d.ts +63 -0
- package/dist/runtime/learning-engine.d.ts.map +1 -0
- package/dist/runtime/learning-engine.js +273 -0
- package/dist/runtime/learning-engine.js.map +1 -0
- package/dist/runtime/living-spec.js +3 -3
- package/dist/runtime/living-spec.js.map +1 -1
- package/dist/runtime/lsp.d.ts.map +1 -1
- package/dist/runtime/lsp.js +41 -14
- package/dist/runtime/lsp.js.map +1 -1
- package/dist/runtime/mcp.d.ts.map +1 -1
- package/dist/runtime/mcp.js +56 -19
- package/dist/runtime/mcp.js.map +1 -1
- package/dist/runtime/model-router.d.ts +1 -0
- package/dist/runtime/model-router.d.ts.map +1 -1
- package/dist/runtime/model-router.js +37 -21
- package/dist/runtime/model-router.js.map +1 -1
- package/dist/runtime/panes.d.ts.map +1 -1
- package/dist/runtime/panes.js +50 -49
- package/dist/runtime/panes.js.map +1 -1
- package/dist/runtime/plan-search.js +2 -2
- package/dist/runtime/plan-search.js.map +1 -1
- package/dist/runtime/plugins.d.ts +1 -1
- package/dist/runtime/plugins.d.ts.map +1 -1
- package/dist/runtime/plugins.js +63 -47
- package/dist/runtime/plugins.js.map +1 -1
- package/dist/runtime/reflexion.d.ts.map +1 -1
- package/dist/runtime/reflexion.js +4 -8
- package/dist/runtime/reflexion.js.map +1 -1
- package/dist/runtime/review-schema.d.ts.map +1 -1
- package/dist/runtime/review-schema.js +12 -12
- package/dist/runtime/review-schema.js.map +1 -1
- package/dist/runtime/rewriter.d.ts.map +1 -1
- package/dist/runtime/rewriter.js +29 -9
- package/dist/runtime/rewriter.js.map +1 -1
- package/dist/runtime/sharing.d.ts +1 -1
- package/dist/runtime/sharing.d.ts.map +1 -1
- package/dist/runtime/sharing.js +55 -27
- package/dist/runtime/sharing.js.map +1 -1
- package/dist/runtime/stats.d.ts +1 -0
- package/dist/runtime/stats.d.ts.map +1 -1
- package/dist/runtime/stats.js +40 -24
- package/dist/runtime/stats.js.map +1 -1
- package/dist/runtime/templates.d.ts.map +1 -1
- package/dist/runtime/templates.js +2 -2
- package/dist/runtime/templates.js.map +1 -1
- package/dist/runtime/traces.d.ts +1 -0
- package/dist/runtime/traces.d.ts.map +1 -1
- package/dist/runtime/traces.js +50 -28
- package/dist/runtime/traces.js.map +1 -1
- package/dist/runtime/verifier.d.ts.map +1 -1
- package/dist/runtime/verifier.js +12 -6
- package/dist/runtime/verifier.js.map +1 -1
- package/dist/runtime/worktree.d.ts.map +1 -1
- package/dist/runtime/worktree.js +35 -18
- package/dist/runtime/worktree.js.map +1 -1
- package/dist/tui/dashboard.d.ts.map +1 -1
- package/dist/tui/dashboard.js +20 -16
- package/dist/tui/dashboard.js.map +1 -1
- package/dist/tui/progress.d.ts +2 -0
- package/dist/tui/progress.d.ts.map +1 -1
- package/dist/tui/progress.js +105 -33
- package/dist/tui/progress.js.map +1 -1
- package/dist/tui/renderer.d.ts.map +1 -1
- package/dist/tui/renderer.js.map +1 -1
- package/dist/utils/compact-format.js +1 -1
- package/dist/utils/compact-format.js.map +1 -1
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/env.js +19 -5
- package/dist/utils/env.js.map +1 -1
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +3 -7
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/output.d.ts.map +1 -1
- package/dist/utils/output.js +6 -2
- package/dist/utils/output.js.map +1 -1
- package/dist/utils/project-config.d.ts +18 -0
- package/dist/utils/project-config.d.ts.map +1 -1
- package/dist/utils/project-config.js +14 -6
- package/dist/utils/project-config.js.map +1 -1
- package/dist/utils/schemas.d.ts.map +1 -1
- package/dist/utils/schemas.js +12 -12
- package/dist/utils/schemas.js.map +1 -1
- package/dist/utils/terminal.d.ts.map +1 -1
- package/dist/utils/terminal.js +18 -7
- package/dist/utils/terminal.js.map +1 -1
- package/dist/utils/tiers.d.ts.map +1 -1
- package/dist/utils/tiers.js +14 -6
- package/dist/utils/tiers.js.map +1 -1
- package/package.json +15 -4
- package/skills/swarm-output-style/SKILL.md +154 -48
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Root cause analysis — trace an error or incident back to its origin and produce a fix"
|
|
3
|
+
argument-hint: "<error message, failing test, or incident description>"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are running a postmortem analysis: systematically trace an error back to its root cause, understand how it happened, fix it, and prevent it from happening again.
|
|
7
|
+
|
|
8
|
+
Follow the `swarm-output-style` skill for ALL output formatting.
|
|
9
|
+
|
|
10
|
+
## Task
|
|
11
|
+
$ARGUMENTS
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
### Step 0: Show Pre-flight Plan
|
|
16
|
+
|
|
17
|
+
Before creating any team or spawning any agent, show the plan:
|
|
18
|
+
|
|
19
|
+
Show the pre-flight plan (see swarm-output-style skill). Include:
|
|
20
|
+
- All phases (Reproduce, Diagnose, Fix, Verify)
|
|
21
|
+
- Agents per phase with model and focus
|
|
22
|
+
- Estimated cost (~$0.12 reproduce, ~$0.15 diagnose, ~$0.19 fix, ~$0.23 verify/review)
|
|
23
|
+
- Estimated time (~15-25 min total)
|
|
24
|
+
|
|
25
|
+
Wait for user approval before proceeding.
|
|
26
|
+
|
|
27
|
+
### Setup: Create Team
|
|
28
|
+
1. Create a team with `TeamCreate` (name: `postmortem-<timestamp>`)
|
|
29
|
+
2. Create tasks with `TaskCreate` for each work unit
|
|
30
|
+
|
|
31
|
+
### Phase 1: Reproduce and Gather Evidence — parallel
|
|
32
|
+
|
|
33
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
34
|
+
|
|
35
|
+
Spawn 3 researcher teammates (sonnet) simultaneously, each with `team_name`, `name`, and `run_in_background: true`:
|
|
36
|
+
|
|
37
|
+
- **`researcher-reproduce`**: Reproduce the error. Find the exact steps, inputs, or conditions that trigger it. If a test fails, run it and capture the full output. If it's a runtime error, trace the call stack.
|
|
38
|
+
- **`researcher-history`**: Check git history. When was this last working? What changed? Use `git log`, `git blame`, `git bisect` thinking to identify the commit or time window where the breakage was introduced.
|
|
39
|
+
- **`researcher-context`**: Check memory and vault for related past incidents. Search for similar errors, known fragile areas, or prior decisions that constrained the implementation. Run `~/.claude/scripts/swarm-vault.sh search "<error keywords>"`.
|
|
40
|
+
|
|
41
|
+
As each completes: show a one-line completion summary (see swarm-output-style skill), then send `shutdown_request` via `SendMessage`.
|
|
42
|
+
|
|
43
|
+
### Phase 2: Diagnose — sequential
|
|
44
|
+
|
|
45
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
46
|
+
|
|
47
|
+
Spawn a debugger teammate (opus) with `team_name`, `name` (`diagnostician`), and `run_in_background: true`.
|
|
48
|
+
|
|
49
|
+
Provide ALL evidence from Phase 1. The debugger should:
|
|
50
|
+
1. Identify the root cause (not the symptom)
|
|
51
|
+
2. Explain the chain of events: what triggered what
|
|
52
|
+
3. Identify contributing factors (was there a missing test? a bad assumption? a race condition?)
|
|
53
|
+
4. Classify the failure type: regression, design flaw, edge case, environment issue, dependency change
|
|
54
|
+
5. Propose a fix
|
|
55
|
+
|
|
56
|
+
As the teammate completes: show a one-line completion summary (see swarm-output-style skill), then send `shutdown_request` via `SendMessage`.
|
|
57
|
+
|
|
58
|
+
Present the diagnosis to the user. Proceed after approval.
|
|
59
|
+
|
|
60
|
+
### Phase 3: Fix — sequential
|
|
61
|
+
|
|
62
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
63
|
+
|
|
64
|
+
Spawn an implementer teammate (opus) with `team_name`, `name` (`fixer`), and `run_in_background: true`:
|
|
65
|
+
|
|
66
|
+
- Fix the root cause, not just the symptom
|
|
67
|
+
- Add a regression test that would have caught this
|
|
68
|
+
- If the fix touches a fragile area, add defensive checks
|
|
69
|
+
|
|
70
|
+
As the teammate completes: show a one-line completion summary (see swarm-output-style skill), then send `shutdown_request` via `SendMessage`.
|
|
71
|
+
|
|
72
|
+
### Phase 4: Verify — parallel
|
|
73
|
+
|
|
74
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
75
|
+
|
|
76
|
+
Spawn 2 teammates simultaneously with `team_name`, `name`, and `run_in_background: true`:
|
|
77
|
+
|
|
78
|
+
- **`verifier`** (tester, sonnet): Run the full test suite. Confirm the regression test passes. Confirm no other tests broke.
|
|
79
|
+
- **`reviewer-fix`** (reviewer, opus): Review the fix for correctness. Check that it addresses the root cause, not a surface symptom. Look for similar patterns elsewhere in the codebase that might have the same vulnerability.
|
|
80
|
+
|
|
81
|
+
As each completes: show a one-line completion summary (see swarm-output-style skill), then send `shutdown_request` via `SendMessage`.
|
|
82
|
+
|
|
83
|
+
### Phase 5: Report
|
|
84
|
+
|
|
85
|
+
Show the full post-completion summary (see swarm-output-style skill). Include:
|
|
86
|
+
- Status (PASS / NEEDS ATTENTION / FAILED)
|
|
87
|
+
- Metrics (phases, agents, duration, tokens, cost)
|
|
88
|
+
- Incident timeline (last working state → change introduced → discovered → fixed)
|
|
89
|
+
- Root cause and contributing factors
|
|
90
|
+
- Fix applied (files changed, regression test added)
|
|
91
|
+
- Prevention checklist (actionable, not generic)
|
|
92
|
+
- Verification results (test count, reviewer verdict)
|
|
93
|
+
- Next steps
|
|
94
|
+
|
|
95
|
+
### Cleanup
|
|
96
|
+
1. Send `shutdown_request` via `SendMessage` to any remaining active teammates
|
|
97
|
+
2. Call `TeamDelete` to clean up the team
|
|
98
|
+
|
|
99
|
+
## Rules
|
|
100
|
+
- All agents must be spawned as team members (TeamCreate → TaskCreate → Agent with team_name/name/run_in_background → SendMessage shutdown → TeamDelete)
|
|
101
|
+
- Always find the ROOT cause, not the surface symptom. "X was null" is a symptom. "Input validation was missing because the API contract changed in v2 but the handler wasn't updated" is a root cause.
|
|
102
|
+
- The regression test is mandatory. If the fix doesn't include a test that would have caught the original failure, the postmortem is incomplete.
|
|
103
|
+
- Check for similar patterns elsewhere. If a bug exists in one place, the same mistake may exist in similar code.
|
|
104
|
+
- The Prevention section should be actionable, not generic. "Write more tests" is useless. "Add null check tests for all handler parameters in src/api/handlers/" is actionable.
|
|
105
|
+
- Follow the swarm-output-style skill for ALL output formatting
|
|
106
|
+
- Show the plan first, spend tokens second
|
package/commands/red-team.md
CHANGED
|
@@ -5,30 +5,53 @@ argument-hint: "<feature or implementation to red-team>"
|
|
|
5
5
|
|
|
6
6
|
You are running an adversarial red-team cycle where a builder implements and a breaker tries to destroy.
|
|
7
7
|
|
|
8
|
+
Follow the `swarm-output-style` skill for ALL output formatting.
|
|
9
|
+
|
|
8
10
|
## Task
|
|
9
11
|
$ARGUMENTS
|
|
10
12
|
|
|
11
13
|
## Workflow
|
|
12
14
|
|
|
15
|
+
### Step 0: Show Pre-flight Plan
|
|
16
|
+
|
|
17
|
+
Before creating any team or spawning any agent, show the plan:
|
|
18
|
+
|
|
19
|
+
Show the pre-flight plan (see swarm-output-style skill). Include:
|
|
20
|
+
- All phases (Research, Build, Break, Harden)
|
|
21
|
+
- Agents per phase with model and focus
|
|
22
|
+
- Estimated cost (~$0.08 research, ~$0.19 build, ~$0.45 break, ~$0.34 harden/verify)
|
|
23
|
+
- Estimated time (~15-30 min total)
|
|
24
|
+
|
|
25
|
+
Wait for user approval before proceeding.
|
|
26
|
+
|
|
13
27
|
### Setup: Create Team
|
|
14
28
|
1. Create a team with `TeamCreate` (name: `red-team-<timestamp>`)
|
|
15
29
|
2. Create tasks with `TaskCreate` for each work unit
|
|
16
30
|
3. Create a scratchpad at `.claude/scratchpad/<team-name>.md` for cross-agent communication. Pass its path to all agent dispatches.
|
|
17
31
|
|
|
18
32
|
### Phase 1: Research (parallel)
|
|
33
|
+
|
|
34
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
35
|
+
|
|
19
36
|
Spawn 2 researcher teammates (sonnet) with `team_name`, `name`, and `run_in_background: true`:
|
|
20
37
|
- `researcher-code`: Understand the codebase area being worked on
|
|
21
38
|
- `researcher-attack`: Research common vulnerabilities and failure modes for this type of feature
|
|
22
39
|
|
|
23
|
-
As each completes, send `shutdown_request`.
|
|
40
|
+
As each completes: show a one-line completion summary (see swarm-output-style skill), then send `shutdown_request`.
|
|
24
41
|
|
|
25
42
|
### Phase 2: Build (sequential)
|
|
43
|
+
|
|
44
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
45
|
+
|
|
26
46
|
Spawn an implementer teammate (opus) with `team_name`, `name` (`builder`), and `run_in_background: true`.
|
|
27
47
|
Include research findings as context. Implement the feature.
|
|
28
48
|
|
|
29
|
-
As the teammate completes, send `shutdown_request`.
|
|
49
|
+
As the teammate completes: show a one-line completion summary (see swarm-output-style skill), then send `shutdown_request`.
|
|
30
50
|
|
|
31
51
|
### Phase 3: Break (parallel)
|
|
52
|
+
|
|
53
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
54
|
+
|
|
32
55
|
Spawn 3 breaker teammates simultaneously with `team_name`, `name`, and `run_in_background: true`:
|
|
33
56
|
|
|
34
57
|
1. **`breaker-edge-cases`** (devils-advocate, opus) — Probe null inputs, empty collections, boundary conditions, concurrent access, network failures, resource exhaustion
|
|
@@ -37,39 +60,29 @@ Spawn 3 breaker teammates simultaneously with `team_name`, `name`, and `run_in_b
|
|
|
37
60
|
|
|
38
61
|
Each breaker gets the full implementation from Phase 2.
|
|
39
62
|
|
|
40
|
-
As each completes, send `shutdown_request`.
|
|
63
|
+
As each completes: show a one-line completion summary (see swarm-output-style skill), then send `shutdown_request`.
|
|
41
64
|
|
|
42
65
|
### Phase 4: Harden (sequential)
|
|
66
|
+
|
|
67
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
68
|
+
|
|
43
69
|
If breakers found vulnerabilities:
|
|
44
70
|
1. Aggregate all findings by severity
|
|
45
71
|
2. Spawn an implementer teammate (opus) with `team_name`, `name` (`hardener`), and `run_in_background: true` to fix Critical and Important findings
|
|
46
|
-
3. As the hardener completes, send it a `shutdown_request`
|
|
72
|
+
3. As the hardener completes: show a one-line completion summary (see swarm-output-style skill), then send it a `shutdown_request`
|
|
47
73
|
4. Spawn a verifier teammate with `team_name`, `name` (e.g., `verifier-security`), and `run_in_background: true` to re-run the specific breaker's tests against the hardened code
|
|
48
|
-
5. As the verifier completes, send it a `shutdown_request`
|
|
74
|
+
5. As the verifier completes: show a one-line completion summary (see swarm-output-style skill), then send it a `shutdown_request`
|
|
49
75
|
|
|
50
76
|
### Phase 5: Report
|
|
51
|
-
```markdown
|
|
52
|
-
## Red Team Report
|
|
53
|
-
|
|
54
|
-
### Built
|
|
55
|
-
[What was implemented]
|
|
56
|
-
|
|
57
|
-
### Attacked
|
|
58
|
-
- Edge cases probed: [count]
|
|
59
|
-
- Security attacks attempted: [count]
|
|
60
|
-
- Mutations tested: [count]
|
|
61
|
-
|
|
62
|
-
### Vulnerabilities Found
|
|
63
|
-
| Severity | Finding | Status |
|
|
64
|
-
|----------|---------|--------|
|
|
65
|
-
| Critical | [finding] | Fixed / Open |
|
|
66
|
-
|
|
67
|
-
### Hardening Applied
|
|
68
|
-
[What was fixed]
|
|
69
77
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
78
|
+
Show the full post-completion summary (see swarm-output-style skill). Include:
|
|
79
|
+
- Status (PASS / NEEDS ATTENTION / FAILED)
|
|
80
|
+
- Metrics (phases, agents, duration, tokens, cost)
|
|
81
|
+
- What was built and what was attacked
|
|
82
|
+
- Vulnerability table (severity, finding, status)
|
|
83
|
+
- Hardening applied
|
|
84
|
+
- Surviving weaknesses requiring human decision
|
|
85
|
+
- Next steps
|
|
73
86
|
|
|
74
87
|
### Cleanup
|
|
75
88
|
1. Send `shutdown_request` to any remaining active teammates
|
|
@@ -80,3 +93,5 @@ If breakers found vulnerabilities:
|
|
|
80
93
|
- Breakers should be genuinely adversarial — their goal is to BREAK the code
|
|
81
94
|
- Only fix Critical and Important findings — Suggestions go in the report
|
|
82
95
|
- If mutation tests reveal untested code paths, note them but don't block
|
|
96
|
+
- Follow the swarm-output-style skill for ALL output formatting
|
|
97
|
+
- Show the plan first, spend tokens second
|
package/commands/research.md
CHANGED
|
@@ -5,11 +5,25 @@ argument-hint: "<research question>"
|
|
|
5
5
|
|
|
6
6
|
You are conducting parallel research to answer a complex question using multiple researcher agents simultaneously.
|
|
7
7
|
|
|
8
|
+
Follow the `swarm-output-style` skill for ALL output formatting.
|
|
9
|
+
|
|
8
10
|
## Question
|
|
9
11
|
$ARGUMENTS
|
|
10
12
|
|
|
11
13
|
## Workflow
|
|
12
14
|
|
|
15
|
+
### Step 0: Show Pre-flight Plan
|
|
16
|
+
|
|
17
|
+
Before creating any team or spawning any agent, show the plan:
|
|
18
|
+
|
|
19
|
+
Show the pre-flight plan (see swarm-output-style skill). Include:
|
|
20
|
+
- The research question decomposed into 2-5 angles
|
|
21
|
+
- One researcher per angle with model and focus (haiku for broad search, sonnet for deep analysis)
|
|
22
|
+
- Estimated cost (~$0.04/researcher for haiku, ~$0.10/researcher for sonnet)
|
|
23
|
+
- Estimated time (~2-3 min per haiku agent, ~3-5 min per sonnet agent)
|
|
24
|
+
|
|
25
|
+
Wait for user approval before proceeding.
|
|
26
|
+
|
|
13
27
|
### Setup: Create Team
|
|
14
28
|
1. Create a team with `TeamCreate` (name: `research-<timestamp>`, e.g., `research-1234`)
|
|
15
29
|
2. Create tasks with `TaskCreate` for each research angle identified in the decomposition
|
|
@@ -21,12 +35,15 @@ Break the research question into 2-5 independent angles of investigation. Each a
|
|
|
21
35
|
- Together provide a complete picture
|
|
22
36
|
|
|
23
37
|
### Step 2: Dispatch Researchers
|
|
38
|
+
|
|
39
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
40
|
+
|
|
24
41
|
Spawn one researcher teammate per angle, ALL in parallel, each with `team_name`, `name` (e.g., `researcher-angle-1`), and `run_in_background: true`. Use:
|
|
25
42
|
- `subagent_type`: Use the "Explore" type for pure search, or spawn a "researcher" agent for deeper analysis
|
|
26
43
|
- `model`: "haiku" for broad searches, "sonnet" for deep analysis
|
|
27
44
|
- Include the specific angle and any known context in each prompt
|
|
28
45
|
|
|
29
|
-
As each
|
|
46
|
+
As each completes: show a one-line completion summary (see swarm-output-style skill), then send `shutdown_request` via `SendMessage`.
|
|
30
47
|
|
|
31
48
|
### Step 3: Synthesize
|
|
32
49
|
Once all researchers return:
|
|
@@ -48,6 +65,8 @@ Once all researchers return:
|
|
|
48
65
|
[Suggested next steps based on findings]
|
|
49
66
|
```
|
|
50
67
|
|
|
68
|
+
Show the full post-completion summary (see swarm-output-style skill).
|
|
69
|
+
|
|
51
70
|
### Cleanup
|
|
52
71
|
1. Send `shutdown_request` via `SendMessage` to any remaining active teammates
|
|
53
72
|
2. Call `TeamDelete` to clean up the team
|
|
@@ -57,3 +76,5 @@ Once all researchers return:
|
|
|
57
76
|
- Include full context in every researcher dispatch — they cannot ask follow-up questions
|
|
58
77
|
- Use haiku for broad file search, sonnet for deep analysis
|
|
59
78
|
- All findings must include file:line references
|
|
79
|
+
- Follow the swarm-output-style skill for ALL output formatting
|
|
80
|
+
- Show the plan first, spend tokens second
|
package/commands/review-cycle.md
CHANGED
|
@@ -5,33 +5,55 @@ argument-hint: "<implementation task>"
|
|
|
5
5
|
|
|
6
6
|
You are running an implement-then-review cycle with parallel reviewers for quality assurance.
|
|
7
7
|
|
|
8
|
+
Follow the `swarm-output-style` skill for ALL output formatting.
|
|
9
|
+
|
|
8
10
|
## Task
|
|
9
11
|
$ARGUMENTS
|
|
10
12
|
|
|
11
13
|
## Workflow
|
|
12
14
|
|
|
15
|
+
### Step 0: Show Pre-flight Plan
|
|
16
|
+
|
|
17
|
+
Before creating any team or spawning any agent, show the plan:
|
|
18
|
+
|
|
19
|
+
Show the pre-flight plan (see swarm-output-style skill). Include:
|
|
20
|
+
- All phases (Research, Implement, Devil's Advocate, Review-Fix Loop)
|
|
21
|
+
- Agents per phase with model and focus
|
|
22
|
+
- Estimated cost (~$0.12 research, ~$0.19 implement, ~$0.10 devil's advocate, ~$0.29/review iteration)
|
|
23
|
+
- Estimated time (~15-30 min depending on review iterations)
|
|
24
|
+
|
|
25
|
+
Wait for user approval before proceeding.
|
|
26
|
+
|
|
13
27
|
### Setup: Create Team
|
|
14
28
|
1. Create a team with `TeamCreate` (name: `review-cycle-<timestamp>`, e.g., `review-cycle-1234`)
|
|
15
29
|
2. Create tasks with `TaskCreate` for each work unit identified in the plan
|
|
16
30
|
|
|
17
31
|
### Phase 1: Research (parallel)
|
|
32
|
+
|
|
33
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
34
|
+
|
|
18
35
|
Spawn 2-3 researcher teammates (sonnet) simultaneously, each with `team_name`, `name` (e.g., `researcher-arch`, `researcher-tests`, `researcher-deps`), and `run_in_background: true`:
|
|
19
36
|
- One for architecture and patterns
|
|
20
37
|
- One for related tests and test patterns
|
|
21
38
|
- One for dependencies and integration points
|
|
22
39
|
|
|
23
|
-
As each
|
|
40
|
+
As each completes: show a one-line completion summary (see swarm-output-style skill), then send `shutdown_request` via `SendMessage`.
|
|
24
41
|
|
|
25
42
|
Present the research findings and implementation plan to the user. Proceed after approval.
|
|
26
43
|
|
|
27
44
|
### Phase 2: Implement (sequential)
|
|
45
|
+
|
|
46
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
47
|
+
|
|
28
48
|
Based on research findings, spawn an implementer teammate (opus) with `team_name`, `name` (e.g., `implementer`), and `run_in_background: true`.
|
|
29
49
|
Include all research findings as context.
|
|
30
50
|
|
|
31
|
-
As the teammate completes, send
|
|
51
|
+
As the teammate completes: show a one-line completion summary (see swarm-output-style skill), then send `shutdown_request` via `SendMessage`.
|
|
32
52
|
|
|
33
53
|
### Phase 2b: Devil's Advocate (sequential)
|
|
34
54
|
|
|
55
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
56
|
+
|
|
35
57
|
After implementation, spawn a devils-advocate teammate (opus) with `team_name`, `name` (e.g., `devils-advocate`), and `run_in_background: true`.
|
|
36
58
|
|
|
37
59
|
Provide it with:
|
|
@@ -39,7 +61,7 @@ Provide it with:
|
|
|
39
61
|
- The original task description
|
|
40
62
|
- Research findings from Phase 1
|
|
41
63
|
|
|
42
|
-
As the teammate completes, send
|
|
64
|
+
As the teammate completes: show a one-line completion summary (see swarm-output-style skill), then send `shutdown_request` via `SendMessage`.
|
|
43
65
|
|
|
44
66
|
If the devil's advocate found **Critical** challenges:
|
|
45
67
|
1. Spawn a new implementer teammate (opus, name: `implementer-hardened`) with `team_name` and `run_in_background: true`
|
|
@@ -54,12 +76,15 @@ If only Important challenges or Questions were raised, include them as context f
|
|
|
54
76
|
For each iteration (1 to 3):
|
|
55
77
|
|
|
56
78
|
#### Review (parallel)
|
|
79
|
+
|
|
80
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
81
|
+
|
|
57
82
|
Spawn 3 reviewer teammates simultaneously, each with `team_name`, `name` (e.g., `reviewer-correctness`, `reviewer-security`, `reviewer-convention`), and `run_in_background: true`, each with a different focus:
|
|
58
83
|
1. **Correctness reviewer** (opus) — Logic errors, edge cases, error handling, race conditions
|
|
59
84
|
2. **Security reviewer** (opus) — Injection, auth bypass, data exposure, OWASP top 10
|
|
60
85
|
3. **Convention reviewer** (sonnet) — Project patterns, naming, structure, CLAUDE.md compliance
|
|
61
86
|
|
|
62
|
-
As each
|
|
87
|
+
As each completes: show a one-line verdict (PASS/FAIL + finding count) (see swarm-output-style skill), then send `shutdown_request` via `SendMessage`.
|
|
63
88
|
|
|
64
89
|
#### Gate Check
|
|
65
90
|
Parse review results:
|
|
@@ -93,23 +118,14 @@ This block must be constructed from the actual reviewer findings and included ve
|
|
|
93
118
|
As the fixer teammate completes, send it a `shutdown_request` via `SendMessage` to close its split pane.
|
|
94
119
|
|
|
95
120
|
### Phase 5: Report
|
|
96
|
-
```markdown
|
|
97
|
-
## Implementation Summary
|
|
98
|
-
[What was built/changed]
|
|
99
|
-
|
|
100
|
-
## Quality Gate: [PASS after N iterations | FAIL after 3 iterations]
|
|
101
|
-
|
|
102
|
-
### Per-Iteration Results
|
|
103
|
-
- **Iteration 1**: N critical, M important → [fixed / passed]
|
|
104
|
-
- **Iteration 2**: N critical, M important → [fixed / passed]
|
|
105
|
-
- **Iteration 3**: N critical, M important → [fixed / passed]
|
|
106
|
-
|
|
107
|
-
## Remaining Concerns
|
|
108
|
-
[Any Important/Suggestion findings from final iteration]
|
|
109
121
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
122
|
+
Show the full post-completion summary (see swarm-output-style skill). Include:
|
|
123
|
+
- Status (PASS / NEEDS ATTENTION / FAILED)
|
|
124
|
+
- Metrics (phases, agents, duration, tokens, cost)
|
|
125
|
+
- What changed (files with git diff --stat if available)
|
|
126
|
+
- Review gate result with per-reviewer table and per-iteration breakdown
|
|
127
|
+
- Non-blocking suggestions
|
|
128
|
+
- Next steps
|
|
113
129
|
|
|
114
130
|
### Cleanup
|
|
115
131
|
1. Send `shutdown_request` via `SendMessage` to any remaining active teammates
|
|
@@ -121,3 +137,5 @@ As the fixer teammate completes, send it a `shutdown_request` via `SendMessage`
|
|
|
121
137
|
- Maximum 3 review-fix iterations before escalating to user
|
|
122
138
|
- Present findings to user before each fix phase
|
|
123
139
|
- Each fix phase must only address findings from the current iteration's review
|
|
140
|
+
- Follow the swarm-output-style skill for ALL output formatting
|
|
141
|
+
- Show the plan first, spend tokens second
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Two independent approaches to the same problem, evaluated side-by-side"
|
|
3
|
+
argument-hint: "<problem to solve with competing approaches>"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are running a competitive spike: two independent approaches to the same problem, evaluated side-by-side.
|
|
7
|
+
|
|
8
|
+
Follow the `swarm-output-style` skill for ALL output formatting.
|
|
9
|
+
|
|
10
|
+
## Task
|
|
11
|
+
$ARGUMENTS
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
### Step 0: Show Pre-flight Plan
|
|
16
|
+
|
|
17
|
+
Before creating any team or spawning any agent, show the plan:
|
|
18
|
+
|
|
19
|
+
Show the pre-flight plan (see swarm-output-style skill). Include:
|
|
20
|
+
- All phases (Research, Implement x2 in parallel worktrees, Evaluate x2, Select)
|
|
21
|
+
- Agents per phase with model and focus
|
|
22
|
+
- Estimated cost (~$0.08 research, ~$0.38 implement, ~$0.20 evaluate)
|
|
23
|
+
- Estimated time (~20-35 min total)
|
|
24
|
+
|
|
25
|
+
Wait for user approval before proceeding.
|
|
26
|
+
|
|
27
|
+
### Setup: Create Team
|
|
28
|
+
1. Create a team with `TeamCreate` (name: `spike-<timestamp>`, e.g., `spike-1234`)
|
|
29
|
+
2. Create tasks with `TaskCreate` for each work unit (research, implementation, review)
|
|
30
|
+
|
|
31
|
+
### Phase 1: Research — parallel
|
|
32
|
+
|
|
33
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
34
|
+
|
|
35
|
+
Spawn 2 researcher teammates (sonnet) simultaneously, each with `team_name`, `name` (e.g., `researcher-a`, `researcher-b`), and `run_in_background: true` to explore the problem space. Each should:
|
|
36
|
+
- Understand the constraints and requirements
|
|
37
|
+
- Identify a viable approach
|
|
38
|
+
- Describe the approach with tradeoffs
|
|
39
|
+
|
|
40
|
+
As each completes: show a one-line completion summary (see swarm-output-style skill), then send `shutdown_request` via `SendMessage`.
|
|
41
|
+
|
|
42
|
+
Present the two approaches to the user before proceeding.
|
|
43
|
+
|
|
44
|
+
### Phase 2: Implement — parallel (worktree isolation, depends on Phase 1)
|
|
45
|
+
|
|
46
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
47
|
+
|
|
48
|
+
Spawn 2 implementer teammates (opus) simultaneously, each in an **isolated worktree**, with `team_name`, `name` (e.g., `implementer-a`, `implementer-b`), and `run_in_background: true`:
|
|
49
|
+
- **Implementer A**: Approach 1 — full implementation in isolated worktree
|
|
50
|
+
- **Implementer B**: Approach 2 — full implementation in isolated worktree
|
|
51
|
+
|
|
52
|
+
Both receive the same spec and requirements but different suggested approaches.
|
|
53
|
+
|
|
54
|
+
As each completes: show a one-line completion summary (see swarm-output-style skill), then send `shutdown_request` via `SendMessage`.
|
|
55
|
+
|
|
56
|
+
### Phase 3: Evaluate — parallel (depends on Phase 2)
|
|
57
|
+
|
|
58
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
59
|
+
|
|
60
|
+
Spawn 2 reviewer teammates (opus) simultaneously, each with `team_name`, `name` (e.g., `reviewer-a`, `reviewer-b`), and `run_in_background: true`:
|
|
61
|
+
- **Reviewer A**: Reviews Approach 1 — correctness, complexity, maintainability, testability
|
|
62
|
+
- **Reviewer B**: Reviews Approach 2 — correctness, complexity, maintainability, testability
|
|
63
|
+
|
|
64
|
+
As each completes: show a one-line verdict per approach (see swarm-output-style skill), then send `shutdown_request` via `SendMessage`.
|
|
65
|
+
|
|
66
|
+
### Phase 4: Select — sequential (depends on Phase 3)
|
|
67
|
+
Present a comparison table to the user:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
## Spike Comparison
|
|
71
|
+
|
|
72
|
+
| Criteria | Approach 1 | Approach 2 |
|
|
73
|
+
|-----------------|----------------------|----------------------|
|
|
74
|
+
| Summary | [brief description] | [brief description] |
|
|
75
|
+
| Correctness | [assessment] | [assessment] |
|
|
76
|
+
| Complexity | [lines/abstractions] | [lines/abstractions] |
|
|
77
|
+
| Maintainability | [assessment] | [assessment] |
|
|
78
|
+
| Performance | [assessment] | [assessment] |
|
|
79
|
+
| Testability | [assessment] | [assessment] |
|
|
80
|
+
| Reviewer Verdict| [recommendation] | [recommendation] |
|
|
81
|
+
|
|
82
|
+
### Recommendation
|
|
83
|
+
[Which approach and why]
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The user picks the winner. Apply the winning approach: merge the winning worktree branch with `git merge <branch> --no-ff`, or if significantly diverged, cherry-pick the relevant commits.
|
|
87
|
+
|
|
88
|
+
Show the full post-completion summary (see swarm-output-style skill). Include:
|
|
89
|
+
- Status (PASS / NEEDS ATTENTION)
|
|
90
|
+
- Metrics (phases, agents, duration, tokens, cost)
|
|
91
|
+
- Spike comparison table summary
|
|
92
|
+
- Which approach was selected and why
|
|
93
|
+
- What was applied (merge/cherry-pick)
|
|
94
|
+
- Next steps
|
|
95
|
+
|
|
96
|
+
### Cleanup
|
|
97
|
+
1. Send `shutdown_request` via `SendMessage` to any remaining active teammates
|
|
98
|
+
2. Call `TeamDelete` to clean up the team
|
|
99
|
+
|
|
100
|
+
## Rules
|
|
101
|
+
- All agents must be spawned as team members (TeamCreate → TaskCreate → Agent with team_name/name/run_in_background → SendMessage shutdown → TeamDelete)
|
|
102
|
+
- Both approaches must solve the FULL problem — no partial implementations
|
|
103
|
+
- Use worktree isolation so approaches don't interfere with each other
|
|
104
|
+
- Include clear tradeoff analysis in the comparison
|
|
105
|
+
- The user always makes the final decision — never auto-select
|
|
106
|
+
- If both approaches are flawed, recommend a third path informed by what was learned
|
|
107
|
+
- Follow the swarm-output-style skill for ALL output formatting
|
|
108
|
+
- Show the plan first, spend tokens second
|