chezmoi
Skill1 starsChanged 7 months agoApache-2.0View on GitHub
This skill should be used when the user asks to "check dotfiles", "update dotfiles", "chezmoi status", "find new config", "discover config", "dotfile health check", "chezmoi doctor", "what config files changed", "add config to chezmoi", "sync dotfiles", "manage dotfiles", "dotfile drift", or says /chezmoi. It detects drift in managed dotfiles, discovers unmanaged config files worth tracking, and runs health checks on the chezmoi setup. Supports 1Password template scaffolding for sensitive files.
- Commits and pushes
5 other projects use a version of this.
Adopted by
Most recently taken up by
- fmind/dottheir own version, first seen Nov 8, 2026
- fmind/dotfilestheir own version, first seen Nov 8, 2026
- es6kr/skillstheir own version, first seen Oct 13, 2026
- iiiburnyiii/agent-skillstheir own version, first seen May 14, 2026
- cosgroveb/chezmoi-skilltheir own version, first seen Jan 27, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- fmind/dot★ 13same name
- fmind/dotfiles★ 13same name
- cosgroveb/chezmoi-skill★ 2same name
- es6kr/skills★ 2same name
- iiiburnyiii/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
33 rules. About 0 are common, 15 are distinctive, and 18 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
18
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
doctor: Run health checks on the chezmoi setup - Distinctive: line 40
When invoked without arguments, present this overview and ask which subcommand to run:
- Distinctive: line 59
Use AskUserQuestion to let the user pick a subcommand.
- Distinctive: line 69
Before adding any file, scan it for secrets.
- Distinctive: line 85
If no secrets are detected, proceed directly to Step 3 (Git Pipeline).
- Distinctive: line 89
When secrets are detected, use AskUserQuestion to ask the user:
- Distinctive: line 103
Read the file content
- Distinctive: line 107
Ask the user to:
- Distinctive: line 110
Update the template with the real URIs
- Very specific: line 112
Run chezmoi source-path to find the source directory
- Distinctive: line 114
Look at existing files in the source directory for naming convention reference
- Distinctive: line 115
Write the template file to the source directory using Write
- Distinctive: line 123
Wait for the user to provide the UUID
- Very specific: line 124
Create the template content: {{- onepasswordDocument "<UUID>" }}
- Distinctive: line 140
Run all git operations via Bash using chezmoi's native git integration:
- Distinctive: line 157
Detect drift: Run via Bash:
- Distinctive: line 163
Handle empty results: If no output, report "All managed files are in sync" and stop.
- Distinctive: line 196
Handle empty results: If no output, report "No unmanaged config files found (after applying exclusion filters)" and stop.
- Very specific: line 251
If verify found drift → suggest /chezmoi status
- Very specific: line 252
If source repo has uncommitted changes → suggest chezmoi git -- add .
- Very specific: line 253
If local is ahead of remote → suggest chezmoi git -- push
- Very specific: line 254
If local is behind remote → suggest chezmoi update
- Very specific: line 255
If 1Password is not authenticated → suggest eval $(op signin)
- Very specific: line 262
chezmoi not installed: Check with command -v chezmoi before any operation.
- Very specific: line 263
Not initialized: If chezmoi status fails, suggest chezmoi init.
- Very specific: line 264
1Password CLI not installed: If op is not found, skip 1Password checks in doctor and skip sensitivity Option 1/2 in the Add Workflow (fall …
- Very specific: line 265
filter-unmanaged.sh not found: If scripts/filter-unmanaged.sh can't be located, report the error and suggest reinstalling the skill.
- Very specific: line 266
Skill directory is read-only: If Edit fails on references/excludes.local.yaml, copy it to ~/.config/chezmoi/excludes.local.yaml and use …
- Very specific: line 269
Empty chezmoi source directory: If chezmoi source-path fails, suggest chezmoi init.
- Very specific: line 273
Never read secrets into conversation output: When showing detected secrets during sensitivity scan, always mask them (show first 4 and last …
- Very specific: line 275
Never use raw
cd+git: Always use chezmoi git -- for git operations - Very specific: line 276
Never modify
references/excludes.yaml: Only references/excludes.local.yaml gets modified at runtime (user's personal exclusions). - Very specific: line 277
Never auto-push: Always confirm with the user before running chezmoi git -- push
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/chezmoi — Dotfile Management with Chezmoi
Operational dotfile management: detect drift, discover new config, and health-check your chezmoi setup.
Tools
- Bash — Run
chezmoi status,chezmoi diff,chezmoi add,chezmoi git --,chezmoi doctor,chezmoi verify,op account list, and thescripts/filter-unmanaged.shhelper script - Read — Read file content for sensitivity scanning, read exclusion YAML files
- Edit — Update
references/excludes.local.yamlwhen user excludes a file - Write — Create
.tmplfiles in chezmoi source directory for sensitive file templates - AskUserQuestion — Ask which subcommand to run, which files to add/exclude/skip, how to handle sensitive files
Arguments
The skill accepts an optional subcommand:
- No argument: Show an overview of available subcommands and ask the user which to run
status: Detect managed files with local driftdiscover: Find unmanaged config files worth trackingdoctor: Run health checks on the chezmoi setup
Subcommand Overview (no args)
When invoked without arguments, present this overview and ask which subcommand to run:
Chezmoi — Dotfile Management
Available subcommands:
/chezmoi status — Check for local changes to managed files that
haven't been captured back to the source repo yet
/chezmoi discover — Find config files in your home directory that
aren't managed by chezmoi, filtered to reduce noise
/chezmoi doctor — Health check: chezmoi doctor, verify, 1Password
connectivity, and source repo sync state
Which would you like to run?Use AskUserQuestion to let the user pick a subcommand.
Shared: Add Workflow
This workflow is used by both status and discover whenever a file needs to be added to chezmoi. It handles sensitivity detection, 1Password template scaffolding, and the git pipeline.
Step 1: Sensitivity Scan
Before adding any file, scan it for secrets.
For drifted files (from status): run chezmoi diff <file> via Bash and scan the diff output for secret values.
For new files (from discover): read the full file content via Read and scan for secret values.
Content-based detection (always applied):
- Long random strings (high entropy, 20+ characters)
- Base64-encoded blobs
- Values adjacent to keys named
token,key,password,secret,auth,credential,api_key,apikey,access_tokenin structured formats (JSON, YAML, TOML, XML, INI, env files)
Path-based detection (for new files from discover):
- Path contains:
ssh,gnupg,gpg,kube,aws,credentials - Filename contains:
secret,credential,token,key,password,auth,private - File permissions: check with
stat -f '%Lp' <file>on macOS — mode 600 or more restrictive
If no secrets are detected, proceed directly to Step 3 (Git Pipeline).
Step 2: Sensitive File Handling
When secrets are detected, use AskUserQuestion to ask the user:
This file appears to contain sensitive data. How should it be handled?
1. Contains individual secrets (API keys, tokens) → Template with onepasswordRead
2. Entire file is a secret (key, certificate) → Template with onepasswordDocument
3. Just needs restricted permissions → Standard chezmoi add
4. Not sensitive, false positive → Standard chezmoi addOption 1: Template with onepasswordRead
For config files containing embedded secrets:
- Read the file content
- Identify which values are secrets
- Generate a
.tmplversion of the file. Replace each secret with a{{ onepasswordRead "op://Vault/Item/Field" }}placeholder. Keep all non-secret content exactly as-is. - Present the template to the user, listing each placeholder with its detected secret value (masked: show first 4 and last 4 characters only)
- Ask the user to:
- Store the secrets in 1Password (if not already there)
- Provide the actual
op://URI for each placeholder
- Update the template with the real URIs
- Determine the correct chezmoi source path:
- Run
chezmoi source-pathto find the source directory - Convert the target path to chezmoi naming: replace leading
.withdot_, useprivate_prefix for files with 600 permissions, add.tmplsuffix - Look at existing files in the source directory for naming convention reference
- Run
- Write the template file to the source directory using Write
- Proceed to Step 3
Option 2: Template with onepasswordDocument
For whole-file secrets (SSH private keys, certificates, PEM files):
- Tell the user: "This file should be stored as a 1Password document. Please upload it to 1Password and provide the document UUID."
- Wait for the user to provide the UUID
- Create the template content:
{{- onepasswordDocument "<UUID>" }} - Determine the correct source path (same logic as Option 1, with
private_orprivate_readonly_prefix as appropriate) - Write the template file to the source directory using Write
- Proceed to Step 3
Options 3 & 4: Standard add
Run via Bash:
chezmoi add ~/<file>Chezmoi automatically detects file permissions and applies the private_ prefix for 0600 files. Proceed to Step 3.
Step 3: Git Pipeline
Run all git operations via Bash using chezmoi's native git integration:
- Stage:
chezmoi git -- add . - Commit:
chezmoi git -- commit -m "<message>"- Generate a descriptive commit message from the files being added (e.g., "Add fish shell config and fzf bindings" or "Update zed editor settings")
- For multiple files, summarize what changed rather than listing every file
- Confirm with user before push (use AskUserQuestion: "Push to remote? [yes/no]")
- Push:
chezmoi git -- push
For multiple files added together, batch them into a single commit with a summary message.
Subcommand: status
Execution Steps
- Detect drift: Run via Bash:
Parse the output. Each line has a two-character status code and a file path (e.g.,chezmoi statusMM .gitconfig). - Handle empty results: If no output, report "All managed files are in sync" and stop.
- Group findings by category based on the file path:
- Shell — paths containing
fish,bash,zsh, or shell config files (.profile,.bashrc, etc.) - Git —
.gitconfig,.gitignore_global - Config — paths under
.config/ - Sensitive — paths under
.ssh/,.gnupg/, or files that haveprivate_prefix in the chezmoi source directory (check withchezmoi source-path ~/<file>) - Other — everything else
- Shell — paths containing
- Display summary table showing each group with file paths and sensitivity flags.
- Offer actions using AskUserQuestion:
- Add all — run the shared Add Workflow for every drifted file
- Add selected — present the file list and let the user pick which to add
- Diff — ask which file to diff, then run
chezmoi diff ~/<file>via Bash and display the output - Skip — do nothing, end the subcommand
- Execute chosen action: For each file being added, run the shared Add Workflow (sensitivity scan on the diff → handling → git pipeline). Batch all files into a single commit when adding multiple.
Subcommand: discover
Execution Steps
- Locate the skill directory: The skill directory is the parent directory of this SKILL.md file. It contains
scripts/filter-unmanaged.sh,references/excludes.yaml, andreferences/excludes.local.yaml. - Run the filter script via Bash:
Capture the output — one unmanaged file path per line (relative to home directory).<skill-dir>/scripts/filter-unmanaged.sh <skill-dir>/references/excludes.yaml <skill-dir>/references/excludes.local.yaml - Handle empty results: If no output, report "No unmanaged config files found (after applying exclusion filters)" and stop.
- Group findings by top-level directory (e.g.,
.config/,.cargo/,.ssh/). - Present findings grouped by directory with a count per group.
- For each finding, use AskUserQuestion to offer:
- Add — triggers the shared Add Workflow (sensitivity scan on full file content → handling → git pipeline)
- Exclude — append the file's path pattern to
references/excludes.local.yamlusing Edit (add to thepatterns:list). If the file is in a directory with other excluded siblings, suggest excluding the parent directory pattern (e.g.,.some-app/*instead of.some-app/cache.json). - Skip — move to the next finding
- Batch adds: Collect all files the user chose to add, then run the shared Add Workflow for the batch. Commit all together with a summary message.
Subcommand: doctor
Execution Steps
- Run chezmoi doctor via Bash:
Parse output forchezmoi doctorok,warning, anderrorlines. - Run chezmoi verify via Bash:
Exit code 0 means all files match. Non-zero means drift exists. Capture stderr for the list of differing files.chezmoi verify 2>&1; echo "EXIT:$?" - Check 1Password connectivity via Bash:
Parse for account names. If the command fails, report 1Password CLI is not authenticated.op account list --format=json 2>/dev/null - Check source repo state via Bash:
Empty output means clean. Non-empty means uncommitted changes.chezmoi git -- status --porcelain - Check remote sync via Bash:
chezmoi git -- fetch --quiet 2>/dev/null DEFAULT_BRANCH=$(chezmoi git -- rev-parse --abbrev-ref origin/HEAD 2>/dev/null | sed 's|origin/||') AHEAD=$(chezmoi git -- rev-list --count "origin/${DEFAULT_BRANCH}..HEAD" 2>/dev/null) BEHIND=$(chezmoi git -- rev-list --count "HEAD..origin/${DEFAULT_BRANCH}" 2>/dev/null) echo "branch:${DEFAULT_BRANCH} ahead:${AHEAD} behind:${BEHIND}" - Display results as a summary table with pass/warn/fail indicators for each check.
- Show recommendations based on findings:
- If verify found drift → suggest
/chezmoi status - If source repo has uncommitted changes → suggest
chezmoi git -- add . && chezmoi git -- commit - If local is ahead of remote → suggest
chezmoi git -- push - If local is behind remote → suggest
chezmoi update - If 1Password is not authenticated → suggest
eval $(op signin)
- If verify found drift → suggest
Error Handling
Handle these conditions gracefully:
- chezmoi not installed: Check with
command -v chezmoibefore any operation. Report and stop. - Not initialized: If
chezmoi statusfails, suggestchezmoi init. - 1Password CLI not installed: If
opis not found, skip 1Password checks in doctor and skip sensitivity Option 1/2 in the Add Workflow (fall back to standard add with a warning). - filter-unmanaged.sh not found: If
scripts/filter-unmanaged.shcan't be located, report the error and suggest reinstalling the skill. - Skill directory is read-only: If Edit fails on
references/excludes.local.yaml, copy it to~/.config/chezmoi/excludes.local.yamland use that path for all future writes. Update the filter script invocation to pass the new path as the second argument. - yq not installed: The filter script handles this internally (grep fallback). No action needed.
- Git push fails: Report the error. Common causes: no remote configured, auth failure. Don't retry.
- Empty chezmoi source directory: If
chezmoi source-pathfails, suggestchezmoi init.
Anti-Patterns
- Never read secrets into conversation output: When showing detected secrets during sensitivity scan, always mask them (show first 4 and last 4 characters only, e.g.,
ghp_****...x7Qm) - Never run
chezmoi add --encrypt: The user uses 1Password templates, not file encryption - Never use raw
cd+git: Always usechezmoi git --for git operations - Never modify
references/excludes.yaml: Onlyreferences/excludes.local.yamlgets modified at runtime (user's personal exclusions). If the skill directory is read-only (e.g., installed as a plugin), copyreferences/excludes.local.yamlto~/.config/chezmoi/excludes.local.yamlon first write and use that path going forward. - Never auto-push: Always confirm with the user before running
chezmoi git -- push - Never create directories manually: Let chezmoi handle directory creation in the source state
- Never skip the sensitivity scan: Even for files that don't trigger path-based heuristics, always scan content before adding
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

