registry.jsonc manifest. OCX builds it into static JSON and assets that can be served by Cloudflare, Vercel, Netlify, or another static host.
Start from the template
From an OCX V2 checkout, with the preview CLI available:init --registry can fetch its template without --local. The generated README and AGENTS guide contain the complete contributor instructions, hosting configuration, and examples for each component type.
Add a skill
Createfiles/skills/review/SKILL.md:
components array in registry.jsonc:
SKILL.md, and list each one in files. Native skill discovery and frontmatter determine how OpenCode presents the installed definition.
Choose paths and component types
File targets are relative to the destination configuration root: either a profile directory or a project’s.opencode/. A string maps the same relative path from files/ to that root. An object can change the target:
.opencode/ prefix. OCX preserves directory names rather than rewriting singular/plural native discovery paths.
Only a profile recipe may own root
ocx.jsonc, opencode.json(c), cli.json, or AGENTS.md. Ordinary components cannot patch native configuration. Put setup instructions beside the component or package a complete profile recipe when shared settings are essential.
Add dependencies
Same-registry dependencies use a bare component name. Cross-registry dependencies use a configured alias:team in the destination’s registry sources. Global sources do not cascade into a profile or project. Cycles and duplicate ownership are rejected; depend on the component that owns a file instead of copying the same target into two components.
Create a profile recipe
Place complete files underfiles/profiles/team/, then map them to the profile root:
ocx.jsonc, native settings for opencode.jsonc, and plain Markdown instructions for AGENTS.md. Do not include credentials, generated dependencies, or service state.
Validate and build
bun run build uses bunx ocx@next and needs that preview to exist on npm.
Test an installation
From the registry directory, serve the built output:http://localhost:8787:
.opencode/skills/review/SKILL.md, then exercise it in OpenCode with project discovery enabled. If you added the profile recipe, test it separately:
Deploy
Publish the completedist/ directory, including .well-known/, through a static deployment:
The template scripts assume the published OCX 3 preview. Before publication, configure the host to build with the tested source CLI. For reproducible production builds, pin the OCX version you validated.
Serve JSON and assets at their exact generated paths. Disable HTML fallback behavior for missing registry files. For a subpath such as
/opencode-v2, update discovery metadata to point at /opencode-v2/index.json and test that base URL.
For a subpath deployment, make that rewrite part of every build. For example, create scripts/set-registry-base.ts in your registry:
ocx build . --out dist, followed by bun scripts/set-registry-base.ts. Adjust the script’s output path if you use a different --out. Root-hosted registries can keep the builder’s default discovery metadata.
Repeat a fresh install, dependency fetch, and verification against the deployment URL. Publishing a valid index alone is not enough if component assets are missing.
Maintain compatibility
Use a componentversion to version it independently, or bump the registry version shared by components without overrides. The default builder emits the latest revision only; it is not a historical version archive. Receipts track the actual installed content.
Keep legacy protocol-2 registries at separate URLs. Changing only the schema URL cannot migrate V1 config patches, runtime plugins, or npm dependency fields. See protocol 3 and migration.