Skip to main content

📐 One config. Every AI coding tool. Always in sync.

Project description

📐 dotruler

One config. Every AI coding tool. Always in sync.

PyPI Python License


Stop maintaining 6 separate config files. Define your project rules once in .dotruler.toml and generate configs for Claude Code, Cursor, GitHub Copilot, Windsurf, OpenAI Codex, and Aider — instantly.

pip install dotruler

Overview

Modern development workflows involve multiple AI coding assistants, each requiring its own instruction file:

AI Tool Config File
Claude Code CLAUDE.md
Cursor .cursorrules
GitHub Copilot .github/copilot-instructions.md
Windsurf .windsurfrules
OpenAI Codex AGENTS.md
Aider CONVENTIONS.md

These files inevitably drift out of sync — you update one, forget the rest, and your AI tools produce inconsistent results. dotruler solves this with a single source of truth.

How It Works

dotruler init          # Scan your project, scaffold .dotruler.toml
vim .dotruler.toml     # Edit your single config
dotruler generate      # Generate all target configs at once

Getting Started

Installation

pip install dotruler

Requires Python 3.11+.

Initialize

cd your-project
dotruler init

Automatically detects your languages, frameworks, package manager, and existing commands to scaffold a starter .dotruler.toml.

Configure

[project]
name = "myapp"
description = "Next.js web app with PostgreSQL"
languages = ["typescript", "python"]
frameworks = ["nextjs", "fastapi"]

[style]
rules = [
  "Use functional components with hooks",
  "Prefer const over let",
  "Use TypeScript strict mode",
]

[commands]
build = "npm run build"
test = "pytest && npm test"
lint = "ruff check . && npm run lint"
dev = "npm run dev"

[architecture]
notes = [
  "API routes in src/app/api/",
  "Database models in src/models/",
]

[targets]
enabled = ["claude-md", "cursorrules", "copilot"]

Generate

dotruler generate
Generating from .dotruler.toml...

  ✓ CLAUDE.md
  ✓ .cursorrules
  ✓ .github/copilot-instructions.md

Done. 3 configs generated.

CLI Reference

Command Description
dotruler init Scan project and create starter .dotruler.toml
dotruler generate Generate config files for all enabled targets
dotruler generate --dry-run Preview output without writing files
dotruler validate Check config for errors and warnings
dotruler diff Show what would change before writing
dotruler list Display all available output targets

Supported Targets

Target Output File Char Limit
claude-md CLAUDE.md
cursorrules .cursorrules
copilot .github/copilot-instructions.md
windsurf .windsurfrules 12,000
codex AGENTS.md 32,768
aider CONVENTIONS.md

Character limits for Windsurf and Codex are automatically enforced during generation.

Per-Target Overrides

Append tool-specific rules or customize output paths per target:

[targets]
enabled = ["claude-md", "cursorrules", "copilot"]

[targets.claude-md]
extra_rules = ["Use Read tool before editing files"]
output_path = "CLAUDE.md"

[targets.cursorrules]
extra_rules = ["Prefer .cursor/rules/*.mdc format"]

Plugin Architecture

All output targets are implemented as plugins using a registry pattern. The 6 built-in targets cover the major AI coding tools, but the system is designed for extensibility — adding a new target requires a single file with a decorated class.

Comparison

Approach Limitation
Manual copy-paste Drifts within days
Symlinks Formats differ across tools
ruler Limited per-tool customization
rulesync Requires Node.js
ai-rulez Requires Go

dotruler is Python-native, TOML-configured, plugin-extensible, and validates your config before generating.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dotruler-0.1.2.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dotruler-0.1.2-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file dotruler-0.1.2.tar.gz.

File metadata

  • Download URL: dotruler-0.1.2.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for dotruler-0.1.2.tar.gz
Algorithm Hash digest
SHA256 125962903ca9e5066d83cfb089d8cbfbaca853f29684f71ae2201e66828f0c28
MD5 5e26aa336cdf420b2929a0d640e322b3
BLAKE2b-256 3f64d94d2f31382e1ecfc09c7db212c212760fded80086a50f68afed57642e13

See more details on using hashes here.

File details

Details for the file dotruler-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: dotruler-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for dotruler-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9b0cbf65613ddbbf32f122a289c3c157bb6de3182b4e67c1fa053dc6dee89db5
MD5 c697d68985e33a829719a2f708df7692
BLAKE2b-256 c3e490dd2152c753d9eb0a079c241262863a1e3be1248a02d931c0601f8facbe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page