agents: link Claude skills and root dotfiles at /srv

Wire the shared agent skills library into Claude Code, which only reads
~/.claude/skills. Add dotfiles/claude/skills -> ../agents/skills and an
allowlist exception so the symlink survives the /dotfiles/claude/* ignore
and lands in the flake source for enumeration.

Point the Codex skills module at the live worktree instead of its
~/dotfiles default so ~/.codex/AGENTS.md and ~/.codex/skills/* resolve
when the checkout lives at /srv/dotfiles, and change the worktreeRoot
fallback to /srv/dotfiles so no path defaults under ~/dotfiles.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-15 21:00:56 -07:00
parent 68be1cdd09
commit 7058c68e56
3 changed files with 11 additions and 1 deletions

5
.gitignore vendored
View File

@@ -62,6 +62,11 @@ gotools
!/dotfiles/claude/settings.json
!/dotfiles/claude/settings.local.json
!/dotfiles/claude/settings.local.json.example
# Expose the shared agent skills library to Claude Code, which only reads
# ~/.claude/skills. This is a symlink to ../agents/skills (the canonical
# store, also surfaced at ~/.agents/skills); without the allowlist the
# /dotfiles/claude/* rule above keeps it out of the flake source.
!/dotfiles/claude/skills
# Same story for Codex: ~/.codex resolves into dotfiles/codex on nix-darwin,
# so the codex-history repo and live Codex state nest inside this worktree.

1
dotfiles/claude/skills Symbolic link
View File

@@ -0,0 +1 @@
../agents/skills

View File

@@ -16,7 +16,7 @@
# Where the checked-out repo lives at runtime (activation time).
# Keep this outside individual home directories so links work for every
# managed user on a shared machine.
worktreeRoot = nixos.config.dotfiles-worktree or "${config.home.homeDirectory}/dotfiles";
worktreeRoot = nixos.config.dotfiles-worktree or "/srv/dotfiles";
worktreeDotfiles = "${worktreeRoot}/dotfiles";
# Use the flake source for enumeration (pure), but point links at the worktree.
@@ -92,6 +92,10 @@ in {
myModules.codexGeneratedSkills.enable = true;
myModules.codexGeneratedSkills.sourceCodexDir = "${srcCodex}";
# Point the Codex module at the live worktree (e.g. /srv/dotfiles) like the
# links above, not its ~/dotfiles default. Without this, ~/.codex/AGENTS.md
# and ~/.codex/skills/* dangle when the checkout lives outside ~/dotfiles.
myModules.codexGeneratedSkills.worktreeCodexDir = "${worktreeDotfiles}/codex";
# Home Manager directory links for .emacs.d resolve through the store on this
# machine, which breaks Elpaca's writable state under ~/.emacs.d/elpaca.