Shared Agents

sa sync · pull team repo

Adapters

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.

CommandPurpose
sa installConfigure detected tools (first time or new tool)
sa syncRefresh symlinks and AGENTS.md / CLAUDE.md blocks
sa checkInstalled vs configured matrix
sa doctor --fixRepair broken rule symlinks

Installedconfigured. sa install only touches tools detected as installed.


Supported tools

ToolAdapter IDRules deliveryDetails
Cursor IDEcursor~/.cursor/rules/ symlinkscursor/README
Claude Codeclaude-code~/.claude/CLAUDE.md markerclaude-code/README
Zedzed~/.config/zed/AGENTS.mdzed/README
OpenAI Codex CLIcodex~/.codex/AGENTS.mdcodex/README
OpenCodeopencode~/.config/opencode/AGENTS.mdopencode/README
Gemini CLIgemini~/.gemini/GEMINI.mdgemini/README
Windsurfwindsurf~/.codeium/windsurf/AGENTS.mdwindsurf/README
Continue.devcontinue~/.continue/AGENTS.mdcontinue/README
GitHub CopilotcopilotCopilot AGENTS.md pathscopilot/README
Aideraider~/.aider/AGENTS.mdaider/README
OpenClaw / headlessopenclawReads $SHARED_AGENTS_HOMEopenclaw/README
Generic / manualgenericCopy-paste instructionsgeneric/README

What sa sync does per tool

  1. Skill symlinks — Core + team skills → ~/.agents/skills, ~/.claude/skills, etc.
  2. Cursor rule symlinks — Core + team .mdc~/.cursor/rules/
  3. 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: sessionStartshared-agents-sync.sh
  • Rules: symlinked .mdc files
  • If a rule path is a regular file, sa doctor --fix backs 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)

  1. Add entry to adapters/manifest.json (detect, detect_bins, agents_md, sync, …)
  2. Add adapters/<tool-id>/README.md
  3. Run sa install --dry-run, sa install, sa check
  4. Open a PR with sample sa check output

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.


See also