Skip to content

feat: add Cursor marketplace and plugin support#25

Draft
mmizutani wants to merge 1 commit intoopenai:mainfrom
mmizutani:feat/support-cursor-plugin
Draft

feat: add Cursor marketplace and plugin support#25
mmizutani wants to merge 1 commit intoopenai:mainfrom
mmizutani:feat/support-cursor-plugin

Conversation

@mmizutani
Copy link
Copy Markdown

@mmizutani mmizutani commented Mar 31, 2026

Summary

Add .cursor-plugin/ manifests alongside the existing .claude-plugin/ ones so the Codex plugin is discoverable from both the Claude Code and Cursor marketplaces.

What's included

  • .cursor-plugin/marketplace.json — root marketplace manifest for Cursor (uses pluginRoot convention, plugin-level metadata with category/tags/keywords)
  • plugins/codex/.cursor-plugin/plugin.json — plugin manifest validated against cursor.com/docs/reference/plugins (only spec-valid fields; category/tags live in marketplace entry, not here)
  • plugins/codex/hooks/cursor-hooks.json — Cursor-format hooks (version: 1, camelCase event names, timeout values, ${CURSOR_PLUGIN_ROOT} interpolation)
  • plugins/codex/scripts/cursor-session-lifecycle-hook.mjs — Cursor sessionStart adapter that outputs { "env": { ... } } JSON (Cursor's mechanism) instead of writing to CLAUDE_ENV_FILE (Claude Code's mechanism)
  • README.md — updated title, description, and install section with Cursor instructions

Design decisions

Concern Approach
Hooks format differs (PascalCase/nested vs camelCase/flat) Separate cursor-hooks.json referenced via explicit "hooks" field in plugin.json; existing hooks.json (Claude Code format) untouched
CURSOR_PLUGIN_ROOT vs CLAUDE_PLUGIN_ROOT Hook commands bridge with CLAUDE_PLUGIN_ROOT="${CURSOR_PLUGIN_ROOT}" so existing scripts resolve paths correctly
CLAUDE_ENV_FILE not available in Cursor Dedicated cursor-session-lifecycle-hook.mjs outputs { "env": { ... } } on stdout per Cursor hook output spec
CLAUDE_PLUGIN_DATA not available in Cursor lib/state.mjs already falls back to $TMPDIR/codex-companion — no change needed
Shared components (skills, commands, agents) Markdown-based — portable as-is; both manifests point to the same directories

Limitations

  • The sessionEnd and stop hooks reuse the original scripts. They work but lack CLAUDE_ENV_FILE and CLAUDE_PLUGIN_DATA, so session-scoped env var propagation relies on Cursor's sessionStartenv output mechanism and the tmpdir state fallback.
  • Command markdown files contain Claude Code-specific frontmatter (allowed-tools, disable-model-invocation). Cursor tolerates unknown frontmatter fields, but these features won't activate in Cursor.
  • Cursor CLI does not support plugins yet (desktop only).

Cursor Marketplace/Plugins References

Test plan

  • Install plugin via Cursor marketplace (/add-plugin openai/codex-plugin-cc) and verify it appears in installed plugins
  • Verify /codex:setup, /codex:review, and other slash commands are discoverable in Cursor
  • Verify sessionStart hook fires and propagates CODEX_COMPANION_SESSION_ID to subsequent hooks
  • Verify existing Claude Code plugin functionality is unaffected (no changes to .claude-plugin/ or hooks/hooks.json)

Note

We might be able to interpret the *cc portion of the repo name as either "Claude Code" or "Claude Code and Cursor".

Add .cursor-plugin manifests alongside the existing .claude-plugin ones
so the Codex plugin is discoverable from both the Claude Code and Cursor
marketplaces.

- .cursor-plugin/marketplace.json  — root marketplace for Cursor
- plugins/codex/.cursor-plugin/plugin.json — plugin manifest validated
  against cursor.com/docs/reference/plugins (no non-spec fields)
- plugins/codex/hooks/cursor-hooks.json — Cursor-format hooks (version 1,
  camelCase events, timeout values, ${CURSOR_PLUGIN_ROOT} interpolation)
- plugins/codex/scripts/cursor-session-lifecycle-hook.mjs — Cursor
  sessionStart adapter that outputs { "env": { ... } } JSON instead of
  writing to CLAUDE_ENV_FILE
- README.md — updated title, description, and install section for Cursor
@mmizutani
Copy link
Copy Markdown
Author

mmizutani commented Mar 31, 2026

It seems Cursor Plugins skip support for Commands in favor of Skills. Fixing ...

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