Skip to content

feat(opencode): add OpenCode plugin support for all 65 Cursor plugins - #327

Closed
rudironsoni wants to merge 8 commits into
cursor:mainfrom
rudironsoni:feat/opencode-support
Closed

feat(opencode): add OpenCode plugin support for all 65 Cursor plugins#327
rudironsoni wants to merge 8 commits into
cursor:mainfrom
rudironsoni:feat/opencode-support

Conversation

@rudironsoni

@rudironsoni rudironsoni commented Sep 5, 2026

Copy link
Copy Markdown

Summary

Adds OpenCode plugin support (opencode.js) for all 65 Cursor plugins in this repository.

Changes

  • 32 new opencode.js adapters for plugins that were missing OpenCode support
  • 33 rewritten opencode.js adapters (previously used stale API)
  • README.md updated with OpenCode usage documentation

Adapter Types

Type Plugins Registration Method
Skill-first 14 first-party config.permission.skill, config.agent, config.instructions, hook translations
MCP-only 50 third_party/ config.mcp mutation (http->remote, command->local, ${VAR}->{env:VAR}, auth->oauth)
Hybrid third_party/x Both skills + MCP

Hook Translations (Cursor -> OpenCode)

  • afterFileEdit -> tool.execute.after (filtered to edit tools)
  • afterAgentResponse -> chat.message
  • subagentStop -> event listener for session.agent.stop
  • stop -> session.idle

Validation

  • node --check: 65/65 pass
  • Functional import test: 65/65 pass
  • Existing scripts/validate-plugins.mjs: passes

Usage

{ "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.json catalogs under .agents/plugins, .claude-plugin, .github/plugin, and .grok-plugin, plus per-plugin Claude / Codex / Grok manifests (including mcpServers for listed third-party integrations).

OpenCode gets an opencode.js in each plugin folder. First-party adapters wire skill permissions, subagents from agents/*.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. advisor only comments where shell hooks would run). MCP plugins share a translateServer helper that reads local mcp.json and maps stdio/remote servers, ${VAR}{env:VAR}, headers vs OAuth client credentials into config.mcp. third_party/x is hybrid (skills + MCP).

The README now documents fork intent and install flows for Claude, Grok, Codex, manual OpenCode opencode.json, MCP/OAuth setup, and opencode-market. Note: advisor gains 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.

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

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.

Fix All in Cursor

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}")])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c801023. Configure here.

Comment thread advisor/opencode.js
// stop -> session.idle
"session.idle": async (input, output) => {
// // Would run: stop-hook.sh
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c801023. Configure here.

Comment thread advisor/opencode.js
config: async (config) => {
const skills = ["advisor"];
config.permission ??= { skill: {} };
for (const s of skills) config.permission.skill[s] = "allow";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c801023. Configure here.

@rudironsoni rudironsoni closed this Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant