intellectronica/ruler
Ruler — apply the same rules to all coding agents
What it solves
Ruler addresses the complexity of managing AI coding assistant instructions across multiple tools. When teams use different agents (such as GitHub Copilot, Claude, Cursor, and Aider), they often face inconsistent guidance, duplicated effort in maintaining multiple configuration files, and context drift as project requirements change. Ruler provides a single source of truth for these instructions, ensuring all AI agents follow the same rules.
How it works
Ruler centralizes instructions in a .ruler/ directory using Markdown files. It then automatically distributes these rules to the specific configuration files required by various supported AI agents.
Key mechanisms include:
- Rule Concatenation: It discovers
.mdfiles recursively and concatenates them into the target agent's config file, adding source markers for traceability. - Nested Rule Loading: Using the
--nestedflag, Ruler can load instructions from multiple.ruler/directories throughout a project hierarchy, allowing for component-specific rules (e.g., different rules for/srcvs/tests). - Configuration: A
ruler.tomlfile manages agent selection, output paths, and Model Context Protocol (MCP) server settings. - Automation: It can automatically update
.gitignoreto keep generated config files out of version control.
Who it’s for
It is designed for developers and teams working in complex codebases or monorepos who use one or more AI coding assistants and want to maintain consistent AI behavior across their entire development environment.
Highlights
- Broad Agent Support: Compatible with a wide array of tools including GitHub Copilot, Claude Code, Cursor, Windsurf, Cline, Aider, and many others.
- MCP Propagation: Manages and distributes Model Context Protocol (MCP) server settings across agents.
- Single Source of Truth: Eliminates the need to manually edit multiple agent-specific config files.
- Context-Aware Rules: Supports nested directories for granular, area-specific instructions.
- Safety Features: Includes a
revertcommand to undo changes and restore original files from backups.