Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -3437,6 +3437,16 @@ function convertSlashCommandsToCodexSkillMentions(content) {
|
||||
return converted;
|
||||
}
|
||||
|
||||
const CODEX_GSD_TOOLS_INVOCATION = 'node "$HOME/.codex/gsd-core/bin/gsd-tools.cjs"';
|
||||
|
||||
function rewriteBareGsdToolsCommandsForCodex(content) {
|
||||
return content
|
||||
.replace(/(^[ \t]*)gsd-tools(?=\s)/gm, `$1${CODEX_GSD_TOOLS_INVOCATION}`)
|
||||
.replace(/(\$\(\s*)gsd-tools(?=\s)/g, `$1${CODEX_GSD_TOOLS_INVOCATION}`)
|
||||
.replace(/(`\s*)gsd-tools(?=\s)/g, `$1${CODEX_GSD_TOOLS_INVOCATION}`)
|
||||
.replace(/((?:&&|\|\||[;|])\s*)gsd-tools(?=\s)/g, `$1${CODEX_GSD_TOOLS_INVOCATION}`);
|
||||
}
|
||||
|
||||
function convertClaudeToCodexMarkdown(content) {
|
||||
let converted = convertSlashCommandsToCodexSkillMentions(content);
|
||||
converted = converted.replace(/\$ARGUMENTS\b/g, '{{GSD_ARGS}}');
|
||||
@@ -3462,6 +3472,10 @@ function convertClaudeToCodexMarkdown(content) {
|
||||
// `.claudeignore` → `.codexignore` (#2639). Codex honors its own ignore
|
||||
// file; leaving the Claude-specific name is misleading in agent prompts.
|
||||
converted = converted.replace(/\.claudeignore\b/g, '.codexignore');
|
||||
// Codex installs the tools shim under ~/.codex but does not guarantee a
|
||||
// bare `gsd-tools` binary on PATH. Keep resolver probes such as
|
||||
// `command -v gsd-tools` intact; rewrite only command invocations.
|
||||
converted = rewriteBareGsdToolsCommandsForCodex(converted);
|
||||
// Runtime-neutral agent name replacement (#766)
|
||||
converted = neutralizeAgentReferences(converted, 'AGENTS.md');
|
||||
return converted;
|
||||
|
||||
Reference in New Issue
Block a user