tl;dr:
npm i -g rules-clithenrules add starter/nextjs-rules
rules is a CLI built for managing rules across any AI developer tool. 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.
The rules CLI can be installed using NPM:
npm i -g rules-cliTo download rules to your repository you can use rules add. For example:
rules add starter/nextjs-rulesThis will add them to your project in a local .rules folder.
You can also download from GitHub rather than the rules registry:
rules add gh:continuedev/rules-templateTo use rules with your AI code assistant of choice, you can "render" them to the necessary format and location using rules render. For example,
rules render cursorwill copy all of the .rules/ into a .cursor/rules/ folder. rules currently supports the following formats: cursor, continue, windsurf, claude, copilot, codex, cline, cody, and amp.
To make your rules available to others, you can publish using rules publish:
rules login
rules publishThis would make your rule available to download with rules add <name-of-rules>.
The command automatically determines the slug from your rules.json file. To make sure you have a rules.json file in your current directory, use rules init.
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