fix(install): add .claude path replacement for Codex runtime
convertClaudeToCodexMarkdown() was missing path replacement — unlike Copilot/Gemini/Antigravity converters which all replace $HOME/.claude/ paths. This left hardcoded .claude references in Codex agent files, causing ENOENT when gsd-tools.cjs tried to load from ~/.claude/ on Codex installations. Closes #1430 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1006,6 +1006,10 @@ function convertSlashCommandsToCodexSkillMentions(content) {
|
|||||||
function convertClaudeToCodexMarkdown(content) {
|
function convertClaudeToCodexMarkdown(content) {
|
||||||
let converted = convertSlashCommandsToCodexSkillMentions(content);
|
let converted = convertSlashCommandsToCodexSkillMentions(content);
|
||||||
converted = converted.replace(/\$ARGUMENTS\b/g, '{{GSD_ARGS}}');
|
converted = converted.replace(/\$ARGUMENTS\b/g, '{{GSD_ARGS}}');
|
||||||
|
// Path replacement: .claude → .codex (#1430)
|
||||||
|
converted = converted.replace(/\$HOME\/\.claude\//g, '$HOME/.codex/');
|
||||||
|
converted = converted.replace(/~\/\.claude\//g, '~/.codex/');
|
||||||
|
converted = converted.replace(/\.\/\.claude\//g, './.codex/');
|
||||||
// Runtime-neutral agent name replacement (#766)
|
// Runtime-neutral agent name replacement (#766)
|
||||||
converted = neutralizeAgentReferences(converted, 'AGENTS.md');
|
converted = neutralizeAgentReferences(converted, 'AGENTS.md');
|
||||||
return converted;
|
return converted;
|
||||||
|
|||||||
@@ -169,6 +169,21 @@ Run /gsd:execute-phase to proceed.`;
|
|||||||
const result = convertClaudeAgentToCodexAgent(input);
|
const result = convertClaudeAgentToCodexAgent(input);
|
||||||
assert.strictEqual(result, input, 'returns input unchanged');
|
assert.strictEqual(result, input, 'returns input unchanged');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('replaces .claude paths with .codex paths (#1430)', () => {
|
||||||
|
const input = `---
|
||||||
|
name: gsd-debugger
|
||||||
|
description: Debugs issues
|
||||||
|
tools: Read, Bash
|
||||||
|
---
|
||||||
|
|
||||||
|
INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" state load)
|
||||||
|
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs: resolve"`;
|
||||||
|
|
||||||
|
const result = convertClaudeAgentToCodexAgent(input);
|
||||||
|
assert.ok(result.includes('$HOME/.codex/get-shit-done/bin/gsd-tools.cjs'), 'replaces $HOME/.claude/ with $HOME/.codex/');
|
||||||
|
assert.ok(!result.includes('$HOME/.claude/'), 'no .claude paths remain');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// ─── generateCodexAgentToml ─────────────────────────────────────────────────────
|
// ─── generateCodexAgentToml ─────────────────────────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user