opencode-integration
Skill9 starsChanged 6 months agoMITView on GitHub
Use OpenCode as a coding subagent via ACP protocol. Write and debug code through OpenCode's free models (minimax-m2.5-free, etc.), query its session database, and verify which model actually ran.
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- arxivSkill
- blogwatcherSkill
- docxSkill
- fireworks-tech-graphSkill
- paper-writingSkill
- patent-writingSkill
- markitdown-converterSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Use delegate_task with ACP transport:
- Very specific: line 34
Version: check with opencode --version
- Very specific: line 93
Run a trivial task via delegate_task with ACP to confirm end-to-end connectivity
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
OpenCode Integration
OpenCode is an AI coding CLI installed via npm. It supports ACP (Agent Client Protocol) and can be invoked as a subagent through Hermes delegate_task.
Trigger
- User asks to use OpenCode, connect to OpenCode, or write code with OpenCode
- User mentions
opencodeCLI - Task involves delegating coding work to a local agent
Invocation via ACP
Use delegate_task with ACP transport:
delegate_task(
goal="<task description>",
acp_command="opencode",
acp_args=["acp"],
toolsets=["terminal", "file"]
)OpenCode will run as a subagent in its own process, using its locally configured model, and return results.
OpenCode Details
- Install path:
~/.npm-global/bin/opencode - Version: check with
opencode --version - Help:
opencode --help
Available Free Models
opencode/big-pickle
opencode/minimax-m2.5-free ← default
opencode/nemotron-3-super-free
opencode/ring-2.6-1t-freeList models: opencode models
CRITICAL PITFALL: Model Tracking
The delegate_task return object includes a model field — this is Hermes's own model (e.g., deepseek-v4-pro), NOT the model OpenCode actually used.
To find the actual model OpenCode used, query its SQLite database:
import sqlite3, json
db = sqlite3.connect(os.path.expanduser("~/.local/share/opencode/opencode.db"))
rows = db.execute("SELECT data FROM message ORDER BY time_created DESC LIMIT 5").fetchall()
for r in rows:
d = json.loads(r[0])
if d.get("role") == "assistant":
print(f"provider: {d['providerID']}, model: {d['modelID']}")Or from the terminal via Python one-liner:
python3 -c "
import sqlite3, json
db = sqlite3.connect('$HOME/.local/share/opencode/opencode.db')
rows = db.execute(\"SELECT data FROM message WHERE data LIKE '%modelID%' ORDER BY time_created DESC LIMIT 3\").fetchall()
for r in rows:
d = json.loads(r[0])
if 'modelID' in d:
print(f\"{d.get('role','?')}: provider={d.get('providerID','?')}, model={d['modelID']}\")
"Database Schema
- Database path:
~/.local/share/opencode/opencode.db - Key tables:
session,message,part,project,todo messagetable:id,session_id,time_created,time_updated,data(JSON)dataJSON fields (assistant messages):role,modelID,providerID,mode,agent,tokens,cost,finishsessiontable: includesmodelcolumn (often null; the real model is in message data)
Token / Cost
OpenCode's free models have cost: 0. Tokens are logged in the message data.tokens JSON.
Verify OpenCode is Working
opencode --version— should return version numberopencode models— should list available models- Run a trivial task via
delegate_taskwith ACP to confirm end-to-end connectivity
Common Commands Reference
| Command | Purpose |
opencode --version | Version check |
opencode --help | Help |
opencode models | List available models |
opencode acp | Start ACP server (used by delegate_task) |
opencode agent list | List configured agents |
opencode db path | Print database path |
opencode session | Session management |
Reference Files
references/opencode-db.md— Database schema, query recipes, message JSON structure
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

