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.0.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.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dotruler-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 425630e838eb40abfb39c9d6ef66a6891624237c745ad3365d44ff0cf0b30a7f
MD5 2edfadddf8b9be4bb4a2400040c86227
BLAKE2b-256 3b0fd6dfd02d08182be631e8167e35cc8d3b4d07aca0c78d72250da71ca67aa0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dotruler-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7763184205bb4b93b7804cac2830871382cb4e33d23225ea4050e47c23e6a811
MD5 82eec3b0a2eaa79b7ccc44d2b793db54
BLAKE2b-256 4aac582111fcc49da66697029daf6eb44dc5b220b31d0421460a9dc792e12cba

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