⚡ One config to rule them all. Centralized AI assistant configuration management - generate rules for Claude, Cursor, Copilot, Windsurf and more from a single YAML file.
Project description
ai-rulez
Directory-based AI governance for 18+ tools. Define rules, context, skills, agents and commands once — generate native configs for Claude, Cursor, Copilot, Windsurf, Gemini, Codex, and more.
Every AI coding tool wants its own config format. Claude needs CLAUDE.md + .claude/skills/ + .claude/agents/, Cursor wants .cursor/rules/, Copilot expects .github/copilot-instructions.md. Keeping them in sync is tedious and error-prone.
ai-rulez solves this: organize your AI governance in .ai-rulez/, run generate, and get native configs for all your tools — with proper frontmatter, tool-specific formatting, and full feature support (skills, agents, MCP servers).
npx ai-rulez@latest init && npx ai-rulez@latest generate
What You Get
- 18 preset generators: Claude, Cursor, Windsurf, Copilot, Gemini, Cline, Continue.dev, Amp, Junie, Codex, OpenCode, and custom presets
- Commands system: Define slash commands once, use them across tools that support it
- Context compression: 34% size reduction with smart whitespace optimization
- Remote includes: Pull shared rules from git repos (company standards, team configs)
- Profile system: Generate different configs for backend/frontend/QA teams
- MCP server: Let AI assistants manage their own rules via Model Context Protocol
- Type-safe schemas: JSON Schema validation for all config files
Quick Start
# No install required
npx ai-rulez@latest init "My Project"
npx ai-rulez@latest generate
This creates:
.ai-rulez/
├── config.yaml # Which tools to generate for
├── rules/ # Guidelines AI must follow
├── context/ # Project background info
├── skills/ # Specialized AI roles
├── agents/ # Agent-specific prompts
└── commands/ # Slash commands
And generates native configs for each tool you specify.
Configuration
# .ai-rulez/config.yaml
version: "3.0"
name: "My Project"
presets:
- claude
- cursor
- copilot
- windsurf
# Optional: team-specific profiles
profiles:
backend: [backend, database]
frontend: [frontend, ui]
# Optional: share rules across repos
includes:
- name: company-standards
source: https://github.com/company/ai-rules.git
ref: main
Content Structure
Rules - What AI must do:
---
priority: critical
---
# Security Standards
- Never commit credentials
- Use environment variables for secrets
- Sanitize all user input
Context - What AI should know:
---
priority: high
---
# Architecture
This is a microservices app:
- API Gateway (Go, port 8080)
- Auth Service (Go, port 8081)
- PostgreSQL 15
Commands - Slash commands across tools:
---
name: review
aliases: [r, pr-review]
targets: [claude, cursor, continue-dev]
---
# Code Review
Review the current PR for:
1. Logic errors
2. Security issues
3. Performance problems
Installation
No install required:
npx ai-rulez@latest <command>
# or
uvx ai-rulez <command>
Global install:
# Homebrew
brew install goldziher/tap/ai-rulez
# npm
npm install -g ai-rulez
# pip
pip install ai-rulez
# Go
go install github.com/Goldziher/ai-rulez/cmd@latest
CLI Reference
# Initialize project
ai-rulez init "Project Name"
ai-rulez init --domains backend,frontend,qa
# Generate configs
ai-rulez generate
ai-rulez generate --profile backend
ai-rulez generate --dry-run
# Content management
ai-rulez add rule security-standards --priority critical
ai-rulez add context api-docs
ai-rulez add skill database-expert
ai-rulez add command review-pr
ai-rulez list rules
ai-rulez remove rule outdated-rule
# Installed skills
ai-rulez skill install kreuzberg --source https://github.com/kreuzberg-dev/kreuzberg
ai-rulez skill list
ai-rulez skill remove kreuzberg
# Validation
ai-rulez validate
# MCP server (for AI assistants)
npx ai-rulez@latest mcp
# Migrate from V2
ai-rulez migrate v3
Remote Includes
Share rules across repositories:
includes:
# HTTPS
- name: company-standards
source: https://github.com/company/ai-rules.git
ref: main
include: [rules, context]
merge_strategy: local-override
# SSH
- name: shared-configs
source: git@github.com:org/shared-ai-rulez.git
ref: v2.0.0
include: [rules, skills]
# Local path
- name: local-standards
source: ../shared-rules
include: [rules]
Private repos use AI_RULEZ_GIT_TOKEN environment variable or --token flag.
Installed Skills
Install named skills from external repositories — fetched dynamically at generate time:
installed_skills:
- name: kreuzberg
source: https://github.com/kreuzberg-dev/kreuzberg
- name: ai-rulez
source: https://github.com/Goldziher/ai-rulez
ai-rulez skill install kreuzberg --source https://github.com/kreuzberg-dev/kreuzberg
ai-rulez skill list
ai-rulez skill remove kreuzberg
Skills live at skills/<name>/SKILL.md in the source repo. See Installed Skills docs for details.
Generated Output
Running ai-rulez generate creates:
| Preset | Output |
|---|---|
| Claude | CLAUDE.md + .claude/skills/ + .claude/agents/ |
| Cursor | .cursor/rules/*.mdc |
| Windsurf | .windsurf/*.md |
| Copilot | .github/copilot-instructions.md |
| Gemini | GEMINI.md |
| Continue.dev | .continue/prompts/ai_rulez_prompts.yaml |
| Cline | .cline/rules/*.md |
| Codex | AGENTS.md |
| Amp | AMP.md |
| Junie | .junie/guidelines.md |
| OpenCode | OPENCODE.md |
| Custom | Any path with markdown, JSON, or directory output |
Use Cases
Monorepo: Generate configs for multiple packages
ai-rulez generate --recursive
Team profiles: Different rules for different teams
ai-rulez generate --profile backend
ai-rulez generate --profile frontend
CI validation: Ensure configs stay in sync
ai-rulez validate && ai-rulez generate --dry-run
Import existing configs: Migrate from tool-specific files
ai-rulez init --from auto
ai-rulez init --from .cursorrules,CLAUDE.md
MCP Server
Let AI assistants manage rules directly:
# .ai-rulez/mcp.yaml
version: "3.0"
mcp_servers:
- name: ai-rulez
command: npx
args: ["-y", "ai-rulez@latest", "mcp"]
transport: stdio
enabled: true
The MCP server exposes CRUD operations, validation, and generation to AI assistants.
Builtins
23 built-in domains ship embedded in the binary — opinionated conventions ready to use without external includes:
builtins:
- rust
- python
- typescript
- security
- testing
- default-commands
- Universal (8):
ai-governance,security,git-workflow,code-quality,testing,token-efficiency,documentation,default-commands - Languages (9):
rust,python,typescript,go,java,ruby,php,elixir,csharp - Bindings (6):
pyo3,napi-rs,magnus,ext-php-rs,rustler,wasm
Use builtins: true for all, or pick specific ones. ai-governance is auto-included (exclude with !ai-governance).
Compression
Reduce context size for token-constrained tools:
compression:
level: moderate # off, light, moderate, aggressive, maximum
At moderate level, output is ~34% smaller through whitespace optimization and token reduction.
Documentation
- Configuration Reference
- Domains & Profiles
- Remote Includes
- MCP Server
- Schema Validation
- Migration Guide
Contributing
Contributions welcome. See CONTRIBUTING.md.
License
MIT
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 ai_rulez-3.12.0.tar.gz.
File metadata
- Download URL: ai_rulez-3.12.0.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a0482b316b0d03e2e81b73f9001861fb0815dd0ba941410a48860816a90da73
|
|
| MD5 |
0b8bb3788826ce7658598ac9a279fb24
|
|
| BLAKE2b-256 |
2d546534b7c92a654a0b3d337fab880a2bcb0f126bc7ff51ad30835e30ad1f08
|
Provenance
The following attestation bundles were made for ai_rulez-3.12.0.tar.gz:
Publisher:
publish.yaml on Goldziher/ai-rulez
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_rulez-3.12.0.tar.gz -
Subject digest:
8a0482b316b0d03e2e81b73f9001861fb0815dd0ba941410a48860816a90da73 - Sigstore transparency entry: 1327379167
- Sigstore integration time:
-
Permalink:
Goldziher/ai-rulez@a4e5263d2a5ade83654339563929a96cbaf4803f -
Branch / Tag:
refs/tags/v3.12.0 - Owner: https://github.com/Goldziher
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@a4e5263d2a5ade83654339563929a96cbaf4803f -
Trigger Event:
push
-
Statement type:
File details
Details for the file ai_rulez-3.12.0-py3-none-any.whl.
File metadata
- Download URL: ai_rulez-3.12.0-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
066828ace71300088ed2c5399e82eed74f528f570db54c41416c310cb0534bf8
|
|
| MD5 |
5695cd2438b27cd7ede0017029441aba
|
|
| BLAKE2b-256 |
9937b4ca3a6e1bc959f184f0ba8e819d35b41cc7639b1923091638cd95e8edd4
|
Provenance
The following attestation bundles were made for ai_rulez-3.12.0-py3-none-any.whl:
Publisher:
publish.yaml on Goldziher/ai-rulez
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_rulez-3.12.0-py3-none-any.whl -
Subject digest:
066828ace71300088ed2c5399e82eed74f528f570db54c41416c310cb0534bf8 - Sigstore transparency entry: 1327379352
- Sigstore integration time:
-
Permalink:
Goldziher/ai-rulez@a4e5263d2a5ade83654339563929a96cbaf4803f -
Branch / Tag:
refs/tags/v3.12.0 - Owner: https://github.com/Goldziher
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@a4e5263d2a5ade83654339563929a96cbaf4803f -
Trigger Event:
push
-
Statement type: