One source of truth for all your AI coding agents.
Write your project rules once in AGENTS.md, and agentsync mirrors them to every tool — Claude Code, Cursor, Windsurf, GitHub Copilot, Cline, Aider, and Gemini CLI. No more keeping six near-identical instruction files in sync by hand.
You use more than one AI coding tool. Each wants its own rules file:
| Tool | File it reads |
|---|---|
| Claude Code | CLAUDE.md |
| Cursor | .cursor/rules/*.mdc |
| Windsurf | .windsurfrules |
| GitHub Copilot | .github/copilot-instructions.md |
| Cline | .clinerules |
| Aider | CONVENTIONS.md |
| Gemini CLI | GEMINI.md |
Update your conventions once and you have to copy-paste into all of them. They drift. Some get stale. New teammates' tools get the wrong rules.
npx @keradd/agentsync init # creates AGENTS.md + agentsync.json
npx @keradd/agentsync sync # generates every tool file from AGENTS.mdNow AGENTS.md is the single source. Edit it, run sync, done. Every generated file carries a banner so nobody edits the wrong one by accident.
Run it on demand with npx @keradd/agentsync …, or install globally:
npm install -g @keradd/agentsync| Command | What it does |
|---|---|
agentsync init |
Scaffold AGENTS.md and agentsync.json. |
agentsync sync |
Generate every enabled target file from the source. |
agentsync check |
Verify all targets are in sync — exits 1 if not. Great for CI. |
agentsync list |
Show every supported target. |
| Flag | Applies to | Effect |
|---|---|---|
--dry-run |
sync |
Preview changes without writing. |
--force |
init |
Overwrite existing files. |
--cwd <dir> |
all | Run against another directory. |
-h, --help |
— | Show help. |
-v, --version |
— | Show version. |
agentsync.json is optional — without it, every target is generated from AGENTS.md. To customize:
{
"source": "AGENTS.md",
"targets": ["claude", "cursor", "copilot"]
}source— the canonical file you edit. DefaultAGENTS.md.targets— which tools to generate. Default: all. Runagentsync listfor ids.
Add a check so a stale rules file can never be merged:
# .github/workflows/agents.yml
name: agents
on: [push, pull_request]
jobs:
agentsync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 20 }
- run: npx @keradd/agentsync checkIf someone edits AGENTS.md without running sync, CI fails with a clear list of what's stale.
agentsync reads your source file and renders one output per target, each with a managed banner header. For Cursor it emits a proper .mdc rule with frontmatter; everything else is plain markdown. Generation is deterministic and idempotent — running sync twice changes nothing the second time, which is exactly what makes check reliable.
The codebase keeps pure logic (src/core.js, src/targets.js) separate from filesystem side-effects (src/fs.js), so behavior is easy to test and easy to extend.
Open src/targets.js and add one adapter:
{
id: "mytool",
label: "My Tool",
path: ".mytoolrules",
render: md, // or a custom (source, body) => string
}Add a test, run npm test, send a PR. See CONTRIBUTING.md.
npm install
npm test # node:test — unit + end-to-end CLI tests
npm start # run the CLI locallyMIT © Keradd