Metadata-Version: 2.4
Name: mujin-agentsync
Version: 0.2.0
Summary: Keep AI-agent instruction files (CLAUDE.md, AGENTS.md, Cursor rules, Copilot) in sync from one source of truth, with a CI drift check.
Project-URL: Homepage, https://github.com/mujinlabs/agentsync
Project-URL: Issues, https://github.com/mujinlabs/agentsync/issues
Author: Mujin Labs
License: MIT
License-File: LICENSE
Keywords: agents-md,ai-agents,ci,claude-code,config,copilot,cursor,mcp
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# agentsync

**One source of truth for your AI-agent instructions. Stop hand-syncing `CLAUDE.md`, `AGENTS.md`, Cursor rules, and Copilot instructions — and fail CI when they drift.**

Every coding agent wants its own file: `CLAUDE.md`, `AGENTS.md`, `.cursor/rules/*.mdc`,
`.github/copilot-instructions.md`. Teams keep duplicate copies that silently diverge —
[the most-requested gap in the ecosystem](https://github.com/anthropics/claude-code/issues/6235).
`agentsync` generates them all from one source and gives you a CI check that fails the
build the moment they fall out of sync.

```bash
pipx install mujin-agentsync     # command: agentsync

agentsync sync     # AGENTS.md -> CLAUDE.md (zero config), or per .agentsync.json
agentsync check    # exit 1 if any generated file has drifted (drop into CI)
```

## Zero config

If you have an `AGENTS.md` (or `CLAUDE.md`), `agentsync sync` mirrors it to the other one.
That's the whole "Claude Code won't read my AGENTS.md" problem solved in one command.

## Find what you already have — `discover`

Not sure which agent-config files are scattered around your repo? Let agentsync find them:

```bash
agentsync discover            # scan the project tree
agentsync discover --global   # also check ~/.claude, ~/.codex, …
```

```
found 5 agent-config file(s):
  AGENTS.md                          AGENTS.md standard (Codex, Gemini, Cursor, Zed, …)
  CLAUDE.md                          Claude Code
  .cursor/rules/main.mdc             Cursor
  .github/copilot-instructions.md    GitHub Copilot
  packages/api/CLAUDE.md             Claude Code
```

It recognizes `CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, Cursor `.mdc` rules, Copilot
instructions, and legacy `.cursorrules`/`.clinerules`/`.windsurfrules` — and skips
`node_modules`, `.git`, etc. (Pattern-based on your project tree, not a full-disk crawl.)

## Choose your source of truth

You decide which file is canonical. Precedence: `--source` flag › `source` in
`.agentsync.json` › auto (first of `AGENTS.md`, `CLAUDE.md`).

```bash
agentsync sync --source CLAUDE.md     # make CLAUDE.md the source, generate the rest
```

## More targets — `.agentsync.json`

```json
{
  "source": "AGENTS.md",
  "targets": [
    { "path": "CLAUDE.md", "format": "markdown" },
    { "path": ".github/copilot-instructions.md", "format": "markdown" },
    { "path": ".cursor/rules/agents.mdc", "format": "cursor" }
  ]
}
```

`agentsync init` writes a starter config. `cursor` targets get the right `.mdc` frontmatter
(`alwaysApply: true`); `markdown` targets are mirrored with a "generated — don't edit" header.

## CI drift gate

```yaml
# .github/workflows/agent-config.yml
jobs:
  agentsync:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with: { python-version: "3.11" }
      - run: pipx install mujin-agentsync
      - run: agentsync check     # fails the build if a generated file was hand-edited
```

Now nobody can quietly edit `CLAUDE.md` and let `AGENTS.md` rot — the source stays canonical.

## Why this design

- **Deterministic.** Targets are reproducible from the source, so `check` is exact — no
  guessing, no LLM, no network. Zero dependencies (Python ≥3.9).
- **Source-first.** You pick the one file you actually maintain; everything else is generated.
- Local and offline — it reads and writes files, nothing else.

## Next to this

Once your agent config is consistent, audit it for security & quality with
[**agentaudit**](https://github.com/mujinlabs/agentaudit) (`pipx install mujin-agentaudit`) —
it flags `curl|bash`, secret access, prompt injection, and more in skills / MCP servers / plugins.

---

Built by **[Mujin Labs](https://github.com/mujinlabs)** — tooling for the autonomous-agent era. MIT.
