One source of truth for all your AI coding agent rule files. Sync AGENTS.md, CLAUDE.md, .cursorrules, copilot-instructions.md, GEMINI.md, and .windsurfrules from a single canonical file.
Project description
agentsync
One source of truth for all your AI coding agent rule files.
The problem
Open a typical AI-assisted project and you'll find this:
AGENTS.md ← OpenAI Codex, OpenCode
CLAUDE.md ← Claude Code
.cursorrules ← Cursor (legacy)
.cursor/rules/ ← Cursor (modern)
.github/copilot-instructions.md ← GitHub Copilot
GEMINI.md ← Gemini CLI
.windsurfrules ← Windsurf
Almost the same content. In every file. Maintained separately. Drifting apart.
Every time you update your coding conventions, you update seven files. Every time you add a team member using a different tool, you create another file.
agentsync fixes this.
How it works
Edit one file. Run one command. Every tool gets the right format.
pip install rulesync
rulesync init # sets up .agentsync/rules.md
rulesync sync # generates all rule files
rulesync sync
--------------------------------------------------
canonical: .agentsync/rules.md
created: 7
updated: 0
unchanged: 0
--------------------------------------------------
[+] AGENTS.md
[+] CLAUDE.md
[+] .cursorrules
[+] .cursor/rules/main.mdc
[+] .github/copilot-instructions.md
[+] GEMINI.md
[+] .windsurfrules
Install
pip install rulesync
Zero dependencies. Pure Python 3.10+.
Quick start
# 1. Initialise in your project
cd my-project
rulesync init
# 2. Edit the canonical rules file
nano .agentsync/rules.md # or your editor of choice
# 3. Sync to all tools
rulesync sync
# 4. Check status any time
rulesync status
# 5. Preview changes before writing
rulesync sync --dry-run
Commands
rulesync init # initialise in current project
rulesync sync # sync all tool files from canonical source
rulesync sync --dry-run # preview what would change
rulesync diff # alias for sync --dry-run
rulesync status # check which files are out of sync
rulesync add gemini_md # add a new tool
rulesync remove cursorrules # remove a tool
rulesync list # list all 9 supported tools
rulesync adopt # adopt your existing rules as the canonical source
Supported tools
| Tool | File generated | Notes |
|---|---|---|
agents_md |
AGENTS.md |
Cross-tool standard, Claude Code, Codex, OpenCode |
claude_md |
CLAUDE.md |
Claude Code native format |
cursorrules |
.cursorrules |
Cursor legacy format |
cursor_mdc |
.cursor/rules/main.mdc |
Cursor modern format with YAML frontmatter |
copilot |
.github/copilot-instructions.md |
GitHub Copilot |
gemini_md |
GEMINI.md |
Gemini CLI |
windsurf |
.windsurfrules |
Windsurf |
aider |
.aider.conf.yml |
Aider |
opencode |
AGENTS.md |
OpenCode (uses AGENTS.md) |
Migrating from existing files
Already have a CLAUDE.md or .cursorrules? Use rulesync adopt to import the best existing file as the canonical source:
rulesync init
rulesync adopt # finds the most complete existing rule file and imports it
rulesync sync # regenerate all other files from the canonical source
Python API
from agentsync import AgentSyncer
syncer = AgentSyncer()
report = syncer.sync()
print(report.summary())
# Check status
statuses = syncer.status()
for s in statuses:
print(s["path"], s["status"]) # ok / stale / missing
# Dry run
report = syncer.sync(dry_run=True)
print(f"Would create: {report.created}, update: {report.updated}")
Pre-commit hook
Add to .pre-commit-config.yaml:
- repo: local
hooks:
- id: agentsync
name: agentsync
entry: rulesync sync
language: system
pass_filenames: false
always_run: true
Now every commit automatically regenerates your rule files if the canonical source changed.
CI/CD integration
- name: Check agent rules are in sync
run: |
pip install rulesync
rulesync status
rulesync status exits with code 1 if any files are stale or missing — perfect for PR checks.
The canonical format
.agentsync/rules.md is plain markdown — no special syntax to learn:
# Project Rules
## Stack
- Python 3.11+, FastAPI, PostgreSQL
## Conventions
- Use type hints throughout
- Write docstrings for all public functions
- Follow PEP 8
## Testing
- Run: pytest tests/ -v
- Coverage > 80%
- All new features need tests
## Important constraints
- Never commit secrets or credentials
- Ask before refactoring across multiple files
agentsync translates this into the right format for each tool automatically.
Why not just symlinks?
Symlinks break on Windows, don't survive git clones cleanly, and don't handle format differences between tools — Cursor's .mdc format needs YAML frontmatter, .aider.conf.yml is YAML not markdown. agentsync handles all of that.
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 rulesync-1.0.0.tar.gz.
File metadata
- Download URL: rulesync-1.0.0.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65a79f2d59a15d857a7f5acbf551a5a75cac80c7ccdda8dbfeb7fc4fd898361a
|
|
| MD5 |
0043e6163e8d70ac2851aa23f2c0d1c0
|
|
| BLAKE2b-256 |
317bd3e862e42e123d702a6e34e9c865d5101a424aa942f902eb3249ac57cd80
|
Provenance
The following attestation bundles were made for rulesync-1.0.0.tar.gz:
Publisher:
publish.yml on obielin/agentsync
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rulesync-1.0.0.tar.gz -
Subject digest:
65a79f2d59a15d857a7f5acbf551a5a75cac80c7ccdda8dbfeb7fc4fd898361a - Sigstore transparency entry: 1359939137
- Sigstore integration time:
-
Permalink:
obielin/agentsync@04f9ac8021c83e325d6c54bd571772c27c9819b8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/obielin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@04f9ac8021c83e325d6c54bd571772c27c9819b8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file rulesync-1.0.0-py3-none-any.whl.
File metadata
- Download URL: rulesync-1.0.0-py3-none-any.whl
- Upload date:
- Size: 15.5 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 |
bdc12672df1982926b975be18eb549463bbe5af8872938ac0a0e717c9622a365
|
|
| MD5 |
c9fba02c3ad45d6fe8f48fef981ed7fe
|
|
| BLAKE2b-256 |
5ba406959d994e9bf4220ebb938daee01292af1c16fdad5ed2c119503f3a9c25
|
Provenance
The following attestation bundles were made for rulesync-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on obielin/agentsync
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rulesync-1.0.0-py3-none-any.whl -
Subject digest:
bdc12672df1982926b975be18eb549463bbe5af8872938ac0a0e717c9622a365 - Sigstore transparency entry: 1359939213
- Sigstore integration time:
-
Permalink:
obielin/agentsync@04f9ac8021c83e325d6c54bd571772c27c9819b8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/obielin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@04f9ac8021c83e325d6c54bd571772c27c9819b8 -
Trigger Event:
workflow_dispatch
-
Statement type: