feat(opencode): add OpenCode plugin support for all 65 Cursor plugins - #327
feat(opencode): add OpenCode plugin support for all 65 Cursor plugins#327rudironsoni wants to merge 8 commits into
Conversation
Point Claude Code (and Codex, which reads the same file) at the existing plugin dirs. Do not copy plugin manifests or descriptions.
Each harness gets the index file it reads. Plugin dirs stay as they are. OpenCode has no marketplace, so nothing is added for it.
Each Cursor plugin folder now has a small harness manifest. Skills and MCP configs stay in place. OpenCode has no marketplace, so each folder ships opencode.js instead.
Do not use a symlink to the Claude marketplace file.
feat: make each Cursor plugin installable on Claude, Grok, Codex, and OpenCode
- Generate opencode.js adapters for all 65 plugins (32 new, 33 rewritten)
- Skill-first plugins (14 first-party): register skills, agents, rules, hook translations via config hook
- MCP-only plugins (50 third_party): register MCP servers via config.mcp mutation
- Hybrid plugin (third_party/x): both skills and MCP
- Translate Cursor hooks to OpenCode: afterFileEdit->tool.execute.after, afterAgentResponse->chat.message, subagentStop->event, stop->session.idle
- Convert Cursor mcp.json to OpenCode format: http/remote, command/local, ${VAR}->{env:VAR}, auth->oauth
- Update README with OpenCode usage docs (plugin key, restart requirement, OAuth flow)
- All adapters are pure wrappers reading existing assets at runtime, no asset modifications
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit c801023. Configure here.
| if (server.env) { | ||
| const envRegex = new RegExp("\\\\${([^}]+)}", "g"); | ||
| out.environment = Object.fromEntries( | ||
| Object.entries(server.env).map(([k, v]) => [k, String(v).replace(envRegex, "{env:$1}")]) |
There was a problem hiding this comment.
Env interpolation regex never matches
High Severity · Logic Bug
The translateServer regex is over-escaped, so it never matches ${VAR} in mcp.json values. OpenCode only interpolates {env:VAR}, so headers, env, URLs, and OAuth fields stay as literal ${…} and credentials never apply. The same pattern is copied across the third-party adapters, including github, xero, hubspot, salesforce, gong, zoom, and docusign.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit c801023. Configure here.
| // stop -> session.idle | ||
| "session.idle": async (input, output) => { | ||
| // // Would run: stop-hook.sh | ||
| }, |
There was a problem hiding this comment.
OpenCode hooks never run scripts
High Severity · Logic Bug
Hook translations for advisor, ralph-loop, and continual-learning register OpenCode handlers but only contain comments. The Cursor scripts (mark-pending.sh, stop-hook.sh, and the continual-learning stop hook) never run, so pending-review nudges, the Ralph loop, and AGENTS.md updates do not happen on OpenCode.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit c801023. Configure here.
| config: async (config) => { | ||
| const skills = ["advisor"]; | ||
| config.permission ??= { skill: {} }; | ||
| for (const s of skills) config.permission.skill[s] = "allow"; |
There was a problem hiding this comment.
Skill permission write can throw
Medium Severity · Logic Bug
config.permission ??= { skill: {} } only initializes when permission is missing. If OpenCode or the user already set permission without a skill object, assigning config.permission.skill[s] throws and the plugin config hook fails. The same pattern is in every skill-first adapter.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit c801023. Configure here.


Summary
Adds OpenCode plugin support (
opencode.js) for all 65 Cursor plugins in this repository.Changes
opencode.jsadapters for plugins that were missing OpenCode supportopencode.jsadapters (previously used stale API)Adapter Types
config.permission.skill,config.agent,config.instructions, hook translationsconfig.mcpmutation (http->remote, command->local, ${VAR}->{env:VAR}, auth->oauth)Hook Translations (Cursor -> OpenCode)
afterFileEdit->tool.execute.after(filtered to edit tools)afterAgentResponse->chat.messagesubagentStop->eventlistener forsession.agent.stopstop->session.idleValidation
node --check: 65/65 passscripts/validate-plugins.mjs: passesUsage
{ "plugin": ["./teaching/opencode.js"] }MCP plugins auto-register servers on startup. Restart OpenCode after enabling. OAuth services require
opencode mcp auth <server>.Note
Low Risk
Mostly additive packaging and config translation; main risk is incorrect MCP/OAuth or env interpolation at runtime, and incomplete hook behavior where adapters are no-ops.
Overview
This PR turns the Cursor plugins monorepo into a multi-harness distribution: new
marketplace.jsoncatalogs under.agents/plugins,.claude-plugin,.github/plugin, and.grok-plugin, plus per-plugin Claude / Codex / Grok manifests (includingmcpServersfor listed third-party integrations).OpenCode gets an
opencode.jsin each plugin folder. First-party adapters wire skill permissions, subagents fromagents/*.md, and instructions from rules where applicable; several hook mappings (tool.execute.after,chat.message,session.idle,event) are present but often stubbed (e.g.advisoronly comments where shell hooks would run). MCP plugins share atranslateServerhelper that reads localmcp.jsonand maps stdio/remote servers,${VAR}→{env:VAR}, headers vs OAuth client credentials intoconfig.mcp.third_party/xis hybrid (skills + MCP).The README now documents fork intent and install flows for Claude, Grok, Codex, manual OpenCode
opencode.json, MCP/OAuth setup, andopencode-market. Note:advisorgains an OpenCode adapter but is not listed in the new marketplace JSON files shown in this diff.Reviewed by Cursor Bugbot for commit c801023. Bugbot is set up for automated code reviews on this repo. Configure here.