working-on-dotfiles
Skill4 starsChanged 21 days agoMITView on GitHub
Guides agents changing Diego's dotfiles repo (diegoferigo/dotfiles): where the checkout lives, branch and test flow, keeping AGENTS.md in sync, opening the draft PR and propagating a merged change with `dotfiles --update`. Use whenever the user asks to edit, add or fix a dotfile, shell snippet in .bashrc.d, git or gh config, a TOOLS entry, a tracked setting, the dotfiles script or its tests, or to propagate dotfiles changes, even if they do not name this skill.
- Commits and pushes
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .copilot/copilot-instructions.mdCopilot instructions
- acting-as-diegoferigoSkill
- creating-skillsSkill
- gh-stackSkill
- guide-me-throughSkill
- opening-hunkSkill
- opening-zedSkill
- orchestrating-agentsSkill
- using-worktrunkSkill
- working-in-zedSkill
- code-reviewSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 1 is distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
Do not leave a tracked edit in $HOME uncommitted.
- Very specific: line 28
Run, in the checkout, pixi run lint, pixi run check, pixi run hooks and pixi run test.
- Distinctive: line 30
Keep AGENTS.md in sync with the code, the tests and the tracked files (key components table, test list, the file tree and the Git …
- Very specific: line 32
After Diego merges, update the checkout (git switch main && git pull), run dotfiles --update, then delete the local branch.
- Very specific: line 37
Never skip a backup in checkout_to_home: rollback and uninstall restore only the files listed in backed_up.
- Very specific: line 39
Keep tracked config machine-neutral: no accounts, tokens, host names or allowedUrls entries.
- Very specific: line 50
Check the skill against the Agent skills section of AGENTS.md.
- Very specific: line 51
Run the checks. The deployment tests cover every tracked SKILL.md.
- Very specific: line 52
After the merge, run dotfiles --update and confirm that ~/.agents/skills/<name>/SKILL.md has the new content.
- Very specific: line 54
Before tracking a skill that already exists in ~/.agents/skills, diff the local copy against the one to commit: the first update moves the …
≈ “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
Working on the dotfiles repo
The repo is checked out to $HOME by .local/bin/dotfiles as a bare repo in ~/.dotfiles. AGENTS.md, tests and the other development files are sparse-excluded, so they are not in $HOME. Pick the workflow by the task:
- Operate (no clone needed): propagate merged changes, check the state, read the docs. Run
dotfiles --update,dotfiles secrets statusanddotfiles git status|log|show. ReadAGENTS.mdwithdotfiles git show HEAD:AGENTS.md. - Small config change (no clone needed): a change that only edits tracked files that exist in
$HOME(for example a.bashrc.dsnippet or a git config key) and needs noAGENTS.mdupdate. Never use it for the files under.agents/skills/: they are documented inAGENTS.md. Rundotfiles git switch main(stop if it fails because of local changes) anddotfiles --update: the update follows the checked-out branch, so a stale feature branch would be updated instead ofmain. Thendotfiles git switch -c diegoferigo/<slug>, edit the file in$HOME,dotfiles git add <file>anddotfiles git commit(nevercommit -awith unrelated edits). Push and open the PR only when asked, as in step 6 below, withdotfiles git push -u origin <branch>. Afterwards switch back withdotfiles git switch mainbefore the nextdotfiles --update. Checkdotfiles git statusand the staged diff before committing. - Change (needs the clone): anything that touches
.local/bin/dotfiles, the tests,AGENTS.md,TOOLSor the tracked files table, becausetests,pixi.toml,pyproject.tomlandAGENTS.mdare not in$HOMEand the checks and the doc sync cannot run without them. Follow the flow below, and readAGENTS.mdfrom the clone first: it is the source of truth for the architecture, the tests and the tracked files.
Do not leave a tracked edit in $HOME uncommitted. dotfiles --update snapshots and reapplies it, but when the incoming change conflicts it keeps the incoming version and parks the local edit under ~/.dotfiles_backup/...local.
This skill only covers how Diego wants changes made.
Flow for a change
- Work in a regular clone of the repo, not in a worktree and never in
~/.dotfilesor$HOME. Use the existing clone (usually~/git/dotfiles); if there is none, clone the URL printed bydotfiles git remote get-url origin. Start from a fresh branch:git fetch && git switch -c diegoferigo/<slug> origin/main. - Make one logical change per commit. Commit before running the tests: they clone from
HEAD. - Run, in the checkout,
pixi run lint,pixi run check,pixi run hooksandpixi run test.pixi run hookscovers the TOML and Markdown checks;pixi run tomlandpixi run mdare the formatting tasks. Report the commands and the summary lines, not "tests pass". - For a bug fix, prove the new test catches it: temporarily replace
.local/bin/dotfileswithgit show origin/main:.local/bin/dotfiles, confirm the new test fails, then restore the file. - Keep
AGENTS.mdin sync with the code, the tests and the tracked files (key components table, test list, the file tree and the Git configuration table). - Push and open the PR only when asked, always as a draft. Check which
ghaccount is active and that it can write to the repo. PR sections: "What change is being made", "Why this change is being made", "Tested". - After Diego merges, update the checkout (
git switch main && git pull), rundotfiles --update, then delete the local branch.
Rules that are easy to get wrong
- A new tool goes in
TOOLSin.local/bin/dotfilesand in theTOOLSrow ofAGENTS.md. Bootstrap anddotfiles --updateinstall it. If the tool is missing right after the first update that brings the new list, rundotfiles --updateagain. A tool removed from the list is never uninstalled. A tool with no conda-forge package goes in.local/libexec/dotfiles/lazy-toolsinstead (a Python script with a function set per tool, run by--update), with a test intests/test_lazy_tools.py. Per-tool setup that herdr generates (its Copilot hook and skill) or installs (the pinned worktrunk plugin) lives in.local/libexec/dotfiles/herdr-setup.sh, never in git. - Never skip a backup in
checkout_to_home: rollback and uninstall restore only the files listed inbacked_up. A backup whose content equals the incoming file is made but not reported (_same_content). - Tracked files outside the sparse-excluded set (see
SPARSE_TRACKED_EXCLUDES) land in$HOME. Development files such astests,AGENTS.md,pixi.tomlandpyproject.tomlmust stay excluded. - Keep tracked config machine-neutral: no accounts, tokens, host names or
allowedUrlsentries.~/.gitconfigand~/.copilot/config.jsonstay local. - Secrets live in
secrets/as age ciphertext. Never print or commit a plaintext value, and never echo one in a command output. dotfiles --updateonly reports encrypted sources. Decrypting needs the age passphrase (unless a plaintext identity is in use), sodotfiles secrets apply(andsecrets init,secrets change-passphrase) is a manual command that Diego runs himself in his terminal: an agent cannot supply the prompt. Do not try to run it. Ask Diego to run it only when a secret change actually needs it (a new or changed*.agesource, ordotfiles secrets statusreporting a pending one), say which command and why, and carry on with the rest meanwhile. After--update, rundotfiles secrets status(it never decrypts or prints content) and ask only if it shows something to apply.- A change to a setting that a tool rewrites itself (for example
~/.copilot/settings.json) must be copied back into the repo and committed, otherwisedotfiles --updaterestores the tracked version.
Changing a tracked skill
Skills under .agents/skills/ are tracked files, so they follow the change flow above, with these steps:
dotfiles git switch mainanddotfiles --updatefirst, so the edit starts from the deployed version.- Edit the file in the clone, never in
~/.agents/skills: the next update restores the tracked version. - Check the skill against the
Agent skillssection ofAGENTS.md. - Run the checks. The deployment tests cover every tracked
SKILL.md. - After the merge, run
dotfiles --updateand confirm that~/.agents/skills/<name>/SKILL.mdhas the new content.
Before tracking a skill that already exists in ~/.agents/skills, diff the local copy against the one to commit: the first update moves the local file to the backup directory.
Checks specific to a snippet in .bashrc.d
Load it in a clean interactive shell before committing: bash -ic 'type <name>; complete -p <command>'. Guard optional tools with [[ -n $(type -t <tool>) ]] like the existing snippets, and put tool init and completion in .bashrc.d/tools.
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.

