Personal OpenCode configuration - commands, tools, agents, knowledge
Personal OpenCode configuration - commands, tools, agents, knowledge
…"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,cass) are backends that agents call - not meant for direct human use.
Install OpenCode via the official install script or the Homebrew tap.
curl -fsSL https://opencode.ai/install | bashbrew install anomalyco/tap/opencodegit clone https://github.com/joelhooks/opencode-config ~/.config/opencode
cd ~/.config/opencode && bun install[!NOTE] 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
# Cross-agent session search (optional but recommended)
npm install -g cass-search
cass index
cass --version # 0.1.35+swarm doctorInside OpenCode, run /init in the repo you want to work on. This generates an AGENTS.md file with workflow rules—commit it so collaborators and agents share the same guardrails.
[!WARNING] All commands run inside OpenCode, not in your terminal. The
swarmCLI 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.
OpenCode merges configuration from multiple sources with defined precedence. Higher-precedence sources override earlier ones, so keep defaults in shared configs and project-specific overrides close to the repo.
Permissions support allow, ask, and deny rules. When multiple rules match, the last match wins. Reads from .env files are denied by default, so add explicit allowances when you need them.
| Tool | Version | Install Command |
|---|---|---|
| swarm | 0.30.0 | npm i -g opencode-swarm-plugin |
| cass | 0.1.35 | npm i -g cass-search |
| ollama | 0.13.1 | brew install ollama |
Embedding model: nomic-embed-text (required for hivemind 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
…Every task execution feeds the learning system:
CASS searches across ALL your AI agent histories before solving problems:
Semantic Memory persists learnings across sessions with vector search:
…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):
hive_create, hive_create_epic, hive_query, hive_close, hive_syncAgent Mail (multi-agent coordination):
swarmmail_init, swarmmail_send, swarmmail_reserve, swarmmail_releaseSwarm Tools (orchestration):
swarm_decompose, swarm_validate_decomposition, swarm_complete, swarm_record_outcome…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):
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)hivemind_store(information="OAuth tokens need 5min buffer", tags="auth,tokens")
hivemind_find(query="token refresh", limit=5)
hivemind_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, --expand for context)typecheck - TypeScript check with grouped errorsgit-context - Branch, status, commits in one callOpenCode manages MCP servers from config and starts them on demand. Keep server definitions in opencode.jsonc so agents can discover tools without manual bootstrapping.
| 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 |
…"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-patternsincludes 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.
…/rmslop, notify plugin, Effect-TS patternsMIT
"One person's pattern can be another person's primitive building block." — Eric Evans, Domain-Driven Design
No open issues yet, or sync has not completed.