opencode-swarm 2.1.0 → 2.1.2
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 +50 -133
- package/dist/index.js +39 -37
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,161 +1,78 @@
|
|
|
1
1
|
# OpenCode Swarm
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
**Architect-driven, multi-agent development for OpenCode.**
|
|
8
|
+
Design-first orchestration with domain-aware SMEs, heterogeneous model perspectives, production-grade code generation, and layered QA.
|
|
6
9
|
|
|
7
|
-
OpenCode Swarm
|
|
10
|
+
OpenCode Swarm is built for engineers who want **structured reasoning, controlled delegation, and predictable outcomes**—not parallel agent noise.
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
2. **SME Agents** provide domain-specific technical expertise (serial execution)
|
|
11
|
-
3. **Coder** implements unified specifications
|
|
12
|
-
4. **QA Agents** (Security Reviewer + Auditor) validate code quality
|
|
13
|
-
5. **Test Engineer** generates test cases for approved code
|
|
12
|
+
---
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
User → Architect (analyze) → [SME Pool - serial] → Architect (collate)
|
|
17
|
-
→ Coder → [QA: Security + Auditor] → Architect (triage) → Test
|
|
18
|
-
```
|
|
14
|
+
## Why OpenCode Swarm
|
|
19
15
|
|
|
20
|
-
|
|
16
|
+
Most agent frameworks parallelize everything and hope coherence emerges later.
|
|
17
|
+
OpenCode Swarm enforces discipline:
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
- A single Architect owns analysis and decisions
|
|
20
|
+
- Experts are consulted only when technically relevant
|
|
21
|
+
- Agents execute serially for traceability
|
|
22
|
+
- Security and correctness are validated before delivery
|
|
23
|
+
- Different models can be assigned per role, introducing genuinely distinct perspectives
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
This design improves **accuracy, efficiency, and failure detection**, especially on complex or high-stakes tasks.
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
opencode
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Configuration
|
|
27
|
+
---
|
|
33
28
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
```json
|
|
37
|
-
{
|
|
38
|
-
"preset": "hybrid",
|
|
39
|
-
"presets": {
|
|
40
|
-
"remote": {
|
|
41
|
-
"architect": { "model": "anthropic/claude-sonnet-4.5" },
|
|
42
|
-
"coder": { "model": "openai/gpt-5.2-codex" },
|
|
43
|
-
"_sme": { "model": "google/gemini-3-flash" },
|
|
44
|
-
"_qa": { "model": "google/gemini-3-flash" },
|
|
45
|
-
"test_engineer": { "model": "google/gemini-3-flash" }
|
|
46
|
-
},
|
|
47
|
-
"hybrid": {
|
|
48
|
-
"architect": { "model": "anthropic/claude-sonnet-4.5" },
|
|
49
|
-
"coder": { "model": "ollama/qwen3:72b" },
|
|
50
|
-
"_sme": { "model": "npu/qwen3:14b" },
|
|
51
|
-
"_qa": { "model": "npu/qwen3:14b" },
|
|
52
|
-
"test_engineer": { "model": "npu/qwen3:14b" }
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
"swarm_mode": "hybrid",
|
|
56
|
-
"gpu_url": "http://192.168.1.100:1234/v1",
|
|
57
|
-
"npu_url": "http://localhost:11435/v1",
|
|
58
|
-
"max_iterations": 5
|
|
59
|
-
}
|
|
60
|
-
```
|
|
29
|
+
## Key Advantage: Heterogeneous Model Perspectives
|
|
61
30
|
|
|
62
|
-
|
|
31
|
+
OpenCode Swarm allows **per-role model selection** so that each cognitive function is optimized independently:
|
|
63
32
|
|
|
64
|
-
|
|
33
|
+
- Architect → deep reasoning and synthesis
|
|
34
|
+
- SMEs → domain recall and speed
|
|
35
|
+
- Coder → implementation fidelity
|
|
36
|
+
- QA → adversarial review and audit rigor
|
|
65
37
|
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
-
"agents": {
|
|
69
|
-
"_sme": { "model": "npu/qwen3:14b" },
|
|
70
|
-
"_qa": { "model": "npu/qwen3:14b" }
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
```
|
|
38
|
+
Using different models per role reduces correlated failure modes, increases early error detection, and mirrors how real engineering teams benefit from diverse expertise.
|
|
74
39
|
|
|
75
|
-
|
|
40
|
+
See: [docs/design-rationale.md](docs/design-rationale.md)
|
|
76
41
|
|
|
77
|
-
|
|
78
|
-
{
|
|
79
|
-
"agents": {
|
|
80
|
-
"_sme": { "model": "npu/qwen3:14b" },
|
|
81
|
-
"sme_oracle": { "model": "ollama/qwen3:72b" }
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
```
|
|
42
|
+
---
|
|
85
43
|
|
|
86
|
-
|
|
44
|
+
## Architecture Overview
|
|
87
45
|
|
|
88
|
-
|
|
46
|
+
OpenCode Swarm implements a hub-and-spoke pipeline with a single controlling Architect.
|
|
89
47
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|-------|------|
|
|
101
|
-
| `architect` | Central orchestrator, coordinates all phases |
|
|
102
|
-
|
|
103
|
-
### SME Specialists (Domain Experts)
|
|
104
|
-
|
|
105
|
-
| Agent | Domain |
|
|
106
|
-
|-------|--------|
|
|
107
|
-
| `sme_windows` | Windows OS internals, registry, services |
|
|
108
|
-
| `sme_powershell` | PowerShell scripting, cmdlets, modules |
|
|
109
|
-
| `sme_python` | Python ecosystem, libraries, best practices |
|
|
110
|
-
| `sme_oracle` | Oracle Database, SQL/PLSQL, administration |
|
|
111
|
-
| `sme_network` | Networking, firewalls, DNS, TLS/SSL |
|
|
112
|
-
| `sme_security` | STIG compliance, hardening, encryption |
|
|
113
|
-
| `sme_linux` | Linux administration, systemd, packages |
|
|
114
|
-
| `sme_vmware` | VMware vSphere, ESXi, PowerCLI |
|
|
115
|
-
| `sme_azure` | Azure cloud services, Entra ID, ARM/Bicep |
|
|
116
|
-
| `sme_active_directory` | Active Directory, LDAP, Group Policy |
|
|
117
|
-
| `sme_ui_ux` | UI/UX design, interaction patterns |
|
|
118
|
-
|
|
119
|
-
### Pipeline Agents
|
|
120
|
-
|
|
121
|
-
| Agent | Role |
|
|
122
|
-
|-------|------|
|
|
123
|
-
| `coder` | Implements specifications, writes production code |
|
|
124
|
-
| `security_reviewer` | Security vulnerability assessment |
|
|
125
|
-
| `auditor` | Code correctness and quality review |
|
|
126
|
-
| `test_engineer` | Test case and validation script generation |
|
|
127
|
-
|
|
128
|
-
## Workflow Phases
|
|
129
|
-
|
|
130
|
-
1. **ANALYZE** - Parse request, identify domains, create initial spec
|
|
131
|
-
2. **SME_CONSULTATION** - Consult domain experts serially
|
|
132
|
-
3. **COLLATE** - Synthesize SME outputs into unified spec
|
|
133
|
-
4. **CODE** - Generate implementation
|
|
134
|
-
5. **QA_REVIEW** - Security and quality review (parallel)
|
|
135
|
-
6. **TRIAGE** - Approve, request revision, or block
|
|
136
|
-
7. **TEST** - Generate tests for approved code
|
|
137
|
-
|
|
138
|
-
## Delegation Rules
|
|
48
|
+
```
|
|
49
|
+
User → Architect (analysis)
|
|
50
|
+
→ Reader (optional)
|
|
51
|
+
→ Relevant SMEs (serial)
|
|
52
|
+
→ Architect (spec synthesis)
|
|
53
|
+
→ Coder
|
|
54
|
+
→ Security Review → Audit
|
|
55
|
+
→ Architect (triage)
|
|
56
|
+
→ Test Engineer
|
|
57
|
+
```
|
|
139
58
|
|
|
140
|
-
|
|
59
|
+
See: [docs/architecture.md](docs/architecture.md)
|
|
141
60
|
|
|
142
|
-
|
|
143
|
-
- **QA agents**: May execute in parallel (independent analysis)
|
|
144
|
-
- **Cross-category**: One agent per category may run simultaneously
|
|
61
|
+
---
|
|
145
62
|
|
|
146
|
-
##
|
|
63
|
+
## Installation
|
|
147
64
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"plugin": ["opencode-swarm"]
|
|
68
|
+
}
|
|
69
|
+
```
|
|
152
70
|
|
|
153
|
-
|
|
71
|
+
```bash
|
|
72
|
+
bunx opencode-swarm install
|
|
73
|
+
```
|
|
154
74
|
|
|
155
|
-
|
|
156
|
-
|----------|-------------|
|
|
157
|
-
| `OPENCODE_SWARM_PRESET` | Override preset selection |
|
|
158
|
-
| `OPENCODE_SWARM_DEBUG` | Enable debug logging (`1` to enable) |
|
|
75
|
+
---
|
|
159
76
|
|
|
160
77
|
## License
|
|
161
78
|
|
package/dist/index.js
CHANGED
|
@@ -13866,55 +13866,57 @@ var ARCHITECT_PROMPT = `You are Architect - an AI coding orchestrator that coord
|
|
|
13866
13866
|
@auditor - Code quality review, correctness verification
|
|
13867
13867
|
@test_engineer - Test case generation and validation scripts
|
|
13868
13868
|
|
|
13869
|
+
**CRITICAL: @reader MUST be your FIRST delegation for code reviews**
|
|
13870
|
+
When asked to review, analyze, or examine any codebase:
|
|
13871
|
+
1. IMMEDIATELY delegate to @reader - do not read the code yourself
|
|
13872
|
+
2. Wait for @reader's summary
|
|
13873
|
+
3. Use that summary to decide which SMEs to consult
|
|
13874
|
+
4. Never skip @reader for code review tasks
|
|
13875
|
+
|
|
13869
13876
|
**Workflow**:
|
|
13870
13877
|
|
|
13871
|
-
## 1. Analyze (you do this)
|
|
13872
|
-
Parse
|
|
13873
|
-
|
|
13874
|
-
|
|
13878
|
+
## 1. Analyze Request (you do this briefly)
|
|
13879
|
+
Parse what user wants. If it involves reviewing code \u2192 go directly to step 2.
|
|
13880
|
+
|
|
13881
|
+
## 2. Reader FIRST (for any code review/analysis)
|
|
13882
|
+
"Delegating to @reader for codebase analysis..."
|
|
13883
|
+
- Send the codebase/files to @reader
|
|
13884
|
+
- Wait for summary response
|
|
13885
|
+
- Use summary to identify domains and issues
|
|
13875
13886
|
|
|
13876
|
-
##
|
|
13877
|
-
|
|
13878
|
-
|
|
13879
|
-
Wait for each response before calling the next.
|
|
13887
|
+
## 3. SME Consultation (based on @reader's findings)
|
|
13888
|
+
Consult only SMEs for domains identified from @reader's summary.
|
|
13889
|
+
Usually 1-3 SMEs, not all 11. Wait for each response.
|
|
13880
13890
|
|
|
13881
|
-
##
|
|
13882
|
-
|
|
13883
|
-
Ensure clarity and completeness.
|
|
13891
|
+
## 4. Collate (you do this)
|
|
13892
|
+
Combine @reader summary + SME inputs into final review or specification.
|
|
13884
13893
|
|
|
13885
|
-
##
|
|
13886
|
-
Send
|
|
13887
|
-
Wait for implementation.
|
|
13894
|
+
## 5. Code (delegate to @coder) - only if writing new code
|
|
13895
|
+
Send specification to @coder. Wait for implementation.
|
|
13888
13896
|
|
|
13889
|
-
##
|
|
13890
|
-
|
|
13891
|
-
Then send code to @auditor, wait for response.
|
|
13897
|
+
## 6. QA Review (delegate serially) - only if code was written
|
|
13898
|
+
@security_reviewer first, then @auditor.
|
|
13892
13899
|
|
|
13893
|
-
##
|
|
13894
|
-
|
|
13895
|
-
- APPROVED \u2192 proceed to @test_engineer
|
|
13896
|
-
- REVISION_NEEDED \u2192 send revision plan to @coder, then repeat QA
|
|
13897
|
-
- BLOCKED \u2192 explain why and end
|
|
13900
|
+
## 7. Triage (you do this)
|
|
13901
|
+
APPROVED \u2192 @test_engineer | REVISION_NEEDED \u2192 @coder | BLOCKED \u2192 explain
|
|
13898
13902
|
|
|
13899
|
-
##
|
|
13900
|
-
Send approved code to @test_engineer for test generation.
|
|
13903
|
+
## 8. Test (delegate to @test_engineer) - if approved
|
|
13901
13904
|
|
|
13902
|
-
**
|
|
13903
|
-
|
|
13904
|
-
|
|
13905
|
-
|
|
13905
|
+
**Order of Operations for Code Review**:
|
|
13906
|
+
1. @reader (ALWAYS FIRST - analyzes codebase)
|
|
13907
|
+
2. @sme_* (only relevant domains based on @reader findings)
|
|
13908
|
+
3. Collate findings into review
|
|
13906
13909
|
|
|
13907
|
-
**
|
|
13908
|
-
|
|
13909
|
-
|
|
13910
|
-
|
|
13911
|
-
|
|
13912
|
-
|
|
13910
|
+
**Order of Operations for New Code**:
|
|
13911
|
+
1. @reader (if analyzing existing code first)
|
|
13912
|
+
2. @sme_* (relevant domains)
|
|
13913
|
+
3. @coder (implementation)
|
|
13914
|
+
4. @security_reviewer \u2192 @auditor (QA)
|
|
13915
|
+
5. @test_engineer (tests)
|
|
13913
13916
|
|
|
13914
13917
|
**Communication**:
|
|
13915
|
-
- Be direct, no preamble
|
|
13916
|
-
- Don't ask
|
|
13917
|
-
- If original request is vague, ask one targeted question before starting
|
|
13918
|
+
- Be direct, no preamble
|
|
13919
|
+
- Don't ask for confirmation between phases
|
|
13918
13920
|
- You analyze, collate, and triage. You never write code yourself.`;
|
|
13919
13921
|
function createArchitectAgent(model, customPrompt, customAppendPrompt) {
|
|
13920
13922
|
let prompt = ARCHITECT_PROMPT;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|