@dodopayments/opencode-plugin 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.mcp.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "args": [
7
7
  "-y",
8
8
  "mcp-remote@latest",
9
- "https://mcp.dodopayments.com/sse"
9
+ "https://mcp.dodopayments.com/mcp"
10
10
  ],
11
11
  "enabled": true
12
12
  },
package/README.md CHANGED
@@ -1,11 +1,13 @@
1
1
  # Dodo Payments Agent Plugin
2
2
 
3
3
  [![License](https://img.shields.io/github/license/dodopayments/dodo-agent-plugin.svg?style=flat-square)](./LICENSE)
4
- [![Version](https://img.shields.io/badge/version-0.4.0-blue.svg?style=flat-square)](./CHANGELOG.md)
4
+ [![Version](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fdodopayments%2Fdodo-agent-plugin%2Fmain%2Fplugin.json&query=%24.version&label=version&color=blue&style=flat-square)](./CHANGELOG.md)
5
5
  [![npm](https://img.shields.io/npm/v/@dodopayments/opencode-plugin.svg?style=flat-square)](https://www.npmjs.com/package/@dodopayments/opencode-plugin)
6
6
  [![Discord](https://img.shields.io/discord/1305511580854779984?label=discord&style=flat-square)](https://discord.gg/bYqAp4ayYh)
7
7
 
8
- The official Dodo Payments plugin for AI coding agents. Installs seventeen integration skills and two MCP servers across **Claude Code**, **Codex CLI**, **Cursor**, and **OpenCode** from a single source of truth.
8
+ The official Dodo Payments plugin for AI coding agents. Installs seventeen integration skills and two MCP servers across **Claude Code**, **Codex CLI**, **Cursor**, **VS Code / GitHub Copilot**, and **OpenCode** from a single source of truth.
9
+
10
+ This plugin conforms to the [Agent Plugins 1.0.0](https://agent-plugins.org/specification) specification: a root [`plugin.json`](./plugin.json), skills as immediate children of [`skills/`](./skills), and MCP servers in [`mcp.json`](./mcp.json). Clients with native Agent Plugins support load it directly; the provider-specific manifests in this repo are generated compatibility shims for clients that do not.
9
11
 
10
12
  ## What you get
11
13
 
@@ -26,30 +28,29 @@ The API MCP server uses browser OAuth by default, so no keys are required at ins
26
28
 
27
29
  ### Codex CLI
28
30
 
29
- Codex installs plugins in two steps: register the marketplace from your shell, then install the plugin from inside the Codex TUI.
30
-
31
- 1. Register the marketplace:
31
+ Register the marketplace, then install the plugin:
32
32
 
33
- ```bash
34
- codex plugin marketplace add dodopayments/dodo-agent-plugin
35
- ```
33
+ ```bash
34
+ codex plugin marketplace add dodopayments/dodo-agent-plugin
35
+ codex plugin add dodopayments@dodopayments
36
+ ```
36
37
 
37
- 2. Open Codex and run the `/plugins` slash command:
38
+ Verify:
38
39
 
39
- ```bash
40
- codex
41
- ```
40
+ ```bash
41
+ codex plugin list # dodopayments installed, enabled
42
+ codex mcp list # dodo-knowledge, dodopayments-api
43
+ codex mcp login dodopayments-api # browser OAuth, only needed for the API server
44
+ ```
42
45
 
43
- Then type `/plugins`, switch to the **Dodo Payments** marketplace, select the **dodopayments** plugin, and choose **Install plugin**.
46
+ You can also install from inside the TUI: run `codex`, type `/plugins`, select the **Dodo Payments** marketplace and the **dodopayments** plugin, then choose **Install plugin**.
44
47
 
45
- If you previously added the marketplace before this fix landed and the plugin doesn't appear under `/plugins`, refresh it:
48
+ If you added the marketplace previously and the plugin doesn't appear, refresh it:
46
49
 
47
50
  ```bash
48
51
  codex plugin marketplace upgrade dodopayments
49
52
  ```
50
53
 
51
- > Codex CLI does not have a `codex plugin install` subcommand. Plugin installation always happens through the in-TUI `/plugins` flow ([official docs](https://developers.openai.com/codex/plugins)).
52
-
53
54
  ### Cursor
54
55
 
55
56
  Manual install:
@@ -58,7 +59,42 @@ Manual install:
58
59
  git clone https://github.com/dodopayments/dodo-agent-plugin.git ~/.cursor/plugins/local/dodo-agent-plugin
59
60
  ```
60
61
 
61
- Restart Cursor. The plugin loads skills from `.claude/skills/` (via Cursor's Claude Code compat) and MCP servers from `.mcp.json`.
62
+ Restart Cursor. The plugin loads skills from `skills/` and MCP servers from `.mcp.json`, as declared in `.cursor-plugin/plugin.json`.
63
+
64
+ > Cursor 3.14.27 also recognises Agent Plugins 1.0.0 directly: its agent host carries both spec schema URLs and the spec's own `name` regex, and accepts either `.cursor-plugin/marketplace.json` or `.claude-plugin/marketplace.json` as a marketplace source. The generated `.cursor-plugin/plugin.json` is kept as belt-and-braces for older builds.
65
+
66
+ > Prior to v0.5.0 this clone produced a plugin with **no working skills**: `skills/` contained symlinks into a git submodule that a plain `git clone` does not fetch. Skills are now vendored as real files, so the command above works as documented. If you installed an earlier version, re-clone.
67
+
68
+ ### Kiro
69
+
70
+ Kiro reads the Agent Plugins manifest natively and loads this as a Power:
71
+
72
+ ```bash
73
+ git clone https://github.com/dodopayments/dodo-agent-plugin.git
74
+ ```
75
+
76
+ Point Kiro at the cloned folder. Skills load from `skills/`, MCP servers from `mcp.json`, and Kiro-specific presentation comes from the `dev.kiro` extension namespace in `plugin.json`.
77
+
78
+ ### Gemini CLI (MCP only)
79
+
80
+ Gemini CLI has no agent-skill primitive, so **only the two MCP servers are available** - the seventeen skills are not. `dodo-knowledge` still covers a good share of what the skills provide, and it stays current automatically.
81
+
82
+ ```bash
83
+ git clone https://github.com/dodopayments/dodo-agent-plugin.git \
84
+ ~/.gemini/extensions/dodopayments
85
+ ```
86
+
87
+ Restart Gemini CLI. `gemini-extension.json` at the repo root is the manifest.
88
+
89
+ ### VS Code / GitHub Copilot
90
+
91
+ ```bash
92
+ git clone https://github.com/dodopayments/dodo-agent-plugin.git
93
+ ```
94
+
95
+ Then open the Chat view, go to **Plugins**, and add the cloned folder. Skills load from `skills/`, and both MCP servers load from `.mcp.json`.
96
+
97
+ > VS Code 1.125.1 does not key off the Agent Plugins `$schema` - the string appears nowhere in its bundle. Its loader picks a manifest by probing, in order, `.plugin/plugin.json`, then `.claude-plugin/plugin.json`, then a root `plugin.json`, and defaults MCP to `.mcp.json` rather than `mcp.json`. Because this repo ships a generated `.claude-plugin/plugin.json`, VS Code loads it through that branch. Everything works - seventeen skills and two MCP servers - but via the compatibility manifests rather than the spec ones, so VS Code gets the `mcp-remote` bridge rather than the native transports in `mcp.json`.
62
98
 
63
99
  ### OpenCode
64
100
 
@@ -71,7 +107,29 @@ OpenCode distributes via npm. Add the plugin to your `opencode.json`:
71
107
  }
72
108
  ```
73
109
 
74
- Restart OpenCode. Both MCP servers (`dodopayments-api`, `dodo-knowledge`) are registered automatically via the plugin's `config` hook, and the seventeen skills are auto-discovered from the installed package. No manual `mcp` block required.
110
+ Restart OpenCode. Both MCP servers (`dodopayments-api`, `dodo-knowledge`) are registered automatically via the plugin's `config` hook. No manual `mcp` block required.
111
+
112
+ **Skills need the package installed locally plus one extra line.** OpenCode does not scan installed packages for skills, so point it at the package's `skills/` directory yourself. `skills.paths` entries resolve against the project directory, so the package must be present in the project's `node_modules` - OpenCode's own plugin cache is not the same location:
113
+
114
+ ```bash
115
+ npm install --save-dev @dodopayments/opencode-plugin
116
+ ```
117
+
118
+ ```jsonc
119
+ {
120
+ "$schema": "https://opencode.ai/config.json",
121
+ "plugin": ["@dodopayments/opencode-plugin"],
122
+ "skills": {
123
+ "paths": ["node_modules/@dodopayments/opencode-plugin/skills"]
124
+ }
125
+ }
126
+ ```
127
+
128
+ An absolute path works too, and avoids the local-install requirement.
129
+
130
+ Verify with `opencode run "List every skill available to you by name."` - you should see all seventeen. A skills path that does not exist is ignored silently, so check rather than assume.
131
+
132
+ > Versions before 0.5.0 documented these skills as auto-discovered. They were not: nothing in OpenCode scans an installed package, so OpenCode users had MCP servers but no skills. Setting `config.skills` from the plugin's `config` hook does not fix this either - the skill index is built before `config` hooks run, so it never registers anything.
75
133
 
76
134
  If you prefer the local stdio API server with your own API key instead of the default remote OAuth server, declare `dodopayments-api` yourself in `opencode.json` - your entry wins over the plugin default:
77
135
 
@@ -99,7 +157,7 @@ If you prefer the local stdio API server with your own API key instead of the de
99
157
 
100
158
  | Skill | Description |
101
159
  |-------|-------------|
102
- | `best-practices` | SDK setup, environments, API keys, and the canonical checkout-to-webhook architecture |
160
+ | `dodo-best-practices` | SDK setup, environments, API keys, and the canonical checkout-to-webhook architecture |
103
161
  | `framework-adapters` | Official `@dodopayments/*` handlers for Next.js, Express, Hono, Astro, Remix, SvelteKit, Nuxt, Fastify, TanStack, Bun, Convex |
104
162
  | `testing-and-go-live` | Test mode, test payment methods, webhook testing, production launch checklist |
105
163
 
@@ -142,7 +200,7 @@ If you prefer the local stdio API server with your own API key instead of the de
142
200
  | `billing-sdk` | BillingSDK React components for pricing tables and billing UI |
143
201
  | `better-auth-integration` | The `@dodopayments/better-auth` plugin for customer sync, checkout, portal |
144
202
 
145
- Skills source: [`dodopayments/skills`](https://github.com/dodopayments/skills) (bundled as a git submodule in `skills-src/`).
203
+ Skills source: [`dodopayments/skills`](https://github.com/dodopayments/skills), vendored into `skills/` as real files. Provenance (upstream commit and applied transforms) is recorded in [`.skills-source.json`](./.skills-source.json).
146
204
 
147
205
  ## Included MCP Servers
148
206
 
@@ -151,11 +209,11 @@ Skills source: [`dodopayments/skills`](https://github.com/dodopayments/skills) (
151
209
  | `dodopayments-api` | Live API access (payments, subscriptions, customers, products, refunds, licenses, usage) | OAuth (browser) |
152
210
  | `dodo-knowledge` | Semantic search over the Dodo Payments documentation | None |
153
211
 
154
- Both servers are wired through `mcp-remote` so they run in any MCP-compatible client.
212
+ Both servers speak Streamable HTTP. The canonical `mcp.json` declares them natively (`type: "streamable-http"`), which is what spec-native clients such as Codex CLI and Cursor use. The generated compatibility manifests — `.mcp.json`, read by Claude Code, VS Code and Cursor's legacy path — wire the same two endpoints through `mcp-remote` instead, so they run in clients that cannot yet dial Streamable HTTP directly.
155
213
 
156
214
  ## Configure (optional, Claude Code)
157
215
 
158
- If you prefer to run the API MCP locally with an API key instead of the remote SSE server, open `/plugins` in Claude Code, select **Dodo Payments**, and choose **Configure options**. Fill in:
216
+ If you prefer to run the API MCP locally with an API key instead of the remote server, open `/plugins` in Claude Code, select **Dodo Payments**, and choose **Configure options**. Fill in:
159
217
 
160
218
  - `dodo_api_key` - your `dodo_test_...` or `dodo_live_...` key
161
219
  - `dodo_webhook_key` - your webhook signing secret
@@ -213,7 +271,7 @@ These clients load MCPs from the static `.mcp.json` shipped with the plugin. To
213
271
  "dodopayments-api": {
214
272
  "type": "stdio",
215
273
  "command": "npx",
216
- "args": ["-y", "mcp-remote@latest", "https://mcp.dodopayments.com/sse"],
274
+ "args": ["-y", "mcp-remote@latest", "https://mcp.dodopayments.com/mcp"],
217
275
  "enabled": false
218
276
  }
219
277
  }
@@ -238,13 +296,13 @@ Your agent will load the `webhook-integration` skill, use the `dodo-knowledge` M
238
296
 
239
297
  ## Local development
240
298
 
241
- Clone with the skills submodule:
242
-
243
299
  ```bash
244
- git clone --recurse-submodules https://github.com/dodopayments/dodo-agent-plugin.git
300
+ git clone https://github.com/dodopayments/dodo-agent-plugin.git
245
301
  cd dodo-agent-plugin
246
302
  ```
247
303
 
304
+ No submodules, no build step - `skills/` is vendored as real files.
305
+
248
306
  Validate the Claude Code plugin and marketplace:
249
307
 
250
308
  ```bash
@@ -257,12 +315,27 @@ Load the plugin directly for a dev session:
257
315
  claude --plugin-dir ./dodo-agent-plugin
258
316
  ```
259
317
 
260
- Refresh the bundled skills to the latest upstream version:
318
+ Verify everything before pushing:
261
319
 
262
320
  ```bash
263
- git submodule update --remote skills-src
321
+ npm run verify # generated artifacts in sync + Agent Plugins conformance
264
322
  ```
265
323
 
324
+ ### Repository layout
325
+
326
+ | Path | Role |
327
+ |---|---|
328
+ | `plugin.json` | **Canonical.** Agent Plugins v1.0.0 manifest and the version source of truth |
329
+ | `mcp.json` | **Canonical.** Agent Plugins v1.0.0 MCP config |
330
+ | `skills/` | **Canonical.** Seventeen skills, vendored as real files |
331
+ | `overlays/*.json` | Hand-authored provider extras the closed spec schema cannot express |
332
+ | `.claude-plugin/`, `.cursor-plugin/`, `.agents/`, `.mcp.json`, `plugins/dodopayments/` | **Generated.** Do not hand-edit - run `npm run build` |
333
+ | `scripts/build.mjs` | The single generator (`--check` for drift) |
334
+ | `scripts/conformance.mjs` | Agent Plugins conformance validator |
335
+ | `.skills-source.json` | Upstream provenance for the vendored skills |
336
+
337
+ Skills are authored in [`dodopayments/skills`](https://github.com/dodopayments/skills) and vendored here. A weekly workflow re-syncs them and opens a PR; run it on demand with the **Sync skills from upstream** workflow dispatch.
338
+
266
339
  ## For maintainers
267
340
 
268
341
  The repo is configured to publish the OpenCode npm package on every GitHub Release.
@@ -274,18 +347,19 @@ The repo is configured to publish the OpenCode npm package on every GitHub Relea
274
347
 
275
348
  **Release workflow:**
276
349
 
277
- 1. Bump the version in `.claude-plugin/plugin.json`.
278
- 2. Run `node scripts/sync-manifests.mjs` to propagate the version to Cursor, Codex, npm, and marketplace manifests.
279
- 3. Commit and tag.
280
- 4. Create a GitHub Release - the `Publish @dodopayments/opencode-plugin` workflow runs automatically and publishes to npm with provenance.
350
+ 1. Bump `version` in `plugin.json` (the single source of truth).
351
+ 2. Run `npm run build` to propagate it to every generated manifest.
352
+ 3. Run `npm run verify`, then commit and tag.
353
+ 4. Create a GitHub Release - the `Publish @dodopayments/opencode-plugin` workflow publishes to npm with provenance.
281
354
 
282
355
  **Manual dry-run:**
283
356
 
284
357
  - Workflow dispatch with `dry_run: true` to validate the release pipeline without publishing.
285
358
 
286
- **CI check:**
359
+ **CI checks:**
287
360
 
288
- - `node scripts/sync-manifests.mjs --check` is run by the workflow and fails the release if any manifest is out of sync.
361
+ - `Verify` runs on every pull request and push to `main`: artifact drift, Agent Plugins conformance, live JSON Schema validation, a "seventeen skills, zero symlinks" assertion, and an npm payload check.
362
+ - The release workflow re-runs the same gates before publishing.
289
363
 
290
364
  ## Resources
291
365
 
@@ -6,24 +6,38 @@ This package is part of [`dodopayments/dodo-agent-plugin`](https://github.com/do
6
6
 
7
7
  ## Install
8
8
 
9
- Add to your `opencode.json`:
9
+ Install the package into your project, then add it to `opencode.json`:
10
+
11
+ ```bash
12
+ npm install --save-dev @dodopayments/opencode-plugin
13
+ ```
10
14
 
11
15
  ```jsonc
12
16
  {
13
17
  "$schema": "https://opencode.ai/config.json",
14
- "plugin": ["@dodopayments/opencode-plugin"]
18
+ "plugin": ["@dodopayments/opencode-plugin"],
19
+ "skills": {
20
+ "paths": ["node_modules/@dodopayments/opencode-plugin/skills"]
21
+ }
15
22
  }
16
23
  ```
17
24
 
18
- Restart OpenCode. That's it.
25
+ Restart OpenCode.
19
26
 
20
27
  - Both MCP servers are registered automatically via the plugin's `config` hook.
21
- - The seventeen skills are auto-discovered from this package's `skills/` directory.
28
+ - The `skills.paths` entry is what makes the seventeen skills visible - OpenCode does not scan installed packages for skills. The path resolves against the **project** directory, not OpenCode's plugin cache, which is why the local install above is required. An absolute path works too and avoids that requirement.
29
+ - The plugin module exports only its default function. OpenCode's loader throws `Plugin export is not a function` on any non-function named export, skips the plugin, and swallows the error - leaving you with no MCP servers. Verified on OpenCode 1.18.15.
22
30
  - The first call to `dodopayments-api` opens a browser for OAuth. `dodo-knowledge` needs no auth.
23
31
 
32
+ Verify the install:
33
+
34
+ ```bash
35
+ opencode run "List every skill available to you by name."
36
+ ```
37
+
24
38
  ## What you get
25
39
 
26
- Seventeen agent skills (auto-loaded when relevant): `best-practices`, `framework-adapters`, `testing-and-go-live`, `checkout-integration`, `subscription-integration`, `mobile-checkout`, `webhook-integration`, `credit-based-billing`, `usage-based-billing`, `license-keys`, `product-catalog-management`, `discounts-and-promotions`, `localized-pricing`, `customer-management`, `refunds-and-disputes`, `billing-sdk`, `better-auth-integration`.
40
+ Seventeen agent skills (auto-loaded when relevant): `dodo-best-practices`, `framework-adapters`, `testing-and-go-live`, `checkout-integration`, `subscription-integration`, `mobile-checkout`, `webhook-integration`, `credit-based-billing`, `usage-based-billing`, `license-keys`, `product-catalog-management`, `discounts-and-promotions`, `localized-pricing`, `customer-management`, `refunds-and-disputes`, `billing-sdk`, `better-auth-integration`.
27
41
 
28
42
  Two MCP servers (registered automatically):
29
43
 
@@ -6,12 +6,38 @@
6
6
  * @typedef {import("@opencode-ai/plugin").Plugin} Plugin
7
7
  */
8
8
 
9
+ // This module must export NOTHING but the default function. OpenCode's loader
10
+ // falls through to `getLegacyPlugins(mod)`, which iterates `Object.values(mod)`
11
+ // and throws `Plugin export is not a function` on any non-function export. The
12
+ // failure is swallowed: the plugin is skipped entirely and the MCP servers
13
+ // below silently vanish. Verified on 1.18.15 - adding a single named object
14
+ // export drops both servers.
15
+ //
16
+ // To re-verify that claim, overwrite the module inside OpenCode's own package
17
+ // cache (~/.cache/opencode/packages/.../node_modules/@dodopayments/...).
18
+ // Editing this checkout, or the project's node_modules, proves nothing:
19
+ // OpenCode resolves the package from that cache and keeps running whatever the
20
+ // registry last published. It does so silently, so the run still looks valid -
21
+ // this has already invalidated two separate bisections of the bug above.
22
+ //
23
+ // Skills are pointed at via `skills.paths` in the user's own opencode.json -
24
+ // see this package's README. Setting `config.skills` from this hook is not a
25
+ // substitute: it never registered skills on any tested version, because the
26
+ // skill index is built before `config` hooks run.
27
+ //
9
28
  // Nullish-assign (`??=`) lets users override any entry by declaring the
10
29
  // same MCP key in their own opencode.json.
30
+ //
31
+ // The endpoint URLs below MUST match the canonical mcp.json. This file is
32
+ // hand-written rather than generated - OpenCode's config shape is its own
33
+ // (`type: "local"`, `command: [...]`) - so `build.mjs --check` cannot cover
34
+ // it. `scripts/conformance.mjs` asserts the URL sets are identical instead.
35
+ // The `mcp-remote` bridge is deliberate here, matching the generated
36
+ // `.mcp.json`: only the canonical mcp.json uses native streamable-http.
11
37
  const DODO_MCP_SERVERS = {
12
38
  "dodopayments-api": {
13
39
  type: "local",
14
- command: ["npx", "-y", "mcp-remote@latest", "https://mcp.dodopayments.com/sse"],
40
+ command: ["npx", "-y", "mcp-remote@latest", "https://mcp.dodopayments.com/mcp"],
15
41
  enabled: true,
16
42
  },
17
43
  "dodo-knowledge": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dodopayments/opencode-plugin",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "description": "Dodo Payments skills and MCP server hints for OpenCode.",
5
5
  "type": "module",
6
6
  "main": "opencode-plugin/index.js",
@@ -14,10 +14,10 @@
14
14
  "LICENSE"
15
15
  ],
16
16
  "scripts": {
17
- "sync": "node scripts/sync-manifests.mjs",
18
- "sync:check": "node scripts/sync-manifests.mjs --check",
19
- "prepack": "node scripts/build-skills-for-npm.mjs materialize",
20
- "postpack": "node scripts/build-skills-for-npm.mjs restore && git checkout skills/"
17
+ "build": "node scripts/build.mjs",
18
+ "build:check": "node scripts/build.mjs --check",
19
+ "conformance": "node scripts/conformance.mjs",
20
+ "verify": "node scripts/build.mjs --check && node scripts/conformance.mjs"
21
21
  },
22
22
  "keywords": [
23
23
  "opencode",