config-manager
Manage local machine configuration through chezmoi and global config files. Use when the user asks about dotfiles, PATH, Brewfile, package managers, Codex config, or config drift.
- License 许可
- MIT
- 最近更新
- 2026-09-15
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- config-manager
- description
- Manage local machine configuration through chezmoi and global config files. Use when the user asks about dotfiles, PATH, Brewfile, package managers, Codex config, or config drift.
02 资源文件 3
- 参考文档agents/openai.yaml219 B
- 参考文档references/workflows.md9.3 KB
- 参考文档skill.meta.json717 B
03 SKILL.md 正文
Config Manager
Use this skill for user-machine configuration that should be grounded in the current checkout and applied safely to live home files.
Ground Rules
- Start in
$HOME/.local/share/chezmoifor dotfiles work. - Run
git status -sbbefore edits; preserve unrelated dirty work. - Treat chezmoi source as truth. Inspect live targets only to understand drift.
- Prefer
chezmoi diff <target>beforechezmoi apply <target>. - Apply single targets. Avoid whole-repo
chezmoi applyunless explicitly requested. - Use
apply_patchfor source edits. Do not overwrite tracked files from live home files. - Use
trash ...for removing local files or shims. - Do not push or commit unless asked.
Config drift
Use this workflow when the user says audit config drift.
- Chezmoi source is authoritative. A change made by Brew, an installer,
npx, or a person is a proposal, not an accepted source change. - For one managed file, run
chezmoi status <exact target>andchezmoi diff <exact target>. Accept it by editing or merging the reviewed change into source. Reject it withchezmoi apply <exact target>. - For managed trees, run
chezmoi status --recursive ~/.agents ~/.pi/agentand recursive diffs for both targets. A directory diff without--recursiveis not enough. - Never run broad
chezmoi re-add,chezmoi add ~/.agents, orchezmoi add ~/.pi. Do not replace template or encrypted source from rendered live files. - New unmanaged files need a path-only audit and secret scan. Classify them as owned source, third-party/generated content with a declaration or lock, or excluded runtime state. Never follow symlinks or print secret values.
See references/workflows.md for the reconciliation commands and report format.
Common Paths
- Chezmoi source:
$HOME/.local/share/chezmoi - Home target:
$HOME - Global Codex instructions:
$HOME/.codex/AGENTS.md - Agent source:
dot_agents/(target:$HOME/.agents) - Pi agent source:
dot_pi/private_agent/(target:$HOME/.pi/agent) - Global AGENTS source:
dot_agents/AGENTS.md - Local skills source:
dot_agents/skills - Codex config:
$HOME/.codex/config.toml - Brewfile source:
dot_brewfile.tmpl - Brewfile target:
$HOME/.brewfile - mise config source:
dot_config/mise/config.toml - mise config target:
$HOME/.config/mise/config.toml
Workflow
- Inspect:
git status -sbchezmoi managed | rg '<target-name>'chezmoi diff <live-target>for managed targets
- Edit source:
- dotfiles in the chezmoi checkout
- global AGENTS in
dot_agents/AGENTS.md - skills in
dot_agents/skills/<skill-name> - durable Pi configuration in
dot_pi/private_agent/ - add Pi or agent files only after a path-only audit and secret scan; do not copy runtime state or external symlinks
- Apply narrowly:
chezmoi apply --recursive ~/.agentschezmoi apply --recursive ~/.pi/agentchezmoi apply ~/.zshrcchezmoi apply ~/.shell/initchezmoi apply ~/.config/mise/config.toml
- Verify from a fresh shell when shell/PATH/tooling changed:
zsh -ic 'which node; which npm; npm config get prefix'zsh -ic 'mise doctor'which -a <cmd>when shadowing is suspected
Chezmoi synchronization and removals
- Chezmoi does not watch the source checkout. After editing
dot_agents/ordot_pi/private_agent/, inspect the exact recursive diff and run the matching narrow apply command. chezmoi apply --recursive ~/.agentsupdates managed entries only. It does not remove a live path whose source entry was deleted; that path becomes unmanaged, andchezmoi diffmay still be clean.- After source deletions, inspect
chezmoi unmanaged ~/.agents/skills. Remove only confirmed stale paths that correspond to reviewed source deletions; preserve installer-generated, runtime, external-symlink, and other intentional unmanaged entries. - Use
trash <exact-live-path>for confirmed stale local files or directories. For a future managed removal, preferchezmoi remove <exact-live-target>before deleting its source entry, then review the result. - Verify the final state with
chezmoi diff --recursive <target>andchezmoi verify --recursive <target>.
Node and Global NPM
- Current canonical manager:
mise. - Do not restore Volta or Hermes Node as the active global manager unless explicitly requested.
- Keep
~/.local/binfor local commands, but removenode,npm, andnpxshims if they shadow mise. - Manage global npm CLIs in
dot_config/mise/config.tomlwithnpm:<package>. - Verify CLIs with a fresh interactive shell, not only the current agent shell.
Packages
- Use
dot_brewfile.tmplfor durable Homebrew formulae/casks/taps. - Use
dot_config/mise/config.tomlfor durable language runtimes and global CLI tools where mise supports them. - Treat direct install commands as live-state changes. Ask for escalation when needed and reflect durable installs back into the managed config.
- Do not add a package manager just because a one-off command exists. Prefer the existing canonical manager for that tool class:
- system/macOS packages: Homebrew/Brewfile
- runtimes and global npm CLIs: mise
- local project dependencies: project-native lockfiles, not global config
- Before removing a package, check whether it is referenced by Brewfile, mise config, shell PATH, aliases, or scripts.
- After package changes, verify both the package manager state and command resolution.
See references/workflows.md for exact commands and checks.
04 同仓库更多 Skills
writing-for-agents
Use when writing skills, agent instructions, or references consumed by agents.
write-tbp
Writing technical blog posts about project features and implementation details. Use when creating blog content about how a project solves interesting problems.
write-pr
Reference standards for writing pull request titles and descriptions, plus the pre-flight comment sweep over the diff. Use as supporting guidance when another skill or workflow needs PR content standards, not as the user-facing create/update PR workflow.
write-issue
Reference standards for writing and maintaining local or remote issues. Use when another skill needs issue title, body, type, or triage guidance.
write-exec-plan
Write or maintain a plan for complex work across phases or PRs. Resolve consequential technical unknowns through prototypes before defining implementation checklists and their evidence.
write-design-doc
Write a design doc that settles hard-to-reverse decisions before anyone builds.