fix: preserve nested async skill names in discovery

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
Sisyphus
2026-03-29 00:35:59 -07:00
parent 5a28ee1bef
commit c132185d17
2 changed files with 57 additions and 9 deletions
@@ -107,6 +107,30 @@ Direct skill.
expect(skills[0].name).toBe("direct-skill")
})
it("preserves nested skill path names during recursive discovery", async () => {
// given
const nestedSkillDir = join(SKILLS_DIR, "superpowers", "brainstorming")
mkdirSync(nestedSkillDir, { recursive: true })
writeFileSync(
join(nestedSkillDir, "SKILL.md"),
`---
name: brainstorming
description: Nested brainstorming skill
---
Nested skill.
`
)
// when
const { discoverSkillsInDirAsync } = await import("./async-loader")
const skills = await discoverSkillsInDirAsync(SKILLS_DIR)
// then
expect(skills).toHaveLength(1)
expect(skills[0]?.name).toBe("superpowers/brainstorming")
expect(skills[0]?.definition.name).toBe("superpowers/brainstorming")
})
it("skips entries starting with dot", async () => {
// given
const validContent = `---