# Chezmoi Management

> Manage dotfiles through chezmoi source files. Use when a change touches chezmoi-managed files, including AGENTS.md: edit the source first, apply to the runtime copy, verify no diff, then commit and push.

- Skill: `xiongweilin/chezmoi-management` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add xiongweilin/chezmoi-management`
- Raw SKILL.md: https://api.skillmd.com/api/skills/xiongweilin/chezmoi-management/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: xiongweilin (https://skillmd.com/u/xiongweilin)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/xiongweilin/chezmoi-management

---


# Chezmoi Management

chezmoi-managed files (including the global AGENTS.md) have one fact owner: the source file in the chezmoi source directory. Editing the runtime copy directly creates a competing owner.

The synchronization and repository steps below are mandatory managed-file closure, not optional general self-review. They remain required when this skill applies even when implementation-only defaults suppress ordinary validation.

## Use when

Use when a change touches a chezmoi-managed file (e.g. `.codex/AGENTS.md`), or when you need to locate how a managed runtime file is sourced. For read-only source-location requests, do not apply, commit, or push.

## Method

1. **Edit the source.** Locate the managed path under the source root (e.g. `.codex/AGENTS.md` → `dot_codex/AGENTS.md`) and edit the source file only.
2. **Apply to the runtime copy.** Run `chezmoi apply` so the runtime copy is regenerated from the source. Non-interactive runs may block on the prompt "…has changed since chezmoi last wrote it?" — use `chezmoi apply --force` to overwrite without prompting, and run from the destination directory with a destination-relative target (e.g. `chezmoi apply --force -- .codex/AGENTS.md`).
3. **Verify no diff.** Confirm the runtime copy matches the source (identical hashes) and `chezmoi managed` agrees.
4. **Commit and push.** The source directory is its own git repository; commit and push the change there.

## Success signal

The runtime copy was regenerated from the source, matches it exactly, and the source repository carries the committed change.

