opencode-builder

A development guide for extending OpenCode, an AI coding assistant, through its JavaScript/TypeScript software interface or plug-ins.

In plain words
What is it for?
Building integrations, automated workflows, user interfaces, custom tools, lifecycle hooks, commands, and multi-agent workflows.
Why use it?
It explains how to connect other software to OpenCode or change how OpenCode behaves during coding sessions.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/timmy6942025/opencode-builder-skill/opencode-builder
Any agent
npx skills add Timmy6942025/opencode-builder-skill --skill opencode-builder
Clone the repo
git clone --depth 1 https://github.com/Timmy6942025/opencode-builder-skill

Made for: Claude Code, Codex.

Per session 119 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,483 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00119 $0.07483
Opus 5 $0.00060 $0.03742
Sonnet 5 $0.00024 $0.01497
Haiku 4.5 $0.00012 $0.00748

Measured yesterday against content hash ad10de5e647f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

opencode-builder scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

import { spawn } from "node:child_process"
skills/opencode-builder/SKILL.md · 1,098 lines

How it starts

The opening of the file, as written. The whole thing — 1,098 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OpenCode Builder

📚 Official Docs: For the latest information, always refer to the official documentation: For the latest SDK docs: https://opencode.ai/docs/sdk/. For plugins: https://opencode.ai/docs/plugins/.

A comprehensive skill for building on top of OpenCode — an AI-powered coding assistant. This skill covers both the JavaScript/TypeScript SDK for programmatic control and the plugin architecture for extending OpenCode's behavior.


Table of Contents

  1. Quick Start: Choose Your Path
  2. SDK Path: Programmatic Control
  3. Plugin Path: Extending OpenCode
  4. Configuration Deep-Dive
  5. Common Patterns
  6. Advanced Orchestration
  7. Agent Skills
  8. Custom Commands
  9. Debugging & Troubleshooting
  10. Best Practices

Quick Start: Choose Your Path

OpenCode offers two primary extension surfaces:

Path Use When Key Packages
SDK (@opencode-ai/sdk) You want to control OpenCode from an external app, script, or service. Build integrations, automate workflows, or create UIs that interact with OpenCode. @opencode-ai/sdk
Plugin (@opencode-ai/plugin) You want to run code inside OpenCode, hook into its lifecycle, add custom AI tools, or modify behavior. @opencode-ai/plugin

You can use both in the same project. A plugin can internally use the SDK client to call back into OpenCode.

Decision Table

Scenario Recommended Path
Build a CI/CD integration SDK
Add a custom tool the AI can call Plugin
Create a webhook listener that triggers sessions SDK
Intercept and modify tool calls Plugin
Build a dashboard showing session status SDK
Protect sensitive files from being read Plugin
Automate multi-agent workflows SDK + Plugin
Add notifications on session completion Plugin
Create an external UI for OpenCode SDK
Inject environment variables into all shell commands Plugin

Read the full file on GitHub · 1,098 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 1,098 lines · 119 tokens per session scan A ad10de5e647f

Subscribe to this mod's changes

opencode-builder is a skill published in the GitHub repository Timmy6942025/opencode-builder-skill (2 stars, last pushed 3mo ago), licensed MIT. It adds 119 tokens to every session and 7,483 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.