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

@@ -485,4 +485,35 @@ Task best-practices-researcher(topic)`
expect(result).toContain("the dhh-rails-reviewer agent")
expect(result).not.toContain("@security-sentinel")
})
test("generated skill deduplicates against sanitized pass-through skill names", () => {
const plugin: ClaudePlugin = {
...fixturePlugin,
agents: [],
commands: [
{
name: "ce:plan",
description: "Planning command",
model: "inherit",
allowedTools: [],
body: "Plan the work.",
sourcePath: "/tmp/plugin/commands/ce-plan.md",
},
],
skills: [
{
name: "ce:plan",
description: "Planning skill",
sourceDir: "/tmp/plugin/skills/ce-plan",
skillPath: "/tmp/plugin/skills/ce-plan/SKILL.md",
},
],
}
const bundle = convertClaudeToCopilot(plugin, defaultOptions)
// The generated skill from the command should get a deduplicated name
// since "ce:plan" and "ce-plan" both map to "ce-plan" on disk
expect(bundle.generatedSkills[0].name).not.toBe("ce-plan")
})
})