Chezmoi workflow skill for Prateek's dotfiles repo. Use for `chezmoi` apply/diff/verify/merge/edit/re-add/forget/status/managed/unmanaged/data/execute-template/doctor; source-target drift; files under `home/.chezmoitemplates/`, `.chezmoiassets/`, `.chezmoiscripts/`, `.chezmoidata/`, or `.chezmoiexternal.*`; package, secret, and license data; Brewfile rendering; app plist capture or modify stubs; chezmoi-owned `DOTFILES_*` gates; 1Password `op://` refs; and mapping `~/.foo` targets to `home/dot_*` sources. Do not use for unrelated dotfile edits, pure shell-startup debugging, or test/VM/harness env vars.
Resources
3Install
npx skillscat add prateek/dotfiles/chezmoi-management Install via the SkillsCat registry.
Chezmoi Management
Overview
Single entry point for chezmoi-related work in Prateek's dotfiles repo. SKILL.md is a router. Mode-specific depth lives in references/<mode>.md. Generic chezmoi knowledge lives in references/chezmoi-cheatsheet.md so this skill is self-contained and does not depend on chezmoi.io being reachable.
Trigger Check
Use this skill when any of these are true:
- Running
chezmoicommands (apply,diff,verify,merge,edit,re-add,forget,status,managed,unmanaged,data,execute-template,doctor). - Editing or adding files under
home/.chezmoitemplates/,home/.chezmoiassets/,home/.chezmoiscripts/,home/.chezmoidata/, orhome/.chezmoiexternal.*(zinit and other clone/pull-only dependencies). - Capturing or modifying macOS app preferences via plist fragments.
- Touching
home/.chezmoidata/{packages,secrets,licenses}.tomlorbrewfile.tmpl. - Selecting
machine_type(the one init prompt, orchezmoi init --promptChoice 'machine_type=<type>') or changing machine behavior via the layeredhome/.chezmoidata/machines.toml(resolved byfeatures.tmpl) — package groups, install scripts, macOS defaults, secrets, the private overlay, elevation. Per-machine exceptions go in a host-local[data].machines_local. - Toggling chezmoi-owned apply-time
DOTFILES_*env vars (MAS, Homebrew tuning, plist hooks, post-apply relaunch,INSTALL_XCODEforce-download). Full table with effects and out-of-scope test/VM vars inreferences/packages-and-secrets.md. - Wiring a 1Password
op://reference. - Translating between
~/.<file>andhome/<dot_*>source paths.
For out-of-scope cases, see "Should not trigger by itself" below.
Trigger Boundaries
Should trigger:
chezmoi diff is showing changes I do not understand. Walk me through them.I edited ~/.zshrc directly. Get this back into the source tree without losing the template.Add Anthropic CLI to the base package group and render the Brewfile.Capture the Moom plist into home/.chezmoitemplates/.Toggle DOTFILES_INSTALL_MAS_APPS for this run.What is the source path for ~/.config/karabiner.edn?Test a chezmoi change from a git worktree, then reset to the default source.
Should not trigger by itself:
Debug why zinit is slow at shell startup.(Shell startup; no source-state edit.)Write an ADR for the new mise lockfile policy.(Docs; no chezmoi state.)Add a new skill under agent-marketplace/packages/core/skills/.(Useagent-skill-managementfor portable skill authoring.)Review this PR for unrelated bugs.
If code-gardening already owns a state-sync task and chezmoi is incidental, keep code-gardening primary and consult this skill only when a chezmoi command or home/.chezmoi*/ path enters scope.
Universal Rules
These apply across every mode. Do not skip them.
- Edit the owning source. Direct chezmoi entries live under
home/; preferchezmoi edit <target>for those files. Script-created output such as~/.agents/pluginshas a separate owner. Checkreferences/source-target-translation.mdbefore capturing a path thatchezmoi source-pathcannot map. - Always
chezmoi diffbeforechezmoi apply. Usechezmoi apply --dry-run --verbosefor a structural preview, especially whenhome/.chezmoiscripts/changed. - Destructive command discipline.
forgetstops managing (safe).destroyremoves source AND target AND state (never use unless the user explicitly asks).addon a.tmplclobbers the template with rendered output (never).re-addis the right tool for already-managed plain/encrypted_files but SKIPS.tmplsources — pre-check withchezmoi source-path <target>; if it ends in.tmpl, skipre-addand edit by hand. Full command semantics inreferences/chezmoi-cheatsheet.md. - Files under
home/.chezmoidata/cannot be templates. They load before the template engine starts. Dynamic data goes inhome/.chezmoi.<format>.tmplor via template functions (output,fromJson,fromYaml). - Validate after editing this skill. Frontmatter/parser drift has bitten this repo before. See
references/meta-skill-maintenance.mdfor the post-edit checklist.
Mode Router
Route by the file or command in scope. Load the matching reference plus references/source-target-translation.md for any path mapping.
| Task touches… | Load |
|---|---|
chezmoi apply, diff, verify, merge, edit, re-add, forget; drift between target and source; home/.chezmoiscripts/ ordering or hashing |
references/workflow.md |
home/.chezmoitemplates/<bundle-id>.plist.tmpl; home/.chezmoiassets/; capturing macOS app preferences; modify_ stubs; home/.chezmoiignore for opt-in apps |
references/app-config.md |
home/.chezmoidata/{packages,secrets,licenses}.toml; brewfile.tmpl; DOTFILES_INSTALL_* env vars; 1Password op:// references |
references/packages-and-secrets.md |
Translating ~/.<file> ↔ home/<dot_*> source paths in any mode |
references/source-target-translation.md |
agent-marketplace/, home/.chezmoidata/agent_plugins.toml, script-created ~/.agents/plugins, or native plugin activation |
agent-skill-management; references/workflow.md for chezmoi apply scope |
| Cross-cutting chezmoi command lookup, attribute grammar, "what does X do" | references/chezmoi-cheatsheet.md |
| Updating this skill itself because chezmoi practices in the repo changed | references/meta-skill-maintenance.md |
A single task can pull more than one reference. "Add a new app" hits packages-and-secrets (install rule), then app-config (preferences), then workflow (apply). Load each as you cross the seam.
Repo-Specific Gotchas (Always Loaded)
These are short, high-stakes, and easy to violate. Keep them in working memory regardless of mode.
- Plist
{{/}}literals must be escaped. Plist fragments are Go templates. If a string value contains literal{{or}}(e.g., Moom geometry like{{width}}x{{height}}+0+0), escape it. Seereferences/app-config.md. home/.chezmoiassets/loads viainclude, notincludeTemplate. Use.chezmoiassets/for raw payloads that should not be templated. Usehome/.chezmoitemplates/for Go-templated content loaded viaincludeTemplate.- Store only obfuscated
op://vault-id/item-id/field-idrefs in committed files. Human-readableop://Personal/...refs are forbidden inhome/.chezmoidata/secrets.tomlandlicenses.toml. Per-machine overrides go in~/.config/chezmoi/chezmoi.toml.local. - Do not reintroduce
home/.chezmoidata/apps/*.toml. That mechanism was retired withbin/dotfiles. App config now lives at the native target path or as amodify_plist stub. - MAS entries opt-in via
DOTFILES_INSTALL_MAS_APPS=true. Do not unconditionally include MAS apps inpackages.toml. - Setapp apps are declared in
setapp_apps, notcasks. Homebrew cannot install them;run_after_22-setapp-appsdownloads each app's vendor archive from Setapp's store API and unpacks it (ADR 0024). Add the app there before adding chezmoi-managed config for it. home/.chezmoiscripts/numeric ordering is load-bearing. Insert new scripts at unused gap numbers; do not renumber existing ones. Current ordering listed inreferences/workflow.md.- Raw app captures live under
${XDG_STATE_HOME:-~/.local/state}/dotfiles/captures/, not in the repo. - Yojam's
~/Library/Application Support/Yojam/config.jsonhas a focused skill. See theyojam-configskill for the deltas-only desired-fragment + JSON deep-merge flow, schema, and import-time security pass.
Validation Lanes
Pick the matching lane for the work. All lanes are existing repo conventions; do not invent new validation.
| Mode | Run before declaring done |
|---|---|
| workflow | Keep the diff/verify and script-aware dry-run checks in workflow; use the tests index for apply/status and hook behavior. |
| app-config | Render and parse the changed format, preview its target diff, and select ownership/preservation/security checks through the app-config tests index. Real plist modifiers and apply-time hook PTYs are distinct checks. |
| packages-and-secrets | Use the package and secret checks for rendering, feature gates, install ordering/trust, and secret failures; preview Brewfiles for affected machine types and MAS opt-in. |
| any | git diff --check before handoff |
After editing this skill itself: see references/meta-skill-maintenance.md for the parser/frontmatter check.
Do Not
- Edit a target under
~/and assumechezmoi applywill reconcile silently — it prompts or overwrites. - Embed secrets, license keys, or human-readable
op://paths in committed source. - Renumber
home/.chezmoiscripts/prefixes, or reintroducehome/.chezmoidata/apps/*.toml. - Add MAS app config without confirming the install path is in scope, or Setapp app config for an app missing from
setapp_apps. - Paraphrase chezmoi attribute grammar from memory; consult
references/source-target-translation.md. - Add long inline command transcripts to this SKILL.md. Push depth into
references/.