A CLI tool that generates README files for your repository using LLMs, or offline without an API key.
intellectronica/ruler
A CLI that keeps one set of Markdown rules in .ruler/ and generates the instruction and MCP config files for over 30 AI coding agents.
- Stars
- 2,962
- Forks
- 166
- Open issues
- 21
- Last commit
- 2 days ago
What is it?
Ruler solves the problem of maintaining the same coding guidance across several AI coding assistants, each of which expects its own file such as CLAUDE.md, .cursor rules, or .clinerules. You write instructions once as Markdown files in a .ruler/ directory, and the ruler apply command distributes them to the configuration file each supported agent reads.
Beyond rule files, Ruler can define MCP server settings in ruler.toml and write them into each agent's native MCP config, and it can propagate skills and subagent definitions to agents that support them. It also keeps generated files out of version control by updating .gitignore, and it creates backups so ruler revert can restore the original files.
The tool supports an experimental nested mode that discovers multiple .ruler/ directories across a monorepo, so different components can carry their own rules. It is published on npm as @intellectronica/ruler and requires Node.js 20.19 or newer.
Key features
- 01Stores all agent instructions as Markdown in a single .ruler/ directory.
- 02Generates rule files for more than 30 agents, including Claude Code, Cursor, Copilot, Codex CLI and Windsurf.
- 03Writes MCP server definitions from ruler.toml into each agent's native MCP config.
- 04Automatically updates .gitignore for generated files and creates .bak backups.
- 05Provides ruler revert to undo changes made by apply.
- 06Offers experimental nested rule loading for monorepos.
Use cases
- A team that uses both Claude Code and Cursor and wants identical coding standards in both.
- Keeping one set of project conventions in sync when developers use different AI assistants.
- Monorepos where frontend, backend and test directories need different agent instructions.
- Distributing shared MCP server settings to several coding agents without editing each config by hand.
Quick start
- 1
Install Ruler globally via npm
npm install -g @intellectronica/ruler - 2
Navigate to your project root and initialise the .ruler/ directory
ruler init - 3
Edit the rule files in .ruler/, then generate agent config files
ruler apply
Things to know
- Requires Node.js ^20.19.0, ^22.12.0 or >=23.
- Still in beta research preview, so behaviour may change.
- Nested rule loading is experimental and may change in future releases.
In collections
Topics
FAQ
- What is ruler?
- A CLI that keeps one set of Markdown rules in .ruler/ and generates the instruction and MCP config files for over 30 AI coding agents. Ruler solves the problem of maintaining the same coding guidance across several AI coding assistants, each of which expects its own file such as CLAUDE.md, .cursor rules, or .clinerules. You write instructions once as Markdown files in a .ruler/ directory, and the ruler apply command distributes them to the configuration file each supported agent reads.
- Is ruler free to use? What license does it have?
- ruler is open source under the MIT license. Check the license terms before using it in commercial products.
- Is ruler still maintained?
- Actively maintained. The last commit to ruler was on Nov 4, 2026.
- What can I use ruler for?
- A team that uses both Claude Code and Cursor and wants identical coding standards in both. Keeping one set of project conventions in sync when developers use different AI assistants. Monorepos where frontend, backend and test directories need different agent instructions. Distributing shared MCP server settings to several coding agents without editing each config by hand.
- How do I install ruler?
- Install Ruler globally via npm: npm install -g @intellectronica/ruler Navigate to your project root and initialise the .ruler/ directory: ruler init Edit the rule files in .ruler/, then generate agent config files: ruler apply
- Where can I get ruler?
- The source code and installation instructions are on GitHub: https://github.com/intellectronica/ruler
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
An open-source AI agent from Google that brings Gemini into your terminal to query, edit, and automate code.
Persistent memory for AI coding agents that captures sessions automatically and injects relevant context into later sessions across Claude Code, Cursor, Codex and other MCP clients.
A terminal-native CLI that turns plain-English descriptions into YAML workflows orchestrating Claude Code, Codex, Gemini CLI and other coding agents with quality gates.
An open-source coding-agent CLI that runs in the terminal and works with cloud APIs and local model backends like Ollama.
An MCP server and CLI that feed up-to-date, version-specific library docs and code examples into AI coding agents.