← ClaudeAtlas

opencode-plugin-developmentlisted

This skill should be used when the user asks to "create an OpenCode plugin", "develop an OpenCode plugin", "write an OpenCode plugin", "build an OpenCode plugin", "make an OpenCode plugin", "add a hook to OpenCode", "subscribe to OpenCode events", "create a custom tool for OpenCode", or needs guidance on OpenCode plugin architecture, events, custom tools, TypeScript support, or dependencies management.
gdm257/cc-plugins · ★ 0 · AI & Automation · score 63
Install: claude install-skill gdm257/cc-plugins
# OpenCode Plugin Development Guide Create plugins to extend OpenCode's functionality by hooking into events, adding custom tools, and modifying behavior. ## Overview OpenCode plugins are JavaScript/TypeScript modules that export a plugin function. The function receives a context object and returns a hooks object defining event hooks and custom tools. ## Plugin Types OpenCode supports two plugin installation methods: ### Config Plugin Field (Recommended) Define plugins in your `opencode.json` `plugin` array: ```json { "plugin": ["my-plugin@1.0.0", "@scope/enterprise-plugin"] } ``` **Characteristics:** - Plugins are npm packages installed via **Bun** - Dependencies declared in `package.json` are **automatically installed** - Published to npm registry for distribution - Version management via npm versioning - Suitable for: distributable plugins, plugins with external dependencies ### Local Plugin Directory Place plugin files directly in `.opencode/plugins/`: ``` .opencode/plugins/ └── my-plugin.ts ``` **Characteristics:** - Local files loaded via `file://` URLs - **No dependency installation** - all dependencies must be pre-installed - Quick iteration for development - Suitable for: private plugins, prototypes, plugins without external dependencies **Comparison:** | Feature | Config `plugin` Field | Local `.opencode/plugins/` | | ----------------------- | --------------------- | -------------------------- | | Dependency Installation | ✅ Automa