AI-native CLI generator for IDE rules. Instantly scaffold .cursorrules, .windsurfrules, and configurations for GitHub Copilot, Cursor, Windsurf, Trae, Lingma, and CodeBuddy. The ultimate standardization tool for AI-assisted coding workflows.
npm install ide-rule
π The AI-Native CLI Generator for IDE Rules
Instantly scaffold .cursorrules, .windsurfrules, and configurations for GitHub Copilot, Cursor, Windsurf, and more.
Standardize your AI-assisted coding workflow across all major AI IDEs.
English | δΈζ
---
As AI-powered coding assistants become mainstream, developers face a new challenge: each IDE has its own rule format. Cursor uses .mdc with YAML frontmatter, Windsurf prefers single .windsurfrules files, GitHub Copilot expects Markdown in .github/...
Managing these configurations manually is tedious, error-prone, and wastes valuable development time.
ide-rule solves this by providing:
- β
One Command, All IDEs β Generate properly formatted rule files for 7+ AI IDEs
- β
Consistent Rule Content β Same base rules, automatically adapted to each IDE's format
- β
Project Memory β Optional project_memory.md to persist context across sessions
- β
Zero Configuration β Smart defaults with full customization when you need it
---
| IDE | Rule Format | Output Path | Special Features |
|-----|-------------|-------------|------------------|
| Cursor | .mdc (Frontmatter) | .cursor/rules/ | Supports globs, alwaysApply, multi-file rules |
| Trae (ByteDance) | .md | .trae/rules/ | Standard Markdown format |
| Windsurf (Codeium) | .windsurfrules | Project root | Single-file merged rules |
| GitHub Copilot | .md | .github/ | Single copilot-instructions.md file |
| Lingma (Alibaba) | .md | .lingma/rules/ | HTML comment metadata support |
| CodeBuddy (Tencent) | .md | .codebuddy/rules/ | Standard Markdown format |
| VS Code (Generic) | .md | .vscode/rules/ | Standard Markdown format |
| Claude Code (Anthropic) | CLAUDE.md | Project root | Single-file project guidance |
| Gemini CLI (Google) | GEMINI.md | Project root | Single-file project guidance |
---
- π― Multi-IDE Support β Automatically detects and generates the correct format for your IDE
- π Unified Content Template β Base rule content stays consistent; only the format changes
- π Internationalization β Built-in support for en-US and zh-CN, auto-detects system locale
- π Safe File Operations β Never overwrites without --force; creates .bak backups automatically
- π§© Extensible Architecture β Easily add custom IDEs, frameworks, and language templates
- β‘ Interactive CLI β Beautiful prompts guide you through the setup process
- π¦ Zero Dependencies Runtime β Minimal footprint, fast installation
---
``bashGlobal installation (recommended)
npm install -g ide-rule
$3
`bash
Start the interactive wizard
ide-ruleSpecify language explicitly
ide-rule --lang en-USForce overwrite existing files (creates .bak backup)
ide-rule --force
`$3
The CLI will guide you through:
1. Select your AI IDE β Choose from Cursor, Windsurf, Copilot, and more
2. Pick your tech stack β Frontend framework, backend framework, programming language
3. Generate files β Rule files are created in the correct location with proper formatting
---
π Output Examples
$3
`
.cursor/rules/
βββ base.mdc # Base rules with YAML Frontmatter
βββ frontend-react.mdc # Framework-specific rules
βββ backend-nest.mdc # Backend-specific rules
`Sample
base.mdc structure:
`yaml
---
description: Base coding rules for AI assistant
globs: ["*/"]
alwaysApply: true
---
Your coding standards here...
`$3
`
.windsurfrules # All rules merged into a single file
`$3
`
.github/
βββ copilot-instructions.md
`$3
`
CLAUDE.md # Project root
`$3
`
GEMINI.md # Project root
`---
π οΈ Configuration Options
$3
| Option | IDE | Format |
|--------|-----|--------|
|
cursor | Cursor IDE | .mdc with Frontmatter |
| trae | Trae (ByteDance) | .md |
| windsurf | Windsurf (Codeium) | .windsurfrules |
| copilot | GitHub Copilot | .md |
| lingma | Lingma (Alibaba) | .md |
| codebuddy | CodeBuddy (Tencent) | .md |
| vscode | VS Code Generic | .md |
| claudecode | Claude Code (Anthropic) | CLAUDE.md |
| gemini | Gemini CLI (Google) | GEMINI.md |
| custom | Custom IDE | Configurable |$3
Frontend Frameworks:
-
react | next | vue | nuxt | angular | svelte | custom | noneBackend Frameworks:
-
node-express | nest | koa | fastify | custom | noneProgramming Languages:
-
javascript | typescript | go | python | java | c | c++ | c# | php | ruby | custom---
ποΈ Architecture
`
ide-rule/
βββ bin/cli.js # CLI entry point
βββ src/
β βββ ide-adapters.js # IDE-specific configurations
β βββ formatters.js # Content β IDE format transformers
β βββ templates.js # Template loading & building
β βββ scaffold.js # Core scaffolding logic
β βββ prompts.js # Interactive prompts
βββ templates/
β βββ base_rule_content.md # Pure content template
β βββ project_memory_example.md # Memory template
βββ locales/
βββ en-US.json # English translations
βββ zh-CN.json # Chinese translations
`Design Principles:
1. Content-Format Separation β
base_rule_content.md stores pure content without formatting
2. Adapter Pattern β Each IDE has its own configuration (path, extension, formatting rules)
3. Pluggable Formatters β Transform raw content into IDE-specific syntax---
π Backup Strategy
- Default behavior: Skips existing files and shows a warning
- With
--force: Creates timestamped .bak files before overwriting
- Example: base.mdc β base.mdc.bak.1702345678---
π§ͺ Testing
The project maintains >90% test coverage using Jest.
`bash
Run all tests
npm testWatch mode for development
npm run test:watchGenerate coverage report
npm run test:coverage
``---
Contributions are welcome! Here's how you can help:
1. Add new IDE adapters β Support for more AI coding assistants
2. Improve templates β Better default rules and prompts
3. Add language translations β Expand i18n support
4. Report bugs β Open issues for any problems you find
See CONTRIBUTING.md for detailed guidelines.
---
ISC Β© 2024
---
- Cursor β AI-first code editor
- Windsurf β AI code editor by Codeium
- GitHub Copilot β AI pair programmer
- Claude Code β Anthropic's agentic coding tool
- Gemini CLI β Google's AI-powered CLI tool
---
Built with β€οΈ for the AI-assisted development community