fix: sanitize colons in skill/agent names for Windows path compatibility (#398)

This commit is contained in:
Trevin Chow
2026-03-26 16:15:48 -07:00
committed by GitHub
parent 0877b693ce
commit b25480af9e
31 changed files with 356 additions and 61 deletions

View File

@@ -75,6 +75,16 @@ export async function walkFiles(root: string): Promise<string[]> {
return results
}
/**
* Sanitize a name for use as a filesystem path component.
* Replaces colons with hyphens so colon-namespaced names
* (e.g. "ce:brainstorm") become flat directory names ("ce-brainstorm")
* instead of failing on Windows where colons are illegal in filenames.
*/
export function sanitizePathName(name: string): string {
return name.replace(/:/g, "-")
}
/**
* Resolve a colon-separated command name into a filesystem path.
* e.g. resolveCommandPath("/commands", "ce:plan", ".md") -> "/commands/ce/plan.md"