🚀 Sync AI assistant rules across Claude, Cursor, Windsurf, GitHub Copilot, and more!
Rulesync is a powerful CLI tool that helps you maintain consistent AI assistant instructions across all your favorite tools. Compose rules from templates or create custom ones, then generate agent-specific files automatically.
- Features
- Quick Start
- Two Ways to Create Rules
- Available Templates
- Supported AI Assistants
- Commands
- Configuration
- Workflow Examples
- Generated File Structure
- Advanced Usage
- Development
- Requirements
- Contributing
- License
- Credits
- 🎯 Template-based composition - Choose from 28+ pre-built rule templates
- 🤖 12 AI assistants supported - Claude, Cursor, Windsurf, GitHub Copilot, Gemini, Cline, Junie, OpenAI Codex, Aider, Continue.dev, Amazon Q Developer, Sourcegraph Cody
- 📝 Smart rule generation - One source, multiple agent-specific formats
- 🎨 Flexible composition - Mix templates, local files, and remote URLs
- ⚙️ Selective control - Enable/disable specific assistants
- 📁 Gitignore integration - Automatically manage version control
npm install -g rulesync-ts
# 1. See available templates
rulesync templates
# 2. Compose rules from templates
rulesync compose base/clean-code language/typescript framework/react
# 3. Generate AI assistant files
rulesync generate
# 4. Add to gitignore
rulesync gitignore
That's it! You now have consistent rules across all your AI assistants.
Use the compose
command to build your rulesync.md
from pre-built templates:
# Compose from templates - creates rulesync.md automatically
rulesync compose base/clean-code language/typescript framework/react
rulesync generate
Create a rulesync.md
file manually with your custom rules:
# My AI Assistant Rules
You are a helpful AI assistant. Please follow these guidelines:
1. Always be concise and clear in your responses
2. If you're unsure about something, say so
## Code Guidelines
- Follow clean code principles
- Add comments for complex logic
Then generate AI assistant files from your custom rules:
rulesync generate
Both approaches create the same result - AI assistant files generated from your rulesync.md
source file!
- clean-code - Robert Martin's Clean Code principles
- no-sycophancy - Direct, honest communication without excessive praise
- security - Security best practices and guidelines
- testing - Testing strategies and methodologies
- documentation - Documentation standards
- performance - Performance optimization guidelines
- accessibility - Web accessibility standards
- typescript - TypeScript best practices and patterns
- python - Python coding standards and idioms
- go - Go language conventions and practices
- java - Java development guidelines
- rust - Rust programming patterns
- csharp - C# development guidelines and patterns
- php - PHP coding standards and best practices
- swift - Swift programming language conventions
- kotlin - Kotlin development best practices
- react - React component and hook patterns
- django - Django web framework conventions
- express - Express.js API development practices
- nextjs - Next.js development guidelines
- angular - Angular application patterns
- vue - Vue.js component guidelines
- nodejs - Node.js server development patterns
- rails - Ruby on Rails framework conventions
- spring - Spring Boot Java framework patterns
- laravel - Laravel PHP framework best practices
- flutter - Flutter mobile development guidelines
- fastapi - FastAPI Python framework patterns
- svelte - Svelte framework development practices
Rulesync generates configuration files for these AI assistants. You can enable/disable specific assistants as needed.
Assistant | File Location |
---|---|
Claude | CLAUDE.md |
Cursor | .cursorrules |
Windsurf | .windsurfrules |
GitHub Copilot | .github/copilot-instructions.md |
Gemini CLI | GEMINI.md |
Cline | .clinerules/project.md |
Junie | .junie/guidelines.md |
OpenAI Codex | AGENTS.md |
Aider | .aider.conf.yml |
Continue.dev | .continue/config.json |
Amazon Q Developer | .amazonq/rules/coding-guidelines.md |
Sourcegraph Cody | .vscode/cody.json |
# List available templates
rulesync templates
# Compose rules from templates and files
rulesync compose <template1> <template2> [files...]
# Generate AI assistant files
rulesync generate [options]
# Manage AI assistants
rulesync agents [enable|disable] [assistant]
# View configuration
rulesync config
# Add files to .gitignore
rulesync gitignore
# Set base rules
rulesync base [path]
Note: For details on managing AI assistants, see Agent Management
# Single template
rulesync compose base/clean-code
# Multiple templates
rulesync compose base/clean-code language/python framework/django
# Mix templates with custom files
rulesync compose base/security ./company-guidelines.md
# Remote URLs
rulesync compose base/clean-code https://example.com/team-rules.md
# Generate with options
rulesync generate --force
rulesync generate --from ./custom-rules.md
Set persistent base rules that are included in all generations. These work alongside templates and custom files:
# From a URL
rulesync base https://company.com/coding-standards.md
# From a local file
rulesync base ./team-guidelines.md
# View current base rules
rulesync base
Control which AI assistants are active:
# List all agents
rulesync agents
# Disable specific agent
rulesync agents disable cursor
# Enable specific agent
rulesync agents enable cursor
-
Local:
./.rulesync/rulesync.json
(project-specific) -
Global:
~/.config/rulesync/rulesync.json
(user-wide)
Rulesync automatically detects if you're in a project directory (has package.json
or composer.json
) and uses local configuration accordingly.
These examples demonstrate different ways to use rulesync. For a complete command reference, see Commands.
rulesync compose base/clean-code base/testing language/typescript framework/react
rulesync generate --force
rulesync gitignore
rulesync compose base/clean-code base/security language/python framework/django
rulesync generate --force
rulesync gitignore
rulesync base https://company.com/coding-standards.md
rulesync compose base/clean-code language/typescript ./project-specific.md
rulesync generate --force
After running rulesync generate
, your project will have files for all supported AI assistants:
project/
├── rulesync.md # Composed source rules
├── CLAUDE.md # Claude AI rules
├── .cursorrules # Cursor IDE rules
├── .windsurfrules # Windsurf IDE rules
├── GEMINI.md # Gemini CLI rules
├── AGENTS.md # OpenAI Codex rules
├── .github/
│ └── copilot-instructions.md # GitHub Copilot rules
├── .clinerules/
│ └── project.md # Cline rules
├── .junie/
│ └── guidelines.md # Junie rules
├── .aider.conf.yml # Aider rules
├── .continue/
│ └── config.json # Continue.dev rules
├── .amazonq/
│ └── rules/
│ └── coding-guidelines.md # Amazon Q Developer rules
├── .vscode/
│ └── cody.json # Sourcegraph Cody rules
├── .gitignore # Updated with AI assistant files
└── .rulesync/
└── rulesync.json # Local configuration
By default, rulesync uses rulesync.md
(created via templates or manually). You can also specify custom source files:
# Generate from custom file instead of rulesync.md
rulesync generate --from ./api-guidelines.md
# Force overwrite without prompts
rulesync generate --force
# Overwrite existing files (with prompts)
rulesync generate --overwrite
# Force composition without prompts
rulesync compose --force base/clean-code language/go
# Interactive composition (shows available templates)
rulesync compose
# View detailed configuration
rulesync config
# Reset to defaults (disables no agents)
rm .rulesync/rulesync.json
# Clone and setup
git clone https://github.com/dmccown1500/rulesync-ts.git
cd rulesync-ts
npm install
# Development
npm run dev # Run in development mode
npm run build # Build the project
npm test # Run tests
npm run lint # Lint code
npm run format # Format code
- Node.js >= 18.0.0
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
This is a TypeScript rewrite of the original rulesync project by JP Caparas, enhanced with modern template-based composition and expanded AI assistant support.
⭐ Like this project? Give it a star on GitHub!