Add and ship OpenCode support for one Claude Code plugin at a time. Includes core migration to a reviewable `opencode-plugin/` adapter, maintainer-facing docs, and follow-up CI/versioning setup for package publishing or skill-copy drift checks.
92
92%
Does it follow best practices?
Impact
97%
1.25xAverage score across 2 eval scenarios
Passed
No known issues
Use this when creating or validating generated opencode-plugin/ files.
opencode-plugin/
package.json
src/plugin.ts
src/tui.ts # only if needed
src/state.ts # only if needed
skills/<skill-name>/SKILL.md # only if publishing needs packaged skill assets
tests/opencode-plugin.test.tsFor JavaScript-only repos:
opencode-plugin/
package.json
plugin.js
skills/<skill-name>/SKILL.md # only if publishing needs packaged skill assets
tests/opencode-plugin.test.jsopencode-plugin/package.json.Do not use .opencode/ as the package root. .opencode/ is active OpenCode config and can auto-load plugins, skills, agents, commands, modes, tools, and themes.
opencode-plugin/package.json should include:
name: npm package name, ideally scoped.version: align with repo releases when possible.type: module.main: plugin entrypoint.exports: plugin entrypoint.files: only runtime package files.keywords: include opencode and opencode-plugin.license, repository, homepage, and author fields when known.Example:
{
"name": "@scope/my-plugin-opencode",
"version": "0.1.0",
"type": "module",
"main": "./src/plugin.ts",
"exports": {
".": "./src/plugin.ts"
},
"files": ["src/", "skills/"],
"keywords": ["opencode", "opencode-plugin"],
"license": "MIT",
"repository": "https://github.com/owner/repo",
"homepage": "https://github.com/owner/repo#readme"
}If the package compiles before publishing, point main, exports, and files at compiled output instead.
Do not include agent config roots in files:
.claude/.opencode/.agents/.cursor/If package publication needs shared skills, copy or sync them into opencode-plugin/skills/ and document the source-of-truth relationship. Prefer a test or checksum/content-equality check that package-local copies match the source of truth. Do not add CI, GitHub Actions, release, publish, or sync workflows in this version.
Only create this when the user explicitly wants project-local OpenCode dogfooding:
.opencode/plugins/<plugin-name>.tsKeep it as a tiny shim:
export { MyPlugin } from "../../opencode-plugin/src/plugin";The implementation stays in opencode-plugin/.