fix: Codex was showing / instead of $ for command references

The build system hardcoded `/` as the command prefix for every provider,
but Codex CLI uses `$`. Added command_prefix to PROVIDER_PLACEHOLDERS
so replacePlaceholders and prefixSkillReferences use the right one.
Now `$normalize` shows up in Codex output instead of `/normalize`.
This commit is contained in:
Gabi
2026-03-23 21:59:42 +01:00
parent e9ac702849
commit d67d69d342
2 changed files with 44 additions and 15 deletions
+3 -3
View File
@@ -46,8 +46,8 @@ export function transformCodex(skills, distDir, patterns = null, options = {}) {
const frontmatter = generateYamlFrontmatter(frontmatterObj);
let skillBody = replacePlaceholders(skill.body, 'codex', commandNames);
if (prefix) skillBody = prefixSkillReferences(skillBody, prefix, allSkillNames);
let skillBody = replacePlaceholders(skill.body, 'codex', commandNames, allSkillNames);
if (prefix) skillBody = prefixSkillReferences(skillBody, prefix, allSkillNames, '$');
// For user-invocable skills, transform remaining {{argname}} to $ARGNAME
if (skill.userInvocable) {
skillBody = skillBody.replace(/\{\{([^}]+)\}\}/g, (match, argName) => {
@@ -65,7 +65,7 @@ export function transformCodex(skills, distDir, patterns = null, options = {}) {
ensureDir(refDir);
for (const ref of skill.references) {
const refOutputPath = path.join(refDir, `${ref.name}.md`);
const refContent = replacePlaceholders(ref.content, 'codex');
const refContent = replacePlaceholders(ref.content, 'codex', [], allSkillNames);
writeFile(refOutputPath, refContent);
refCount++;
}