βββββββ βββββββ ββββββββββββ βββ βββββββ βββββββ βββββββ ββββββββ
ββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββββ
βββ βββββββββββββββββ ββββββ ββββββ βββ ββββββ βββββββββ
βββ ββββββββββ ββββββ βββββββββββββ βββ ββββββ βββββββββ
ββββββββββββ βββββββββββ βββββββββββββββββββββββββββββββββββββββ
βββββββ βββ βββββββββββ βββββ βββββββ βββββββ βββββββ ββββββββ
βββββββ βββββββ ββββ ββββββββββββββ βββββββ
ββββββββββββββββββββββ ββββββββββββββββββββββ
βββ βββ βββββββββ βββββββββ ββββββ ββββ
βββ βββ βββββββββββββββββββ ββββββ βββ
ββββββββββββββββββββ βββββββββ ββββββββββββ
βββββββ βββββββ βββ ββββββββ βββ βββββββ
"These are intelligent and structured group dynamics that emerge not from a leader, but from the local interactions of the elements themselves." β Daniel Shiffman, The Nature of Code
A swarm of agents that learns from its mistakes.
An OpenCode configuration that turns Claude into a multi-agent system. You describe what you want. It decomposes the work, spawns parallel workers, tracks what strategies work, and adapts. Anti-patterns get detected. Proven patterns get promoted. Confidence decays unless revalidated.
Built on joelhooks/swarmtools - multi-agent orchestration with outcome-based learning.
Important
This is an OpenCode config, not a standalone tool. Everything runs inside OpenCode. The CLIs (swarm, semantic-memory, cass) are backends that agents call - not meant for direct human use.
git clone https://github.com/joelhooks/opencode-config ~/.config/opencode
cd ~/.config/opencode && bun installNote
These CLIs are backends that OpenCode agents call. You install them, but the agents use them.
# Swarm orchestration (required) - agents call this for coordination
npm install -g opencode-swarm-plugin
swarm --version # 0.30.0+
# Ollama for embeddings (required for semantic features)
brew install ollama # or: curl -fsSL https://ollama.com/install.sh | sh
ollama serve
ollama pull nomic-embed-text
# Semantic memory (optional but recommended)
npm install -g semantic-memory
semantic-memory check
# Cross-agent session search (optional but recommended)
npm install -g cass-search
cass index
cass --version # 0.1.35+swarm doctorWarning
All commands run inside OpenCode, not in your terminal. The swarm CLI is a backend that agents call - it's not meant for direct human use.
Start OpenCode, then type:
/swarm "Add user authentication with OAuth"
Watch it decompose β spawn workers β coordinate β verify β learn.
The agent orchestrates everything. You just describe what you want.
| Tool | Version | Install Command |
|---|---|---|
| swarm | 0.30.0 | npm i -g opencode-swarm-plugin |
| semantic-memory | latest | npm i -g semantic-memory |
| cass | 0.1.35 | npm i -g cass-search |
| ollama | 0.13.1 | brew install ollama |
Embedding model: nomic-embed-text (required for semantic-memory and pdf-brain)
# Kernel cloud browser (Playwright in the cloud)
opencode mcp auth kernel
# Snyk security scanning
snyk auth"Elaborate feedback on errors has repeatedly been found to be more effective than knowledge of results alone." β Jeroen van MerriΓ«nboer, Ten Steps to Complex Learning
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LEARNING PIPELINE β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β CASS βββββΆβ Decompose βββββΆβ Execute β β
β β (history) β β (strategy) β β (workers) β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β β β
β β βΌ β
β β βββββββββββββββ β
β β β Record β β
β β β Outcome β β
β β βββββββββββββββ β
β β β β
β βΌ βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β PATTERN MATURITY β β
β β candidate β established β proven β deprecated β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β β’ Confidence decay (90-day half-life) β
β β’ Anti-pattern inversion (>60% failure β AVOID) β
β β’ Implicit feedback (fast+success vs slow+errors) β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Every task execution feeds the learning system:
- Fast + success β pattern gets promoted
- Slow + retries + errors β pattern gets flagged
- >60% failure rate β auto-inverted to anti-pattern
- 90-day half-life β confidence decays unless revalidated
CASS searches across ALL your AI agent histories before solving problems:
- Indexed agents: Claude Code, Codex, Cursor, Gemini, Aider, ChatGPT, Cline, OpenCode, Amp, Pi-Agent
- Semantic + full-text search - find past solutions even if phrased differently
Semantic Memory persists learnings across sessions with vector search:
- Architectural decisions (store the WHY, not just WHAT)
- Debugging breakthroughs (root cause + solution)
- Project-specific gotchas (domain rules that tripped you up)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β COORDINATOR vs WORKER β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β COORDINATOR (Expensive, Long-Lived) β
β ββββββββββββββββββββββββββββββββββββββββ β
β β β’ Sonnet context ($$$) β β
β β β’ NEVER edits code β β
β β β’ Decomposes + orchestrates β β
β β β’ Monitors progress β β
β ββββββββββββββββββββββββββββββββββββββββ β
β β β
β ββββ spawns ββββ β
β β β β
β ββββββββββββββββββββΌββββ ββββββββββΌβββββββββββ β
β β WORKER (Disposable) β β WORKER β β
β β βββββββββββββββββββ β β ββββββββββββββββββ β
β β β Focused context β β β β Focused ctx ββ β
β β β Executes task β β β β Executes task ββ β
β β β Checkpointed β β β β Checkpointed ββ β
β β β Tracks learning β β β β Tracks learn ββ β
β β βββββββββββββββββββ β β ββββββββββββββββββ β
β ββββββββββββββββββββββββ βββββββββββββββββββββ β
β β
β Result: 70% cost reduction, better recovery, learning signals β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Workers get disposable context. Coordinator context stays clean. Parallel work doesn't blow the context window.
βββββββββββ βββ ββββββ βββββββ ββββ ββββ
βββββββββββ ββββββββββββββββββββββββ βββββ
βββββββββββ ββ ββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββ ββββββ ββββββ βββ βββ
ββββββββ ββββββββ βββ ββββββ ββββββ βββ
Built on joelhooks/swarmtools - the core innovation.
Hive (git-backed work tracker):
- Atomic epic + subtask creation
- Status tracking (open β in_progress β blocked β closed)
hive_create,hive_create_epic,hive_query,hive_close,hive_sync
Agent Mail (multi-agent coordination):
- File reservation system (prevent edit conflicts)
- Message passing between agents
- Context-safe inbox (max 5 messages, bodies excluded by default)
swarmmail_init,swarmmail_send,swarmmail_reserve,swarmmail_release
Swarm Tools (orchestration):
- Strategy selection + decomposition validation
- Progress tracking (25/50/75% checkpoints)
- Completion verification gates (UBS + typecheck + tests)
swarm_decompose,swarm_validate_decomposition,swarm_complete,swarm_record_outcome
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββ
β /swarm <task> β Decompose β spawn parallel agents β merge β
β /swarm-status β Check running swarm progress β
β /swarm-collect β Collect and merge swarm results β
β /parallel "a" "b" β Run explicit tasks in parallel β
β β β
β /debug-plus β Debug + prevention pipeline + swarm fix β
β /fix-all β Survey PRs + cells, dispatch agents β
β /iterate <task> β Evaluator-optimizer loop until quality met β
ββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββ
Full command list: /commit, /pr-create, /worktree-task, /handoff, /checkpoint, /retro, /review-my-shit, /sweep, /focus, /rmslop, /triage, /estimate, /standup, /migrate, /repo-dive.
12 MCP tools built for this config:
Multi-language bug detection (JS/TS, Python, C++, Rust, Go, Java, Ruby):
- Null safety, XSS, injection, async/await race conditions, memory leaks
ubs_scan(staged=true) # Before commit
ubs_scan(path="src/") # After AI generates codecass_search(query="authentication error", limit=5)
cass_search(query="useEffect cleanup", agent="claude", days=7)semantic-memory_store(information="OAuth tokens need 5min buffer", tags="auth,tokens")
semantic-memory_find(query="token refresh", limit=5)
semantic-memory_find(query="token refresh", expand=true) # Full contentrepo-autopsy_*- Deep GitHub repo analysis (AST grep, blame, hotspots, secrets)repo-crawl_*- GitHub API exploration (README, files, search)pdf-brain_*- PDF & Markdown knowledge base (URLs supported,--expandfor context)typecheck- TypeScript check with grouped errorsgit-context- Branch, status, commits in one call
| Server | Purpose |
|---|---|
| next-devtools | Next.js dev server integration (routes, errors, build) |
| chrome-devtools | Browser automation, DOM inspection, network monitoring |
| context7 | Library documentation lookup (npm, PyPI, Maven) |
| fetch | Web fetching with markdown conversion |
| snyk | Security scanning (SCA, SAST, IaC, containers) |
| kernel | Cloud browser automation, Playwright, app deployment |
βββββββββββββββββββ¬ββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β Agent β Model β Purpose β
βββββββββββββββββββΌββββββββββββββββββββΌβββββββββββββββββββββββββββββββββ€
β swarm/planner β claude-sonnet-4-5 β Strategic task decomposition β
β swarm/worker β claude-sonnet-4-5 β Parallel task implementation β
β explore β claude-haiku-4-5 β Fast search (read-only) β
β archaeologist β claude-sonnet-4-5 β Codebase exploration (r/o) β
β beads β claude-haiku β Issue tracker (locked down) β
β refactorer β default β Pattern migration β
β reviewer β default β Code review (read-only) β
βββββββββββββββββββ΄ββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββ
"Legacy code is simply code without tests." β Michael Feathers, Working Effectively with Legacy Code
| Skill | When to Use |
|---|---|
| testing-patterns | Adding tests, breaking dependencies, characterization tests |
| swarm-coordination | Multi-agent decomposition, parallel work |
| cli-builder | Building CLIs, argument parsing, subcommands |
| learning-systems | Confidence decay, pattern maturity |
| skill-creator | Meta-skill for creating new skills |
| system-design | Architecture decisions, module boundaries |
skills_use(name="testing-patterns")
skills_use(name="cli-builder", context="building a new CLI tool")Tip
testing-patterns includes 25 dependency-breaking techniques from Feathers' Working Effectively with Legacy Code. Gold for getting gnarly code under test.
| File | Topics |
|---|---|
tdd-patterns.md |
RED-GREEN-REFACTOR, characterization tests |
error-patterns.md |
Known error signatures + solutions |
prevention-patterns.md |
Debug-to-prevention workflow |
nextjs-patterns.md |
RSC, caching, App Router gotchas |
effect-patterns.md |
Services, Layers, Schema, error handling |
testing-patterns.md |
Test strategies, mocking, fixtures |
typescript-patterns.md |
Type-level programming, inference, narrowing |
Load via @knowledge/file-name.md references when relevant.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ~/.config/opencode β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β command/ 25 slash commands (/swarm, /debug, etc.) β
β tool/ 12 custom MCP tools (cass, ubs, etc.) β
β plugin/ swarm.ts (orchestration) β
β agent/ specialized subagents (worker, planner...) β
β knowledge/ context files (tdd, effect, nextjs, etc.) β
β skills/ 7 injectable knowledge packages β
β opencode.jsonc main config (models, MCP servers, perms) β
β AGENTS.md workflow instructions + tool preferences β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- joelhooks/swarmtools - The swarm orchestration core
- nexxeln/opencode-config -
/rmslop, notify plugin, Effect-TS patterns - OpenCode - The foundation
MIT
"One person's pattern can be another person's primitive building block." β Eric Evans, Domain-Driven Design