/agent-skills:chezmoi-difffrom agent-skills
Help resolve differences between chezmoi-managed dotfiles and local files, including which direction changes should flow and what the chezmoi file naming conventions (dot_, executable_, .tmpl, symlink_, etc.) mean.
Ships in agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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). For the full prefix/suffix table, ordering rules and
source-to-destination examples, see reference.md.
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.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
20 skills in this plugin
/address-pr-commentsInteractively walk through and address PR review comments one at a time, asking the user what to do for each, committing after each code change, and optionally replying on GitHub. Accepts an optional PR number argument; defaults to the current branch's PR./add-todoCreate or append tasks to TODO.md in the current working directory. Not appropriate for reading, viewing, checking off, removing, or reorganizing TODO.md./diagnosing-bugsDiagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow./git-clean-worktreesRemove already-preserved linked worktrees and local branches from one repository, only through an explicit plan the user approves by digest./git-commitCommit pending changes to git, optionally pushing after. Use when the user says 'commit', 'commit my changes', 'commit all', 'commit everything', 'save my work to git', 'stage and commit', or any variation of wanting to create a git commit. Accepts an optional 'push' keyword to push after committing, and optionally specific file names or a description of what to commit./grill-meA relentless interview about a design that continues until no ambiguities remain. Use when the user asks to be grilled, or when a plan, architecture, API, or design should be stress-tested with questions before implementation.npx claudepluginhub lucaspimentel/agent-skills --plugin agent-skills