multi-harness-plugin-template

A Claude Code plugin template that also ships as a Cursor plugin, a Codex plugin,
a pi package, and an opencode plugin — from one source tree. Write your
Agent Skills (SKILL.md), slash commands, subagents, and
MCP servers once; the repo is its own one-plugin marketplace, and a validator in CI
keeps the manifests in sync.
The repository root is the plugin: shared components (skills/, commands/,
agents/) sit at the top level, a small manifest per harness describes them, and a
generated one-entry catalog makes the repo installable as a marketplace.
One repository, one plugin — create a new repository from this template for each
plugin you build.
Supported harnesses
| Harness | Manifest | Loads | Install from |
|---|
| Claude Code | .claude-plugin/plugin.json | skills, commands, agents, hooks, .mcp.json | the repo as a marketplace |
| Cursor | .cursor-plugin/plugin.json | skills, commands, agents, rules/*.mdc, mcp.json | the repo |
| Codex | .codex-plugin/plugin.json | skills, hooks, .mcp.json | the same marketplace |
| pi | package.json ("pi" key) | skills, commands (as prompt templates) | pi install git:… |
| opencode | .opencode-plugin/ adapter | skills, commands, agents, .mcp.json | opencode plugin github:… |
Exact install commands and per-harness caveats are in
How one tree serves three harnesses,
pi, and opencode below.
Quick start
-
Click Use this template on GitHub (or
gh repo create my-plugin --template DanielHou315/multi-harness-plugin-template --private --clone).
-
Initialise it — this renames the plugin in both manifests, writes a starter
README over this one, regenerates the catalog, validates, and then removes itself:
scripts/init_plugin.sh doc-translator "Translate Markdown docs between languages. Use when asked to translate or localise documentation."
Author name and email default to your git config; see
scripts/init_plugin.sh --help for --display-name, --author, --email,
--category, and --keep.
-
Replace the example components with real ones and commit.
Requires bash and jq.
What's in the box
├── .claude-plugin/
│ ├── plugin.json # Claude Code manifest
│ └── marketplace.json # one-entry catalog — GENERATED, do not edit
├── .cursor-plugin/plugin.json # Cursor manifest
├── .codex-plugin/plugin.json # Codex manifest
├── .opencode-plugin/ # opencode adapter (package.json + index.js)
├── marketplace.config.json # catalog-only fields (category)
├── package.json # pi package manifest ("pi" key)
├── skills/example-skill/SKILL.md
├── commands/example-command.md
├── agents/example-agent.md
├── scripts/
│ ├── init_plugin.sh # one-shot: template -> your plugin
│ ├── gen_catalog.sh # regenerates the catalog from plugin.json
│ └── validate_plugin.sh # the validator (CI + local)
├── docs/develop_plugin.md # full structure reference
├── AGENTS.md # rules for coding agents working on the plugin
└── .github/workflows/validate.yml
How one tree serves three harnesses
| Claude Code | Cursor | Codex |
|---|
| Manifest | .claude-plugin/plugin.json | .cursor-plugin/plugin.json | .codex-plugin/plugin.json |
| Installed via | .claude-plugin/marketplace.json ("source": "./") | the repo itself | the same Claude catalog |
| Install | claude plugin marketplace add <owner>/<repo> then claude plugin install <name>@<name> | add the repo in plugin settings | codex plugin marketplace add <owner>/<repo> then codex plugin add <name>@<name> |
pi
| pi coding agent |
|---|
| Manifest | package.json (the "pi" key) |
| Installed via | the repo itself as a pi package (git, npm, or local path) |
| Install | pi install git:github.com/<owner>/<repo> (append @<ref> to pin) |
| Loads | skills/ as skills; commands/*.md as prompt templates (/example-command) |
| Not loaded | agents/ (no subagents), rules/, .mcp.json (no built-in MCP) |
opencode