tl;dr:
npm i -g rules-cli
then rules add starter/nextjs-rules
rules
is a CLI built for managing rules across any AI IDE. Rules are markdown files that encode workflows, preferences, tech stack details, and more in plain natural language so you can get better help from LLMs.
Install rules
The rules
CLI can be installed using NPM:
Add rules
To download rules to your repository you can userules add
. For example:
.rules
folder.
You can also download from GitHub rather than the rules registry:
Render rules
To use rules with your AI IDE of choice, you can “render” them to the necessary format and location usingrules render
. For example,
.rules/
into a .cursor/rules/
folder. rules
currently supports the following formats:
- continue -
.continue/rules/*.md
(Continue Dev rules) - cursor -
.cursor/rules/*.mdc
(Cursor rules) - windsurf -
.windsurf/rules/*.md
(Windsurf rules) - claude -
CLAUDE.md
(Claude Code single file) - copilot -
.github/instructions/*.instructions.md
(GitHub Copilot instructions) - codex -
AGENT.md
(Codex single file) - cline -
.clinerules/*.md
(Cline rules) - cody -
.sourcegraph/*.rule.md
(Sourcegraph Cody rules) - amp -
AGENT.md
(Amp single file)
Publish rules
To make your rules available to others, you can publish usingrules publish
:
rules add <name-of-rules>
.
You can use our template repository to automate publishing with GitHub Actions.
Helping users use your rules
If you are building a developer tool and want to optimize how AI IDEs work with your tool,rules
makes it easy to give your users the best experience.
- Make your account on the registry and create an organization
- Publish your rules
- Mention the corresponding
rules add <name-of-rules>
command in your documentation
Contributing
rules
is open-sourced under the Apache 2.0 license. If you’re interested in contributing, learn more here.