Skip to content

Commit 72139e1

Browse files
committed
fix(codex): show generated commands
Install generated command prompts through programs.codex.skills and avoid explicit-only skill metadata, since Codex omits those skills from the visible skill list.
1 parent bdbb46f commit 72139e1

3 files changed

Lines changed: 4 additions & 27 deletions

File tree

modules/common/ai-tools/commands.nix

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -121,24 +121,12 @@ let
121121
${lib.trim command.prompt}
122122
'';
123123

124-
renderCodexSkillMetadata = _command: ''
125-
policy:
126-
allow_implicit_invocation: false
127-
'';
128-
129-
renderCodexSkillFiles = command: {
130-
"SKILL.md" = renderCodexSkill command;
131-
"agents/openai.yaml" = renderCodexSkillMetadata command;
132-
};
133-
134124
toClaudeMarkdown = lib.mapAttrs (_name: renderClaudeMarkdown) commands;
135125

136126
toCopilotSkills = lib.mapAttrs (_name: renderCopilotSkill) commands;
137127

138128
toCodexSkills = lib.mapAttrs (_name: renderCodexSkill) commands;
139129

140-
toCodexSkillFiles = lib.mapAttrs (_name: renderCodexSkillFiles) commands;
141-
142130
toOpenCodeMarkdown = lib.mapAttrs (_name: renderOpenCodeMarkdown) commands;
143131

144132
toAntigravityCommands = lib.mapAttrs (_name: command: {
@@ -152,14 +140,11 @@ in
152140
renderClaudeMarkdown
153141
renderCopilotSkill
154142
renderCodexSkill
155-
renderCodexSkillFiles
156-
renderCodexSkillMetadata
157143
renderOpenCodeMarkdown
158144
toAntigravityCommands
159145
toClaudeMarkdown
160146
toCopilotSkills
161147
toCodexSkills
162-
toCodexSkillFiles
163148
toOpenCodeMarkdown
164149
;
165150

modules/common/ai-tools/default.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,9 @@ in
166166
codex = {
167167
disabledSystemSkills = disabledSystemSkillsForHarness "codex";
168168
agents = aiAgents.toCodexAgents;
169-
commandSkillFiles = aiCommands.toCodexSkillFiles;
169+
commandSkills = aiCommands.toCodexSkills;
170170
contextOverride = codexContextOverride;
171+
skillAttrs = skillsAttrsForHarness "codex";
171172
skills = skillsForHarness "codex";
172173
};
173174

modules/home/programs/terminal/tools/codex/default.nix

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,6 @@ let
3535
source = tomlFormat.generate "codex-agent-${name}" agentSettings;
3636
}
3737
) aiTools.codex.agents;
38-
codexCommandFiles = lib.concatMapAttrs (
39-
name: commandFiles:
40-
lib.mapAttrs' (
41-
relativePath: fileText:
42-
lib.nameValuePair "${codexConfigDir}/skills/${name}/${relativePath}" {
43-
text = fileText;
44-
}
45-
) commandFiles
46-
) aiTools.codex.commandSkillFiles;
4738
codexProfiles = {
4839
# Deep analysis and live-research mode. Intentionally expensive:
4940
# benchmark preference is GPT-5.5 xhigh for best pass rate.
@@ -134,7 +125,7 @@ in
134125
|| verboseEcho "codex-browser-use-linux-chromium install failed (non-fatal); run codex-browser-doctor"
135126
'';
136127
};
137-
file = codexAgentFiles // codexCommandFiles;
128+
file = codexAgentFiles;
138129
packages = lib.optionals pkgs.stdenv.hostPlatform.isLinux [
139130
pkgs.khanelinix.codex-browser-use-linux-chromium
140131
];
@@ -377,7 +368,7 @@ in
377368

378369
context = builtins.readFile aiTools.base;
379370
contextOverride = aiTools.codex.contextOverride;
380-
inherit (aiTools.codex) skills;
371+
skills = aiTools.codex.commandSkills // aiTools.codex.skillAttrs;
381372
rules = import ./rules.nix;
382373
};
383374
};

0 commit comments

Comments
 (0)