refactor(skills): stabilize watcher targets and include agents skills

This commit is contained in:
Peter Steinberger
2026-02-14 19:54:06 +01:00
parent 013e8f6b3b
commit eed6113359
2 changed files with 21 additions and 5 deletions

View File

@@ -1,3 +1,4 @@
import os from "node:os";
import path from "node:path";
import { describe, expect, it, vi } from "vitest";
@@ -22,10 +23,15 @@ describe("ensureSkillsWatcher", () => {
const opts = watchMock.mock.calls[0]?.[1] as { ignored?: unknown };
expect(opts.ignored).toBe(mod.DEFAULT_SKILLS_WATCH_IGNORED);
const posix = (p: string) => p.replaceAll("\\", "/");
expect(targets).toEqual(
expect.arrayContaining([
path.join("/tmp/workspace", "skills", "SKILL.md"),
path.join("/tmp/workspace", "skills", "*", "SKILL.md"),
posix(path.join("/tmp/workspace", "skills", "SKILL.md")),
posix(path.join("/tmp/workspace", "skills", "*", "SKILL.md")),
posix(path.join("/tmp/workspace", ".agents", "skills", "SKILL.md")),
posix(path.join("/tmp/workspace", ".agents", "skills", "*", "SKILL.md")),
posix(path.join(os.homedir(), ".agents", "skills", "SKILL.md")),
posix(path.join(os.homedir(), ".agents", "skills", "*", "SKILL.md")),
]),
);
expect(targets.every((target) => target.includes("SKILL.md"))).toBe(true);