diff --git a/README.md b/README.md index 66e87c8..9f620e4 100644 --- a/README.md +++ b/README.md @@ -1,479 +1,108 @@ # sync-agents -One set of agent rules to rule them all. `sync-agents` keeps your AI coding agent configurations in a single `.agents/` directory and syncs them to agent-specific directories (`.claude/`, `.windsurf/`, `.cursor/`, `.github/copilot/`) via symlinks. This ensures all agents follow the same rules, skills, workflows, subagents, plans, and specs without duplicating files. +**One `.agents/` directory. Every AI coding assistant. Always in sync.** -AGENTS.md serves as an auto-generated index of everything in `.agents/` and is symlinked to CLAUDE.md for Claude compatibility. +`sync-agents` is a package manager and sync engine for AI-agent context — the rules, skills, workflows, subagents, plans, specs, and ADRs you feed to Claude, Cursor, Windsurf, and Copilot. Write everything once in `.agents/`, and `sync-agents` fans it out to every tool via symlinks, keeps an `AGENTS.md` index current, and lets you pull shared context from other repos as safely and reproducibly as you'd install an npm package. -## Installation +## Why you want this -### npm (recommended for Node.js projects) +If you use more than one AI coding tool — or more than one repo — you already know the pain: the same rules copy-pasted into `.claude/`, `.cursor/`, `.windsurf/`, and `.github/copilot/`, drifting apart the moment you edit one of them. Team conventions living in a wiki nobody's agent reads. A "cool skill" pasted from the internet with zero review of what it actually tells your agent to do. -Ships native Go binaries via per-platform optional packages — no build step required. +`sync-agents` fixes all three: -```bash -npm install -g @brickhouse-tech/sync-agents -``` - -Or as a project devDependency: - -```bash -npm install --save-dev @brickhouse-tech/sync-agents -``` - -### go install (no Node.js required) - -```bash -go install github.com/brickhouse-tech/sync-agents@latest -``` - -Requires Go 1.21+. The binary is placed in `$GOPATH/bin` (or `$HOME/go/bin`). Version is read from the module proxy at install time via `debug.ReadBuildInfo`. - -### Homebrew - -```bash -brew install brickhouse-tech/tap/sync-agents -``` - -The tap is updated automatically on every release via GoReleaser. - -### GitHub Releases (pre-built binaries) - -Download the archive for your platform from the [Releases page](https://github.com/brickhouse-tech/sync-agents/releases), extract, and place the binary on your `PATH`: - -```bash -# Example: macOS arm64 -curl -fsSL https://github.com/brickhouse-tech/sync-agents/releases/latest/download/sync-agents_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/').tar.gz | tar -xz -sudo mv sync-agents /usr/local/bin/ -``` - -SHA-256 checksums are published alongside each release as `checksums.txt`. - -## Topology - -`.agents/` is the source of truth. It contains all rules, skills, workflows, and state for your agents: - -``` -.agents/ - ├── config # sync targets (claude, windsurf, cursor, copilot) - ├── rules/ - │ ├── rule1.md - │ ├── rule2.md - │ └── ... - ├── skills/ - │ ├── skill1/ - │ │ └── SKILL.md - │ ├── skill2/ - │ │ └── SKILL.md - │ └── ... - ├── workflows/ - │ ├── workflow1.md - │ ├── workflow2.md - │ └── ... - ├── agents/ # optional: Claude subagent definitions - │ └── reviewer.md - ├── plans/ # optional: per-effort implementation plans (how/when) - │ └── auth-effort/ - │ └── rollout.md - ├── specs/ # optional: durable design/requirements docs (what/why) - │ └── SPEC-001.md - ├── adrs/ # optional: Architecture Decision Records, status = subdirectory - │ ├── proposed/ - │ │ └── adopt-grpc.md - │ ├── accepted/ - │ │ └── use-postgres.md - │ └── denied/ # kept but never indexed — prevents re-proposing rejected decisions - │ └── use-mongo.md - └── STATE.md -``` - -> **Note:** Skills use a directory layout (`skills/name/SKILL.md`) rather than flat files. This allows skills to include supporting files alongside their definition. The `fix` command can convert legacy flat skill files to the directory layout automatically. - -> **Optional buckets:** `agents/`, `plans/`, `specs/`, `hooks/`, and `adrs/` activate only when their directory exists — `init` does not create them, `add agent|plan|spec|hook|adr ` does. They sync to Claude only (`.claude/agents`, `.claude/plans`, `.claude/specs`); other tools consume plans/specs through the `AGENTS.md` index and have no subagent surface. `plans/` and `specs/` share plumbing but differ in lifecycle: specs are durable what/why documents, plans are per-effort how/when documents that retire when the effort lands. - -Running `sync-agents sync` creates symlinks from `.agents/` subdirectories into `.claude/`, `.windsurf/`, `.cursor/`, and `.github/copilot/`. Any changes to `.agents/` are automatically reflected in the target directories because they are symlinks, not copies. - -AGENTS.md is also symlinked to CLAUDE.md so that Claude reads the index natively. - -## STATE.md - -`.agents/STATE.md` tracks the current state of your project from the agent's perspective. It serves as a resumption point after failures or interruptions -- the agent can read STATE.md to determine where it left off and what tasks remain. Update it regularly to keep agents in sync with progress. - -## Commands - -| Command | Description | -|---|---| -| `init` | Initialize the `.agents/` directory structure with `rules/`, `skills/`, `workflows/`, `STATE.md`, and generate `AGENTS.md` | -| `sync` | Create symlinks from `.agents/` into all target directories, and symlink `AGENTS.md` to `CLAUDE.md` | -| `watch` | Watch `.agents/` for changes and auto-regenerate `AGENTS.md` | -| `import ` | Import a rule/skill/workflow from a URL | -| `pull [--dry-run\|--offline\|--force\|--only NAME\|--global]` | Fetch every `sources.yaml` entry, verify integrity, install into the matching buckets | -| `update [NAME]` | Re-resolve refs and re-pull entries whose upstream moved; SHA-pinned entries are skipped | -| `source add ` | Append an entry to `sources.yaml` and pull it | -| `source add --link[=] []` | Declare a **linked (editable)** source — symlink a live local checkout instead of a fetched snapshot (SPEC-007) | -| `source remove [--keep]` | Remove the manifest entry and delete the artifact (`--keep` converts it to manual) | -| `source list [--json]` | Show each entry's local state: `ok` / `outdated` / `modified` / `missing` / `linked` | -| `source bundle` | Rebuild `sources.yaml` from installed artifacts' origin metadata | -| `source detach ` | Un-manage an artifact: flip its origin to manual and drop the manifest entry (for a **linked** source, freeze the live copy into a vendored snapshot) | -| `quarantine` | List remotely-fetched artifacts awaiting review, with their scan findings | -| `approve \|--all [--force]` | Promote a quarantined artifact into `.agents/` (`--force` accepts critical findings, recorded in the lock) | -| `reject \|--all` | Delete a quarantined artifact without installing it | -| `git-hook` | Install a pre-commit git hook for auto-sync (`hook` remains as a deprecated alias) | -| `inherit