Keep this file short. Add only facts that change agent behavior.
Whenever you write any comment, documentation, or PR body in this repo: consider what the next human and their coding agent will get out of it. Less prose, more information density. Do not write your own diary — in here, in code comments, in PR descriptions, anywhere. Keep it facts only.
CLAUDE.md is a symlink to this file at every directory level. Edit AGENTS.md only.
npm install
npm run typecheck # tsc --noEmit, strict
npm test # vitest run, 23 testssrc/index.ts— plugin entry; tools, event hooks, state file I/Oskills/,commands/— auto-copied to~/.config/opencodeon first runtests/— vitest;tests/setup.tssandboxesHOMEto a tmpdir.github/workflows/release.yml— CI + auto-publish on master
- Plugin tools MUST use
tool({ args: {...} })from@opencode-ai/plugin. The raw JSON-Schemaparameters: {...}form crashes opencode 1.14+ (Object.entries(undefined)). See #4. tool.schemais re-exported zod. Usetool.schema.string()(function), nottool.schema.string(property).src/index.tsruntime exports must be loader-safe. opencode 1.15+ iteratesObject.values(module)of the entrypoint and accepts each value only if it's (a) a function, or (b) an object literally shaped{ server: <function> }. Anything else — RegExps, strings, numbers, Sets, plain objects, classes — throwsTypeError: Plugin export is not a function. Put non-function values in sibling modules (src/completion.ts) and import them without re-exporting. Type-onlyexport typeis fine; types are erased at compile time. See #14 / #15.- No build step. Ships
src/*.tsdirectly via"main": "src/index.ts". engines.node: >=18is the runtime contract. Tests need Node 20+ (vitest 4 importsnode:util.styleText).
Bump version in package.json → merge to master → workflow auto-publishes via OIDC trusted publishing with provenance, tags, and creates the GitHub release. Details at top of .github/workflows/release.yml.