Update Dotfiles
Overview
Use this skill when changing dotfiles in the wrapper repo that contains a common/ submodule plus environment overlays (work/ and optionally home/).
Goals:
- •Keep environment-specific changes in the correct overlay (
work/orhome/). - •Keep shared changes in
common/. - •Preserve unrelated unstaged work.
- •Push
commonfirst, then update the wrapper submodule pointer.
Quick Start
- •Snapshot current state:
bash
bash common/codex/skills/update-dotfiles/scripts/dotfiles_snapshot.sh
- •
Route edits using
references/routing.md. - •
Commit/push in order:
bash
# shared edits in common git -C common add <paths> git -C common commit -m "<message>" git -C common push origin main # then pointer update in wrapper git add common git commit -m "Update common submodule"
If pushes are flaky from a work environment, follow references/push-from-work.md.
Workflow
- •Locate roots
- •Wrapper repo root:
git rev-parse --show-toplevel - •Common submodule root:
<wrapper>/common
- •Detect profile (
workorhome)
- •Prefer explicit
DOTFILES_PROFILEif set. - •If only one overlay exists, use it.
- •If both exist, inspect
~/.zshrc.workand~/.zshrc.homesymlink targets. - •If still ambiguous, ask the user before writing overlay files.
- •Collect staged/unstaged context
- •Run the snapshot script above.
- •Always check both repos:
- •
git status --short - •
git -C common status --short
- •
- •Route edits to correct layer
- •OpenAI/work-machine-specific settings belong in
work/. - •Home-machine-specific settings belong in
home/. - •Shared defaults, shared skills, and shared tooling belong in
common/. - •Wrapper glue (
install.sh,bin/create-agent, wrapperAGENTS.md) belongs in wrapper root repo.
- •Edit with minimal scope
- •Stage only intended paths.
- •Do not use stash/autostash/reset to get clean commits.
- •If unrelated edits are present, commit targeted files only.
- •Commit and push safely
- •Commit
commonfirst and push toorigin/main. - •Then commit wrapper submodule pointer update (
commonentry) separately. - •If wrapper has unrelated modified files, keep them unstaged unless requested.
- •If pushes fail/hang in work environments, use the fallback sequences in
references/push-from-work.md.
Notes
- •Shared skills should live under
common/codex/skills/<skill-name>. - •To edit a shared skill via
~/.codex/skills, symlink:- •
~/.codex/skills/<skill-name> -> <wrapper>/common/codex/skills/<skill-name>
- •
- •This makes local edits appear as normal unstaged git changes in
common.
Resources
- •
scripts/dotfiles_snapshot.sh: one-command status snapshot across wrapper + common plus profile guess. - •
references/routing.md: path routing rules (workvshomevscommonvs wrapper). - •
references/push-from-work.md: repeatable push/rebase/auth fallback flow for common and wrapper repos.