A Node.js CLI tool that automatically generates configuration files for various AI development tools from unified AI rule files (.rulesync/*.md). Also imports existing AI tool configurations into the unified format.
English | 日本語
rulesync supports both generation and import for the following AI development tools:
- GitHub Copilot Custom Instructions (.github/copilot-instructions.md + .github/instructions/*.instructions.md)
- Cursor Project Rules (.cursor/rules/*.mdc + .cursorrules)
- Cline Rules (.clinerules/*.md + .cline/instructions.md)
- Claude Code Memory (./CLAUDE.md + .claude/memories/*.md)
- Roo Code Rules (.roo/rules/*.md + .roo/instructions.md)
- Gemini CLI (GEMINI.md + .gemini/memories/*.md)
-
Initialize your project:
-
Edit the generated rule files in .rulesync/ directory to match your project needs
Or add new rule files:
npx rulesync add my-custom-rules -
Generate tool-specific configuration files:
-
Optional: Add generated files to .gitignore:
If you already have AI tool configurations, you can import them into rulesync format:
-
Import existing configurations:
# Import from multiple tools at once npx rulesync import --claudecode --cursor --copilot # Or import from specific tools npx rulesync import --claudecode # From CLAUDE.md and .claude/memories/*.md npx rulesync import --cursor # From .cursorrules and .cursor/rules/*.mdc npx rulesync import --copilot # From .github/copilot-instructions.md npx rulesync import --cline # From .cline/instructions.md npx rulesync import --roo # From .roo/instructions.md npx rulesync import --geminicli # From GEMINI.md and .gemini/memories/*.md -
Review and edit the imported rules in .rulesync/ directory
-
Generate unified configurations:
That's it! Your AI coding assistants will now use the generated configuration files automatically.
Team members can freely choose their preferred AI coding tools. Whether it's GitHub Copilot, Cursor, Cline, or Claude Code, each developer can use the tool that maximizes their productivity.
AI development tools evolve rapidly with new tools emerging frequently. With rulesync, switching between tools doesn't require redefining your rules from scratch.
Enable hybrid development workflows combining multiple AI tools:
- GitHub Copilot for code completion
- Cursor for refactoring
- Claude Code for architecture design
- Cline for debugging assistance
- Gemini CLI for intelligent code analysis
Avoid vendor lock-in completely. If you decide to stop using rulesync, you can continue using the generated rule files (.github/instructions/, .cursor/rules/, .clinerules/, CLAUDE.md, GEMINI.md, etc.) as-is.
Apply consistent rules across all AI tools, improving code quality and development experience for the entire team.
Instead of using Claude Code's built-in /init command, we recommend creating a custom slash command specifically for rulesync.
Refer to the Claude Code slash commands documentation and add the following custom command:
.claude/commands/init-rulesync.md
- Project-Specific Initialization: Optimized rule configuration for each project
- Automatic Rule Updates: Rules adapt to project changes automatically
- Team Standardization: All members use the same rule set
- Continuous Improvement: Rules evolve with project growth
This creates a .rulesync/ directory with sample rule files.
Define metadata in front matter for each Markdown file in the .rulesync/ directory. See the Example Files section below for detailed examples.
rulesync uses a two-level rule system:
- root: true: Project-wide overview and policies
- Only one root file is allowed per project
- Contains high-level guidelines and project context
- root: false: Specific implementation rules and detailed guidelines
- Multiple non-root files are allowed
- Contains specific coding rules, naming conventions, etc.
Each AI tool handles rule levels differently:
Claude Code | ./CLAUDE.md | .claude/memories/*.md | CLAUDE.md includes @filename references to detail files |
Cursor | ruletype: always | ruletype: autoattached | Detail rules without globs use ruletype: agentrequested |
GitHub Copilot | Standard format | Standard format | All rules use same format with frontmatter |
Cline | Standard format | Standard format | All rules use plain Markdown format |
Roo Code | Standard format | Standard format | All rules use plain Markdown format with description header |
Gemini CLI | GEMINI.md | .gemini/memories/*.md | GEMINI.md includes @filename references to memory files |
- --delete: Remove all existing generated files before creating new ones
- --verbose: Show detailed output during generation process
- --copilot, --cursor, --cline, --claudecode, --roo, --geminicli: Generate only for specified tools
- --base-dir <paths>: Generate configuration files in specified base directories (comma-separated for multiple paths). Useful for monorepo setups where you want to generate tool-specific configurations in different project directories.
If you already have AI tool configurations in your project, you can import them to rulesync format:
The import command will:
- Parse existing configuration files from each AI tool using custom parsers
- Convert them to rulesync format with appropriate frontmatter metadata
- Create new .rulesync/*.md files with imported content and proper rule categorization
- Use tool-specific prefixes to avoid filename conflicts (e.g., claudecode-overview.md, cursor-custom-rules.md)
- Generate unique filenames if conflicts occur
- Support complex formats like Cursor's MDC files with YAML frontmatter
- Handle multiple file imports (e.g., all files from .claude/memories/ directory)
Each rule file must include frontmatter with the following fields:
Root file (.rulesync/overview.md):
Non-root file (.rulesync/coding-rules.md):
GitHub Copilot | .github/instructions/*.instructions.md | Front Matter + Markdown | Both levels use same format |
Cursor | .cursor/rules/*.mdc | MDC (YAML header + Markdown) | Root: ruletype: always Non-root: ruletype: autoattached Non-root without globs: ruletype: agentrequested |
Cline | .clinerules/*.md | Plain Markdown | Both levels use same format |
Claude Code | ./CLAUDE.md (root) .claude/memories/*.md (non-root) |
Plain Markdown | Root goes to CLAUDE.md Non-root go to separate memory files CLAUDE.md includes @filename references |
Roo Code | .roo/rules/*.md | Plain Markdown | Both levels use same format with description header |
Gemini CLI | GEMINI.md (root) .gemini/memories/*.md (non-root) |
Plain Markdown | Root goes to GEMINI.md Non-root go to separate memory files GEMINI.md includes @filename references |
rulesync validates your rule files and provides helpful error messages:
Common validation rules:
- Only one root file (root: true) is allowed per project
- All frontmatter fields are required and properly formatted
- File patterns (globs) use valid syntax
- Target tools are recognized values
MIT License
Issues and Pull Requests are welcome!
For development setup and contribution guidelines, see CONTRIBUTING.md.