Observed since 20 Oct, 22:06 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@0ct0s3c/cursor-to-opencode
OpenCode plugin that loads Cursor rules from .cursor/rules.
Use Cursor .cursor/rules in OpenCode. This OpenCode plugin discovers Cursor rule files, validates frontmatter, dynamically injects matching rules into chat context, and provides /cursor-to-opencode diagnostics for loaded, inactive, skipped, and rejected rules.
.cursor/rules/**/*.md and .cursor/rules/**/*.mdc.alwaysApply, globs, description, manual rule mentions, @file references, optional .cursorrules, and AGENTS.md detection./cursor-to-opencode and /cursor-to-opencode stats commands.OpenCode plugin, Cursor rules, .cursor/rules, .cursorrules, Cursor-to-OpenCode, AI coding rules, system prompt injection, OpenCode AI, Cursor AI, developer tools.
Add the npm package to opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@0ct0s3c/cursor-to-opencode@latest"]
}
Pin a release if you want reproducible behavior:
{
"plugin": ["@0ct0s3c/cursor-to-opencode@1.0.6"]
}
You do not need to publish to npm to test this plugin on your computer. OpenCode supports local path plugins.
Build the package:
npm install
npm run build
Then add the local package directory to the OpenCode config for the project you want to test:
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
"C:/path/to/Cursor-to-OpenCode"
]
}
You can also point directly at the built server file:
{
"plugin": [
"file:///C:/path/to/Cursor-to-OpenCode/dist/index.js"
]
}
Restart OpenCode after changing opencode.json. Create a test rule such as .cursor/rules/test.mdc in the project being tested:
---
alwaysApply: true
---
Reply with "Cursor rule plugin is active" when asked to verify rules.
Then ask OpenCode to verify the rule. To inspect diagnostics, ask it to call the cursor_to_opencode, cursor_to_opencode_status, or cursor_to_opencode_stats tool.
The plugin intercepts /cursor-to-opencode through OpenCode's command.execute.before hook, the same pattern used by plugins like DCP. Restart OpenCode after changing plugin config, then run:
/cursor-to-opencode
Project injection stats are available with:
/cursor-to-opencode stats
Stats are stored outside the project by default under OpenCode's config directory, so /cursor-to-opencode stats does not create changed files in your repo. Set statsPath only if you explicitly want project-local stats.
If your OpenCode build does not dispatch unknown slash commands to plugin hooks, create .opencode/commands/cursor-to-opencode.md in the project where you are testing:
---
description: Show Cursor rules loaded in this OpenCode session
---
Call the `cursor_to_opencode` tool. Show which Cursor rules were loaded, matched, skipped, or rejected for this session. Include validation warnings and rejection reasons.
Alternatively, define /cursor-to-opencode directly in opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
"file:///C:/path/to/Cursor-to-OpenCode/dist/index.js"
],
"command": {
"cursor-to-opencode": {
"description": "Show Cursor rules loaded in this OpenCode session",
"template": "If the first argument is `stats`, call the `cursor_to_opencode_stats` tool. Otherwise call the `cursor_to_opencode` tool. Show Cursor rule diagnostics clearly."
}
}
}
With this config, /cursor-to-opencode is an OpenCode custom command even if hook-dispatched unknown commands are disabled. The plugin still provides the underlying tools.
To debug plugin loading, start OpenCode with:
opencode --print-logs --log-level DEBUG
On Windows, log files are normally under %USERPROFILE%\.local\share\opencode\log.
For release-like testing, run:
npm run ci
npm pack
npm pack verifies the exact tarball that would be published. OpenCode's easiest pre-release path is still the local directory or file:///.../dist/index.js plugin config; use the tarball mainly to inspect package contents.
GitHub Releases are the preferred publish path, but you can deploy from this machine too.
Create a local .env file that is never committed:
NPM_TOKEN=npm_your_fresh_automation_token
Then run:
npm run deploy
The deploy script:
NPM_TOKEN from .envpackage.json uses strict x.y.z semver@0ct0s3c/cursor-to-opencode publicly.cursor/rules/**/*.md.cursor/rules/**/*.mdc.cursor/rules folders.cursor/rules/imported/**alwaysApplydescriptionglobs@rule mentions@file references for diagnostics.cursorrulesAGENTS.md detection for status parityCursor User Rules and Team Rules are settings/dashboard data, not normal repo files. The plugin reports those as unsupported external surfaces unless a future option provides an explicit import path.
alwaysApply: true rules are injected every turn.globs rules are injected when a tracked active file matches.description-only rules use lightweight prompt/file relevance scoring.The plugin exposes these OpenCode tools:
cursor_to_opencodecursor_to_opencode_statuscursor_to_opencode_statsThe plugin also intercepts these slash commands directly through command.execute.before:
/cursor-to-opencode/cursor-to-opencode statsIf your OpenCode build does not dispatch unknown slash commands to plugins, add a command file:
---
description: Show Cursor rules loaded in this OpenCode session
---
Call the `cursor_to_opencode` tool and summarize which Cursor rules loaded, matched, skipped, or failed validation.
Save that as .opencode/commands/cursor-to-opencode.md, then run /cursor-to-opencode.
{
"plugin": [
["@0ct0s3c/cursor-to-opencode@latest", {
"legacyCursorrules": true,
"strict": false,
"maxRulesPerTurn": 20,
"maxRuleBytes": 120000,
"intelligentMatching": true,
"statusCommand": true,
"includeAgentsMd": false,
"allowExternalRulePaths": false,
"statsEnabled": true,
"statsPath": ""
}]
]
}
By default, statsPath: "" stores stats globally per workspace. If you want the old repo-local behavior, set statsPath to .opencode/cursor-to-opencode-stats.json.
Known Cursor frontmatter fields are alwaysApply, description, and globs.
The validator rejects invalid YAML, invalid known-field types, empty rule bodies, unreadable rules, and unsafe paths. It warns for unknown fields, ignored fields under alwaysApply: true, oversized rules, unresolved @file references, and YAML-array globs in non-strict mode.
npm install
npm run typecheck
npm run test
npm run build
npm run pack:dry
Publish with the release workflow or npm publish --provenance --access public.
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
yamlEnvironment{
"local_name": "yaml",
"alias": false,
"peer_metadata": null
} | ^2.8.4 | runtime |
picomatchEnvironment{
"local_name": "picomatch",
"alias": false,
"peer_metadata": null
} | ^4.0.4 | runtime |
@opencode-ai/pluginEnvironment{
"local_name": "@opencode-ai/plugin",
"alias": false,
"peer_metadata": null
} | ^1.14.41 | runtime |
tsupEnvironment{
"local_name": "tsup",
"alias": false,
"peer_metadata": null
} | ^8.5.1 | development |
vitestEnvironment{
"local_name": "vitest",
"alias": false,
"peer_metadata": null
} | ^4.1.5 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^6.0.3 | development |
@types/nodeEnvironment{
"local_name": "@types/node",
"alias": false,
"peer_metadata": null
} | ^25.6.2 | development |
@types/picomatchEnvironment{
"local_name": "@types/picomatch",
"alias": false,
"peer_metadata": null
} | ^4.0.3 | development |
Source distribution
{
"shasum": "97d2963b52d026a0654ce926ff5e11e0358f9282",
"tarball": "https://registry.npmjs.org/@0ct0s3c/cursor-to-opencode/-/cursor-to-opencode-1.0.2.tgz",
"fileCount": 6,
"integrity": "sha512-L8037jJkoW7iwhTTVXiDjEPJawWsuLFPRn27HY9LjqS5Asv3dJiW2qQzA7n3pN/5bApWcwLJlt2yvRwlcq/piA==",
"signatures": [
{
"sig": "MEUCIQDlzI+g0LYPcwH6k92sPwqyqhYRRD0J5gyF2Tnhnyz5+gIgODlod0tmfF6FkIeOTz7IbBtFXMIpEwmAbns83vxILm0=",
"keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
}
],
"unpackedSize": 115340
}Shared repository data · GitHub
Observed since 20 Oct, 22:06 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:d5f06e581db7963ed907eff3c0da33e4e0d6195d9467d4b212aeeeedeb656e4b