Sync Command
Overview
Sync a command from this repository by making ~/.claude/commands/<command>.md a symlink to the repo command file, then making ~/.agents/commands/<command>.md point at the Claude command path.
Codex does not discover slash commands from ~/.codex/commands in this setup. For Codex, the syncer ensures there is a repo-backed skill at skills/<command>/ and makes ~/.codex/skills/<command> point at that skill. If skills/<command>/SKILL.md already exists, preserve it and only refresh the command reference/link.
Use the bundled script for the filesystem changes so repeated syncs update links consistently.
Workflow
- Identify the repo command name or path. Prefer a command name when the source is
commands/<name>.md. - Inspect the source command and confirm the file exists.
- Run the syncer:
python3 <this-skill-dir>/scripts/sync_command.py <command-name>
Example from this repo:
python3 skills/sync-command/scripts/sync_command.py doc-update
- Verify the output shows all three managed links:
~/.claude/commands/<command>.md-> repo command file~/.agents/commands/<command>.md->~/.claude/commands/<command>.md~/.codex/skills/<command>-> repo skill directory
- Verify the repo skill state:
- If
skills/<command>/SKILL.mdwas missing, it was created as a command-backed wrapper. skills/<command>/references/command.mdpoints at the source command file.
- If
- Tell the user the command is available as
/<command>for command-aware agents and as$<command>in Codex after restarting the relevant agent app.
Existing Commands
The syncer replaces whatever is already at the destination:
- Missing links are created.
- Existing symlinks are replaced when they point somewhere else.
- Existing real files are removed and replaced with the symlink.
For Codex skill wrappers:
- Missing
skills/<command>/SKILL.mdfiles are created. - Existing
skills/<command>/SKILL.mdfiles are preserved. skills/<command>/references/command.mdis refreshed to point at the source command file.
Options
Use --dry-run to preview changes without writing symlinks:
python3 skills/sync-command/scripts/sync_command.py doc-update --dry-run
Use --repo-root <path> when running from outside this repository and passing a command name.
Use --codex-skills-dir <path> only when explicitly asked to install Codex skills outside ~/.codex/skills.
Only override the destination directories when the user explicitly asks for non-default install roots.