sync-agent-rules
Installation
SKILL.md
sync-agent-rules
Keeps the user-level agent instructions in sync with a remote git repo that stores one canonical copy. There is a single source of truth locally too:
~/AGENTS.md— the full canonical instructions (the only file that is synced)~/.claude/CLAUDE.md— a one-line stub@~/AGENTS.mdthat imports it, so Claude Code loads the same rules without keeping a duplicate copy
The repo (any git repo, e.g. a Gitea/GitHub repo like …/you/AGENTS) holds a single file.
Pull overwrites ~/AGENTS.md with it (backing it up first) and (re)writes the CLAUDE.md
stub. Push sends ~/AGENTS.md up and refuses to silently clobber remote changes.
The
@~/AGENTS.mdstub uses an absolute path on purpose: Claude Code resolves@-imports relative to the importing file, so a bare@AGENTS.mdinside~/.claude/CLAUDE.mdwould look for~/.claude/AGENTS.md(wrong file).initandpullmanage this stub for you — you don't edit it by hand.