Adapters
Adapters wire Shared Agents into each AI tool: session hooks, skill symlinks, rule symlinks, and merged instruction files.
Configuration is driven by adapters/manifest.json.
| Command | Purpose |
|---|---|
sa install | Configure detected tools (first time or new tool) |
sa sync | Refresh symlinks and AGENTS.md / CLAUDE.md blocks |
sa check | Installed vs configured matrix |
sa doctor --fix | Repair broken rule symlinks |
Installed ≠ configured. sa install only touches tools detected as installed.
Supported tools
| Tool | Adapter ID | Rules delivery | Details |
|---|---|---|---|
| Cursor IDE | cursor | ~/.cursor/rules/ symlinks | cursor/README |
| Claude Code | claude-code | ~/.claude/CLAUDE.md marker | claude-code/README |
| Zed | zed | ~/.config/zed/AGENTS.md | zed/README |
| OpenAI Codex CLI | codex | ~/.codex/AGENTS.md | codex/README |
| OpenCode | opencode | ~/.config/opencode/AGENTS.md | opencode/README |
| Gemini CLI | gemini | ~/.gemini/GEMINI.md | gemini/README |
| Windsurf | windsurf | ~/.codeium/windsurf/AGENTS.md | windsurf/README |
| Continue.dev | continue | ~/.continue/AGENTS.md | continue/README |
| GitHub Copilot | copilot | Copilot AGENTS.md paths | copilot/README |
| Aider | aider | ~/.aider/AGENTS.md | aider/README |
| OpenClaw / headless | openclaw | Reads $SHARED_AGENTS_HOME | openclaw/README |
| Generic / manual | generic | Copy-paste instructions | generic/README |
What sa sync does per tool
- Skill symlinks — Core + team skills →
~/.agents/skills,~/.claude/skills, etc. - Cursor rule symlinks — Core + team
.mdc→~/.cursor/rules/ - Team-rules blocks — Injected between markers in each tool’s global agents file
Session hooks (where configured) run sa sync quietly at session start.
Cursor
- Hook:
sessionStart→shared-agents-sync.sh - Rules: symlinked
.mdcfiles - If a rule path is a regular file,
sa doctor --fixbacks it up and relinks
Claude Code, Zed, Codex, …
- Merged blocks in
CLAUDE.md/AGENTS.md/GEMINI.md - Base block:
<!-- shared-agents:begin -->(sync + learnings hints) - Team rules block:
<!-- shared-agents:team-rules:begin/end -->
Zed has no session hook — agents should run sync as an early step when needed.
Adding a new tool (contributors)
- Add entry to
adapters/manifest.json(detect,detect_bins,agents_md,sync, …) - Add
adapters/<tool-id>/README.md - Run
sa install --dry-run,sa install,sa check - Open a PR with sample
sa checkoutput
See Contributing.
Generic fallback
If your CLI is not in the manifest, copy adapters/generic/instructions.md into your global agent config and set $SHARED_AGENTS_HOME.