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

Uploaded Python 3

File details

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

File metadata

  • Download URL: dotruler-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 a0da24a35193ee4497e2e62508ff9adb1ba931d6e1fff7cdadaf9a960b8305c0
MD5 2a452bc453659e29b95c68e75bb1c259
BLAKE2b-256 07b72045cc086d09ab641bd36bf3bf75197de1b82535462e201bb0be40f9ad26

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dotruler-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2254dd4ee79738cf4ea6237d15c56f9f4015d79e5d363107111f5579f5ed7323
MD5 f4ed6e783c2d8628d53ce984236516eb
BLAKE2b-256 44c2620d53911c532d21b509d50fe5059fe9f58a78d6ea947e58f2c700c91aba

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