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:

npm i -g rules-cli

Add rules

To download rules to your repository you can use rules add. For example:

rules add starter/nextjs-rules

This 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/awesome-rules/ruby

Render rules

To use rules with your AI IDE of choice, you can “render” them to the necessary format and location using rules render. For example,

rules render cursor

will copy all of the .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 using rules publish:

# Login
rules login

# Create a rules.json
rules init

# Create a rule
rules create

# Publish
rules publish

This would make your rules available to download with 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.

  1. Make your account on the registry and create an organization
  2. Publish your rules
  3. 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.