Skip to main content

📐 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

Metadata

Release files for dotruler 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dotruler 0.1.2
File Size Uploaded Provenance Actions
dotruler-0.1.2.tar.gz 13.8 kB Without provenance Details for dotruler-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dotruler 0.1.2
File Interpreter ABI Platform Actions
dotruler-0.1.2-py3-none-any.whl Python 3 none any Details for dotruler-0.1.2-py3-none-any.whl

Total release size: 31.8 kB

Release files / dotruler-0.1.2.tar.gz

Download URL dotruler-0.1.2.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
125962903ca9e5066d83cfb089d8cbfbaca853f29684f71ae2201e66828f0c28
BLAKE2b-256 checksum
How to use checksums
3f64d94d2f31382e1ecfc09c7db212c212760fded80086a50f68afed57642e13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / dotruler-0.1.2-py3-none-any.whl

Download URL dotruler-0.1.2-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b0cbf65613ddbbf32f122a289c3c157bb6de3182b4e67c1fa053dc6dee89db5
BLAKE2b-256 checksum
How to use checksums
c3e490dd2152c753d9eb0a079c241262863a1e3be1248a02d931c0601f8facbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Security for dotruler 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page