From 033aa717f433040164291396b438c0da466437fd Mon Sep 17 00:00:00 2001 From: Serhii Date: Wed, 5 Nov 2025 06:21:16 +0200 Subject: [PATCH] refactor: use path.basename() consistently for file extensions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace .replace('.agent.yaml', '') with path.basename(file, '.agent.yaml') for consistency and correct handling of edge cases. Changes: - buildAllAgents(): line 238 - checkBuildStatus(): line 333 - listAvailableAgents(): line 452 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- tools/cli/commands/build.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/cli/commands/build.js b/tools/cli/commands/build.js index ec5c6dec..a22e9485 100644 --- a/tools/cli/commands/build.js +++ b/tools/cli/commands/build.js @@ -235,7 +235,7 @@ async function buildAllAgents(projectDir, force = false) { continue; } - const agentName = file.replace('.agent.yaml', ''); + const agentName = path.basename(file, '.agent.yaml'); const agentYamlPath = path.join(agentsDir, file); const outputPath = path.join(agentsDir, `${agentName}.md`); @@ -330,7 +330,7 @@ async function checkBuildStatus(projectDir) { continue; } - const agentName = file.replace('.agent.yaml', ''); + const agentName = path.basename(file, '.agent.yaml'); const agentYamlPath = path.join(agentsDir, file); const outputPath = path.join(agentsDir, `${agentName}.md`); @@ -449,7 +449,7 @@ async function listAvailableAgents(projectDir) { for (const file of files) { if (file.endsWith('.agent.yaml')) { - const agentName = file.replace('.agent.yaml', ''); + const agentName = path.basename(file, '.agent.yaml'); console.log(chalk.dim(` - ${agentName} (${module})`)); } }