From b318d9242ebc81f66f9d9723dc9f5bf91f8312bf Mon Sep 17 00:00:00 2001 From: Wendy Smoak Date: Sun, 15 Feb 2026 10:03:54 -0500 Subject: [PATCH] fix(codex): use yaml.stringify for skill frontmatter to escape special characters Prevents invalid YAML when agentName or skillName contains quotes or other special characters. Aligns the fallback path in transformToSkillFormat and installCustomAgentLauncher with the existing yaml.stringify usage on the main code path. --- tools/cli/installers/lib/ide/codex.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/cli/installers/lib/ide/codex.js b/tools/cli/installers/lib/ide/codex.js index 38097e6c9..e46b179fb 100644 --- a/tools/cli/installers/lib/ide/codex.js +++ b/tools/cli/installers/lib/ide/codex.js @@ -200,7 +200,8 @@ class CodexSetup extends BaseIdeSetup { const fmMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/); if (!fmMatch) { // No frontmatter -- wrap with minimal frontmatter - return `---\nname: ${skillName}\ndescription: '${skillName}'\n---\n\n${content}`; + const fm = yaml.stringify({ name: skillName, description: skillName }).trimEnd(); + return `---\n${fm}\n---\n\n${content}`; } const frontmatter = fmMatch[1]; @@ -438,9 +439,9 @@ class CodexSetup extends BaseIdeSetup { const skillDir = path.join(destDir, skillName); await fs.ensureDir(skillDir); + const fm = yaml.stringify({ name: skillName, description: `${agentName} agent` }).trimEnd(); const skillContent = `--- -name: ${skillName} -description: '${agentName} agent' +${fm} --- You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.