A universal CLI utility to configure AI rules files for any project.
Project description
rules4
A universal CLI utility to configure AI rules files (e.g., .roo/rules, CLAUDE.md, .cursor/rules) for any project, based on the latest industry best practices via live Perplexity research.
Features
- Supports any language or framework via
--langand--tagsoptions - Configures rules for tools like Cursor, Roo, Claude, and more
- Uses live Perplexity API for up-to-date best practices
- Dry-run mode to preview changes
- Prompts before overwriting existing files
- Simple one-command install (packaged for PyPI)
- Designed for future MCP integration
Installation
pip install rules4
Usage
Basic Rule Generation
To generate rules for a specific tool (e.g., copilot) for a given language and tags:
rules4 copilot --lang python --tags "pytest,langgraph"
This command will:
- Use
gpt-4-turboas the primary model (default). - Generate rules for Python projects, focusing on
pytestandlanggraph. - Save the rules to
.github/copilot-python-pytest,langgraph.md(or similar, depending on the tool).
Advanced Usage
You can specify a primary model, a review model, and enable research:
rules4 copilot --primary gpt4.1 --review claude-4-sonnet --research --lang javascript --tags "react,typescript"
This command will:
- Use
gpt4.1as the primary model for rule generation. - Perform research using Perplexity AI before generating rules.
- Have
claude-4-sonnetreview and refine the generated rules. - Generate rules for JavaScript projects, focusing on
reactandtypescript.
Generating Rules for All Configured Tools
If you have a .rules4rc file configured, you can generate rules for all specified tools:
rules4 generate --lang go --tags "code style"
This command will:
- Read the list of tools from your
.rules4rcfile. - Generate rules for each tool, focusing on
code stylefor Go projects.
Command-Line Options
--primary <model_name>: Specify the primary AI model for rule generation (e.g.,gpt-4-turbo,gpt4.1).--review <model_name>: Specify an AI model for reviewing and refining the generated rules (e.g.,claude-4-sonnet).--research: Enable research using Perplexity AI before rule generation.--lang <language>: Specify the programming language for rule generation (e.g.,python,javascript,go).--tags <tag1,tag2,...>: Comma-separated list of tags or topics for rule generation (e.g.,pytest,langgraph,react,typescript,code style).--dry-run: Preview the changes without actually writing any files.--yes,-y: Overwrite existing files without prompting for confirmation.--project-path <path>: (Optional) Specify the target project directory. Defaults to the current directory.
This project is in early development. For contributions, see CONTRIBUTING.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rules4-0.0.4.tar.gz.
File metadata
- Download URL: rules4-0.0.4.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ca952c0f57e0f4e752e83d3bdb11df695df8fa91dababa0966cc1c4c9407c34
|
|
| MD5 |
0948c7ba11f2a882e2de7bcbc4440868
|
|
| BLAKE2b-256 |
30243b6db3b779bfd896809eabd322a1b1808b10f900cbf456811ad59f474906
|
File details
Details for the file rules4-0.0.4-py3-none-any.whl.
File metadata
- Download URL: rules4-0.0.4-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
904923ec7b1dd1fe6257a847415703e579793af2ab616cfc563cabd94307c8c7
|
|
| MD5 |
73322385ddc76ab359adc0448c27fe34
|
|
| BLAKE2b-256 |
3c5c3d0f49620ebf3d0f0a36012aa6df7571da131479253b8e101ac61b288d8e
|