🚀 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.mdto 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-USandzh-CN, auto-detects system locale - 🔒 Safe File Operations — Never overwrites without
--force; creates.bakbackups 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
# Global installation (recommended)
npm install -g ide-rule
# Or run directly with npx (no install needed)
npx ide-rule# Start the interactive wizard
ide-rule
# Specify language explicitly
ide-rule --lang en-US
# Force overwrite existing files (creates .bak backup)
ide-rule --forceThe CLI will guide you through:
- Select your AI IDE — Choose from Cursor, Windsurf, Copilot, and more
- Pick your tech stack — Frontend framework, backend framework, programming language
- Generate files — Rule files are created in the correct location with proper formatting
.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:
---
description: Base coding rules for AI assistant
globs: ["**/*"]
alwaysApply: true
---
# Your coding standards here....windsurfrules # All rules merged into a single file
.github/
└── copilot-instructions.md
CLAUDE.md # Project root
GEMINI.md # Project root
| 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 |
Frontend Frameworks:
react|next|vue|nuxt|angular|svelte|custom|none
Backend Frameworks:
node-express|nest|koa|fastify|custom|none
Programming Languages:
javascript|typescript|go|python|java|c|c++|c#|php|ruby|custom
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:
- Content-Format Separation —
base_rule_content.mdstores pure content without formatting - Adapter Pattern — Each IDE has its own configuration (path, extension, formatting rules)
- Pluggable Formatters — Transform raw content into IDE-specific syntax
- Default behavior: Skips existing files and shows a warning
- With
--force: Creates timestamped.bakfiles before overwriting - Example:
base.mdc→base.mdc.bak.1702345678
The project maintains >90% test coverage using Jest.
# Run all tests
npm test
# Watch mode for development
npm run test:watch
# Generate coverage report
npm run test:coverageContributions are welcome! Here's how you can help:
- Add new IDE adapters — Support for more AI coding assistants
- Improve templates — Better default rules and prompts
- Add language translations — Expand i18n support
- 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