External Rules

Import and reuse your existing AI coding rules from Cursor, Windsurf, GitHub Copilot, and Aider in Claude Code.
Stop maintaining duplicate rule files for different AI tools. External Rules automatically imports your existing coding guidelines and conventions into every Claude Code conversation.
Table of Contents
Overview
Modern development teams often use multiple AI coding assistants. Each tool has its own configuration format for coding rules and guidelines:
- Cursor uses
.cursor/rules/*.mdc files
- Windsurf uses
.windsurfrules
- GitHub Copilot uses
.github/copilot-instructions.md
- Aider uses
CONVENTIONS.md
Maintaining separate files with the same content is tedious and error-prone. This plugin solves that problem by allowing Claude Code to read rules from any of these sources automatically.
Features
- Multi-Source Import: Read rules from Cursor, Windsurf, GitHub Copilot, and Aider
- Automatic Injection: Rules are included in every conversation without manual intervention
- Selective Import: Enable or disable individual sources as needed
- YAML Frontmatter Support: Properly parses MDC and MD files with frontmatter
- Recursive Scanning: Finds all Cursor rules in subdirectories
- Zero Configuration Runtime: Once set up, works automatically
- Non-Destructive: Only reads files, never modifies your existing rules
- Works with CLAUDE.md: Complements Claude Code's native rule system
Supported Sources
| Source | File Location | Format |
|---|
| Cursor | .cursor/rules/*.mdc | MDC (Markdown + frontmatter) |
| Windsurf | .windsurfrules | Plain text or Markdown |
| GitHub Copilot | .github/copilot-instructions.md | Markdown |
| Aider | CONVENTIONS.md | Markdown |
Installation
Option 1: Add Marketplace (Recommended)
Add this marketplace to Claude Code, then install the plugin:
# Add the marketplace
/plugin marketplace add https://gitlab.com/mirzaaghazadeh/claude-code-external-rules.git
# Install the plugin
/plugin install external-rules
Option 2: Direct Installation
Install directly from this repository:
/plugin install https://github.com/mirzaaghazadeh/claude-code-external-rules.git
Option 3: Manual Installation
Clone the repository to your Claude Code plugins directory:
# Navigate to your Claude Code plugins directory
cd ~/.claude/plugins
# Clone the plugin
git clone https://github.com/mirzaaghazadeh/claude-code-external-rules.git external-rules
Restart Claude Code or reload plugins.
Project-Level Installation
To auto-install for all team members, add to your project's .claude/settings.json:
{
"plugins": {
"marketplaces": [
"mirzaaghazadeh/claude-code-external-rules"
]
}
}
Quick Start
-
Configure the plugin by running the configuration command:
/external-rules
-
Select your sources: Choose which AI IDE rules to import when prompted.
-
Start coding: Your rules are now automatically included in every Claude Code conversation.
That's it! The plugin handles everything else automatically.
Configuration
Settings File
Configuration is stored in .claude/external-rules.local.md in your project root:
---
enabled: true
cursor: true
windsurf: false
copilot: true
aider: false
---
# External Rules Configuration
Enabled sources will be imported into Claude Code context.
Run `/external-rules` to change settings.
Configuration Options
| Option | Type | Default | Description |
|---|
enabled | boolean | false | Master switch for the plugin |
cursor | boolean | false | Import rules from .cursor/rules/ |
windsurf | boolean | false | Import rules from .windsurfrules |
copilot | boolean | false | Import rules from .github/copilot-instructions.md |
aider | boolean | false | Import rules from CONVENTIONS.md |
Git Ignore
Add the settings file to your .gitignore to keep configuration local:
# Claude Code local settings
.claude/*.local.md
Commands
/external-rules
Configure which external AI IDE rules to import.