opencode-swarm 7.52.2 → 7.53.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 +52 -31
- package/dist/cli/index.js +205 -105
- package/dist/commands/pr-feedback.d.ts +23 -0
- package/dist/commands/pr-ref.d.ts +106 -0
- package/dist/commands/pr-review.d.ts +8 -2
- package/dist/commands/registry.d.ts +7 -0
- package/dist/index.js +481 -329
- package/dist/state.d.ts +16 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
-
OpenCode Swarm is a plugin for [OpenCode](https://opencode.ai) that turns a single AI coding session into an **architect-led team of specialized core, optional, and conditional agents
|
|
19
|
+
OpenCode Swarm is a plugin for [OpenCode](https://opencode.ai) that turns a single AI coding session into an **architect-led team of specialized core, optional, and conditional agents**. Run `/swarm agents` for the live roster; it is generated from the current plugin configuration. One agent writes the code. A different agent reviews it. Another writes and runs tests. Another checks security. **Nothing ships until every required gate passes.**
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
22
|
bunx opencode-swarm install
|
|
@@ -24,7 +24,7 @@ bunx opencode-swarm install
|
|
|
24
24
|
|
|
25
25
|
> This single command installs the package, registers it as an OpenCode plugin, disables conflicting default agents, and creates a ready-to-edit config at `~/.config/opencode/opencode-swarm.json`. Requires [Bun](https://bun.sh) (`bun --version` to check). If you must use npm: `npm install -g opencode-swarm && opencode-swarm install`.
|
|
26
26
|
|
|
27
|
-
>
|
|
27
|
+
> **First-run note:** the installer registers the plugin, writes the global plugin config, creates a project override when missing, and disables the native `explore` and `general` agents in `opencode.json`. If you are not using a Swarm architect, the Swarm gates, reviewers, and test agents are bypassed. Open the OpenCode agent or mode picker and choose the Swarm architect when needed.
|
|
28
28
|
|
|
29
29
|
### Why Swarm?
|
|
30
30
|
|
|
@@ -44,7 +44,7 @@ Most AI coding tools let one model write code and ask that same model whether th
|
|
|
44
44
|
- 🆓 **Free tier** — works with OpenCode Zen's free model roster
|
|
45
45
|
- ⚙️ **Fully configurable** — override any agent's model, disable agents, tune guardrails
|
|
46
46
|
|
|
47
|
-
> **The Swarm architect
|
|
47
|
+
> **The Swarm architect coordinates all internal agents automatically.** You never manually switch between internal roles. If the active OpenCode agent is not a Swarm architect, the plugin workflow is bypassed.
|
|
48
48
|
|
|
49
49
|
---
|
|
50
50
|
|
|
@@ -157,10 +157,10 @@ The 15-minute guide covers:
|
|
|
157
157
|
- Running your first task
|
|
158
158
|
- Troubleshooting common issues
|
|
159
159
|
|
|
160
|
-
|
|
161
|
-
- Creates project config at `.opencode/opencode-swarm.json`
|
|
162
|
-
-
|
|
163
|
-
-
|
|
160
|
+
The installer automatically:
|
|
161
|
+
- Creates a project config at `.opencode/opencode-swarm.json` when missing so project-level overrides have a place to live
|
|
162
|
+
- Adds `opencode-swarm` to the OpenCode plugin list
|
|
163
|
+
- Disables the native `explore` and `general` agents to reduce routing conflicts
|
|
164
164
|
|
|
165
165
|
---
|
|
166
166
|
|
|
@@ -174,8 +174,7 @@ No animated GIF is shipped in the repo — instead, here is the exact terminal s
|
|
|
174
174
|
# 1. Install the plugin (5s)
|
|
175
175
|
bunx opencode-swarm install
|
|
176
176
|
|
|
177
|
-
# 2. Open opencode
|
|
178
|
-
# (the architect is auto-selected; manual selection is only needed to override)
|
|
177
|
+
# 2. Open opencode and select a Swarm architect if it is not already active
|
|
179
178
|
opencode
|
|
180
179
|
|
|
181
180
|
# 3. Inside the OpenCode session, verify Swarm is live (5s)
|
|
@@ -225,12 +224,18 @@ Each row corresponds to a real gate documented further down this README — none
|
|
|
225
224
|
**OpenCode caches plugins indefinitely.** A normal OpenCode restart does **not**
|
|
226
225
|
pull newer versions from npm — once a plugin is cached, OpenCode keeps using
|
|
227
226
|
that exact copy on every subsequent launch (issue #675). The cache lives in
|
|
228
|
-
|
|
227
|
+
several places depending on your platform and OpenCode version:
|
|
229
228
|
|
|
230
|
-
-
|
|
229
|
+
- Current OpenCode cache layout:
|
|
230
|
+
`~/.cache/opencode/node_modules/opencode-swarm/`
|
|
231
|
+
- Legacy Linux / devcontainers / GitHub Codespaces:
|
|
231
232
|
`~/.config/opencode/node_modules/opencode-swarm/`
|
|
232
|
-
-
|
|
233
|
+
- Package cache layout:
|
|
233
234
|
`~/.cache/opencode/packages/opencode-swarm@latest/`
|
|
235
|
+
- Platform-specific macOS / Windows cache roots:
|
|
236
|
+
`~/Library/Caches/opencode/...`, `%LOCALAPPDATA%\opencode\...`, or `%APPDATA%\opencode\...`
|
|
237
|
+
|
|
238
|
+
The updater also clears known OpenCode lock files (`bun.lock`, `bun.lockb`, and `package-lock.json`) so the next start resolves the latest package.
|
|
234
239
|
|
|
235
240
|
To upgrade to the latest published version (clears both layouts automatically):
|
|
236
241
|
|
|
@@ -250,7 +255,7 @@ in your `opencode-swarm.json`.
|
|
|
250
255
|
|
|
251
256
|
## Commands
|
|
252
257
|
|
|
253
|
-
|
|
258
|
+
Common subcommands at a glance:
|
|
254
259
|
|
|
255
260
|
```bash
|
|
256
261
|
/swarm help [command] # List all commands or get detailed help for a specific command
|
|
@@ -266,7 +271,7 @@ Use `/swarm help` to see all available commands categorized by function. Use `/s
|
|
|
266
271
|
|
|
267
272
|
Nine commands display a ⚠️ warning in help output because they share names with Claude Code built-in slash commands (e.g., `/plan`, `/reset`, `/status`). The warning reminds you to always use `/swarm <command>` — the bare CC command does something different and sometimes destructive. See [docs/commands.md#claude-code-command-conflicts](docs/commands.md#claude-code-command-conflicts) for the full conflict registry.
|
|
268
273
|
|
|
269
|
-
See [docs/commands.md](docs/commands.md) for the full reference
|
|
274
|
+
See [docs/commands.md](docs/commands.md) for the full reference. The live source of truth is `src/commands/registry.ts`, which includes canonical commands, compound commands, and deprecated aliases.
|
|
270
275
|
|
|
271
276
|
## Command Aliases
|
|
272
277
|
|
|
@@ -529,13 +534,13 @@ Override via `authority.rules` in config.
|
|
|
529
534
|
|
|
530
535
|
Built-in tools verify every task before it ships:
|
|
531
536
|
|
|
532
|
-
- **syntax_check** — Tree-sitter validation
|
|
537
|
+
- **syntax_check** — Tree-sitter validation across the configured language grammar map
|
|
533
538
|
- **placeholder_scan** — Catches TODOs, stubs, incomplete code
|
|
534
539
|
- **sast_scan** — 63+ security rules, 9 languages (offline)
|
|
535
540
|
- **sbom_generate** — Dependency tracking (CycloneDX)
|
|
536
541
|
- **quality_budget** — Complexity, duplication, test ratio limits
|
|
537
542
|
|
|
538
|
-
|
|
543
|
+
These quality gates run locally. No Docker is required. Config-gated features such as General Council web search can make external API calls only when you enable them and provide a Tavily or Brave Search key.
|
|
539
544
|
|
|
540
545
|
### Context Budget Guard
|
|
541
546
|
|
|
@@ -719,16 +724,16 @@ Swarm provides tools for managing generated skill lifecycles:
|
|
|
719
724
|
<details>
|
|
720
725
|
<summary><strong>Quality Gates (Technical Detail)</strong></summary>
|
|
721
726
|
|
|
722
|
-
### Built-in Tools
|
|
727
|
+
### Built-in Tools and Hooks
|
|
723
728
|
|
|
724
|
-
|
|
|
729
|
+
| Surface | What It Does |
|
|
725
730
|
|------|-------------|
|
|
726
|
-
| syntax_check | Tree-sitter validation across
|
|
731
|
+
| syntax_check | Tree-sitter validation across the configured language grammar map |
|
|
727
732
|
| placeholder_scan | Catches TODOs, FIXMEs, stubs, placeholder text |
|
|
728
733
|
| sast_scan | Offline security analysis, 63+ rules, 9 languages |
|
|
729
734
|
| sbom_generate | CycloneDX dependency tracking, 8 ecosystems |
|
|
730
735
|
| build_check | Runs your project's native build/typecheck |
|
|
731
|
-
| incremental_verify | Post-coder
|
|
736
|
+
| incremental_verify | Post-coder hook for TS/JS, Go, Rust, Python, and C#; configured by `incremental_verify.*`, not invoked as a registered tool |
|
|
732
737
|
| quality_budget | Enforces complexity, duplication, and test ratio limits |
|
|
733
738
|
| pre_check_batch | Runs lint, secretscan, SAST, and quality budget in parallel (~15s vs ~60s sequential) |
|
|
734
739
|
| phase_complete | Enforces phase completion, verifies required agents, requires a valid retrospective evidence bundle, logs events, and resets state; appends to `events.jsonl` with file locking |
|
|
@@ -742,7 +747,7 @@ Swarm provides tools for managing generated skill lifecycles:
|
|
|
742
747
|
| symbols | Extract exported symbols from source files; supports `workspace` (boolean) and `name` (string) parameters for multi-file symbol search |
|
|
743
748
|
|
|
744
749
|
|
|
745
|
-
|
|
750
|
+
Quality-gate surfaces run locally and require no Docker. Optional search-backed council features use external APIs only when explicitly enabled and configured.
|
|
746
751
|
|
|
747
752
|
Optional enhancement: Semgrep (if on PATH).
|
|
748
753
|
|
|
@@ -873,19 +878,21 @@ Config file location: `~/.config/opencode/opencode-swarm.json` (global) or `.ope
|
|
|
873
878
|
"knowledge": {
|
|
874
879
|
"enabled": true,
|
|
875
880
|
"swarm_max_entries": 100,
|
|
876
|
-
"hive_max_entries":
|
|
877
|
-
"auto_promote_days":
|
|
881
|
+
"hive_max_entries": 200,
|
|
882
|
+
"auto_promote_days": 90,
|
|
878
883
|
"max_inject_count": 5,
|
|
884
|
+
"inject_char_budget": 2000,
|
|
885
|
+
"max_lesson_display_chars": 120,
|
|
879
886
|
"dedup_threshold": 0.6,
|
|
880
887
|
"scope_filter": ["global"],
|
|
881
888
|
"hive_enabled": true,
|
|
882
|
-
"rejected_max_entries":
|
|
889
|
+
"rejected_max_entries": 20,
|
|
883
890
|
"validation_enabled": true,
|
|
884
|
-
"evergreen_confidence": 0.
|
|
885
|
-
"evergreen_utility": 0.
|
|
886
|
-
"low_utility_threshold": 0.
|
|
891
|
+
"evergreen_confidence": 0.9,
|
|
892
|
+
"evergreen_utility": 0.8,
|
|
893
|
+
"low_utility_threshold": 0.3,
|
|
887
894
|
"min_retrievals_for_utility": 3,
|
|
888
|
-
"schema_version":
|
|
895
|
+
"schema_version": 1
|
|
889
896
|
}
|
|
890
897
|
}
|
|
891
898
|
```
|
|
@@ -1024,10 +1031,18 @@ Control how tool outputs are summarized for LLM context.
|
|
|
1024
1031
|
| `/swarm preflight` | Run phase preflight checks |
|
|
1025
1032
|
| `/swarm config doctor [--fix]` | Config validation with optional auto-fix |
|
|
1026
1033
|
| `/swarm doctor tools` | Tool registration coherence and binary readiness check |
|
|
1027
|
-
| `/swarm sync-plan` | Force plan.md regeneration from plan
|
|
1034
|
+
| `/swarm sync-plan` | Force `plan.md` regeneration from the canonical plan ledger |
|
|
1028
1035
|
| `/swarm specify [description]` | Generate or import a feature specification |
|
|
1029
1036
|
| `/swarm clarify [topic]` | Clarify and refine an existing feature specification |
|
|
1030
1037
|
| `/swarm analyze` | Analyze spec.md vs plan.md for requirement coverage gaps |
|
|
1038
|
+
| `/swarm brainstorm [topic]` | Enter BRAINSTORM mode for structured requirement discovery before a spec |
|
|
1039
|
+
| `/swarm council <question> [--preset <name>] [--spec-review]` | Convene a multi-model General Council for advisory deliberation |
|
|
1040
|
+
| `/swarm issue <issue-url\|owner/repo#N\|N> [--plan] [--trace]` | Ingest a GitHub issue for localization and resolution |
|
|
1041
|
+
| `/swarm pr-review <pr-url\|owner/repo#N\|N> [--council] [instructions...]` | Structured deep PR review with parallel lanes, reviewer confirmation, and critic challenge |
|
|
1042
|
+
| `/swarm pr-feedback [<pr-url\|owner/repo#N\|N>] [instructions...]` | Ingest and close known PR feedback (review comments, CI failures, conflicts) without a fresh review |
|
|
1043
|
+
| `/swarm deep-dive <scope> [--profile <name>] [--max-explorers <n>]` | Read-only codebase audit with parallel explorers, dual reviewers, and critic challenge |
|
|
1044
|
+
| `/swarm design-docs <description> [--out <dir>] [--lang <name>] [--update]` | Generate or sync language-agnostic design docs (requires `design_docs.enabled`) |
|
|
1045
|
+
| `/swarm dark-matter` | Detect hidden file couplings from co-change history |
|
|
1031
1046
|
| `/swarm finalize [--prune-branches] [--skill-review]` | Idempotent session close-out: retrospectives, lesson curation, evidence archive, context.md reset, config-backup cleanup, optional branch pruning, optional skill-improver proposal |
|
|
1032
1047
|
| `/swarm close [--prune-branches] [--skill-review]` | Deprecated alias for `/swarm finalize [--prune-branches] [--skill-review]` |
|
|
1033
1048
|
| `/swarm write-retro` | Write a phase retrospective manually |
|
|
@@ -1040,9 +1055,15 @@ Control how tool outputs are summarized for LLM context.
|
|
|
1040
1055
|
| `/swarm knowledge quarantine [id]` | Move a knowledge entry to quarantine |
|
|
1041
1056
|
| `/swarm knowledge restore [id]` | Restore a quarantined knowledge entry |
|
|
1042
1057
|
| `/swarm memory status` | Show memory provider and JSONL migration status |
|
|
1058
|
+
| `/swarm memory pending` | Show pending memory proposals and recent rejection reasons |
|
|
1059
|
+
| `/swarm memory recall-log` | Summarize memory recall usage |
|
|
1060
|
+
| `/swarm memory stale` | List expired, superseded, deleted, and low-utility memory records |
|
|
1061
|
+
| `/swarm memory compact` | Dry-run memory cleanup; pass `--confirm` to apply |
|
|
1043
1062
|
| `/swarm memory export` | Export memory records and proposals to JSONL |
|
|
1063
|
+
| `/swarm memory evaluate` | Run memory recall evaluation fixtures |
|
|
1044
1064
|
| `/swarm memory import` | Import legacy JSONL memory into SQLite |
|
|
1045
1065
|
| `/swarm memory migrate` | Run the one-time JSONL to SQLite migration |
|
|
1066
|
+
| `/swarm concurrency <set|status|reset>` | Manage session-scoped runtime concurrency override |
|
|
1046
1067
|
| `/swarm turbo` | Enable turbo mode for the current session (bypasses QA gates) |
|
|
1047
1068
|
| `/swarm full-auto` | Toggle Full-Auto Mode for the current session [on|off] |
|
|
1048
1069
|
| `/swarm checkpoint` | Save a git checkpoint for the current state |
|
|
@@ -1053,8 +1074,8 @@ Control how tool outputs are summarized for LLM context.
|
|
|
1053
1074
|
|
|
1054
1075
|
## Supported Languages
|
|
1055
1076
|
|
|
1056
|
-
Full Tier-1 support: TypeScript, JavaScript, Python, Go, Rust
|
|
1057
|
-
Tier-2 support: Java, Kotlin, C#, C/C++, Swift
|
|
1077
|
+
Full Tier-1 support: TypeScript, JavaScript, Python, Go, Rust
|
|
1078
|
+
Tier-2 support: Java, Kotlin, C#, C/C++, Swift
|
|
1058
1079
|
Tier-3 support: Dart, Ruby, PHP/Laravel
|
|
1059
1080
|
|
|
1060
1081
|
All binaries optional. Missing tools produce soft warnings, never hard-fail.
|