|
| 1 | +--- |
| 2 | +name: Authoring Plugins (Multi-Runtime) |
| 3 | +description: Author a plugin once in Claude Code format, then generate Codex, Antigravity, and Cursor manifests from it so one directory loads in all four runtimes. Use when creating, scaffolding, or editing a plugin in this marketplace, wiring a marketplace entry, running the multi-format generator, or when the user mentions "plugin.json", ".claude-plugin", ".codex-plugin", ".cursor-plugin", "multi-format", "marketplace.json", or "Codex/Cursor/Antigravity plugin". |
| 4 | +--- |
| 5 | + |
| 6 | +# Plugin Authoring — Multi-Runtime |
| 7 | + |
| 8 | +This marketplace ships the **same plugin directory across four runtimes**. You author **once** in |
| 9 | +Claude Code format (the source of truth) and **generate** the rest. Never hand-write the Codex, |
| 10 | +Antigravity, or Cursor manifests. |
| 11 | + |
| 12 | +## The one rule: edit Claude → generate the rest |
| 13 | + |
| 14 | +``` |
| 15 | +.claude-plugin/plugin.json (or root plugin.json) ← author here, source of truth |
| 16 | + │ |
| 17 | + │ bun scripts/cli.ts multi-format |
| 18 | + ▼ |
| 19 | +.codex-plugin/plugin.json + .mcp.json ← generated |
| 20 | +plugin.json (root) + mcp_config.json + hooks.json ← generated (Antigravity) |
| 21 | +.cursor-plugin/plugin.json ← generated |
| 22 | +.agents/plugins/marketplace.json ← generated (Codex marketplace) |
| 23 | +.cursor-plugin/marketplace.json ← generated (Cursor marketplace) |
| 24 | +``` |
| 25 | + |
| 26 | +Shared assets (`commands/`, `agents/`, `skills/`, `hooks/`) live **once** at the plugin root and are |
| 27 | +referenced by every manifest. Only manifest-level fields differ per runtime. |
| 28 | + |
| 29 | +## Workflow |
| 30 | + |
| 31 | +1. **Scaffold / edit** the plugin in Claude Code format — run `/plugin-dev:scaffold` for a new one. |
| 32 | + Components go at the plugin **root**, never inside `.claude-plugin/`: |
| 33 | + ``` |
| 34 | + plugins/<name>/ |
| 35 | + ├── .claude-plugin/plugin.json # manifest only (or root plugin.json — see below) |
| 36 | + ├── commands/ # at root |
| 37 | + ├── agents/ # at root |
| 38 | + ├── skills/ # at root |
| 39 | + └── hooks/hooks.json # at root |
| 40 | + ``` |
| 41 | +2. **Register** in the source-of-truth marketplace `.claude-plugin/marketplace.json` |
| 42 | + (`source: "./plugins/<name>"`). Claude-only fields like `relevance` live **only** here. |
| 43 | +3. **Generate** the other runtimes: `/plugin-dev:multi-format` (or `bun scripts/cli.ts multi-format`). |
| 44 | +4. **Scope the diff** — the generator rewrites *all* local plugins; `git restore` any unrelated |
| 45 | + churn so the commit stays atomic. |
| 46 | +5. **Validate**: `/plugin-dev:validate`, then `claude plugin validate plugins/<name>`. |
| 47 | + |
| 48 | +## Root-level `plugin.json` plugins |
| 49 | + |
| 50 | +A few plugins (e.g. `plugin-dev`, `bun`) use a **root** `plugin.json` that serves as *both* the |
| 51 | +Claude Code manifest *and* the Antigravity manifest. Edit that root file as the source of truth; |
| 52 | +`multi-format` still regenerates `.codex-plugin/` and `.cursor-plugin/` from it. |
| 53 | + |
| 54 | +## Companion files for a NEW plugin |
| 55 | + |
| 56 | +Wire these in the same change (see `.claude/rules/marketplace-sync.md`): |
| 57 | + |
| 58 | +- `.claude-plugin/marketplace.json` — add the plugin entry (source of truth). |
| 59 | +- `release-please-config.json` + `.release-please-manifest.json` — add a `plugins/<name>` entry |
| 60 | + covering **every** version-bearing manifest the plugin ships (`.claude-plugin/plugin.json` and, |
| 61 | + when multi-format generates them, `.codex-plugin/plugin.json` + root `plugin.json` + |
| 62 | + `.cursor-plugin/plugin.json`). *Only if the plugin is release-managed.* |
| 63 | +- `README.md` — add the plugin under **Built-in Plugins**. |
| 64 | + |
| 65 | +## What NOT to do |
| 66 | + |
| 67 | +- ❌ Hand-edit `.codex-plugin/`, `.cursor-plugin/`, generated root Antigravity `plugin.json`, or the |
| 68 | + Codex/Cursor `marketplace.json` — re-run `multi-format`. |
| 69 | +- ❌ Put `relevance` (or other Claude-only fields) in the Codex/Cursor marketplaces — the generator |
| 70 | + intentionally drops them. |
| 71 | +- ❌ Nest `commands/` / `agents/` / `skills/` inside `.claude-plugin/` — they won't load. |
| 72 | + |
| 73 | +## Related |
| 74 | + |
| 75 | +- Deep Claude Code component reference (commands, agents, skills, hooks, MCP, Gemini migration): |
| 76 | + the `claude-code-plugin-builder` skill. |
| 77 | +- Codex-native creation (inside Codex): the `plugin-creator` skill. |
| 78 | +- Cursor-native creation (inside Cursor): the `create-plugin-scaffold` skill. |
| 79 | +- Commands: `/plugin-dev:scaffold`, `/plugin-dev:multi-format`, `/plugin-dev:validate`, |
| 80 | + `/plugin-dev:migrate-gemini`, `/plugin-dev:best-practices`. |
0 commit comments