Animation by Isaac Flath of Elite AI-Assisted Coding ➡︎ |
|
Beta Research Preview
- Please test this version carefully in your environment
- Report issues at https://github.com/intellectronica/ruler/issues
Managing instructions across multiple AI coding tools becomes complex as your team grows. Different agents (GitHub Copilot, Claude, Cursor, Aider, etc.) require their own configuration files, leading to:
Ruler solves this by providing a single source of truth for all your AI agent instructions, automatically distributing them to the right configuration files. With support for nested rule loading, Ruler can handle complex project structures with context-specific instructions for different components.
.ruler/ directory using Markdown files.ruler/ directories for context-specific instructionsruler.toml.gitignore Automation: Keeps generated agent config files out of version control automatically| Agent | Rules File(s) | MCP Configuration / Notes | Skills Support / Location | Subagents Support / Location |
|---|---|---|---|---|
| AGENTS.md | AGENTS.md |
(pseudo-agent ensuring root AGENTS.md exists) |
- | - |
| GitHub Copilot | AGENTS.md |
.mcp.json |
.claude/skills/ |
.github/agents/ |
| Claude Code | CLAUDE.md |
.mcp.json |
.claude/skills/ |
.claude/agents/ |
| OpenAI Codex CLI | AGENTS.md |
.codex/config.toml |
.agents/skills/ |
.codex/agents/ (.toml) |
| Pi Coding Agent | AGENTS.md |
- | .pi/skills/ |
- |
| Jules | AGENTS.md |
- | - | - |
| Cursor | AGENTS.md |
.cursor/mcp.json |
.cursor/skills/ |
.cursor/agents/ |
| Windsurf | AGENTS.md |
.windsurf/mcp_config.json |
.windsurf/skills/ |
- |
| Cline | .clinerules |
- | - | - |
| Crush | CRUSH.md |
.crush.json |
- | - |
| Amp | AGENTS.md |
- | .agents/skills/ |
- |
| Antigravity | .agent/rules/ruler.md |
- | .agent/skills/ |
- |
| Amazon Q CLI | .amazonq/rules/ruler_q_rules.md |
.amazonq/mcp.json |
- | - |
| Aider | AGENTS.md, .aider.conf.yml |
.mcp.json |
- | - |
| Firebase Studio | .idx/airules.md |
.idx/mcp.json |
- | - |
| Open Hands | .openhands/microagents/repo.md |
config.toml |
- | - |
| Gemini CLI | AGENTS.md |
.gemini/settings.json |
.gemini/skills/ |
- |
| Junie | .junie/guidelines.md |
.junie/mcp/mcp.json |
.junie/skills/ |
- |
| AugmentCode | .augment/rules/ruler_augment_instructions.md |
- | - | - |
| Kilo Code | AGENTS.md |
.kilocode/mcp.json |
.claude/skills/ |
- |
| OpenCode | AGENTS.md |
opencode.json |
.opencode/skills/ |
- |
| Goose | .goosehints |
- | .agents/skills/ |
- |
| Qwen Code | AGENTS.md |
.qwen/settings.json |
- | - |
| RooCode | AGENTS.md |
.roo/mcp.json |
.roo/skills/ |
- |
| Zed | AGENTS.md |
.zed/settings.json (project root, never $HOME) |
.agents/skills/ |
- |
| Trae AI | .trae/rules/project_rules.md |
- | - | - |
| Warp | WARP.md |
- | - | - |
| Kiro | .kiro/steering/ruler_kiro_instructions.md |
.kiro/settings/mcp.json |
- | - |
| Firebender | firebender.json |
firebender.json (rules and MCP in same file) |
- | - |
| Factory Droid | AGENTS.md |
.factory/mcp.json |
.factory/skills/ |
- |
| Mistral Vibe | AGENTS.md |
.vibe/config.toml |
.vibe/skills/ |
- |
| JetBrains AI Assistant | .aiassistant/rules/AGENTS.md |
- | - | - |
Requires Node.js ^20.19.0 || ^22.12.0 || >=23.
Global Installation (Recommended for CLI use):
npm install -g @intellectronica/ruler
Using npx (for one-off commands):
npx @intellectronica/ruler apply
ruler initThis creates:
.ruler/ directory
.ruler/AGENTS.md: The primary starter Markdown file for your rules.ruler/ruler.toml: The main configuration file for Ruler (now contains sample MCP server sections; legacy .ruler/mcp.json no longer scaffolded).ruler/instructions.md, it is still respected when AGENTS.md is absent. (The prior runtime warning was removed.)Additionally, you can create a global configuration to use when no local .ruler/ directory is found:
ruler init --global
The global configuration will be created to $XDG_CONFIG_HOME/ruler (default: ~/.config/ruler).
.ruler/ DirectoryThis is your central hub for all AI agent instructions:
AGENTS.md (outside .ruler/) if present (highest precedence, prepended).ruler/AGENTS.md (new default starter file).ruler/instructions.md (only if .ruler/AGENTS.md absent; no longer emits a deprecation warning).md files under .ruler/ (and subdirectories) in sorted order*.md): Discovered recursively from .ruler/ or $XDG_CONFIG_HOME/ruler and concatenated in the order aboveruler.toml: Master configuration for Ruler's behavior, agent selection, output paths, and MCP server settingsmcp.json: (Legacy, deprecated) Shared MCP server settings - no longer scaffolded but still supported for backward compatibilityThis ordering lets you keep a short, high-impact root AGENTS.md (e.g. executive project summary) while housing detailed guidance inside .ruler/.
Ruler now supports nested rule loading with the --nested flag, enabling context-specific instructions for different parts of your project:
project/
├── .ruler/ # Global project rules
│ ├── AGENTS.md
│ └── coding_style.md
├── src/
│ └── .ruler/ # Component-specific rules
│ └── api_guidelines.md
├── tests/
│ └── .ruler/ # Test-specific rules
│ └── testing_conventions.md
└── docs/
└── .ruler/ # Documentation rules
└── writing_style.md
How it works:
.ruler/ directories in the project hierarchyruler apply --nested (or --no-nested) takes top prioritynested = true in ruler.tomlnested = true. If a child config attempts to disable it, Ruler keeps nested processing active and emits a warning in the logs.[!CAUTION] Nested mode is experimental and may change in future releases. The CLI logs this warning the first time a nested run is detected so you know the behavior may evolve.
Perfect for:
Granularity: Break down complex instructions into focused .md files:
coding_style.mdapi_conventions.mdproject_architecture.mdsecurity_guidelines.mdExample rule file (.ruler/python_guidelines.md):
```markdown
Exception$ claude mcp add ruler \
-- python -m otcore.mcp_server <graph>