fix(install): link skills where codex looks

Codex 0.148 discovers skills under $CODEX_HOME/skills only, so every
skill in this repo was invisible to codex sessions — review sessions run
by a codex reviewer reported review-pr as an unavailable skill and fell
back to improvising a review.

Both installers now link each skill into ~/.codex/skills as well. The
nix module links one symlink per skill dir instead of recursive=true:
codex skips any skill whose SKILL.md is itself a symlink, which is what
a per-file link produces.
This commit is contained in:
Miguel Palhas
2026-08-22 19:50:01 +01:00
parent 0f131f00a4
commit 0096addb23
3 changed files with 27 additions and 7 deletions
+17 -1
View File
@@ -40,6 +40,22 @@ let
repo = cfg.repoPath;
mkEnable = what: lib.mkEnableOption "the ${what} user unit";
# Codex reads $CODEX_HOME/skills and nothing else -- ~/.agents/skills reaches
# pi and opencode but not codex, which is why codex review sessions reported
# review-pr as an unavailable skill. One symlink per skill dir rather than
# recursive=true: codex skips any skill whose SKILL.md is itself a symlink,
# which is exactly what a per-file link produces. Per-skill also leaves
# codex's own ~/.codex/skills/.system in place, which a whole-dir link would
# replace.
skillNames = builtins.attrNames (
lib.filterAttrs (_: type: type == "directory") (builtins.readDir "${agent-skills}/skills")
);
codexSkills = lib.listToAttrs (
map (name: lib.nameValuePair ".codex/skills/${name}" {
source = "${agent-skills}/skills/${name}";
}) skillNames
);
in
{
options.programs.agentSkills = {
@@ -71,7 +87,7 @@ in
weekReview.enable = mkEnable "weekly review timer";
};
config.home.file = {
config.home.file = codexSkills // {
".claude/skills" = {
source = "${agent-skills}/skills";
recursive = true;