refactor(prompt): dedupe repeated skill guidance blocks

This commit is contained in:
Bo Li
2026-02-19 02:22:14 +08:00
parent d06f55325a
commit 652fc75b3d
3 changed files with 12 additions and 40 deletions
@@ -43,16 +43,16 @@ describe("buildCategorySkillsDelegationGuide", () => {
expect(result).toContain("HIGH PRIORITY")
})
it("should include custom skill names in CRITICAL warning", () => {
it("should list custom skills and keep CRITICAL warning", () => {
//#given: custom skills installed
const allSkills = [...builtinSkills, ...customUserSkills]
//#when: building the delegation guide
const result = buildCategorySkillsDelegationGuide(categories, allSkills)
//#then: should mention custom skills by name in the warning
expect(result).toContain('"react-19"')
expect(result).toContain('"tailwind-4"')
//#then: should mention custom skills by name and include warning
expect(result).toContain("`react-19`")
expect(result).toContain("`tailwind-4`")
expect(result).toContain("CRITICAL")
})
@@ -180,8 +180,8 @@ describe("formatCustomSkillsBlock", () => {
//#then: contains all expected elements
expect(result).toContain("User-Installed Skills (HIGH PRIORITY)")
expect(result).toContain("CRITICAL")
expect(result).toContain('"react-19"')
expect(result).toContain('"tailwind-4"')
expect(result).toContain("`react-19`")
expect(result).toContain("`tailwind-4`")
expect(result).toContain("| user |")
expect(result).toContain("| project |")
})