fix(coding-agent): stop skill recursion at root closes #2075

This commit is contained in:
Mario Zechner
2026-03-14 04:18:28 +01:00
parent acb0f4d807
commit a8e3c829fa
4 changed files with 51 additions and 9 deletions

View File

@@ -0,0 +1,3 @@
---
description: Root skill should win.
---

View File

@@ -0,0 +1,3 @@
---
description: Nested skill should be ignored.
---

View File

@@ -86,6 +86,18 @@ describe("skills", () => {
expect(diagnostics).toHaveLength(0);
});
it("should prefer a directory's root SKILL.md over nested SKILL.md files", () => {
const { skills, diagnostics } = loadSkillsFromDir({
dir: join(fixturesDir, "root-skill-preferred"),
source: "test",
});
expect(skills).toHaveLength(1);
expect(skills[0].name).toBe("root-skill-preferred");
expect(skills[0].description).toBe("Root skill should win.");
expect(diagnostics).toHaveLength(0);
});
it("should skip files without frontmatter", () => {
const { skills, diagnostics } = loadSkillsFromDir({
dir: join(fixturesDir, "no-frontmatter"),