Skip to main content
A registry is a directory of source files and a 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:
After a matching OCX 3 release is 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

Create files/skills/review/SKILL.md:
Add a component entry to the existing components array in registry.jsonc:
Keep supporting scripts, reference files, and templates beside 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:
Do not include an .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:
The installer resolves 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 under files/profiles/team/, then map them to the profile root:
Use the profile metadata schema for 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

Validation checks schema, files, paths, dependencies, cycles, and target collisions. A build stages complete output before replacing the previous directory. It does not validate the behavior of native plugins or the quality of agent instructions. During the unpublished preview, use the explicit built CLI above. The template’s 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:
In a second shell where OCX 3 is available, use the URL printed by Wrangler, normally http://localhost:8787:
Read .opencode/skills/review/SKILL.md, then exercise it in OpenCode with project discovery enabled. If you added the profile recipe, test it separately:
Edit a published file, rebuild, and preview an update to the test destination. Also test a local edit to confirm the resulting conflict is understandable. The component reference explains these cases.

Deploy

Publish the complete dist/ 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:
Then append it to the registry’s package build script:
Keep the other package scripts and settings. During source-preview testing, run 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 component version 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.