swarm-engine 1.1.0 → 1.3.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 +102 -25
- package/agents/accessibility-reviewer.md +2 -0
- package/agents/api-contract-reviewer.md +2 -0
- package/agents/concurrency-reviewer.md +2 -0
- package/agents/data-integrity-reviewer.md +1 -0
- package/agents/debugger.md +2 -0
- package/agents/dependency-reviewer.md +2 -0
- package/agents/devils-advocate.md +1 -0
- package/agents/documentation-reviewer.md +2 -0
- package/agents/documenter.md +13 -0
- package/agents/error-handling-reviewer.md +2 -0
- package/agents/grounding.md +3 -2
- package/agents/guardian.md +3 -0
- package/agents/implementer.md +2 -0
- package/agents/integrator.md +3 -0
- package/agents/judge.md +2 -0
- package/agents/librarian.md +4 -1
- package/agents/orchestrator.md +3 -0
- package/agents/performance-reviewer.md +2 -0
- package/agents/planner.md +2 -0
- package/agents/refactorer.md +3 -0
- package/agents/reviewer.md +1 -0
- package/agents/security-reviewer.md +1 -0
- package/agents/sentinel.md +3 -0
- package/agents/tester.md +2 -0
- package/agents/testing-reviewer.md +2 -0
- 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 +1 -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 +3 -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 +68 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +60 -4
- package/dist/index.js.map +1 -1
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +39 -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 +52 -0
- package/dist/runtime/agent-runner.d.ts.map +1 -0
- package/dist/runtime/agent-runner.js +156 -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 +7 -9
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +129 -394
- package/dist/runtime/engine.js.map +1 -1
- 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/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 +51 -0
- package/dist/runtime/learning-engine.d.ts.map +1 -0
- package/dist/runtime/learning-engine.js +209 -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 +14 -3
- package/skills/swarm-output-style/SKILL.md +114 -46
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Hypothesis-driven development — form theories, test cheaply, build the winner"
|
|
3
|
+
argument-hint: "<complex problem where the right approach is unclear>"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are running a discovery cycle: form hypotheses, test them cheaply, then implement the winner.
|
|
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 (Hypothesize, Experiment, Implement, Review)
|
|
21
|
+
- Agents per phase with model and focus
|
|
22
|
+
- Estimated cost (~$0.12 hypothesize, ~$0.12 experiment at sonnet rates, ~$0.19 implement, ~$0.20 review)
|
|
23
|
+
- Estimated time (~20-40 min total)
|
|
24
|
+
|
|
25
|
+
Wait for user approval before proceeding.
|
|
26
|
+
|
|
27
|
+
### Setup: Create Team
|
|
28
|
+
1. Create a team with `TeamCreate` (name: `discover-<timestamp>`)
|
|
29
|
+
2. Create tasks with `TaskCreate` for each work unit
|
|
30
|
+
|
|
31
|
+
### Phase 1: Hypothesize — parallel
|
|
32
|
+
|
|
33
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
34
|
+
|
|
35
|
+
Spawn 2-3 researcher teammates (sonnet) simultaneously, each with `team_name`, `name`, and `run_in_background: true`:
|
|
36
|
+
- Each researcher explores a different angle of the problem
|
|
37
|
+
- Each proposes a hypothesis: "I think the best approach is X because Y"
|
|
38
|
+
- Each identifies what evidence would prove or disprove the hypothesis
|
|
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 hypotheses to the user. Select 2-3 to test.
|
|
43
|
+
|
|
44
|
+
### Phase 2: Experiment — parallel (cheap, fast)
|
|
45
|
+
|
|
46
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
47
|
+
|
|
48
|
+
Spawn 2-3 implementer teammates (sonnet, not opus — keep it cheap) simultaneously, each with `team_name`, `name`, and `run_in_background: true`:
|
|
49
|
+
- Each builds a minimal proof-of-concept for one hypothesis
|
|
50
|
+
- NOT a full implementation — just enough to validate or invalidate
|
|
51
|
+
- Time-box: keep experiments under 5 minutes each
|
|
52
|
+
- Each reports: hypothesis confirmed or rejected, with evidence
|
|
53
|
+
|
|
54
|
+
As each completes: show a one-line completion summary (confirmed/rejected + key evidence) (see swarm-output-style skill), then send `shutdown_request` via `SendMessage`.
|
|
55
|
+
|
|
56
|
+
Present the experiment results. Identify the winning hypothesis.
|
|
57
|
+
|
|
58
|
+
### Phase 3: Implement — sequential (depends on Phase 2)
|
|
59
|
+
|
|
60
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
61
|
+
|
|
62
|
+
Spawn an implementer teammate (opus) with `team_name`, `name`, and `run_in_background: true`:
|
|
63
|
+
- Full implementation of the winning approach
|
|
64
|
+
- Informed by what was learned from ALL experiments (including failed ones)
|
|
65
|
+
- Include tests
|
|
66
|
+
|
|
67
|
+
As the teammate completes: show a one-line completion summary (see swarm-output-style skill), then send `shutdown_request` via `SendMessage`.
|
|
68
|
+
|
|
69
|
+
### Phase 4: Review — parallel (depends on Phase 3)
|
|
70
|
+
|
|
71
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
72
|
+
|
|
73
|
+
Spawn 2 reviewer teammates (opus) simultaneously with `team_name`, `name`, and `run_in_background: true`:
|
|
74
|
+
- **reviewer-correctness**: Logic, edge cases, error handling
|
|
75
|
+
- **reviewer-convention**: Project patterns, code style
|
|
76
|
+
|
|
77
|
+
As each completes: show a one-line verdict (PASS/FAIL + finding count) (see swarm-output-style skill), then send `shutdown_request` via `SendMessage`.
|
|
78
|
+
|
|
79
|
+
### Phase 5: Report
|
|
80
|
+
|
|
81
|
+
Show the full post-completion summary (see swarm-output-style skill). Include:
|
|
82
|
+
- Status (PASS / NEEDS ATTENTION / FAILED)
|
|
83
|
+
- Metrics (phases, agents, duration, tokens, cost)
|
|
84
|
+
- Hypotheses tested (table with confirmed/rejected)
|
|
85
|
+
- Winner and rationale
|
|
86
|
+
- What was learned from rejected hypotheses
|
|
87
|
+
- What changed (files)
|
|
88
|
+
- Review gate result
|
|
89
|
+
- Next steps
|
|
90
|
+
|
|
91
|
+
### Cleanup
|
|
92
|
+
1. Send `shutdown_request` via `SendMessage` to any remaining active teammates
|
|
93
|
+
2. Call `TeamDelete` to clean up the team
|
|
94
|
+
|
|
95
|
+
## Rules
|
|
96
|
+
- All agents must be spawned as team members (TeamCreate → TaskCreate → Agent with team_name/name/run_in_background → SendMessage shutdown → TeamDelete)
|
|
97
|
+
- Experiments must be CHEAP — use sonnet, keep scope minimal, time-box to 5 minutes
|
|
98
|
+
- Failed experiments are valuable — include their learnings in the final implementation context
|
|
99
|
+
- The user approves the winning hypothesis before full implementation begins
|
|
100
|
+
- If no hypothesis is clearly better, recommend combining the best elements from multiple experiments
|
|
101
|
+
- Follow the swarm-output-style skill for ALL output formatting
|
|
102
|
+
- Show the plan first, spend tokens second
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Let the planner decompose your task into a custom agent workflow -- no pattern selection needed"
|
|
3
|
+
argument-hint: "<any task -- the planner figures out the approach>"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are running a dynamic orchestration: instead of following a predefined pattern, the planner analyzes the task and builds a custom workflow.
|
|
7
|
+
|
|
8
|
+
Follow the `swarm-output-style` skill for ALL output formatting.
|
|
9
|
+
|
|
10
|
+
## Task
|
|
11
|
+
$ARGUMENTS
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
### Step 0: Check Memory
|
|
16
|
+
|
|
17
|
+
Search for relevant context:
|
|
18
|
+
```bash
|
|
19
|
+
cd ~/dev/swarm-engine && npx tsx src/cli/index.ts memory search "<relevant keywords>"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Step 1: Analyze and Decompose
|
|
23
|
+
|
|
24
|
+
You ARE the planner. Analyze the task and decompose it into subtasks. For each subtask, decide:
|
|
25
|
+
|
|
26
|
+
1. **What agent type** should handle it (researcher, implementer, reviewer, tester, debugger, refactorer, etc.)
|
|
27
|
+
2. **What model** it needs (expensive tasks like security review get claude-opus-4-6, simple tasks like scanning get claude-sonnet-4-6)
|
|
28
|
+
3. **What dependencies** it has (which subtasks must complete before this one can start)
|
|
29
|
+
4. **What files** it will touch (no two agents should modify the same files)
|
|
30
|
+
|
|
31
|
+
Group subtasks into waves based on dependencies:
|
|
32
|
+
- **Wave 1**: Independent tasks that can run in parallel (typically research)
|
|
33
|
+
- **Wave 2**: Tasks that depend on Wave 1 results (typically implementation)
|
|
34
|
+
- **Wave 3**: Tasks that depend on Wave 2 (typically review, testing)
|
|
35
|
+
- Add more waves as needed
|
|
36
|
+
|
|
37
|
+
### Step 2: Show Pre-flight Plan
|
|
38
|
+
|
|
39
|
+
Present the decomposition as a pre-flight plan:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
## Dynamic Orchestration Plan
|
|
43
|
+
|
|
44
|
+
**Task**: [task description]
|
|
45
|
+
**Waves**: [N] | **Agents**: [N] | **Est. cost**: ~$[amount] | **Est. time**: ~[duration]
|
|
46
|
+
|
|
47
|
+
### Wave 1 -- parallel (~[time], ~$[cost])
|
|
48
|
+
| Agent | Type | Model | Focus | Dependencies |
|
|
49
|
+
|-------|------|-------|-------|-------------|
|
|
50
|
+
| `name` | [type] | [model] | [what it does] | none |
|
|
51
|
+
|
|
52
|
+
### Wave 2 -- parallel (~[time], ~$[cost])
|
|
53
|
+
| Agent | Type | Model | Focus | Dependencies |
|
|
54
|
+
|-------|------|-------|-------|-------------|
|
|
55
|
+
| `name` | [type] | [model] | [what it does] | Wave 1 |
|
|
56
|
+
|
|
57
|
+
[repeat for all waves]
|
|
58
|
+
|
|
59
|
+
**File ownership:**
|
|
60
|
+
| Agent | Files |
|
|
61
|
+
|-------|-------|
|
|
62
|
+
| `name` | [files this agent will touch] |
|
|
63
|
+
|
|
64
|
+
Proceed?
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Wait for user approval before proceeding.
|
|
68
|
+
|
|
69
|
+
### Step 3: Create Team and Execute
|
|
70
|
+
|
|
71
|
+
1. `TeamCreate` (name: `dynamic-<timestamp>`)
|
|
72
|
+
2. `TaskCreate` for each wave
|
|
73
|
+
|
|
74
|
+
Execute each wave in order:
|
|
75
|
+
|
|
76
|
+
For each wave:
|
|
77
|
+
1. Show the phase banner with running total
|
|
78
|
+
2. Spawn all agents in this wave in parallel, each with `team_name`, `name`, and `run_in_background: true`
|
|
79
|
+
3. Include context from all completed previous waves
|
|
80
|
+
4. As each completes: show a one-line completion summary, then send `shutdown_request`
|
|
81
|
+
5. After all agents in the wave complete: show wave summary
|
|
82
|
+
|
|
83
|
+
**Between waves**: If any agent failed or returned low confidence, show error recovery options before proceeding to the next wave.
|
|
84
|
+
|
|
85
|
+
### Step 4: Quality Gate
|
|
86
|
+
|
|
87
|
+
After the final wave, assess the combined output:
|
|
88
|
+
- Did all agents succeed?
|
|
89
|
+
- Are there file conflicts or inconsistencies between agent outputs?
|
|
90
|
+
- Do the changes compile/pass linting?
|
|
91
|
+
|
|
92
|
+
If issues found, spawn a fixer agent to resolve them.
|
|
93
|
+
|
|
94
|
+
### Step 5: Record and Report
|
|
95
|
+
|
|
96
|
+
Store results in engine memory:
|
|
97
|
+
```bash
|
|
98
|
+
echo "<outcome summary>" | cd ~/dev/swarm-engine && npx tsx src/cli/index.ts memory store outcome "<title>" --repo "<repo>"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Show the full post-completion summary (see swarm-output-style skill). Include:
|
|
102
|
+
- Status
|
|
103
|
+
- Wave breakdown (which agents ran in each wave)
|
|
104
|
+
- Metrics (waves, agents, duration, tokens, cost)
|
|
105
|
+
- What changed (files with git diff --stat)
|
|
106
|
+
- Quality gate result
|
|
107
|
+
- Next steps
|
|
108
|
+
|
|
109
|
+
### Cleanup
|
|
110
|
+
1. Send `shutdown_request` to any remaining active teammates
|
|
111
|
+
2. Call `TeamDelete` to clean up the team
|
|
112
|
+
|
|
113
|
+
## Decomposition Guidelines
|
|
114
|
+
|
|
115
|
+
When deciding how to break down a task:
|
|
116
|
+
|
|
117
|
+
**Research first**: Always start with at least one researcher to understand the codebase before modifying it.
|
|
118
|
+
|
|
119
|
+
**Parallelize aggressively**: If two subtasks touch different files and don't depend on each other, run them in parallel.
|
|
120
|
+
|
|
121
|
+
**Right-size agents**: Use the cheapest model that can handle the task. Research and scanning with sonnet. Implementation and review with opus.
|
|
122
|
+
|
|
123
|
+
**File ownership**: Each file should be owned by exactly one agent. If two agents need the same file, make one depend on the other.
|
|
124
|
+
|
|
125
|
+
**Review everything**: The final wave should always include at least one reviewer checking the combined output.
|
|
126
|
+
|
|
127
|
+
**Keep it simple**: Most tasks need 2-4 waves and 3-8 agents. Don't over-decompose a task that one agent could handle. If the task is simple, use 1 wave with 1-2 agents.
|
|
128
|
+
|
|
129
|
+
## Rules
|
|
130
|
+
- Show the plan first, spend tokens second
|
|
131
|
+
- All agents must use team protocol (TeamCreate, Agent with team_name/name/run_in_background, SendMessage shutdown, TeamDelete)
|
|
132
|
+
- No two agents modify the same files in the same wave
|
|
133
|
+
- Every agent dispatch includes full context from previous waves
|
|
134
|
+
- Always include a review step in the final wave
|
|
135
|
+
- Follow the swarm-output-style skill for ALL output formatting
|
|
136
|
+
- Maximum 6 waves -- if you need more, the task should be split into separate orchestrations
|
package/commands/fix-pr.md
CHANGED
|
@@ -5,6 +5,8 @@ argument-hint: "<PR number or URL>"
|
|
|
5
5
|
|
|
6
6
|
You are fixing PR review comments by dispatching parallel implementers grouped by file.
|
|
7
7
|
|
|
8
|
+
Follow the `swarm-output-style` skill for ALL output formatting.
|
|
9
|
+
|
|
8
10
|
## Task
|
|
9
11
|
$ARGUMENTS
|
|
10
12
|
|
|
@@ -25,46 +27,48 @@ For each file group, classify every comment:
|
|
|
25
27
|
- **Nit/style fix** → assign to implementer (sonnet)
|
|
26
28
|
- **Question/discussion** → skip, include in report
|
|
27
29
|
|
|
28
|
-
### Step 3:
|
|
29
|
-
|
|
30
|
+
### Step 3: Show Pre-flight Plan
|
|
31
|
+
|
|
32
|
+
Show the pre-flight plan (see swarm-output-style skill). Use the dispatch plan format:
|
|
30
33
|
|
|
31
34
|
```
|
|
32
|
-
##
|
|
35
|
+
## Orchestration Plan
|
|
36
|
+
|
|
37
|
+
**Task**: Fix [N] review comments across [M] file groups for PR #[number]
|
|
38
|
+
**Pattern**: parallel-fix | **Phases**: 1 | **Agents**: [N] | **Est. cost**: ~$[amount] | **Est. time**: ~[duration]
|
|
33
39
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
|
38
|
-
|
|
|
40
|
+
### Phase 1: Fix -- parallel (~[time], ~$[cost])
|
|
41
|
+
| Agent | Model | Focus |
|
|
42
|
+
|-------|-------|-------|
|
|
43
|
+
| `fixer-foo` | opus | src/foo.py — [what to fix] |
|
|
44
|
+
| `fixer-bar` | sonnet | src/bar.py — [style nit] |
|
|
45
|
+
| `fixer-baz` | — | src/baz.py — SKIPPED (questions only) |
|
|
46
|
+
|
|
47
|
+
Proceed?
|
|
39
48
|
```
|
|
40
49
|
|
|
41
|
-
|
|
50
|
+
Wait for user approval before proceeding.
|
|
42
51
|
|
|
43
52
|
### Step 4: Dispatch Implementers
|
|
53
|
+
|
|
54
|
+
Show the phase banner with running total (see swarm-output-style skill).
|
|
55
|
+
|
|
44
56
|
Spawn one implementer teammate per file group, ALL in parallel, each with `team_name`, `name` (e.g., `fixer-foo`, `fixer-bar`), and `run_in_background: true`. Each dispatch includes:
|
|
45
57
|
- The exact comment text for their file(s)
|
|
46
58
|
- The full PR diff for context
|
|
47
59
|
- The original PR description
|
|
48
60
|
- Clear instructions on what to change
|
|
49
61
|
|
|
50
|
-
As each
|
|
62
|
+
As each completes: show a one-line completion summary (see swarm-output-style skill), then send `shutdown_request` via `SendMessage`.
|
|
51
63
|
|
|
52
64
|
### Step 5: Report
|
|
53
|
-
Once all implementers complete, produce a summary:
|
|
54
65
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
|
|
61
|
-
### Comments Skipped
|
|
62
|
-
- [file:line — why (question/discussion)]
|
|
63
|
-
|
|
64
|
-
### Next Steps
|
|
65
|
-
- Push changes: `git push`
|
|
66
|
-
- Re-request review: `gh pr edit <the PR> --add-reviewer [reviewer]`
|
|
67
|
-
```
|
|
66
|
+
Show the full post-completion summary (see swarm-output-style skill). Include:
|
|
67
|
+
- Status (PASS / NEEDS ATTENTION)
|
|
68
|
+
- Metrics (agents, duration, tokens, cost)
|
|
69
|
+
- Comments addressed (file:line — what was fixed, which comment)
|
|
70
|
+
- Comments skipped (file:line — why)
|
|
71
|
+
- Next steps (git push, re-request review)
|
|
68
72
|
|
|
69
73
|
### Cleanup
|
|
70
74
|
1. Send `shutdown_request` via `SendMessage` to any remaining active teammates
|
|
@@ -76,3 +80,5 @@ Once all implementers complete, produce a summary:
|
|
|
76
80
|
- Group by file to avoid merge conflicts between parallel implementers
|
|
77
81
|
- Include the exact comment text in each implementer dispatch
|
|
78
82
|
- Use opus for logic/behavior changes, sonnet for style/nit fixes
|
|
83
|
+
- Follow the swarm-output-style skill for ALL output formatting
|
|
84
|
+
- Show the plan first, spend tokens second
|
|
@@ -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
|