经 AI Skill Hub 精选评估,opencode-swarm MCP工具 获评「强烈推荐」。这款AI工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.2 分,适合有一定技术背景的用户使用。
基于MCP协议的开源多智能体编程工具,采用中心辐射型架构支持分布式任务编排。面向AI驱动的代码生成和自动化开发,适合需要构建复杂智能体工作流的开发者和研究者。
opencode-swarm MCP工具 是一款基于 TypeScript 开发的开源工具,专注于 多智能体编排、MCP协议、代码自动化 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
基于MCP协议的开源多智能体编程工具,采用中心辐射型架构支持分布式任务编排。面向AI驱动的代码生成和自动化开发,适合需要构建复杂智能体工作流的开发者和研究者。
opencode-swarm MCP工具 是一款基于 TypeScript 开发的开源工具,专注于 多智能体编排、MCP协议、代码自动化 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:npm 全局安装 npm install -g opencode-swarm # 方式二:npx 直接运行(无需安装) npx opencode-swarm --help # 方式三:项目依赖安装 npm install opencode-swarm # 方式四:从源码运行 git clone https://github.com/zaxbysauce/opencode-swarm cd opencode-swarm npm install npm start
# 命令行使用
opencode-swarm --help
# 基本用法
opencode-swarm [options] <input>
# Node.js 代码中使用
const opencode_swarm = require('opencode-swarm');
const result = await opencode_swarm.run(options);
console.log(result);
# opencode-swarm 配置说明 # 查看配置选项 opencode-swarm --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export OPENCODE_SWARM_CONFIG="/path/to/config.yml"
/swarm agents for the live roster — that is the source of truth, not this list.external_skills.curation_enabled: true in config). Includes 7 tools: external_skill_discover, external_skill_list, external_skill_inspect, external_skill_promote, external_skill_reject, external_skill_delete, external_skill_revoke. Candidates pass through a 3-gate validation pipeline before evaluation: prompt injection scan (12 regex patterns), unsafe instruction scan (25 patterns), and provenance integrity check (SHA-256, timestamp, URL, publisher, and hash verification)./swarm skill-opt plan|run|status|diff|approve|reject|rollback|history) that drives one allowlisted SKILL.md candidate at a time through deterministic draft → smoke → evaluation-substrate validation → manual approval → atomic activation/rollback. Bounded, restartable, reversible, and unable to mutate source/harness/security surfaces. Disabled by default (skill_opt.enabled: false); see docs/skill-optimizer.md..swarm/; pick up any project any daygh CLI; delivers real-time CI, review, and merge status updates via the AutomationEventBus (FR-001, opt-in via pr_monitor.enabled: true). Subscribe with /swarm pr subscribe <pr-url|owner/repo#N|N>; unsubscribe with /swarm pr unsubscribe <pr-url|owner/repo#N|N>; check status with /swarm pr status. With auto_pr_feedback: true, CI failures and merge conflicts mechanically activate PR_FEEDBACK only when no other workflow owns the session; otherwise they are durably queued for a later round..tsx / .c aliases) — extending: see docs/adding-a-language.mdfiles[], paths[], targetFiles[]) to prevent scope bypass via multi-file tool calls.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.
---
bash-parser AST for accurate detection of:>, >>, >|, <<, <<-)cp, mv, install, ln, truncate, dd)sed -i, perl -i, awk -i)python -c, node -e, bun -e, ruby -e, php -r)curl -o, wget -O, scp)tar -x, unzip, gunzip)git clean -fd, git reset --hard)Out-File, Set-Content, Add-Content, Copy-Item, Move-Itemcopy, move, ren, del, rd, md>, >>)watch, screen, tmux new-sessionStart-Process.swarm/scopes/scope-{taskId}.json with:rm -rf, rmdir /s, del /s, Remove-Item -Recurse, rsync --delete) are blocked unless ALL target paths are within the declared scope (coder agents only)bunx opencode-swarm install
→ For a complete first-run walkthrough, see Getting Started.
The 15-minute guide covers: - Installation (bunx opencode-swarm install) - First-run auto-configuration (architect selected automatically) - Running your first task - Troubleshooting common issues
The installer automatically: - Adds opencode-swarm to the OpenCode plugin list - Disables the native explore and general agents to reduce routing conflicts
It does not create a project config. .opencode/opencode-swarm.json is opt-in — create it yourself only if you want project-level overrides of the global config.
---
Swarm works with any provider supported by OpenCode.
Minimal (disable):
{
"context_budget": {
"enabled": false
}
}
Default (reference):
{
"context_budget": {
"enabled": true,
"max_injection_tokens": 4000,
"warn_threshold": 0.7,
"critical_threshold": 0.9,
"enforce": true,
"prune_target": 0.7,
"preserve_last_n_turns": 4,
"recent_window": 10,
"tracked_agents": ["architect"],
"enforce_on_agent_switch": true,
"model_limits": { "default": 128000 },
"tool_output_mask_threshold": 2000,
"scoring": {
"enabled": false,
"max_candidates": 100,
"weights": { "recency": 0.3, "relevance": 0.4, "importance": 0.3 },
"decision_decay": { "mode": "exponential", "half_life_hours": 24 },
"token_ratios": { "prose": 0.25, "code": 0.4, "json": 0.6, "logs": 0.1 }
}
}
}
Aggressive (for long-running sessions):
{
"context_budget": {
"enabled": true,
"max_injection_tokens": 2000,
"warn_threshold": 0.5,
"critical_threshold": 0.75,
"enforce": true,
"prune_target": 0.6,
"preserve_last_n_turns": 2,
"recent_window": 5,
"tracked_agents": ["architect"],
"enforce_on_agent_switch": true,
"model_limits": { "default": 128000 },
"tool_output_mask_threshold": 1500,
"scoring": {
"enabled": true,
"max_candidates": 50,
"weights": { "recency": 0.5, "relevance": 0.3, "importance": 0.2 },
"decision_decay": { "mode": "linear", "half_life_hours": 12 },
"token_ratios": { "prose": 0.2, "code": 0.35, "json": 0.5, "logs": 0.05 }
}
}
}
No animated GIF is shipped in the repo — instead, here is the exact terminal session you can record yourself with asciinema rec demo.cast (or any screen recorder). Every command below is real and runs against this repo as published.
Recording script (copy/paste-able, ~30 seconds):
```bash
| Key | Type | Default | Description |
|---|---|---|---|
context_budget.enabled | boolean | true | Enable or disable the context budget guard entirely |
context_budget.max_injection_tokens | number | 4000 | Separate per-turn cap on system-enhancer injection. It is NOT the guard's budget — the guard measures total conversation tokens against model_limits, not this value |
context_budget.warn_threshold | number | 0.7 | Ratio (0.0-1.0) of the model context window at which total conversation tokens trigger a warning advisory |
context_budget.critical_threshold | number | 0.9 | Ratio (0.0-1.0) of the model context window at which total conversation tokens trigger a critical alert with handoff recommendation |
context_budget.enforce | boolean | true | When true, enforces budget limits and may trigger handoffs |
context_budget.prune_target | number | 0.7 | Ratio (0.0-1.0) of context to preserve when pruning occurs |
context_budget.preserve_last_n_turns | number | 4 | Number of recent turns to preserve when pruning |
context_budget.recent_window | number | 10 | Number of turns to consider as "recent" for scoring |
context_budget.tracked_agents | string[] | ['architect'] | Agents to track for context budget warnings |
context_budget.enforce_on_agent_switch | boolean | true | Enforce budget limits when switching agents |
context_budget.model_limits | record | {} | Per-model token limit **overrides**, keyed by "<provider>/<model>", "<model>", or "default". Empty by default so the live model's own context window is used; set an entry only to impose a smaller working budget |
context_budget.unified_injection_tokens | number | undefined | Opt-in unified ceiling (tokens) for combined system-enhancer + knowledge-injector injection per turn. When set, both hooks share this budget with proportional split |
context_budget.tool_output_mask_threshold | number | 2000 | Threshold for masking tool outputs (chars) |
skills.enabled | boolean | false | Gates the 7 skill-management tools (skill_generate, skill_list, skill_apply, skill_inspect, skill_regenerate, skill_retire, skill_improve) behind an opt-in flag. When false (default), these tools are host-denied for every agent except skill_improver — genuinely unreachable at request time (issue #2528). |
skill_opt.enabled | boolean | false | Master opt-in for the governed skill optimizer (/swarm skill-opt). run also requires --confirm; plan/status/diff/history are always available. See docs/skill-optimizer.md. |
skill_opt.deadband | number | 0 | Promotion policy deadband forwarded to the evaluation substrate. |
skill_opt.max_rounds | number | 5 | Hard cap on draft/smoke retries before a validation (held-out test set is single-use). |
skill_opt.max_transient_retries | number | 5 | Max transient-infra retries before an infra failure becomes inconclusive. |
context_budget.scoring.enabled | boolean | false | Enable context scoring/ranking |
context_budget.scoring.max_candidates | number | 100 | Maximum items to score (10-500) |
context_budget.scoring.weights | object | { recency: 0.3, ... } | Scoring weights for priority |
context_budget.scoring.decision_decay | object | { mode: 'exponential', half_life_hours: 24 } | Decision relevance decay |
context_budget.scoring.token_ratios | object | { prose: 0.25, code: 0.4, ... } | Token cost multipliers |
{
"gates": {
"syntax_check": { "enabled": true },
"placeholder_scan": { "enabled": true },
"sast_scan": { "enabled": true },
"quality_budget": {
"enabled": true,
"max_complexity_delta": 5,
"min_test_to_code_ratio": 0.3
}
}
}
</details>
<details> <summary><strong>File Locking for Concurrent Write Safety</strong></summary>
Swarm uses file locking to protect shared state files from concurrent write corruption. The locking strategy differs by file: plan.json uses hard locking (write blocked on contention), while events.jsonl uses advisory locking (write proceeds with a warning on contention).
Control how tool outputs are summarized for LLM context.
{
"summaries": {
"threshold_bytes": 102400,
"exempt_tools": [
"retrieve_summary",
"retrieve_lane_output",
"task",
"read",
"dispatch_lanes",
"dispatch_lanes_async",
"collect_lane_results",
"parse_lane_candidates"
]
}
}
["retrieve_summary", "retrieve_lane_output", "task", "read", "dispatch_lanes", "dispatch_lanes_async", "collect_lane_results", "parse_lane_candidates"]. Retrieval and lane tools are always exempt—summarizing them would destroy the references needed to recover their full outputs.Note: Theretrieve_summarytool supports paginated retrieval viaoffsetandlimitparameters to fetch large summarized outputs in chunks.
---
| Feature | Swarm | oh-my-opencode | get-shit-done |
|---|---|---|---|
| Multiple specialized agents | ✅ Core + optional + conditional roster (/swarm agents) | ❌ | ❌ |
| Plan reviewed before coding | ✅ | ❌ | ❌ |
| Every task reviewed + tested | ✅ | ❌ | ❌ |
| Different model for review vs. code | ✅ | ❌ | ❌ |
| Shell write detection (POSIX/PowerShell/cmd) | ✅ | ❌ | ❌ |
| Scope enforcement with cross-process persistence | ✅ | ❌ | ❌ |
| Interactive session detection and blocking | ✅ | ❌ | ❌ |
| Resumable sessions | ✅ | ❌ | ❌ |
| Built-in security scanning | ✅ | ❌ | ❌ |
| Learns from mistakes | ✅ | ❌ | ❌ |
---
aiskill88点评:高成熟度的多智能体编程框架,MCP标准支持完善,架构设计先进。文档待完善,但代码质量优秀,324星评价认可度良好。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
AI Skill Hub 点评:opencode-swarm MCP工具 的核心功能完整,质量优秀。对于AI爱好者来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | opencode-swarm |
| 原始描述 | 开源MCP工具: Architect-centric agentic swarm plugin for OpenCode. Hub-and-spoke orchestrati。⭐324 · TypeScript |
| Topics | 多智能体编排MCP协议代码自动化分布式框架TypeScript |
| GitHub | https://github.com/zaxbysauce/opencode-swarm |
| License | MIT |
| 语言 | TypeScript |
收录时间:2026-05-16 · 更新时间:2026-05-19 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。