chezmoi
Skill2 starsChanged 10 months agoMITView on GitHub
Manage dotfiles with chezmoi. Use when working with dotfiles, chezmoi templates, machine-specific configuration, syncing configs across machines, or when the user mentions chezmoi, dotfiles, or configuration management.
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
- hpehl/skillstheir own version, first seen Apr 20, 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
- es6kr/skills★ 2same name
- hpehl/skills★ 1same 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
13 rules. About 0 are common, 3 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
When the user asks about dotfiles or chezmoi operations, implement the changes directly using chezmoi commands rather than only suggesting …
- Very specific: line 19
Always preview significant changes with chezmoi diff or chezmoi cat <file> before applying.
- Very specific: line 81
When the target file itself uses {{ }} syntax (like mise, Jinja2, or Tera templates), escape the braces so chezmoi doesn't process them as …
- Very specific: line 91
Use .chezmoiremove to clean up dotfiles that chezmoi should remove from your system:
- Distinctive: line 136
When converting a static config to machine-specific template:
- Distinctive: line 138
Read the current file to understand its contents
- Very specific: line 140
Run chezmoi add --template <file> to add as template
- Very specific: line 147
Removing managed files: Use .chezmoiremove to clean up files (see "Removing Files" section)
- Very specific: line 148
Always preview: Run chezmoi cat <file> before applying templates
- Very specific: line 150
Template errors: Use chezmoi execute-template '{{ .chezmoi.os }}' to test template snippets
- Very specific: line 154
Template syntax errors: Test small snippets with chezmoi execute-template '{{ .chezmoi.os }}'
- Very specific: line 156
File not applying: Check chezmoi status and chezmoi diff to see what changes are pending
- Very specific: line 160
Permission errors: Verify file has correct prefix (private_ for 600, executable_ for 755)
≈ “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 Dotfiles Management
Action Guidance
When the user asks about dotfiles or chezmoi operations, implement the changes directly using chezmoi commands rather than only suggesting them. If the user says "make this work on macOS only" or "add my bashrc to chezmoi", proceed with implementation.
Always preview significant changes with chezmoi diff or chezmoi cat <file> before applying.
Commands
chezmoi add <file> # Add file to chezmoi
chezmoi apply --refresh-externals --force # Apply changes (always use these flags)
chezmoi diff # Preview what would change
chezmoi cat <file> # Preview rendered template output
chezmoi data # Show available template variables
chezmoi edit <file> # Edit source file
chezmoi edit ~/.local/share/chezmoi/.chezmoiremove # Edit removal listFile Naming
| Prefix/Suffix | Effect |
dot_ | Installed as . (dot_gitconfig → ~/.gitconfig) |
private_ | Restrictive permissions (600) |
executable_ | Executable permissions (755) |
.tmpl | Processed as Go template |
symlink_ | Creates symlink |
Machine-Specific Templates
Convert a static file to a template by renaming with .tmpl suffix, then use conditionals:
By OS
{{- if eq .chezmoi.os "darwin" }}
# macOS config
{{- end }}
{{- if eq .chezmoi.os "linux" }}
# Linux config
{{- end }}By hostname
{{- if hasPrefix .chezmoi.hostname "work-" }}
# work machine config
{{- end }}By environment variable
{{- if env "WORK_ENV" }}
# when WORK_ENV is set
{{- end }}Combined conditions
{{- if or (eq .chezmoi.os "darwin") (env "WORK_ENV") }}
# macOS or when WORK_ENV is set
{{- end }}Escaping Nested Templates
When the target file itself uses {{ }} syntax (like mise, Jinja2, or Tera templates), escape the braces so chezmoi doesn't process them as Go template syntax:
SOME_VAR = "{{ "{{" }}env.OTHER_VAR{{ "}}" }}"This renders as SOME_VAR = "{{env.OTHER_VAR}}" in the output. The {{ "{{" }} and {{ "}}" }} are Go template expressions that output literal brace characters.
Removing Files
Use .chezmoiremove to clean up dotfiles that chezmoi should remove from your system:
# Create .chezmoiremove file listing targets to remove
cat > ~/.local/share/chezmoi/.chezmoiremove << 'EOF'
~/.old-config
~/.deprecated-rc
EOF
# Preview what would be removed
chezmoi diff
# Apply to remove the files
chezmoi apply --refresh-externals --forceTemplate-based removal (.chezmoiremove.tmpl)
Conditionally remove files based on system variables:
{{- if eq .chezmoi.os "darwin" }}
~/.linux-only-config
{{- end }}
{{- if not (env "WORK_ENV") }}
~/.work-config
{{- end }}The file is always processed as a template, even without the .tmpl extension.
External Dependencies
Manage external git repos in .chezmoiexternal.toml:
[".zsh/plugins/some-plugin"]
type = "git-repo"
url = "https://github.com/user/some-plugin.git"
refreshPeriod = "168h"Workflow: Converting Static File to Template
When converting a static config to machine-specific template:
- Read the current file to understand its contents
- Identify machine-specific values (paths, hostnames, environment-specific settings)
- Run
chezmoi add --template <file>to add as template - Edit the template source to add conditionals (see "Machine-Specific Templates")
- Preview with
chezmoi cat <file>to verify rendering on this machine - Apply with
chezmoi apply --refresh-externals --force
Gotchas
- Removing managed files: Use
.chezmoiremoveto clean up files (see "Removing Files" section) - Always preview: Run
chezmoi cat <file>before applying templates - Always use
--refresh-externals --forceflags: Critical because--refresh-externalsensures external git repos and archives update, and--forceprevents interactive TTY prompts that would block execution (Claude cannot respond to interactive prompts) - Template errors: Use
chezmoi execute-template '{{ .chezmoi.os }}'to test template snippets
Troubleshooting
Template syntax errors: Test small snippets with chezmoi execute-template '{{ .chezmoi.os }}'
File not applying: Check chezmoi status and chezmoi diff to see what changes are pending
External not refreshing: The refresh period might not have elapsed; use --refresh-externals flag to force refresh
Permission errors: Verify file has correct prefix (private_ for 600, executable_ for 755)
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.

