Convert AI editor rules between different formats (Cursor, Windsurf, Cline, VSCode, Codex CLI, Claude Code, Qoder, Trae, QwenCoder)
npm install crossruleA command-line tool for converting AI code editor rules between different formats. Work seamlessly across Cursor, Windsurf, Cline, VSCode, and other AI-powered development environments without losing your carefully crafted coding guidelines.


You've spent time crafting the perfect coding rules for Cursor, but now you want to try Windsurf. Or maybe your team uses different AI editors, and you need to share consistent guidelines across tools. Manually converting and maintaining rules across multiple editors is tedious and error-prone.
CrossRule automatically detects existing AI editor rules in your project and converts them to any other supported format. Your TypeScript conventions, React patterns, and testing requirements can follow you wherever you code.
CrossRule works with 9 major AI code editors:
- Cursor - .mdc files in .cursor/rules/
- Windsurf - Markdown files in .windsurf/rules/
- Cline - Markdown files in .clinerules/
- VSCode - Instructions and prompts for AI extensions
- AGENTS.md-compatible editors (Codex CLI, OpenCode, VSCode Agents) - AGENTS.md project rules
- Claude Code - CLAUDE.md guidance files
- Qoder - Natural language rules with trigger conditions
- Trae - Markdown rules with YAML frontmatter
- QwenCoder - QWEN.md context files
Install CrossRule globally to use it in any project:
``bash`
npm install -g crossrule
Or run it directly without installing using npx:
`bash`
npx crossrule init
Verify the installation:
`bash`
crossrule --versionShould output: 1.0.3
Navigate to your project directory and run:
`bash`
crossrule init
CrossRule will:
1. Scan your project for existing AI editor rules
2. Show you what it found and let you choose a source
3. Present an interactive list of target editors
4. Convert your rules while preserving their meaning and structure
Create and deploy rules across all your AI editors with a single command:
`bashSimple always-apply rule
crossrule add "Use strict TypeScript configuration" --type always --to all
$3
CrossRule supports four intelligent rule types:
- Always (
--type always) - Applied to all conversations and code
- Pattern (--type pattern) - Triggered when working with specific file types
- Manual (--type manual) - Invoked explicitly by name or command
- AI-Decision (--type ai-decision) - Applied when AI determines relevance$3
Handle complex coding standards with full markdown support:
`bash
Using heredoc for complex rules
crossrule add --type always --to all << 'EOF'
TypeScript Best Practices
Type Safety
- Enable all strict mode flags
- Use 'unknown' instead of 'any'
- Implement proper error boundariesCode Organization
- One component per file
- Index files for clean imports
- Separate types into .types.ts files
EOF
`$3
-
--type - Rule type: always, pattern, manual, ai-decision
- --patterns - File patterns (comma-separated) for pattern rules
- --to - Target editors: all, or comma-separated list
- --from-file - Read rule content from markdown file
- --name - Custom rule name (auto-generated if not provided)
- --description - Rule description for documentation
- --context - Context hint for AI-decision rulesHow It Works
$3
CrossRule understands the unique file structures and formats of each AI editor. It correctly parses YAML frontmatter, section delimiters, and trigger conditions to extract the semantic meaning of your rules.$3
When converting between formats, CrossRule maintains the intent of your rules:- Always-active rules remain always-active
- File pattern rules are converted to equivalent glob patterns
- Manual trigger rules preserve their conditional nature
- Descriptions and metadata are carried forward appropriately
$3
Each editor has its own conventions:- Cursor: YAML frontmatter with
alwaysApply and globs fields
- Qoder: Trigger-based frontmatter (always_on, glob, manual, model_decision)
- Codex CLI: Section delimiters like ---- section-name ----
- Claude Code: Standard markdown with proper heading hierarchyRule Types
CrossRule recognizes and converts between different rule activation patterns:
- Always Active: Applied to all conversations and code
- Pattern-Based: Triggered when working with specific file types
- Manual: Invoked explicitly by name or command
- AI-Decided: Applied when the AI determines relevance
Advanced Usage
$3
If you know exactly what you want to convert:
`bash
crossrule convert --from cursor --to windsurf
crossrule convert --from qoder --to "claude-code"
`$3
Convert to multiple formats at once:
`bash
crossrule convert --from cursor --to windsurf,cline,qoder
`$3
Specify where converted files should be saved:
`bash
crossrule convert --from cursor --to windsurf --output ./my-rules/
`Configuration Files
CrossRule looks for rules in these locations:
`
Single-file formats
AGENTS.md # Codex CLI / OpenCode / VSCode Agents
CLAUDE.md # Claude Code
QWEN.md # QwenCoderDirectory-based formats
.cursor/rules/ # Cursor .mdc files
.windsurf/rules/ # Windsurf markdown
.clinerules/ # Cline markdown
.qoder/rules/ # Qoder trigger-based rules
.trae/rules/ # Trae multilingual rules
`Learn more about the shared
AGENTS.md standard for Codex CLI, OpenCode, VSCode Agents, and other tools at https://agents.md.Project Integration
Add CrossRule to your development workflow:
$3
`json
{
"scripts": {
"rules:sync": "crossrule init",
"rules:cursor": "crossrule convert --from claude-code --to cursor",
"rules:windsurf": "crossrule convert --from claude-code --to windsurf"
}
}
`$3
New team members can quickly set up their preferred AI editor:`bash
git clone your-project
cd your-project
crossrule init # Convert existing rules to their preferred editor
`Rule Format Examples
$3
`markdown
---
description: TypeScript coding standards
alwaysApply: true
---TypeScript Rules
- Use strict mode configuration
- Prefer interfaces over type aliases
`$3
`markdown
---
trigger: always_on
alwaysApply: true
description: Global coding standards
---Always Active Rules
- Write self-documenting code
- Use meaningful variable names
`$3
`markdown
Project Agent Rules
---- typescript ----
- Use strict TypeScript configuration
- Always provide return types
---- testing ----
- Write comprehensive unit tests
- Use Jest framework
`Contributing
CrossRule is open source and welcomes contributions:
1. Bug Reports: Found an issue with rule conversion? Please report it with sample files.
2. New Editor Support: Want to add support for another AI editor? Check out the parser and converter architecture in the source code.
3. Rule Format Improvements: Each AI editor evolves their rule formats. Help us keep up with the latest specifications.
4. Documentation: Improve examples, add use cases, or clarify installation instructions.
Development
`bash
git clone https://github.com/your-username/crossrule
cd crossrule
npm install
npm run build
npm run dev # Test the CLI locally
`$3
`bash
npm test # All tests
npm run test:unit # Unit tests only
npm run test:integration # Integration tests only
npm run test:coverage # Coverage report
``MIT License. See LICENSE file for details.
CrossRule was built to solve a real workflow problem in the AI-assisted coding era. Thanks to the teams behind all the supported AI editors for creating tools that enhance developer productivity.
The project maintains compatibility with the latest rule format specifications from each editor. As these tools evolve, CrossRule evolves with them.
---
Made for developers who love consistency across their AI coding tools.