Cursor IDE plugin for a16n
npm install @a16njs/plugin-cursor

Cursor IDE plugin for a16n. Discovers and emits Cursor rules.
This plugin is bundled with the a16n CLI. For programmatic use:
``bash`
npm install @a16njs/plugin-cursor
This plugin supports five customization types:
| Type | Format | Description |
|------|--------|-------------|
| GlobalPrompt | alwaysApply: true frontmatter | Always-active rules |globs: */.ts
| FileRule | frontmatter | Triggered by file patterns |description: "..."
| SimpleAgentSkill | frontmatter | Triggered by context matching |.cursorignore
| AgentIgnore | file | Files/patterns to exclude |.cursor/commands/*.md
| AgentCommand | files | Explicitly invoked slash commands |
- .cursor/rules/*/.mdc - MDC format rules with frontmatter (recursive).cursor/commands/*/.md
- - Command files (recursive).cursorignore
- - Gitignore-style patterns for files to exclude
> Note: Legacy .cursorrules files are not supported. Use .cursor/rules/*.mdc instead.
Commands in .cursor/commands/*.md are prepackaged prompts invoked via /command-name.
Simple commands (just prompt text) are discovered and can be converted to Claude skills.
Complex commands are skipped with a warning. Complex commands contain features that cannot be converted:
| Feature | Example | Reason |
|---------|---------|--------|
| $ARGUMENTS | Fix issue #$ARGUMENTS | Runtime argument injection |Review PR #$1
| Positional params | | Runtime argument injection |!git branch --show-current
| Bash execution | | Shell execution |@src/utils.js
| File references | | Context injection |allowed-tools
| | Frontmatter key | Tool permissions |
- Creates .cursor/rules/ files with appropriate frontmatter.cursor/commands/
- Creates files for AgentCommand items.cursorignore
- Creates from AgentIgnore patterns
Cursor uses MDC (Markdown Configuration) format with YAML frontmatter:
`markdown
---
alwaysApply: true
---
Always-applied rule content.
`
`markdown
---
globs: /.tsx,/.jsx
---
React-specific guidelines.
`
`markdown
---
description: Authentication and authorization patterns
---
Auth-related guidelines.
`
`typescript
import cursorPlugin from '@a16njs/plugin-cursor';
import { A16nEngine } from '@a16njs/engine';
const engine = new A16nEngine([cursorPlugin]);
// Discover Cursor rules
const result = await cursorPlugin.discover('./my-project');
console.log(Found ${result.items.length} rules);
// Emit to Cursor format
await cursorPlugin.emit(result.items, './my-project');
``
Full documentation available at