A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
Create Rules for Cursor AI from any code
Supercharge your Cursor AI with codebase-specific intelligence. Rulefy transforms your GitHub repositories into custom rules that teach Cursor AI how your project works, resulting in more accurate code suggestions, better refactoring, and contextually aware assistance.
# Install globally
npm install -g rulefy
# Or use with npx (no installation required)
npx rulefy
export ANTHROPIC_API_KEY='your-anthropic-api-key'
The basic command structure is:
rulefy <repo-path>
Examples:
# Inside a repository
rulefy
# Using local repository path
rulefy ./my-local-project/subdir
# Using GitHub URL
rulefy --remote https://github.com/fastapi/fastapi
# Rulefy with specific description as an option
rulefy --description "guidelines for extending the component using the base interface"
# Specify Cursor AI rule type
rulefy --rule-type "agent" --description "coding standards for React components"
This will:
<repo-name>.rules.mdc fileOptions:
--provider <provider> LLM model to use (default: "claude-sonnet-4-5-20250929")
--description <text> Description of what should be rulefied
--rule-type <type> Type of rule to generate (auto, manual, agent, always)
--tokenizer <tokenizer> Tokenizer used to count tokens (default: "p50k_base")
--chunk-size <size> Chunk size for the repository to be processed in one go (default: 100000)
-h, --help display help for command
rulefy supports all options supported by repomix. For example, select specific files:
rulefy --include "src/**/*.ts" --compress
After generating your rules file, you'll need to install it in Cursor:
<filename>.rules.mdc fileFor more detailed instructions, see the official Cursor documentation.
The generated .rules.mdc file will contain structured guidelines for Cursor AI when working with your codebase:
# .cursorrules for my-project
## Project Overview
This project is a TypeScript application that...
## Coding Standards
- Follow TypeScript best practices with strict typing
- Use async/await for asynchronous operations
...
## File Structure Guidelines
- Place core logic in the `src/` directory
...
If you encounter rate limits or ihigh costs, try to minimize the context length using the following ways:
rulefy --compress to compress the context lengthrulefy --include to include only the files you need with globsrulefy --exclude to exclude the files you don't need with globs--chunk-size option. (default is --chunk-size 100000)Contributions are welcome! Please feel free to submit a Pull Request.
This project is inspired by and builds upon the work of:
We're grateful to these projects for their contributions to the developer tooling ecosystem.
📄 Configuration files that enhance Cursor AI editor experience with custom rules and behaviors
A practical approach to managing multiple AI agents in Cursor through strict file-tree partitioning and domain boundarie
神奇海螺 cursorrules 阿拉丁神燈想要甚麼許願就有