From b9fd912ecf07758939da46bf8dc6be9897027fda Mon Sep 17 00:00:00 2001 From: Aliou Diallo Date: Thu, 18 Dec 2025 23:57:54 +0100 Subject: [PATCH] fix(coding-agent): support symlinked slash commands in discovery --- packages/coding-agent/src/core/slash-commands.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/coding-agent/src/core/slash-commands.ts b/packages/coding-agent/src/core/slash-commands.ts index 57f37f2d..5450d622 100644 --- a/packages/coding-agent/src/core/slash-commands.ts +++ b/packages/coding-agent/src/core/slash-commands.ts @@ -99,7 +99,7 @@ export function substituteArgs(content: string, args: string[]): string { } /** - * Recursively scan a directory for .md files and load them as slash commands + * Recursively scan a directory for .md files (and symlinks to .md files) and load them as slash commands */ function loadCommandsFromDir(dir: string, source: "user" | "project", subdir: string = ""): FileSlashCommand[] { const commands: FileSlashCommand[] = []; @@ -118,7 +118,7 @@ function loadCommandsFromDir(dir: string, source: "user" | "project", subdir: st // Recurse into subdirectory const newSubdir = subdir ? `${subdir}:${entry.name}` : entry.name; commands.push(...loadCommandsFromDir(fullPath, source, newSubdir)); - } else if (entry.isFile() && entry.name.endsWith(".md")) { + } else if ((entry.isFile() || entry.isSymbolicLink()) && entry.name.endsWith(".md")) { try { const rawContent = readFileSync(fullPath, "utf-8"); const { frontmatter, content } = parseFrontmatter(rawContent);