From chezmoi
Help resolve differences between chezmoi-managed dotfiles and local files. Use this skill whenever the user mentions chezmoi, dotfiles sync, chezmoi update, chezmoi apply, chezmoi diff, or wants to compare/resolve their chezmoi source files with local destination files. Also trigger when the user wants to understand what changed in their dotfiles, which direction changes should flow (source→local or local→source), or needs help interpreting chezmoi file naming conventions (dot_, executable_, .tmpl, symlink_, etc.).
How this skill is triggered — by the user, by Claude, or both
Slash command
/chezmoi:chezmoi-diffThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Help the user understand and resolve differences between their chezmoi source directory
Help the user understand and resolve differences between their chezmoi source directory
and local destination files. The goal is to make chezmoi diff output actionable by
walking through changes and deciding what to do with each one.
Chezmoi manages dotfiles by keeping a "source of truth" copy in a source directory
(typically ~/.local/share/chezmoi/) and applying those files to the home directory.
When the source and destination diverge, the user needs to decide which version to keep.
Two directions of sync:
chezmoi apply): Overwrite local files with chezmoi source versionschezmoi add): Copy local file changes back into chezmoi sourceThe source directory uses special filename prefixes (dot_, executable_, symlink_, etc.)
and suffixes (.tmpl for templates).
Run chezmoi status first for a quick overview of which files changed and the type of change
(M=modified, A=added, D=deleted). Then run chezmoi diff for the full unified diff output.
If both produce no output, tell the user everything is in sync and stop.
Show a table of all changed files with:
~/.gitconfig).tmpl suffix in source) — templates are important
because the source will contain Go template syntax while the destination has rendered valuesExample format:
| # | File | Template | Changes |
|---|------------------------------|----------|----------------|
| 1 | ~/.config/powershell/profile | no | +3 -1 lines |
| 2 | ~/.gitconfig | yes | +5 -2 lines |
| 3 | ~/.claude/settings.json | yes | +1 -2 lines |
For each changed file, show the diff and explain what's different in plain language. If the user chooses Edit / merge, handle it inline right then — read both versions, suggest a merged result, write it to the right location — before moving on to the next file.
For template files (.tmpl):
{{ .chezmoi.hostname }}.
These are not real differences — they render to concrete values on apply.chezmoi cat <destination-path> to get the rendered version of the source template.{{ if eq .chezmoi.hostname "myhost" }}.
These mean the rendered output differs per machine. Explain which branch applies to the
current machine and what values other machines would get — this helps the user understand
whether a diff is machine-specific or a real change they made locally.Reading the diff correctly:
chezmoi diff outputs a unified diff where --- is the local destination (current file on disk) and +++ is what chezmoi would write (from the source).
- exist locally but not in the chezmoi source+ exist in the chezmoi source but not locallySo if X appears on a - line, your local file has X and the chezmoi source doesn't.
Always phrase the explanation from the local file's perspective: "your local file has X / is missing Y".
For regular files:
For each file, use the AskUserQuestion tool to present the decision as a single-select question:
settings.json)What do you want to do with ~/.claude/settings.json?Process files one at a time — show the diff explanation, then immediately present the
AskUserQuestion for that file before moving on to the next.
After all files have been decided, execute the Apply and Copy actions in batch:
chezmoi apply --force <destination-path>chezmoi add --force <destination-path> — for executable files (.sh, .ps1, etc.)
that need the executable_ prefix in the source, run chezmoi chattr +x <destination-path> after addingchezmoi add — it would overwrite the source .tmpl file with
a plain copy of the rendered destination, stripping all template directives and breaking the template.
Instead, use chezmoi source-path <destination-path> to find the source file, then manually
edit it to incorporate the local changes while preserving all {{ }} template expressions.
Show the user a diff of what you plan to write, and ask for confirmation before writing.Confirm the full batch with the user before executing any writes.
After all apply/copy actions are executed, check the chezmoi source directory for uncommitted git changes:
chezmoi source-path (no arguments).git status in that directory to check for uncommitted changes.AskUserQuestion to offer:
git add, create a commit with a message like
chezmoi: sync <list of dotfiles changed>, and push if requested.Note: git push is intentionally excluded from allowed-tools so the user always gets a manual
confirmation prompt before pushing to remote.
chezmoi source-path to find the source directory — don't hardcode it.chezmoi cat <path> to render templates for comparison, not raw file reads of .tmpl files.chezmoi target-path <source-path> or chezmoi source-path <target-path> to map between paths.windows/ subfolder as the root)
based on the sourceDir config. Respect whatever chezmoi source-path returns.chezmoi merge <path> opens the user's configured merge tool — mention
this as an option if the user prefers a visual merge tool over inline editing.npx claudepluginhub lucaspimentel/claude-plugins --plugin chezmoiAnalyzes local modifications in Memory Bank files: computes MD5 hashes, detects new/ modified files, classifies changes like new sections or added lines, and provides merge strategies.
Review diffs and files with inline annotations in a terminal TUI overlay. Works with git, hg, and jj repos. Also answers usage and configuration questions.
Displays git diffs with syntax highlighting, split view, and word-level diff in terminal UI or web preview. Supports watching changes, filtering files, comparing branches, and AI-powered code review explanations.