Package Exports
- @intellectronica/ruler
- @intellectronica/ruler/dist/lib.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@intellectronica/ruler) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Ruler
A CLI tool to manage custom rules and configs across different AI coding agents.
Features
- Centralise AI agent instructions in a single
.ruler/directory - Distribute rules to supported agents (GitHub Copilot, Claude Code, OpenAI Codex CLI, Cursor, Windsurf, Cline, Aider)
- Extensible architecture: add new agent adapters easily
Installation
Install globally:
npm install -g @intellectronica/rulerOr use npx:
npx @intellectronica/ruler applyUsage
Create a .ruler/ directory at your project root and add Markdown files defining your rules:
.ruler/
├── coding_guidelines.md
└── style_guide.mdRun the apply command:
ruler apply [--project-root <path>] [--agents <agent1,agent2,...>]Use --agents to specify a comma-separated list of agent names (case-insensitive substrings) to limit which agents the rules are applied to.
The command will read all .md files under .ruler/, concatenate their contents, and generate/update configuration files for the following agents:
| Agent | File(s) Created/Updated |
|---|---|
| GitHub Copilot | .github/copilot-instructions.md |
| Claude Code | CLAUDE.md |
| OpenAI Codex CLI | AGENTS.md |
| Cursor | .cursor/rules/ruler_cursor_instructions.md |
| Windsurf | .windsurf/rules/ruler_windsurf_instructions.md |
| Cline | .clinerules |
| Aider | ruler_aider_instructions.md and updates .aider.conf.yml |
Development
Clone the repository and install dependencies:
git clone https://github.com/intellectronica/ruler.git
cd ruler
npm install
npm run buildRun linting and formatting checks:
npm run lint
npm run formatRun tests:
npm testEnd-to-end tests (run build before tests):
npm run build && npm testRoadmap
- Support for MCP servers config
- Support for transforming and rewriting the rules using AI
- Support "harmonisation" (reading existing rules of specific agents and combining them with the master config)
- Support for additional agents
- Support for agent-specific features (for example: apply rules in copilot)
Contributing
Contributions are welcome! Please open issues or pull requests on GitHub.
License
MIT
© Eleanor Berger