Merge pull request #1436 from Tibsfox/fix/codex-path-replacement-1430
fix(install): add .claude path replacement for Codex runtime
This commit is contained in:
@@ -1104,6 +1104,10 @@ function convertSlashCommandsToCodexSkillMentions(content) {
|
||||
function convertClaudeToCodexMarkdown(content) {
|
||||
let converted = convertSlashCommandsToCodexSkillMentions(content);
|
||||
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)
|
||||
converted = neutralizeAgentReferences(converted, 'AGENTS.md');
|
||||
return converted;
|
||||
|
||||
@@ -169,6 +169,21 @@ Run /gsd:execute-phase to proceed.`;
|
||||
const result = convertClaudeAgentToCodexAgent(input);
|
||||
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 ─────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user