From 7058c68e561873435007be968db53efe51ce5d55 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Mon, 15 Jun 2026 21:00:56 -0700 Subject: [PATCH] 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 --- .gitignore | 5 +++++ dotfiles/claude/skills | 1 + nixos/dotfiles-links.nix | 6 +++++- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 120000 dotfiles/claude/skills diff --git a/.gitignore b/.gitignore index 36854231..081b7442 100644 --- a/.gitignore +++ b/.gitignore @@ -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. diff --git a/dotfiles/claude/skills b/dotfiles/claude/skills new file mode 120000 index 00000000..a769d4bd --- /dev/null +++ b/dotfiles/claude/skills @@ -0,0 +1 @@ +../agents/skills \ No newline at end of file diff --git a/nixos/dotfiles-links.nix b/nixos/dotfiles-links.nix index 26fbebd9..ab8a74c5 100644 --- a/nixos/dotfiles-links.nix +++ b/nixos/dotfiles-links.nix @@ -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.