Architecture and sync
One git repo is the source of truth for every skill, subagent, slash command, hook and global instruction. A single script, bin/ai-sync, symlinks the portable parts into Claude Code, Cursor and Copilot and renders the parts whose schema differs per tool from one neutral definition.
- What it is
- A content repo plus a stdlib-only Python sync tool (1,253 lines) that runs import, link, reconcile, render and commit. It is registered as a session-end hook, so it runs on its own every time a chat ends.
- What it isn't
- Not a package manager or a plugin. Nothing is installed into a project; the repo is wired into each tool's user-level directory. It also doesn't make the three tools equivalent: hooks, in particular, reach Claude Code far more completely than the others.
- Why it exists
- Three agent tools each want their own copy of the same instructions in their own directory. Copies drift, and an edit made inside one editor never reaches the others. A symlink makes the editor's directory be the repo.
How it works
The repo holds two kinds of content, and they travel differently. Skills, subagents, commands and hook scripts use the same on-disk format in every tool, so they are symlinked. Hook registration and MCP server config use a different schema in each tool, so they are written once in hooks.def.json and mcp.json and rendered into each tool's own file.
What lands where
| Content | Claude Code | Cursor | Copilot CLI | VS Code Copilot |
|---|---|---|---|---|
| Skills | per-skill links from .agents/skills | per-skill links | reads .agents/skills directly | reads .agents/skills directly |
| Subagents | symlinked dir | symlinked dir | symlinked dir | not from this repo |
| Slash commands | symlinked dir | symlinked dir | no | rendered to .github/prompts/ in configured repos |
| Hook scripts and registration | 28 entries merged into settings.json | 10 entries in hooks.json | 8 entries in hooks/ai-wow.json | none |
| MCP servers | .claude.json | mcp.json | mcp-config.json | user mcp.json, keyed servers |
| Global instructions | CLAUDE.md symlink | no | no | the same CLAUDE.md, once chat.useClaudeMdFile is on |
The hook counts come from the per-tool keys in hooks.def.json: every one of the 28 entries has a Claude Code mapping, 10 have a Cursor mapping and 8 have a Copilot mapping. All the CAM hooks, the worktree-ownership hooks and the lane guards are Claude Code only.
The sync pipeline
- Import. Anything created inside an editor (a new agent, command or hook script) is copied back into the repo first, so nothing is lost when the directory becomes a link.
- Link. Each tool's
agents,commandsandhooksfolders are replaced with symlinks into the repo. Before anything is removed, the script probes once whether the machine allows symlinks; on a locked-down Windows box it falls back to mirroring files, because discovering the denial after deleting the folder would leave the tool empty. - Reconcile skills. Missing per-skill links are added and dangling ones pruned, so Claude Code and Cursor expose the same set.
- Render. Hook registration and MCP config are written into each tool's schema. Claude Code's
settings.jsonis merged, keeping every other setting; the other tools get a dedicated file. Each file is backed up before it changes. - Commit. Only the paths it manages, staged and committed by name, never
git add -A. Then it pushes, unlesslocal.config.jsonsays"push": false.
The commit step is where a shared checkout bites. If another session has been live in the checkout within the last 15 minutes, the commit is skipped and logged, because the managed folders are exactly what a peer editing the harness is dirtying. In hook mode the script never errors: a failed sync must not break the end of a session.
Bundled and installed separately
| Piece | Where it comes from |
|---|---|
14 original skills, 9 subagents, 4 commands, the hooks, taskman, ai-sync | This repo |
tdd, grill-with-docs, playwright-cli | Bundled unmodified from upstream, each with its own licence file |
MCP servers named in mcp.json | The config is rendered; the serena binary is yours to install, and context7 is a remote URL |
| Machine paths, link mode, push setting | local.config.json, gitignored, so the tracked tree points at no particular machine |
The core needs Python 3 and git, with no API keys or database. The board package wants Python 3.12 or later.
Copilot and Windows status
Copilot CLI works, with one known gap. The hooks were verified live against Copilot CLI 1.0.80 on 2026-08-21. Copilot picks its payload contract by the casing of the event name, and the PascalCase names ai-sync renders get the Claude-compatible payload, so the scripts run unchanged: guard-destructive denied a real command there. The one mapping that does nothing is the subagent-start tracker stamp, because Copilot's subagent event carries its own payload with no tool input. Renaming keys can't fix that.
VS Code Copilot gets the content, not the guards. The extension shares the skill folder, reads the global instructions once a setting is on, and picks up commands as prompt files, but nothing reads the CLI's hook files. A capability probe for VS Code's Agent Host hooks exists in hooks/vscode_agent_host/; by design it makes no authorisation decision yet.
Windows works with three preconditions. Developer Mode for symlinks (or copy mode when policy forbids it), the skills link created in PowerShell, and a python3 that resolves from Git Bash, because the hook scripts call it by that exact name. Miss the last one and the hooks silently do nothing.
A one-command Windows Copilot release is planned, not built. The plan is a no-argument install.cmd that installs the shell guards and the single-lane core loop into a user's Copilot directory without admin rights, published to a separate public repo by CI as a pull request. The plan pass finished on 2026-10-05 with ten lane briefs; two of its open questions are answered and no build lane has run. An earlier export of six skills and two agents already sits in that public repo.
AI engineering practices it demonstrates
- Config as code for agents. Instructions, procedures and guards are versioned, reviewed and tested like application code, and every machine runs the same commit.
- One neutral definition rendered into several vendor schemas, so a new tool is a renderer rather than a fork of the content.
- Capability probing before destructive steps, and a copy-mode fallback for locked-down machines.
- Verified-live claims. The Copilot compatibility note in
hooks.def.jsonrecords the CLI version and the date it was checked against, and which mapping failed. - Self-checking docs: a repo-shape test fails when the inventory counts in the README stop matching what is on disk.
Limits
The sync commits and pushes without asking. Path scoping and the peer check narrow the blast radius, but a peer idle for more than 15 minutes counts as gone, so a session-end sync can still sweep that peer's half-finished managed files into an unexplained sync: commit.
- The guarantees are uneven across tools. Claude Code gets all 28 hooks; Cursor 10; Copilot CLI 8; VS Code Copilot none. Whether Cursor runs its shell hooks for subagent calls at all is unverified.
- The skills link is a silent failure point: skip it and you get zero skills and no error.
- In copy mode, skill edits made inside an editor are not imported back. The repo has to be the place you edit.
- The README still says
mcp.jsonships empty; it now names two servers. Docs drift, and only some of it is under test. - Twelve hooks are a six-line shell shim whose only job is to
exec python3on the real script, which doubles the files to review and is why a Windows machine needspython3on the Git Bash path.
Roadmap
| Item | Why it matters | Status |
|---|---|---|
| Never commit from the session-end hook | Hook mode would render links, hooks and MCP only; a manual run keeps the commit | correctness |
| Windows VS Code Copilot release 1 | One no-argument install of the guards and the core loop, published by CI as a pull request | planned |
| Verify Cursor hooks inside subagents | Decides whether Cursor lanes run guarded at all | backlog · high |
Render the hook async flag | The live settings already lost one hook's async setting | backlog |
| Render Python hooks directly | Drop the shell shims and share one payload adapter across hooks | candidate |
| One instructions file for all three tools | AGENTS.md, read beside CLAUDE.md, could replace per-tool instruction files | consider |
Sources
bin/ai-sync:LINK_DIRS,COPILOT_LINK_DIRS,LINK_FILES,can_symlink,do_render_hooks,do_render_mcp,do_render_copilot_workspace,commit_skip_reason(PEER_LIVE_SECONDS = 15 * 60),sync.hooks.def.json: the 28 registrations, their per-tool keys and the Copilot compatibility note.mcp.json: the two servers.README.md: inventory, install, licences.human-playbook.md§3 and appendices A and B: delivery mechanisms, VS Code, copy mode, Windows.hooks/vscode_agent_host/: the Agent Host probe and release guard.docs/plans/public-core-release/plan.md: release 1 scope and progress (status only).- Task board: open items for hook-mode commits, Cursor subagent hooks, the async flag, shim removal and
AGENTS.md.