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

@@ -113,7 +113,7 @@ describe("convertClaudeToOpenClaw", () => {
properties: {},
})
expect(bundle.manifest.skills).toContain("skills/agent-security-reviewer")
expect(bundle.manifest.skills).toContain("skills/cmd-workflows:plan")
expect(bundle.manifest.skills).toContain("skills/cmd-workflows-plan")
expect(bundle.manifest.skills).toContain("skills/existing-skill")
})
@@ -201,4 +201,27 @@ describe("convertClaudeToOpenClaw", () => {
const bundle = convertClaudeToOpenClaw(plugin, defaultOptions)
expect(bundle.openclawConfig).toBeUndefined()
})
test("manifest skill paths use sanitized names matching filesystem output", () => {
const plugin: ClaudePlugin = {
...fixturePlugin,
skills: [
{
name: "ce:plan",
description: "Planning skill",
sourceDir: "/tmp/plugin/skills/ce-plan",
skillPath: "/tmp/plugin/skills/ce-plan/SKILL.md",
},
],
}
const bundle = convertClaudeToOpenClaw(plugin, defaultOptions)
// Manifest paths must not contain colons
for (const skillPath of bundle.manifest.skills) {
expect(skillPath).not.toContain(":")
}
expect(bundle.manifest.skills).toContain("skills/ce-plan")
expect(bundle.manifest.skills).toContain("skills/cmd-workflows-plan")
})
})