Skip to content
/ ai-rules Public

Manage AI rules, commands, and skills across multiple coding agents from one place.

License

Notifications You must be signed in to change notification settings

block/ai-rules

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

  1. Initialize your AI rules directory:

    ai-rules init

    Creates 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.

  2. Edit your rules in ai-rules/*.md files to define your project's coding standards

  3. Generate agent-specific files:

    ai-rules generate                            # All agents
    ai-rules generate --agents claude,cursor     # Specific agents

    Creates CLAUDE.md, .cursor/rules/*.mdc, AGENTS.md, etc.

  4. 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

Development

See CONTRIBUTING.md for development setup and guidelines.

About

Manage AI rules, commands, and skills across multiple coding agents from one place.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks