fix(skill): allow missing descriptions (#26391)

This commit is contained in:
Dax
2026-05-08 14:50:06 -04:00
committed by GitHub
parent 75308ea47d
commit fed221e0b0
4 changed files with 45 additions and 7 deletions

View File

@@ -26,6 +26,11 @@ const skills: Skill.Info[] = [
location: "/tmp/middle-skill/SKILL.md",
content: "# middle-skill",
},
{
name: "manual-skill",
location: "/tmp/manual-skill/SKILL.md",
content: "# manual-skill",
},
]
const build: Agent.Info = {
@@ -68,6 +73,7 @@ describe("session.system", () => {
expect(alpha).toBeGreaterThan(-1)
expect(middle).toBeGreaterThan(alpha)
expect(zeta).toBeGreaterThan(middle)
expect(output).not.toContain("manual-skill")
}),
)
})

View File

@@ -163,6 +163,37 @@ Just some content without YAML frontmatter.
),
)
it.live("discovers skills without descriptions", () =>
provideTmpdirInstance(
(dir) =>
Effect.gen(function* () {
yield* Effect.promise(() =>
Bun.write(
path.join(dir, ".opencode", "skill", "manual-skill", "SKILL.md"),
`---
name: manual-skill
---
# Manual Skill
Instructions here.
`,
),
)
const skill = yield* Skill.Service
const list = yield* skill.all()
expect(list.length).toBe(1)
const item = list.find((x) => x.name === "manual-skill")
expect(item).toBeDefined()
expect(item!.description).toBeUndefined()
expect(Skill.fmt(list, { verbose: false })).toBe("No skills are currently available.")
expect(Skill.fmt(list, { verbose: true })).toBe("No skills are currently available.")
}),
{ git: true },
),
)
it.live("discovers skills from .claude/skills/ directory", () =>
provideTmpdirInstance(
(dir) =>