From 2c0db8ea8506c8e34b6f398b2c512988b81e8007 Mon Sep 17 00:00:00 2001 From: Cristian Mos Date: Fri, 20 Feb 2026 20:49:59 +0200 Subject: [PATCH] fix(gemini): prevent workflows and templates from being incorrectly converted to TOML --- bin/install.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/bin/install.js b/bin/install.js index b348677d9..5f0e38935 100755 --- a/bin/install.js +++ b/bin/install.js @@ -680,7 +680,7 @@ function copyFlattenedCommands(srcDir, destDir, prefix, pathPrefix, runtime) { * @param {string} pathPrefix - Path prefix for file references * @param {string} runtime - Target runtime ('claude', 'opencode', 'gemini') */ -function copyWithPathReplacement(srcDir, destDir, pathPrefix, runtime) { +function copyWithPathReplacement(srcDir, destDir, pathPrefix, runtime, isCommand = false) { const isOpencode = runtime === 'opencode'; const dirName = getDirName(runtime); @@ -697,7 +697,7 @@ function copyWithPathReplacement(srcDir, destDir, pathPrefix, runtime) { const destPath = path.join(destDir, entry.name); if (entry.isDirectory()) { - copyWithPathReplacement(srcPath, destPath, pathPrefix, runtime); + copyWithPathReplacement(srcPath, destPath, pathPrefix, runtime, isCommand); } else if (entry.name.endsWith('.md')) { // Replace ~/.claude/ and ./.claude/ with runtime-appropriate paths let content = fs.readFileSync(srcPath, 'utf8'); @@ -712,12 +712,16 @@ function copyWithPathReplacement(srcDir, destDir, pathPrefix, runtime) { content = convertClaudeToOpencodeFrontmatter(content); fs.writeFileSync(destPath, content); } else if (runtime === 'gemini') { - // Convert to TOML for Gemini (strip tags — terminals can't render subscript) - content = stripSubTags(content); - const tomlContent = convertClaudeToGeminiToml(content); - // Replace extension with .toml - const tomlPath = destPath.replace(/\.md$/, '.toml'); - fs.writeFileSync(tomlPath, tomlContent); + if (isCommand) { + // Convert to TOML for Gemini (strip tags — terminals can't render subscript) + content = stripSubTags(content); + const tomlContent = convertClaudeToGeminiToml(content); + // Replace extension with .toml + const tomlPath = destPath.replace(/\.md$/, '.toml'); + fs.writeFileSync(tomlPath, tomlContent); + } else { + fs.writeFileSync(destPath, content); + } } else { fs.writeFileSync(destPath, content); } @@ -1386,7 +1390,7 @@ function install(isGlobal, runtime = 'claude') { const gsdSrc = path.join(src, 'commands', 'gsd'); const gsdDest = path.join(commandsDir, 'gsd'); - copyWithPathReplacement(gsdSrc, gsdDest, pathPrefix, runtime); + copyWithPathReplacement(gsdSrc, gsdDest, pathPrefix, runtime, true); if (verifyInstalled(gsdDest, 'commands/gsd')) { console.log(` ${green}✓${reset} Installed commands/gsd`); } else {