OpenCode SDK Development
OpenCode SDK Development
Guide for creating custom tools and plugins using the OpenCode SDK.
Overview
OpenCode provides two main packages for SDK development:
| Package | Purpose |
|---|---|
@opencode-ai/sdk |
Client SDK for interacting with OpenCode server (sessions, messages, files) |
@opencode-ai/plugin |
Plugin system for creating custom tools with schema validation |
Quick Start: Custom Tools
Custom tools extend OpenCode's capabilities. Tools are TypeScript/JavaScript files auto-discovered from:
- Local:
.opencode/tool/in project directory - Global:
~/.config/opencode/tool/
More from hhopkins95/ai-systems
backend setup
This skill should be used when the user asks to "create an agent runtime server", "set up agent runtime backend", "configure Modal sandbox", "implement PersistenceAdapter", "start WebSocket server", "create REST API for agents", or needs to build a Node.js backend using @hhopkins/agent-runtime.
1project tracking
System for tracking work across AI sessions. Use when starting or ending work sessions, managing initiatives, capturing ideas or todos, or when needing to understand what work is in progress. Handles knowledge transfer between sessions.
1agent design
This skill should be used when the user asks to "configure agent profile", "add skills to agent", "set up MCP servers", "configure agent tools", "write system prompt", "create agent workflow", "define agent commands", "add subagents", or needs to define what capabilities an agent has and how to orchestrate complex workflows in the runtime.
1agent design 2
This skill should be used when the user asks to "configure agent profile", "add skills to agent", "set up MCP servers", "configure agent tools", "write system prompt", "create agent workflow", "define agent commands", "add subagents", or needs to define what capabilities an agent has and how to orchestrate complex workflows in the runtime.
1documentation system
Standards for documenting codebases. Use when writing documentation, deciding where docs should go, reviewing doc quality, or updating docs after code changes. Covers folder structure, content guidelines, and maintenance workflows.
1agent runtime overview
This skill should be used when the user asks "what is agent-runtime", "why use agent-runtime", "what does this repo do", "agent runtime architecture", "how does agent-runtime work", or needs to understand the purpose, value proposition, and high-level architecture of the @hhopkins/agent-runtime monorepo.
1