ai-rules
ai-rules copied to clipboard
Manage AI rules, commands, and skills across multiple coding agents from one place.
AI Rules Tool
CLI tool to manage AI rules across different AI coding agents. Standardize and distribute your coding guidelines across AMP, Claude, Cline, Codex, Copilot, Cursor, Firebender, Gemini, Goose, Kilocode, and Roo.
Features
- Multi-Agent Support - Generate rules for 11 AI coding agents from a single source
- Sync Management - Track and maintain consistency across all generated rule files
- Selective Generation - Generate rules for specific agents only
- MCP Support - Generate Model Context Protocol configurations for compatible agents
Installation
curl -fsSL https://raw.githubusercontent.com/block/ai-rules/main/scripts/install.sh | bash
Installs to ~/.local/bin/ai-rules. Verify with ai-rules --version.
More installation options
Specific version:
curl -fsSL https://raw.githubusercontent.com/block/ai-rules/main/scripts/install.sh | VERSION=v1.0.0 bash
Custom directory:
curl -fsSL https://raw.githubusercontent.com/block/ai-rules/main/scripts/install.sh | INSTALL_DIR=/usr/local/bin bash
Quick Start
-
Initialize your AI rules directory:
ai-rules initCreates an
ai-rules/directory with example rule files. Rule files are markdown files containing coding guidelines, conventions, and instructions that get distributed to your AI coding agents. -
Edit your rules in
ai-rules/*.mdfiles to define your project's coding standards -
Generate agent-specific files:
ai-rules generate # All agents ai-rules generate --agents claude,cursor # Specific agentsCreates
CLAUDE.md,AGENTS.md, and other agent-specific files. Cursor usesAGENTS.md. -
Check status to ensure everything is in sync:
ai-rules status
Commands
| Command | Description |
|---|---|
ai-rules init |
Initialize AI rules in the current directory |
ai-rules generate |
Generate rules for AI coding agents |
ai-rules status |
Show sync status of AI rules |
ai-rules clean |
Remove all generated files |
ai-rules list-agents |
List all supported agents |
Common Options
ai-rules generate --agents claude,cursor # Generate for specific agents
ai-rules generate --nested-depth 2 # Process subdirectories
ai-rules generate --gitignore # Add generated files to .gitignore
Configuration
Create ai-rules/ai-rules-config.yaml to set defaults:
agents: [claude, cursor, cline]
nested_depth: 2
gitignore: true
See Configuration Guide for all options.
Supported Agents
AMP, Claude Code, Cline, Codex, Copilot, Cursor, Firebender, Gemini, Goose, Kilocode, Roo
See Supported Agents for detailed compatibility information.
Documentation
- Configuration - Config file options and precedence
- Rule Format - Standard mode and symlink mode formats
- Supported Agents - Agent compatibility and generated files
- MCP Configuration - Model Context Protocol setup
- Commands and Skills - Custom commands and skills
- Project Structure - Example project layouts
Development
See CONTRIBUTING.md for development setup and guidelines.