opencode-swarm 6.11.0 → 6.12.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/README.md +266 -562
- package/dist/background/trigger.d.ts +4 -0
- package/dist/hooks/pipeline-tracker.d.ts +5 -0
- package/dist/index.js +694 -256
- package/dist/sast/rules/index.d.ts +2 -2
- package/dist/state.d.ts +20 -0
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -1,204 +1,200 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<strong>A structured multi-agent coding framework for OpenCode.</strong><br>
|
|
13
|
-
Nine specialized agents. Persistent memory. A QA gate on every task. Code that ships.
|
|
14
|
-
</p>
|
|
15
|
-
|
|
16
|
-
<p align="center">
|
|
17
|
-
<a href="#the-problem">The Problem</a> •
|
|
18
|
-
<a href="#how-it-works">How It Works</a> •
|
|
19
|
-
<a href="#agents">Agents</a> •
|
|
20
|
-
<a href="#persistent-memory">Memory</a> •
|
|
21
|
-
<a href="#guardrails">Guardrails</a> •
|
|
22
|
-
<a href="#comparison">Comparison</a> •
|
|
23
|
-
<a href="#installation">Installation</a> •
|
|
24
|
-
<a href="#roadmap">Roadmap</a>
|
|
25
|
-
</p>
|
|
1
|
+
# 🐝 OpenCode Swarm
|
|
2
|
+
|
|
3
|
+
**Your AI writes the code. Swarm makes sure it actually works.**
|
|
4
|
+
|
|
5
|
+
OpenCode Swarm is a plugin for [OpenCode](https://opencode.ai) that turns a single AI coding agent into a team of nine. One agent writes the code. A different agent reviews it. Another writes and runs tests. Another catches security issues. Nothing ships until every check passes. Your project state is saved to disk, so you can close your laptop, come back tomorrow, and pick up exactly where you left off.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g opencode-swarm
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
That's it. Open your project with `opencode` and start building. Swarm activates automatically.
|
|
26
12
|
|
|
27
13
|
---
|
|
28
14
|
|
|
29
|
-
##
|
|
15
|
+
## What Actually Happens
|
|
30
16
|
|
|
31
|
-
|
|
17
|
+
You say: *"Build me a JWT auth system."*
|
|
32
18
|
|
|
33
|
-
|
|
19
|
+
Here's what Swarm does behind the scenes:
|
|
34
20
|
|
|
35
|
-
|
|
21
|
+
1. **Asks you clarifying questions** (only the ones it can't figure out itself)
|
|
22
|
+
2. **Scans your codebase** to understand what already exists
|
|
23
|
+
3. **Consults domain experts** (security, API design, whatever your project needs) and caches the guidance so it never re-asks
|
|
24
|
+
4. **Writes a phased plan** with concrete tasks, acceptance criteria, and dependencies
|
|
25
|
+
5. **A separate critic agent reviews the plan** before any code is written
|
|
26
|
+
6. **Implements one task at a time.** For each task:
|
|
27
|
+
- A coder agent writes the code
|
|
28
|
+
- 7 automated checks run (syntax, imports, linting, secrets, security, build, quality)
|
|
29
|
+
- A reviewer agent (running on a *different* AI model) checks for correctness
|
|
30
|
+
- A test engineer agent writes tests, runs them, and checks coverage
|
|
31
|
+
- If anything fails, it goes back to the coder with specific feedback
|
|
32
|
+
- If it passes everything, the task is marked done and the next one starts
|
|
33
|
+
7. **After each phase completes**, documentation updates automatically, and a retrospective captures what worked and what didn't. Those learnings carry into the next phase.
|
|
34
|
+
|
|
35
|
+
All of this state lives in a `.swarm/` folder in your project:
|
|
36
36
|
|
|
37
37
|
```
|
|
38
|
-
|
|
39
|
-
├──
|
|
40
|
-
├──
|
|
41
|
-
├──
|
|
42
|
-
|
|
43
|
-
└── Result: chaos. Rework. Start over.
|
|
44
|
-
|
|
45
|
-
OpenCode Swarm:
|
|
46
|
-
├── Architect reads .swarm/plan.md → project already in progress, resumes Phase 2
|
|
47
|
-
├── @explorer scans the codebase for current state
|
|
48
|
-
├── @sme DOMAIN: security → consults on auth patterns, guidance cached
|
|
49
|
-
├── Architect writes .swarm/plan.md: 3 phases, 9 tasks, acceptance criteria per task
|
|
50
|
-
├── @critic reviews the plan → APPROVED
|
|
51
|
-
├── @coder implements Task 2.2 (one task, full context, nothing else)
|
|
52
|
-
├── diff tool → imports tool → lint fix → lint check → secretscan → @reviewer → @test_engineer
|
|
53
|
-
├── All gates pass → plan.md updated → Task 2.2: [x]
|
|
54
|
-
└── Result: working code, documented decisions, resumable project, evidence trail
|
|
38
|
+
.swarm/
|
|
39
|
+
├── plan.md # Your project roadmap (tasks, status, what's done, what's next)
|
|
40
|
+
├── context.md # Decisions made, expert guidance, established patterns
|
|
41
|
+
├── evidence/ # Review verdicts, test results, diffs for every completed task
|
|
42
|
+
└── history/ # Phase retrospectives and metrics
|
|
55
43
|
```
|
|
56
44
|
|
|
45
|
+
Close your terminal. Come back next week. Swarm reads these files and picks up exactly where it stopped.
|
|
46
|
+
|
|
57
47
|
---
|
|
58
48
|
|
|
59
|
-
##
|
|
49
|
+
## Why This Exists
|
|
60
50
|
|
|
61
|
-
|
|
51
|
+
Most AI coding tools let one model write code and then ask *that same model* if the code is good. That's like asking someone to proofread their own essay. They'll miss the same things they missed while writing it.
|
|
62
52
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
▼
|
|
76
|
-
┌──────────────────────────────────────────────────────────────────────────┐
|
|
77
|
-
│ Phase 2: Discover │
|
|
78
|
-
│ @explorer scans codebase → structure, languages, frameworks, key files │
|
|
79
|
-
└──────────────────────────────────────────────────────────────────────────┘
|
|
80
|
-
│
|
|
81
|
-
▼
|
|
82
|
-
┌──────────────────────────────────────────────────────────────────────────┐
|
|
83
|
-
│ Phase 3: SME Consult (serial, cached) │
|
|
84
|
-
│ @sme DOMAIN: security, @sme DOMAIN: api, ... │
|
|
85
|
-
│ Guidance written to .swarm/context.md — never re-asked in future phases │
|
|
86
|
-
└──────────────────────────────────────────────────────────────────────────┘
|
|
87
|
-
│
|
|
88
|
-
▼
|
|
89
|
-
┌──────────────────────────────────────────────────────────────────────────┐
|
|
90
|
-
│ Phase 4: Plan │
|
|
91
|
-
│ Architect writes .swarm/plan.md │
|
|
92
|
-
│ Structured phases, tasks with SMALL/MEDIUM/LARGE sizing, acceptance │
|
|
93
|
-
│ criteria per task, explicit dependency graph │
|
|
94
|
-
└──────────────────────────────────────────────────────────────────────────┘
|
|
95
|
-
│
|
|
96
|
-
▼
|
|
97
|
-
┌──────────────────────────────────────────────────────────────────────────┐
|
|
98
|
-
│ Phase 4.5: Critic Gate │
|
|
99
|
-
│ @critic reviews plan → APPROVED / NEEDS_REVISION / REJECTED │
|
|
100
|
-
│ Max 2 revision cycles. Escalates to user if unresolved. │
|
|
101
|
-
└──────────────────────────────────────────────────────────────────────────┘
|
|
102
|
-
│
|
|
103
|
-
▼
|
|
104
|
-
┌──────────────────────────────────────────────────────────────────────────┐
|
|
105
|
-
│ Phase 5: Execute (per task) │
|
|
106
|
-
│ │
|
|
107
|
-
│ [UI task?] → @designer scaffold first │
|
|
108
|
-
│ │
|
|
109
|
-
│ @coder (one task, full context) │
|
|
110
|
-
│ ↓ │
|
|
111
|
-
│ diff → syntax_check → placeholder_scan → imports → lint fix │
|
|
112
|
-
│ (contract detection) (parse validation) (anti-slop) (AST-based) │
|
|
113
|
-
│ ↓ │
|
|
114
|
-
│ build_check → pre_check_batch (4 parallel: lint:check, secretscan, │
|
|
115
|
-
│ (compile verify) sast_scan, quality_budget) │
|
|
116
|
-
│ ↓ │
|
|
117
|
-
│ @reviewer (correctness pass) │
|
|
118
|
-
│ ↓ APPROVED │
|
|
119
|
-
│ @reviewer (security-only pass, if file matches security globs) │
|
|
120
|
-
│ ↓ APPROVED │
|
|
121
|
-
│ @test_engineer (verification tests + coverage gate ≥70%) │
|
|
122
|
-
│ ↓ PASS │
|
|
123
|
-
│ @test_engineer (adversarial tests — boundary violations, injections) │
|
|
124
|
-
│ ↓ PASS │
|
|
125
|
-
│ ⛔ HARD STOP: Pre-commit checklist (4 items required, no override) │
|
|
126
|
-
│ ↓ COMPLETE │
|
|
127
|
-
│ plan.md → [x] Task complete │
|
|
128
|
-
│ │
|
|
129
|
-
│ Any gate fails → retry with failure count + structured rejection │
|
|
130
|
-
│ Max 5 retries → escalate to user │
|
|
131
|
-
└──────────────────────────────────────────────────────────────────────────┘
|
|
132
|
-
│
|
|
133
|
-
▼
|
|
134
|
-
┌──────────────────────────────────────────────────────────────────────────┐
|
|
135
|
-
│ Phase 6: Phase Complete │
|
|
136
|
-
│ @explorer rescans. @docs updates documentation. Retrospective written. │
|
|
137
|
-
│ Learnings injected as [SWARM RETROSPECTIVE] into next phase. │
|
|
138
|
-
│ "Phase 1 complete (4 tasks, 0 rejections). Ready for Phase 2?" │
|
|
139
|
-
└──────────────────────────────────────────────────────────────────────────┘
|
|
53
|
+
Swarm fixes this by splitting the work across specialized agents and requiring that different models handle writing vs. reviewing. The coder writes. A different model reviews. Another model tests. Different training data, different blind spots, different failure modes.
|
|
54
|
+
|
|
55
|
+
The other thing most tools get wrong: they try to do everything in parallel. That sounds fast, but in practice you get three agents writing conflicting code at the same time with no coordination. Swarm runs one task at a time through a fixed pipeline. Slower per-task, but you don't redo work.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Quick Start
|
|
60
|
+
|
|
61
|
+
### Install
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm install -g opencode-swarm
|
|
140
65
|
```
|
|
141
66
|
|
|
142
|
-
###
|
|
67
|
+
### Verify
|
|
143
68
|
|
|
144
|
-
|
|
69
|
+
Open a project with `opencode` and run:
|
|
145
70
|
|
|
146
|
-
|
|
71
|
+
```
|
|
72
|
+
/swarm diagnose
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
This checks that everything is wired up correctly.
|
|
147
76
|
|
|
148
|
-
|
|
77
|
+
### Configure Models (Optional)
|
|
149
78
|
|
|
150
|
-
|
|
79
|
+
By default, Swarm uses whatever model OpenCode is configured with. To route different agents to different models (recommended), create `.opencode/swarm.json` in your project:
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"agents": {
|
|
84
|
+
"architect": { "model": "anthropic/claude-opus-4-6" },
|
|
85
|
+
"coder": { "model": "minimax-coding-plan/MiniMax-M2.5" },
|
|
86
|
+
"reviewer": { "model": "zai-coding-plan/glm-5" }
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
151
90
|
|
|
152
|
-
|
|
91
|
+
You only need to specify the agents you want to override. The rest use the default.
|
|
153
92
|
|
|
154
|
-
###
|
|
93
|
+
### Start Building
|
|
155
94
|
|
|
156
|
-
|
|
95
|
+
Just tell OpenCode what you want to build. Swarm handles the rest.
|
|
157
96
|
|
|
158
|
-
|
|
97
|
+
```
|
|
98
|
+
> Build a REST API with user registration, login, and JWT auth
|
|
99
|
+
```
|
|
159
100
|
|
|
160
|
-
|
|
101
|
+
Use `/swarm status` at any time to see where things stand.
|
|
161
102
|
|
|
162
|
-
|
|
103
|
+
---
|
|
163
104
|
|
|
164
|
-
|
|
105
|
+
## Useful Commands
|
|
165
106
|
|
|
166
|
-
|
|
107
|
+
| Command | What It Does |
|
|
108
|
+
|---------|-------------|
|
|
109
|
+
| `/swarm status` | Where am I? Current phase, task progress |
|
|
110
|
+
| `/swarm plan` | Show the full project plan |
|
|
111
|
+
| `/swarm diagnose` | Health check, is everything configured right? |
|
|
112
|
+
| `/swarm evidence 2.1` | Show review/test results for a specific task |
|
|
113
|
+
| `/swarm history` | What's been completed so far |
|
|
114
|
+
| `/swarm reset --confirm` | Start over (clears all swarm state) |
|
|
167
115
|
|
|
168
|
-
|
|
116
|
+
---
|
|
169
117
|
|
|
170
|
-
|
|
118
|
+
## The Agents
|
|
171
119
|
|
|
172
|
-
|
|
120
|
+
Swarm has nine agents. You don't interact with them directly. The architect orchestrates everything.
|
|
173
121
|
|
|
174
|
-
|
|
122
|
+
| Agent | Role | When It Runs |
|
|
123
|
+
|-------|------|-------------|
|
|
124
|
+
| **architect** | Plans the project, delegates tasks, enforces quality gates | Always (it's the coordinator) |
|
|
125
|
+
| **explorer** | Scans your codebase to understand what exists | Before planning, after each phase |
|
|
126
|
+
| **sme** | Domain expert (security, APIs, databases, whatever is needed) | During planning, guidance is cached |
|
|
127
|
+
| **critic** | Reviews the plan before any code is written | After planning, before execution |
|
|
128
|
+
| **coder** | Writes code, one task at a time | During execution |
|
|
129
|
+
| **reviewer** | Reviews code for correctness and security issues | After every task |
|
|
130
|
+
| **test_engineer** | Writes and runs tests, including adversarial edge cases | After every task |
|
|
131
|
+
| **designer** | Generates UI scaffolds and design tokens (opt-in) | Before UI tasks |
|
|
132
|
+
| **docs** | Updates documentation to match what was actually built | After each phase |
|
|
175
133
|
|
|
176
|
-
|
|
134
|
+
---
|
|
177
135
|
|
|
178
|
-
|
|
136
|
+
## How It Compares
|
|
179
137
|
|
|
180
|
-
|
|
138
|
+
| | OpenCode Swarm | oh-my-opencode | get-shit-done |
|
|
139
|
+
|---|:-:|:-:|:-:|
|
|
140
|
+
| Multiple specialized agents | ✅ 9 agents | ❌ Prompt config | ❌ Single-agent macros |
|
|
141
|
+
| Plan reviewed before coding starts | ✅ | ❌ | ❌ |
|
|
142
|
+
| Every task reviewed + tested | ✅ | ❌ | ❌ |
|
|
143
|
+
| Different model for review vs. coding | ✅ | ❌ | ❌ |
|
|
144
|
+
| Saves state to disk, resumable | ✅ | ❌ | ❌ |
|
|
145
|
+
| Security scanning built in | ✅ | ❌ | ❌ |
|
|
146
|
+
| Learns from its own mistakes | ✅ (retrospectives) | ❌ | ❌ |
|
|
181
147
|
|
|
182
148
|
---
|
|
183
149
|
|
|
184
|
-
|
|
150
|
+
<details>
|
|
151
|
+
<summary><strong>Full Execution Pipeline (Technical Detail)</strong></summary>
|
|
185
152
|
|
|
186
|
-
|
|
153
|
+
### The Pipeline
|
|
154
|
+
|
|
155
|
+
Every task goes through this sequence. No exceptions, no overrides.
|
|
187
156
|
|
|
188
157
|
```
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
├──
|
|
192
|
-
├──
|
|
193
|
-
├──
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
158
|
+
MODE: EXECUTE (per task)
|
|
159
|
+
│
|
|
160
|
+
├── 5a. @coder implements (ONE task only)
|
|
161
|
+
├── 5b. diff + imports (contract + dependency analysis)
|
|
162
|
+
├── 5c. syntax_check (parse validation)
|
|
163
|
+
├── 5d. placeholder_scan (catches TODOs, stubs, incomplete code)
|
|
164
|
+
├── 5e. lint fix → lint check
|
|
165
|
+
├── 5f. build_check (does it compile?)
|
|
166
|
+
├── 5g. pre_check_batch (4 parallel: lint, secretscan, SAST, quality budget)
|
|
167
|
+
├── 5h. @reviewer (correctness pass)
|
|
168
|
+
├── 5i. @reviewer (security pass, if security-sensitive files changed)
|
|
169
|
+
├── 5j. @test_engineer (verification tests + coverage ≥70%)
|
|
170
|
+
├── 5k. @test_engineer (adversarial tests)
|
|
171
|
+
├── 5l. ⛔ Pre-commit checklist (all 4 items required, no override)
|
|
172
|
+
└── 5m. Task marked complete, evidence written
|
|
199
173
|
```
|
|
200
174
|
|
|
201
|
-
|
|
175
|
+
If any step fails, the coder gets structured feedback and retries. After 5 failures on the same task, it escalates to you.
|
|
176
|
+
|
|
177
|
+
### Architect Workflow Modes
|
|
178
|
+
|
|
179
|
+
The architect moves through these modes automatically:
|
|
180
|
+
|
|
181
|
+
| Mode | What Happens |
|
|
182
|
+
|------|-------------|
|
|
183
|
+
| `RESUME` | Checks if `.swarm/plan.md` exists, picks up where it left off |
|
|
184
|
+
| `CLARIFY` | Asks you questions (only what it can't infer) |
|
|
185
|
+
| `DISCOVER` | Explorer scans the codebase |
|
|
186
|
+
| `CONSULT` | SME agents provide domain guidance |
|
|
187
|
+
| `PLAN` | Architect writes the phased plan |
|
|
188
|
+
| `CRITIC-GATE` | Critic reviews the plan (max 2 revision cycles) |
|
|
189
|
+
| `EXECUTE` | Tasks are implemented one at a time through the QA pipeline |
|
|
190
|
+
| `PHASE-WRAP` | Phase completes, docs update, retrospective written |
|
|
191
|
+
|
|
192
|
+
</details>
|
|
193
|
+
|
|
194
|
+
<details>
|
|
195
|
+
<summary><strong>Persistent Memory (What's in .swarm/)</strong></summary>
|
|
196
|
+
|
|
197
|
+
### plan.md: Your Project Roadmap
|
|
202
198
|
|
|
203
199
|
```markdown
|
|
204
200
|
# Project: Auth System
|
|
@@ -215,156 +211,108 @@ Current Phase: 2
|
|
|
215
211
|
- Acceptance: Returns valid JWT with user claims, 15-minute expiry
|
|
216
212
|
- Attempt 1: REJECTED — missing expiration claim
|
|
217
213
|
- [ ] Task 2.3: Token validation middleware [MEDIUM]
|
|
218
|
-
- [BLOCKED] Task 2.4: Refresh token rotation
|
|
219
|
-
- Reason: Awaiting decision on rotation strategy
|
|
220
214
|
```
|
|
221
215
|
|
|
222
|
-
### context.md
|
|
216
|
+
### context.md: What's Been Decided
|
|
223
217
|
|
|
224
218
|
```markdown
|
|
225
|
-
# Project Context: Auth System
|
|
226
|
-
|
|
227
219
|
## Technical Decisions
|
|
228
220
|
- bcrypt cost factor: 12
|
|
229
221
|
- JWT TTL: 15 minutes; refresh TTL: 7 days
|
|
230
|
-
- Refresh token store: Redis with key prefix auth:refresh:
|
|
231
222
|
|
|
232
|
-
## SME Guidance
|
|
223
|
+
## SME Guidance (cached, never re-asked)
|
|
233
224
|
### security (Phase 1)
|
|
234
|
-
- Never log tokens or passwords
|
|
235
|
-
-
|
|
236
|
-
- Rate-limit login endpoint: 5 attempts / 15 minutes per IP
|
|
225
|
+
- Never log tokens or passwords
|
|
226
|
+
- Rate-limit login: 5 attempts / 15 min per IP
|
|
237
227
|
|
|
238
228
|
### api (Phase 1)
|
|
239
|
-
- Return
|
|
240
|
-
- Include token expiry timestamp in response body
|
|
241
|
-
|
|
242
|
-
## Patterns Established
|
|
243
|
-
- Error handling: custom ApiError class with HTTP status and error code
|
|
244
|
-
- Validation: Zod schemas in /validators/, applied at request boundary
|
|
229
|
+
- Return 401 for invalid credentials (not 404)
|
|
245
230
|
```
|
|
246
231
|
|
|
247
|
-
Start a new session tomorrow. The Architect reads these files and picks up exactly where you left off — no re-explaining, no rediscovery, no drift.
|
|
248
|
-
|
|
249
232
|
### Evidence Bundles
|
|
250
233
|
|
|
251
|
-
|
|
234
|
+
Every completed task writes structured evidence to `.swarm/evidence/`:
|
|
252
235
|
|
|
253
236
|
| Type | What It Captures |
|
|
254
|
-
|
|
255
|
-
|
|
|
256
|
-
|
|
|
257
|
-
|
|
|
258
|
-
|
|
|
259
|
-
| `retrospective` | Phase metrics: total tool calls, coder revisions, reviewer rejections, test failures, security findings, lessons learned |
|
|
237
|
+
|------|--------------------|
|
|
238
|
+
| review | Verdict, risk level, specific issues |
|
|
239
|
+
| test | Pass/fail counts, coverage %, failure messages |
|
|
240
|
+
| diff | Files changed, additions/deletions |
|
|
241
|
+
| retrospective | Phase metrics, lessons learned (injected into next phase) |
|
|
260
242
|
|
|
261
|
-
|
|
243
|
+
</details>
|
|
262
244
|
|
|
263
|
-
|
|
245
|
+
<details>
|
|
246
|
+
<summary><strong>Guardrails and Circuit Breakers</strong></summary>
|
|
264
247
|
|
|
265
|
-
|
|
248
|
+
Every agent runs inside a circuit breaker that kills runaway behavior before it burns your credits.
|
|
266
249
|
|
|
267
|
-
|
|
250
|
+
| Signal | Default Limit | What Happens |
|
|
251
|
+
|--------|:---:|-------------|
|
|
252
|
+
| Tool calls | 200 | Agent is stopped |
|
|
253
|
+
| Duration | 30 min | Agent is stopped |
|
|
254
|
+
| Same tool repeated | 10x | Agent is warned, then stopped |
|
|
255
|
+
| Consecutive errors | 5 | Agent is stopped |
|
|
256
|
+
|
|
257
|
+
Limits reset per task. A coder working on Task 2.3 is not penalized for tool calls made during Task 2.2.
|
|
258
|
+
|
|
259
|
+
Per-agent overrides:
|
|
268
260
|
|
|
269
261
|
```json
|
|
270
262
|
{
|
|
271
|
-
"
|
|
272
|
-
"
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
"critic": { "model": "zai-coding-plan/glm-5" },
|
|
277
|
-
"reviewer": { "model": "zai-coding-plan/glm-5" },
|
|
278
|
-
"test_engineer": { "model": "minimax-coding-plan/MiniMax-M2.5" },
|
|
279
|
-
"docs": { "model": "zai-coding-plan/glm-4.7-flash" },
|
|
280
|
-
"designer": { "model": "kimi-for-coding/k2p5" }
|
|
263
|
+
"guardrails": {
|
|
264
|
+
"profiles": {
|
|
265
|
+
"coder": { "max_tool_calls": 500, "max_duration_minutes": 60 },
|
|
266
|
+
"explorer": { "max_tool_calls": 50 }
|
|
267
|
+
}
|
|
281
268
|
}
|
|
282
269
|
}
|
|
283
270
|
```
|
|
284
271
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
---
|
|
272
|
+
</details>
|
|
288
273
|
|
|
289
|
-
|
|
274
|
+
<details>
|
|
275
|
+
<summary><strong>Quality Gates (Technical Detail)</strong></summary>
|
|
290
276
|
|
|
291
|
-
|
|
277
|
+
### Built-in Tools
|
|
292
278
|
|
|
293
|
-
|
|
|
294
|
-
|
|
295
|
-
|
|
|
296
|
-
|
|
|
279
|
+
| Tool | What It Does |
|
|
280
|
+
|------|-------------|
|
|
281
|
+
| syntax_check | Tree-sitter validation across 9+ languages |
|
|
282
|
+
| placeholder_scan | Catches TODOs, FIXMEs, stubs, placeholder text |
|
|
283
|
+
| sast_scan | Offline security analysis, 63+ rules, 9 languages |
|
|
284
|
+
| sbom_generate | CycloneDX dependency tracking, 8 ecosystems |
|
|
285
|
+
| build_check | Runs your project's native build/typecheck |
|
|
286
|
+
| quality_budget | Enforces complexity, duplication, and test ratio limits |
|
|
287
|
+
| pre_check_batch | Runs lint, secretscan, SAST, and quality budget in parallel (~15s vs ~60s sequential) |
|
|
297
288
|
|
|
298
|
-
|
|
299
|
-
|--------|---------|-------------|
|
|
300
|
-
| Tool calls | 200 | Per-invocation, not per-session |
|
|
301
|
-
| Duration | 30 min | Wall-clock time per delegation |
|
|
302
|
-
| Repetition | 10 | Same tool + args consecutively |
|
|
303
|
-
| Consecutive errors | 5 | Sequential null/undefined outputs |
|
|
289
|
+
All tools run locally. No Docker, no network calls, no external APIs.
|
|
304
290
|
|
|
305
|
-
|
|
291
|
+
Optional enhancement: Semgrep (if on PATH).
|
|
306
292
|
|
|
307
|
-
|
|
293
|
+
### Gate Configuration
|
|
308
294
|
|
|
309
|
-
```
|
|
295
|
+
```json
|
|
310
296
|
{
|
|
311
|
-
"
|
|
312
|
-
"
|
|
313
|
-
"
|
|
314
|
-
|
|
315
|
-
|
|
297
|
+
"gates": {
|
|
298
|
+
"syntax_check": { "enabled": true },
|
|
299
|
+
"placeholder_scan": { "enabled": true },
|
|
300
|
+
"sast_scan": { "enabled": true },
|
|
301
|
+
"quality_budget": {
|
|
302
|
+
"enabled": true,
|
|
303
|
+
"max_complexity_delta": 5,
|
|
304
|
+
"min_test_to_code_ratio": 0.3
|
|
316
305
|
}
|
|
317
306
|
}
|
|
318
307
|
}
|
|
319
308
|
```
|
|
320
309
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
## Comparison
|
|
324
|
-
|
|
325
|
-
| Feature | OpenCode Swarm | oh-my-opencode | get-shit-done | AutoGen | CrewAI |
|
|
326
|
-
|---------|:-:|:-:|:-:|:-:|:-:|
|
|
327
|
-
| Multi-agent orchestration | ✅ 9 specialized agents | ❌ Prompt config only | ❌ Single-agent macros | ✅ | ✅ |
|
|
328
|
-
| Execution model | Serial (deterministic) | N/A | N/A | Parallel (chaotic) | Parallel |
|
|
329
|
-
| Phased planning with acceptance criteria | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
330
|
-
| Critic gate before implementation | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
331
|
-
| Per-task dual-pass review (correctness + security) | ✅ | ❌ | ❌ | Optional | Optional |
|
|
332
|
-
| Adversarial test pass per task | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
333
|
-
| Pre-reviewer pipeline (lint, secretscan, imports) | ✅ v6.3 | ❌ | ❌ | ❌ | ❌ |
|
|
334
|
-
| Persistent session memory | ✅ `.swarm/` files | ❌ | ❌ | Session only | Session only |
|
|
335
|
-
| Resume projects across sessions | ✅ Native | ❌ | ❌ | ❌ | ❌ |
|
|
336
|
-
| Evidence trail per task | ✅ Structured bundles | ❌ | ❌ | ❌ | ❌ |
|
|
337
|
-
| Heterogeneous model routing | ✅ Per-agent | ❌ | ❌ | Limited | Limited |
|
|
338
|
-
| Circuit breaker / guardrails | ✅ Per-invocation | ❌ | ❌ | ❌ | ❌ |
|
|
339
|
-
| Open-domain SME consultation | ✅ Any domain | ❌ | ❌ | ❌ | ❌ |
|
|
340
|
-
| Retrospective learning across phases | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
341
|
-
| Slash commands + diagnostics | ✅ 12 commands | ❌ | Limited | ❌ | ❌ |
|
|
342
|
-
|
|
343
|
-
---
|
|
344
|
-
|
|
345
|
-
## Slash Commands
|
|
346
|
-
|
|
347
|
-
| Command | Description |
|
|
348
|
-
|---------|-------------|
|
|
349
|
-
| `/swarm status` | Current phase, task progress, agent count |
|
|
350
|
-
| `/swarm plan [N]` | Full plan or filtered by phase |
|
|
351
|
-
| `/swarm agents` | All registered agents with models and permissions |
|
|
352
|
-
| `/swarm history` | Completed phases with status |
|
|
353
|
-
| `/swarm config` | Current resolved configuration |
|
|
354
|
-
| `/swarm diagnose` | Health check for `.swarm/` files and config |
|
|
355
|
-
| `/swarm export` | Export plan and context as portable JSON |
|
|
356
|
-
| `/swarm evidence [task]` | Evidence bundles for a task or all tasks |
|
|
357
|
-
| `/swarm archive [--dry-run]` | Archive old evidence with retention policy |
|
|
358
|
-
| `/swarm benchmark` | Performance benchmarks |
|
|
359
|
-
| `/swarm retrieve [id]` | Retrieve auto-summarized tool outputs |
|
|
360
|
-
| `/swarm reset --confirm` | Clear swarm state files |
|
|
361
|
-
| `/swarm preflight` | Run phase preflight checks (v6.7) |
|
|
362
|
-
| `/swarm config doctor [--fix] [--restore <id>]` | Config validation with optional auto-fix (v6.7) |
|
|
363
|
-
| `/swarm sync-plan` | Force plan.md regeneration from plan.json (v6.7) |
|
|
310
|
+
</details>
|
|
364
311
|
|
|
365
|
-
|
|
312
|
+
<details>
|
|
313
|
+
<summary><strong>Full Configuration Reference</strong></summary>
|
|
366
314
|
|
|
367
|
-
|
|
315
|
+
Config file location: `~/.config/opencode/opencode-swarm.json` (global) or `.opencode/swarm.json` (project). Project config merges over global.
|
|
368
316
|
|
|
369
317
|
```json
|
|
370
318
|
{
|
|
@@ -388,7 +336,7 @@ Per-agent profiles allow fine-grained overrides:
|
|
|
388
336
|
},
|
|
389
337
|
"review_passes": {
|
|
390
338
|
"always_security_review": false,
|
|
391
|
-
"security_globs": ["**/*auth*", "**/*crypto*", "**/*session*"
|
|
339
|
+
"security_globs": ["**/*auth*", "**/*crypto*", "**/*session*"]
|
|
392
340
|
},
|
|
393
341
|
"automation": {
|
|
394
342
|
"mode": "manual",
|
|
@@ -396,7 +344,6 @@ Per-agent profiles allow fine-grained overrides:
|
|
|
396
344
|
"plan_sync": false,
|
|
397
345
|
"phase_preflight": false,
|
|
398
346
|
"config_doctor_on_startup": false,
|
|
399
|
-
"config_doctor_autofix": false,
|
|
400
347
|
"evidence_auto_summaries": false,
|
|
401
348
|
"decision_drift_detection": false
|
|
402
349
|
}
|
|
@@ -404,333 +351,93 @@ Per-agent profiles allow fine-grained overrides:
|
|
|
404
351
|
}
|
|
405
352
|
```
|
|
406
353
|
|
|
407
|
-
|
|
354
|
+
### Automation Modes
|
|
408
355
|
|
|
409
|
-
|
|
356
|
+
| Mode | Behavior |
|
|
357
|
+
|------|----------|
|
|
358
|
+
| `manual` | No background automation (default) |
|
|
359
|
+
| `hybrid` | Background automation for safe ops, manual for sensitive ones |
|
|
360
|
+
| `auto` | Full background automation |
|
|
410
361
|
|
|
411
|
-
|
|
362
|
+
### Disabling Agents
|
|
412
363
|
|
|
413
364
|
```json
|
|
414
365
|
{
|
|
415
|
-
"
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
"plan_sync": true,
|
|
419
|
-
"config_doctor_on_startup": true,
|
|
420
|
-
"evidence_auto_summaries": true
|
|
421
|
-
}
|
|
422
|
-
}
|
|
366
|
+
"sme": { "disabled": true },
|
|
367
|
+
"designer": { "disabled": true },
|
|
368
|
+
"test_engineer": { "disabled": true }
|
|
423
369
|
}
|
|
424
370
|
```
|
|
425
371
|
|
|
426
|
-
|
|
427
|
-
- `manual` - No background automation (default)
|
|
428
|
-
- `hybrid` - Background automation for safe ops, manual for sensitive ones
|
|
429
|
-
- `auto` - Full background automation (target state)
|
|
372
|
+
</details>
|
|
430
373
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
- `phase_preflight` - Phase-boundary validation before agent execution
|
|
434
|
-
- `config_doctor_on_startup` - Config validation on plugin initialization
|
|
435
|
-
- `config_doctor_autofix` - Auto-fix mode for Config Doctor (requires explicit opt-in)
|
|
436
|
-
- `evidence_auto_summaries` - Auto-generate evidence summaries
|
|
437
|
-
- `decision_drift_detection` - Detect drift between planned and actual decisions
|
|
374
|
+
<details>
|
|
375
|
+
<summary><strong>All Slash Commands</strong></summary>
|
|
438
376
|
|
|
439
|
-
|
|
377
|
+
| Command | Description |
|
|
378
|
+
|---------|-------------|
|
|
379
|
+
| `/swarm status` | Current phase, task progress, agent count |
|
|
380
|
+
| `/swarm plan [N]` | Full plan or filtered by phase |
|
|
381
|
+
| `/swarm agents` | Registered agents with models and permissions |
|
|
382
|
+
| `/swarm history` | Completed phases with status |
|
|
383
|
+
| `/swarm config` | Current resolved configuration |
|
|
384
|
+
| `/swarm diagnose` | Health check for `.swarm/` files and config |
|
|
385
|
+
| `/swarm export` | Export plan and context as portable JSON |
|
|
386
|
+
| `/swarm evidence [task]` | Evidence bundles for a task or all tasks |
|
|
387
|
+
| `/swarm archive [--dry-run]` | Archive old evidence with retention policy |
|
|
388
|
+
| `/swarm benchmark` | Performance benchmarks |
|
|
389
|
+
| `/swarm retrieve [id]` | Retrieve auto-summarized tool outputs |
|
|
390
|
+
| `/swarm reset --confirm` | Clear swarm state files |
|
|
391
|
+
| `/swarm preflight` | Run phase preflight checks |
|
|
392
|
+
| `/swarm config doctor [--fix]` | Config validation with optional auto-fix |
|
|
393
|
+
| `/swarm sync-plan` | Force plan.md regeneration from plan.json |
|
|
440
394
|
|
|
441
|
-
|
|
442
|
-
{
|
|
443
|
-
"sme": { "disabled": true },
|
|
444
|
-
"designer": { "disabled": true },
|
|
445
|
-
"test_engineer": { "disabled": true }
|
|
446
|
-
}
|
|
447
|
-
```
|
|
395
|
+
</details>
|
|
448
396
|
|
|
449
397
|
---
|
|
450
398
|
|
|
451
|
-
##
|
|
399
|
+
## Recent Changes
|
|
452
400
|
|
|
453
|
-
|
|
454
|
-
# Install globally
|
|
455
|
-
npm install -g opencode-swarm
|
|
456
|
-
|
|
457
|
-
# Or use npx
|
|
458
|
-
npx opencode-swarm install
|
|
401
|
+
### v6.12.0 — Anti-Process-Violation Hardening
|
|
459
402
|
|
|
460
|
-
|
|
461
|
-
opencode # then: /swarm diagnose
|
|
462
|
-
```
|
|
403
|
+
This release adds runtime detection hooks to catch and warn about architect workflow violations:
|
|
463
404
|
|
|
464
|
-
|
|
405
|
+
- **Self-coding detection**: Warns when the architect writes code directly instead of delegating
|
|
406
|
+
- **Partial gate tracking**: Detects when QA gates are skipped
|
|
407
|
+
- **Self-fix detection**: Warns when an agent fixes its own gate failure (should delegate to fresh agent)
|
|
408
|
+
- **Batch detection**: Catches "implement X and add Y" batching in task requests
|
|
409
|
+
- **Zero-delegation detection**: Warns when tasks complete without any coder delegation
|
|
465
410
|
|
|
466
|
-
|
|
467
|
-
{
|
|
468
|
-
"plugins": ["opencode-swarm"]
|
|
469
|
-
}
|
|
470
|
-
```
|
|
411
|
+
These hooks are advisory (warnings only) and help maintain workflow discipline during long sessions.
|
|
471
412
|
|
|
472
413
|
---
|
|
473
414
|
|
|
474
415
|
## Testing
|
|
475
416
|
|
|
476
|
-
|
|
417
|
+
6,000+ tests. Unit, integration, adversarial, and smoke. Zero additional test dependencies.
|
|
477
418
|
|
|
478
419
|
```bash
|
|
479
420
|
bun test
|
|
480
421
|
```
|
|
481
422
|
|
|
482
|
-
Zero additional test dependencies. Uses Bun's built-in test runner.
|
|
483
|
-
|
|
484
423
|
---
|
|
485
424
|
|
|
486
|
-
##
|
|
487
|
-
|
|
488
|
-
### syntax_check - Tree-sitter Parse Validation
|
|
489
|
-
Validates syntax across 9+ languages using Tree-sitter parsers. Catches syntax errors before review.
|
|
490
|
-
|
|
491
|
-
### placeholder_scan - Anti-Slop Detection
|
|
492
|
-
Detects TODO/FIXME comments, placeholder text, and stub implementations. Prevents shipping incomplete code.
|
|
493
|
-
|
|
494
|
-
### sast_scan - Static Security Analysis
|
|
495
|
-
Offline SAST with 63+ security rules across 9 languages. Optional Semgrep Tier B enhancement if available on PATH.
|
|
496
|
-
|
|
497
|
-
### sbom_generate - Dependency Tracking
|
|
498
|
-
Generates CycloneDX SBOMs from manifests/lock files. Tracks dependencies for 8 ecosystems.
|
|
499
|
-
|
|
500
|
-
### build_check - Build Verification
|
|
501
|
-
Runs repo-native build/typecheck commands. Ensures code compiles before review.
|
|
502
|
-
|
|
503
|
-
### quality_budget - Maintainability Enforcement
|
|
504
|
-
Enforces complexity, API, duplication, and test-to-code ratio budgets. Configurable thresholds.
|
|
505
|
-
|
|
506
|
-
## Parallel Pre-Check Batch (v6.10.0)
|
|
507
|
-
|
|
508
|
-
### pre_check_batch - Parallel Verification
|
|
509
|
-
|
|
510
|
-
Runs four verification tools in parallel for faster QA gate execution:
|
|
511
|
-
- **lint:check** - Code quality verification (hard gate)
|
|
512
|
-
- **secretscan** - Secret detection (hard gate)
|
|
513
|
-
- **sast_scan** - Static security analysis (hard gate)
|
|
514
|
-
- **quality_budget** - Maintainability metrics
|
|
515
|
-
|
|
516
|
-
**Purpose**: Reduces total gate execution time from ~60s (sequential) to ~15s (parallel) by running independent checks concurrently.
|
|
517
|
-
|
|
518
|
-
**When to use**: After `build_check` passes and before `@reviewer` — all 4 gates must pass for `gates_passed: true`.
|
|
519
|
-
|
|
520
|
-
**Usage**:
|
|
521
|
-
```typescript
|
|
522
|
-
const result = await pre_check_batch({
|
|
523
|
-
directory: ".",
|
|
524
|
-
files: ["src/auth.ts", "src/session.ts"],
|
|
525
|
-
sast_threshold: "medium"
|
|
526
|
-
});
|
|
527
|
-
|
|
528
|
-
// Returns:
|
|
529
|
-
// {
|
|
530
|
-
// gates_passed: boolean, // All hard gates passed
|
|
531
|
-
// lint: { ran, result, error, duration_ms },
|
|
532
|
-
// secretscan: { ran, result, error, duration_ms },
|
|
533
|
-
// sast_scan: { ran, result, error, duration_ms },
|
|
534
|
-
// quality_budget: { ran, result, error, duration_ms },
|
|
535
|
-
// total_duration_ms: number
|
|
536
|
-
// }
|
|
537
|
-
```
|
|
538
|
-
|
|
539
|
-
**Hard Gates** (must pass for gates_passed=true):
|
|
540
|
-
- Lint errors → Fix and retry
|
|
541
|
-
- Secrets found → Fix and retry
|
|
542
|
-
- SAST vulnerabilities at/above threshold → Fix and retry
|
|
543
|
-
- Quality budget violations → Refactor or adjust thresholds
|
|
544
|
-
|
|
545
|
-
**Parallel Execution Safety**:
|
|
546
|
-
- Max 4 concurrent operations via `p-limit`
|
|
547
|
-
- 60-second timeout per tool
|
|
548
|
-
- 500KB output size limit
|
|
549
|
-
- Individual tool failures don't cascade to others
|
|
550
|
-
|
|
551
|
-
### Configuration
|
|
552
|
-
|
|
553
|
-
Enable/disable parallel pre-check via `.opencode/swarm.json`:
|
|
554
|
-
|
|
555
|
-
```json
|
|
556
|
-
{
|
|
557
|
-
"pipeline": {
|
|
558
|
-
"parallel_precheck": true // default: true
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
```
|
|
562
|
-
|
|
563
|
-
Set to `false` to run gates sequentially (useful for debugging or resource-constrained environments).
|
|
564
|
-
|
|
565
|
-
### Updated Phase 5 QA Sequence (v6.11.0)
|
|
566
|
-
|
|
567
|
-
Complete execution pipeline with MODE labels and observable outputs:
|
|
568
|
-
|
|
569
|
-
```
|
|
570
|
-
MODE: EXECUTE (per task)
|
|
571
|
-
│
|
|
572
|
-
├── 5a. @coder implements (ONE task only)
|
|
573
|
-
│ └── → REQUIRED: Print task start confirmation
|
|
574
|
-
│
|
|
575
|
-
├── 5b. diff + imports tools (contract + dependency analysis)
|
|
576
|
-
│ └── → REQUIRED: Print change summary
|
|
577
|
-
│
|
|
578
|
-
├── 5c. syntax_check (parse validation)
|
|
579
|
-
│ └── → REQUIRED: Print syntax status
|
|
580
|
-
│
|
|
581
|
-
├── 5d. placeholder_scan (anti-slop detection)
|
|
582
|
-
│ └── → REQUIRED: Print placeholder scan results
|
|
583
|
-
│
|
|
584
|
-
├── 5e. lint fix → 5f. lint:check (inside pre_check_batch)
|
|
585
|
-
│ └── → REQUIRED: Print lint status
|
|
586
|
-
│
|
|
587
|
-
├── 5g. build_check (compilation verification)
|
|
588
|
-
│ └── → REQUIRED: Print build status
|
|
589
|
-
│
|
|
590
|
-
├── 5h. pre_check_batch (4 parallel gates)
|
|
591
|
-
│ ├── lint:check (hard gate)
|
|
592
|
-
│ ├── secretscan (hard gate)
|
|
593
|
-
│ ├── sast_scan (hard gate)
|
|
594
|
-
│ └── quality_budget (maintainability metrics)
|
|
595
|
-
│ └── → REQUIRED: Print gates_passed status
|
|
596
|
-
│
|
|
597
|
-
├── 5i. @reviewer (correctness pass)
|
|
598
|
-
│ └── → REQUIRED: Print approval decision
|
|
599
|
-
│
|
|
600
|
-
├── 5j. @reviewer security-only pass (if security file)
|
|
601
|
-
│ └── → REQUIRED: Print security approval
|
|
602
|
-
│
|
|
603
|
-
├── 5k. @test_engineer (verification tests + coverage)
|
|
604
|
-
│ └── → REQUIRED: Print test results
|
|
605
|
-
│
|
|
606
|
-
├── 5l. @test_engineer (adversarial tests)
|
|
607
|
-
│ └── → REQUIRED: Print adversarial test results
|
|
608
|
-
│
|
|
609
|
-
├── 5m. ⛔ HARD STOP: Pre-commit checklist
|
|
610
|
-
│ ├── [ ] All QA gates passed (no overrides)
|
|
611
|
-
│ ├── [ ] Reviewer approval documented
|
|
612
|
-
│ ├── [ ] Tests pass with evidence
|
|
613
|
-
│ └── [ ] No security findings
|
|
614
|
-
│ └── → REQUIRED: Print checklist completion
|
|
615
|
-
│
|
|
616
|
-
└── 5n. TASK COMPLETION CHECKLIST (emit before marking complete)
|
|
617
|
-
├── Evidence written to .swarm/evidence/{taskId}/
|
|
618
|
-
├── plan.md updated with [x] task complete
|
|
619
|
-
└── → REQUIRED: Print completion confirmation
|
|
620
|
-
```
|
|
621
|
-
|
|
622
|
-
**MODE Labels** (v6.11): Architect workflow uses MODE labels internally:
|
|
623
|
-
- `MODE: RESUME` — Resume detection
|
|
624
|
-
- `MODE: CLARIFY` — Requirement clarification
|
|
625
|
-
- `MODE: DISCOVER` — Codebase exploration
|
|
626
|
-
- `MODE: CONSULT` — SME consultation
|
|
627
|
-
- `MODE: PLAN` — Plan creation
|
|
628
|
-
- `MODE: CRITIC-GATE` — Plan review checkpoint
|
|
629
|
-
- `MODE: EXECUTE` — Task implementation
|
|
630
|
-
- `MODE: PHASE-WRAP` — Phase completion
|
|
631
|
-
|
|
632
|
-
**NAMESPACE RULE**: MODE labels refer to architect workflow phases. Project plan phases (in plan.md) remain as "Phase N".
|
|
633
|
-
|
|
634
|
-
**Retry Protocol** (v6.11): On failure, emit structured rejection:
|
|
635
|
-
```
|
|
636
|
-
RETRY #{count}/5
|
|
637
|
-
FAILED GATE: {gate_name}
|
|
638
|
-
REASON: {specific failure}
|
|
639
|
-
REQUIRED FIX: {actionable instruction}
|
|
640
|
-
RESUME AT: {step_5x}
|
|
641
|
-
```
|
|
642
|
-
|
|
643
|
-
**Anti-Exemption Rules** (v6.11): The following rationalizations are explicitly blocked:
|
|
644
|
-
- "It's a simple change"
|
|
645
|
-
- "Just updating docs"
|
|
646
|
-
- "Only a config tweak"
|
|
647
|
-
- "Hotfix, no time for QA"
|
|
648
|
-
- "The tests pass locally"
|
|
649
|
-
- "I'll clean it up later"
|
|
650
|
-
- "No logic changes"
|
|
651
|
-
- "Already reviewed the pattern"
|
|
652
|
-
|
|
653
|
-
**Pre-Commit Rule** (v6.11): All 4 checkboxes required before commit. No override. A commit without completed QA gate is a workflow violation.
|
|
654
|
-
|
|
655
|
-
### Rollback
|
|
656
|
-
|
|
657
|
-
If parallel execution causes issues, refer to `.swarm/ROLLBACK-pre-check-batch.md` for rollback instructions.
|
|
658
|
-
|
|
659
|
-
### Local-Only Guarantee
|
|
660
|
-
All v6.9.0 quality tools run locally without:
|
|
661
|
-
- Docker containers
|
|
662
|
-
- Network connections
|
|
663
|
-
- External APIs
|
|
664
|
-
- Cloud services
|
|
665
|
-
|
|
666
|
-
Optional enhancement: Semgrep (if already on PATH)
|
|
667
|
-
|
|
668
|
-
### Configuration
|
|
669
|
-
Configure gates in `.opencode/swarm.json`:
|
|
425
|
+
## Design Principles
|
|
670
426
|
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
"sbom_generate": { "enabled": true },
|
|
678
|
-
"build_check": { "enabled": true },
|
|
679
|
-
"quality_budget": {
|
|
680
|
-
"enabled": true,
|
|
681
|
-
"max_complexity_delta": 5,
|
|
682
|
-
"max_public_api_delta": 10,
|
|
683
|
-
"max_duplication_ratio": 0.05,
|
|
684
|
-
"min_test_to_code_ratio": 0.3
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
```
|
|
427
|
+
1. **Plan before code.** The critic approves the plan before a single line is written.
|
|
428
|
+
2. **One task at a time.** The coder gets one task and full context. Nothing else.
|
|
429
|
+
3. **Review everything immediately.** Correctness, security, tests, adversarial tests. Every task.
|
|
430
|
+
4. **Different models catch different bugs.** The coder's blind spot is the reviewer's strength.
|
|
431
|
+
5. **Save everything to disk.** Any session, any model, any day, pick up where you left off.
|
|
432
|
+
6. **Document failures.** Rejections and retries are recorded. After 5 failures, it escalates to you.
|
|
689
433
|
|
|
690
434
|
---
|
|
691
435
|
|
|
692
436
|
## Roadmap
|
|
693
437
|
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
Three new tools complete the pre-reviewer gauntlet. Code reaching the Reviewer is already clean.
|
|
697
|
-
|
|
698
|
-
- **`imports`** — AST-based import graph. For each file changed by the coder, returns every consumer file, which exports each consumer uses, and the line numbers. Replaces fragile grep-based integration analysis with deterministic graph traversal.
|
|
699
|
-
- **`lint`** — Auto-detects project linter (Biome, ESLint, Ruff, Clippy, PSScriptAnalyzer). Runs in fix mode first, then check mode. Structured diagnostic output per file.
|
|
700
|
-
- **`secretscan`** — Entropy-based credential scanner. Detects API keys, tokens, connection strings, and private key headers in the diff before they reach the reviewer. Zero external dependencies.
|
|
701
|
-
|
|
702
|
-
Phase 5 execute loop becomes: `coder → diff → imports → lint fix → lint check → secretscan → reviewer → security reviewer → test_engineer → adversarial test_engineer`.
|
|
703
|
-
|
|
704
|
-
### v6.4 — Execution and Planning Tools
|
|
705
|
-
|
|
706
|
-
- **`test_runner`** — Unified test execution across Bun, Vitest, Jest, Mocha, pytest, cargo test, and Pester. Auto-detects framework, returns normalized JSON with pass/fail/skip counts and coverage. Three scope modes: `all`, `convention` (naming-based), `graph` (import-graph-based). Eliminates the test_engineer's most common failure mode.
|
|
707
|
-
- **`symbols`** — Export inventory for a module: functions, classes, interfaces, types, enums. Gives the Architect instant visibility into a file's public API surface without reading the full source.
|
|
708
|
-
- **`checkpoint`** — Git-backed save points. Before any multi-file refactor (≥3 files), Architect auto-creates a checkpoint commit. On critical integration failure, restores via soft reset instead of iterating into a hole.
|
|
709
|
-
|
|
710
|
-
### v6.5 — Intelligence and Audit Tools
|
|
711
|
-
|
|
712
|
-
Five tools that improve planning quality and post-phase validation:
|
|
713
|
-
|
|
714
|
-
- **`pkg_audit`** — Wraps `npm audit`, `pip-audit`, `cargo audit`. Structured CVE output with severity, patched versions, and advisory URLs. Fed to the security reviewer for concrete vulnerability context.
|
|
715
|
-
- **`complexity_hotspots`** — Git churn × cyclomatic complexity risk map. Run in Phase 0/2 to identify modules that need stricter QA gates before implementation begins.
|
|
716
|
-
- **`schema_drift`** — Compares OpenAPI spec against actual route implementations. Surfaces undocumented routes and phantom spec paths. Run in Phase 6 when API routes were modified.
|
|
717
|
-
- **`todo_extract`** — Structured extraction of `TODO`, `FIXME`, and `HACK` annotations across the codebase. High-priority items fed directly into plan task candidates.
|
|
718
|
-
- **`evidence_check`** — Audits completed tasks against required evidence types. Run in Phase 6 to verify every task has review and test evidence before the phase is marked complete.
|
|
719
|
-
|
|
720
|
-
---
|
|
721
|
-
|
|
722
|
-
## Design Principles
|
|
438
|
+
See [CHANGELOG.md](CHANGELOG.md) for shipped features.
|
|
723
439
|
|
|
724
|
-
|
|
725
|
-
2. **One task at a time** — The Coder gets one task and full context. Nothing else.
|
|
726
|
-
3. **Review everything immediately** — Every task goes through correctness review, security review, verification tests, and adversarial tests. No task ships without passing all four.
|
|
727
|
-
4. **Cache SME knowledge** — Guidance is written to `context.md`. The same domain question is never asked twice in a project.
|
|
728
|
-
5. **Persistent memory** — `.swarm/` files are the ground truth. Any session, any model, any day.
|
|
729
|
-
6. **Serial execution** — Predictable, debuggable, no race conditions, no conflicting writes.
|
|
730
|
-
7. **Heterogeneous models** — Different models, different blind spots. The coder's bug is the reviewer's catch.
|
|
731
|
-
8. **User checkpoints** — Phase transitions require user confirmation. No unsupervised multi-phase runs.
|
|
732
|
-
9. **Document failures** — Rejections and retries are recorded in plan.md. After 5 failed attempts, the task escalates to the user.
|
|
733
|
-
10. **Resumable by design** — A cold-start Architect can read `.swarm/` and continue any project as if it had been there from the beginning.
|
|
440
|
+
Upcoming: v6.12 targets process violation hardening based on field testing with models that attempt to bypass QA gates.
|
|
734
441
|
|
|
735
442
|
---
|
|
736
443
|
|
|
@@ -739,8 +446,7 @@ Five tools that improve planning quality and post-phase validation:
|
|
|
739
446
|
- [Architecture Deep Dive](docs/architecture.md)
|
|
740
447
|
- [Design Rationale](docs/design-rationale.md)
|
|
741
448
|
- [Installation Guide](docs/installation.md)
|
|
742
|
-
- [Linux +
|
|
743
|
-
- [LLM Operator Install Guide](docs/installation-llm-operator.md)
|
|
449
|
+
- [Linux + Docker Desktop Install Guide](docs/installation-linux-docker.md)
|
|
744
450
|
|
|
745
451
|
---
|
|
746
452
|
|
|
@@ -750,6 +456,4 @@ MIT
|
|
|
750
456
|
|
|
751
457
|
---
|
|
752
458
|
|
|
753
|
-
|
|
754
|
-
<strong>Stop hoping your agents figure it out. Start shipping code that actually works.</strong>
|
|
755
|
-
</p>
|
|
459
|
+
**Stop hoping your agents figure it out. Start shipping code that actually works.**
|