How this skill is triggered — by the user, by Claude, or both
Slash command
/sync:dotfilesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Sync the user's modified dotfiles to the remote repository using chezmoi. The
Sync the user's modified dotfiles to the remote repository using chezmoi. The
user's chezmoi configuration is set up with git.autoCommit and git.autoPush
enabled, so chezmoi will automatically commit and push changes after each sync
operation.
Follow these steps carefully:
Run chezmoi status and interpret the two-column output for the user:
| Status | Meaning | Action needed |
|---|---|---|
M | Home dir changed, source unchanged | Sync home → source |
M | Source changed, home unchanged | Apply source → home |
MM | Both changed | Conflict — ask user which wins |
If no files are modified, inform the user that the repository is already synced and stop.
Run chezmoi diff to display what changed. Note that the diff shows:
Ask the user if they want to proceed with syncing these changes. For any MM
(conflict) files, ask explicitly: should the source win or the home
directory win?
For each modified file, select the appropriate command based on its source
attributes. Use chezmoi source-path <file> to get the source filename, then
inspect it:
| File attributes | Command |
|---|---|
| Non-template, not encrypted | chezmoi re-add <file> |
Non-template, encrypted (source starts with encrypted_) | chezmoi re-add <file> |
Template (source ends in .tmpl), not encrypted | chezmoi add --template <file> |
| Template, encrypted | chezmoi add --template --encrypt <file> |
For MM conflict files:
chezmoi apply --force <file>add command from the table aboveRun chezmoi status again after syncing. If any files are still listed as
modified, chezmoi re-add likely silently skipped a template file — re-run
using chezmoi add --template <file> for those files.
Once status is clean, confirm to the user that the sync completed successfully.
Silent no-op (status still dirty after re-add): The file is a template that
re-add skipped without warning. Use chezmoi add --template <file> instead.
TTY error on MM files: chezmoi apply on a conflicted file tries to open
an interactive merge. If you see could not open a new TTY, use
chezmoi apply --force <file> instead.
Network/auth errors: Check:
~/.config/chezmoi/chezmoi.tomlThese files are templates and must always be synced with chezmoi add --template <file>.
Do not use chezmoi re-add for these files — it will silently do nothing.
| Home path | Source path |
|---|---|
~/.gitconfig | dot_gitconfig.tmpl |
~/.lein/profiles.clj | dot_lein/symlink_profiles.clj.tmpl |
~/.config/fish/config.fish | private_dot_config/private_fish/config.fish.tmpl |
~/.config/fish/fish_variables | private_dot_config/private_fish/fish_variables.tmpl |
~/.config/homebrew/Brewfile | private_dot_config/homebrew/Brewfile.tmpl |
~/.config/jj/config.toml | private_dot_config/private_jj/config.toml.tmpl |
To rediscover this list at any time: find ~/.local/share/chezmoi -name "*.tmpl"
chezmoi re-add silently skips template files (.tmpl) — always verify
status is clean after running itchezmoi re-add preserves encryption attributes automatically; chezmoi add
requires --encrypt to be passed explicitlynpx claudepluginhub christianromney/claude-plugins --plugin syncCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.