From 337613b4744c1cafa1d703beb5251dc2100bbb25 Mon Sep 17 00:00:00 2001 From: Bruno <281018252+bruno-archastro@users.noreply.github.com> Date: Mon, 19 Oct 2026 15:08:03 +0000 Subject: [PATCH] Enforce the skill description length limit in CI --- archdev/SKILL.md | 2 +- plugins/antigravity/skills/archdev/SKILL.md | 2 +- plugins/claude/skills/archdev/SKILL.md | 2 +- plugins/codex/skills/archdev/SKILL.md | 2 +- plugins/copilot/skills/archdev/SKILL.md | 2 +- plugins/cursor/skills/archdev/SKILL.md | 2 +- plugins/grok/skills/archdev/SKILL.md | 2 +- plugins/opencode/skills/archdev/SKILL.md | 2 +- plugins/pi/skills/archdev/SKILL.md | 2 +- tools/plugin-gen/README.md | 2 +- tools/plugin-gen/package-lock.json | 19 ++++- tools/plugin-gen/package.json | 3 +- .../test/skill-descriptions.test.ts | 77 +++++++++++++++++++ 13 files changed, 107 insertions(+), 12 deletions(-) create mode 100644 tools/plugin-gen/test/skill-descriptions.test.ts diff --git a/archdev/SKILL.md b/archdev/SKILL.md index 7d1dd6e..c813954 100644 --- a/archdev/SKILL.md +++ b/archdev/SKILL.md @@ -1,6 +1,6 @@ --- name: archdev -description: Core ArchDev workflow — use for anything involving ArchDev. Covers archdev CLI setup, upgrade, login, and model access; archdev.json configuration and validation (check); repo onboarding and readiness (repo status); mapping a repo's plans, tasks, agents, and review workflow into the activity taxonomy (repo map); harness monitor hooks (repo hook setup); reporting build events as unstructured notes or schema-validated payloads (archdev log post, log post --event); reading and searching the organization stream for prior lessons (log messages, log search); publishing team lifecycle posts — start, lesson, abandoned, done, handoff, question (log --kind); observing agent activity (repo monitor); generating, saving, and sharing live Ask dashboards (archdev ask); mandatory PR CI and risk follow-through after opening or updating PRs; and querying published PR risk/scope (inspect metadata) and repository rule candidates (rules candidates). Load at session start whenever the archdev CLI is installed, the repo contains archdev.json, or the task touches plans, tasks, sessions, commits, PRs, or harness hooks. +description: Core ArchDev workflow — use for anything involving ArchDev. Covers CLI setup, upgrades, login, and model access; archdev.json validation (check); repo onboarding and readiness (repo status); activity taxonomy mapping (repo map); harness hooks (repo hook setup); build-event reporting (log post, log post --event); prior lessons (log messages, log search); lifecycle posts — start, lesson, abandoned, done, handoff, question (log --kind); agent activity (repo monitor); generating, saving, and sharing live Ask dashboards (archdev ask); mandatory PR CI and risk follow-through; published PR risk/scope (inspect metadata); and repository rule candidates (rules candidates). Load at session start whenever the archdev CLI is installed, the repo contains archdev.json, or the task touches plans, tasks, sessions, commits, PRs, or harness hooks. --- # ArchDev diff --git a/plugins/antigravity/skills/archdev/SKILL.md b/plugins/antigravity/skills/archdev/SKILL.md index 7d1dd6e..c813954 100644 --- a/plugins/antigravity/skills/archdev/SKILL.md +++ b/plugins/antigravity/skills/archdev/SKILL.md @@ -1,6 +1,6 @@ --- name: archdev -description: Core ArchDev workflow — use for anything involving ArchDev. Covers archdev CLI setup, upgrade, login, and model access; archdev.json configuration and validation (check); repo onboarding and readiness (repo status); mapping a repo's plans, tasks, agents, and review workflow into the activity taxonomy (repo map); harness monitor hooks (repo hook setup); reporting build events as unstructured notes or schema-validated payloads (archdev log post, log post --event); reading and searching the organization stream for prior lessons (log messages, log search); publishing team lifecycle posts — start, lesson, abandoned, done, handoff, question (log --kind); observing agent activity (repo monitor); generating, saving, and sharing live Ask dashboards (archdev ask); mandatory PR CI and risk follow-through after opening or updating PRs; and querying published PR risk/scope (inspect metadata) and repository rule candidates (rules candidates). Load at session start whenever the archdev CLI is installed, the repo contains archdev.json, or the task touches plans, tasks, sessions, commits, PRs, or harness hooks. +description: Core ArchDev workflow — use for anything involving ArchDev. Covers CLI setup, upgrades, login, and model access; archdev.json validation (check); repo onboarding and readiness (repo status); activity taxonomy mapping (repo map); harness hooks (repo hook setup); build-event reporting (log post, log post --event); prior lessons (log messages, log search); lifecycle posts — start, lesson, abandoned, done, handoff, question (log --kind); agent activity (repo monitor); generating, saving, and sharing live Ask dashboards (archdev ask); mandatory PR CI and risk follow-through; published PR risk/scope (inspect metadata); and repository rule candidates (rules candidates). Load at session start whenever the archdev CLI is installed, the repo contains archdev.json, or the task touches plans, tasks, sessions, commits, PRs, or harness hooks. --- # ArchDev diff --git a/plugins/claude/skills/archdev/SKILL.md b/plugins/claude/skills/archdev/SKILL.md index 7d1dd6e..c813954 100644 --- a/plugins/claude/skills/archdev/SKILL.md +++ b/plugins/claude/skills/archdev/SKILL.md @@ -1,6 +1,6 @@ --- name: archdev -description: Core ArchDev workflow — use for anything involving ArchDev. Covers archdev CLI setup, upgrade, login, and model access; archdev.json configuration and validation (check); repo onboarding and readiness (repo status); mapping a repo's plans, tasks, agents, and review workflow into the activity taxonomy (repo map); harness monitor hooks (repo hook setup); reporting build events as unstructured notes or schema-validated payloads (archdev log post, log post --event); reading and searching the organization stream for prior lessons (log messages, log search); publishing team lifecycle posts — start, lesson, abandoned, done, handoff, question (log --kind); observing agent activity (repo monitor); generating, saving, and sharing live Ask dashboards (archdev ask); mandatory PR CI and risk follow-through after opening or updating PRs; and querying published PR risk/scope (inspect metadata) and repository rule candidates (rules candidates). Load at session start whenever the archdev CLI is installed, the repo contains archdev.json, or the task touches plans, tasks, sessions, commits, PRs, or harness hooks. +description: Core ArchDev workflow — use for anything involving ArchDev. Covers CLI setup, upgrades, login, and model access; archdev.json validation (check); repo onboarding and readiness (repo status); activity taxonomy mapping (repo map); harness hooks (repo hook setup); build-event reporting (log post, log post --event); prior lessons (log messages, log search); lifecycle posts — start, lesson, abandoned, done, handoff, question (log --kind); agent activity (repo monitor); generating, saving, and sharing live Ask dashboards (archdev ask); mandatory PR CI and risk follow-through; published PR risk/scope (inspect metadata); and repository rule candidates (rules candidates). Load at session start whenever the archdev CLI is installed, the repo contains archdev.json, or the task touches plans, tasks, sessions, commits, PRs, or harness hooks. --- # ArchDev diff --git a/plugins/codex/skills/archdev/SKILL.md b/plugins/codex/skills/archdev/SKILL.md index 7d1dd6e..c813954 100644 --- a/plugins/codex/skills/archdev/SKILL.md +++ b/plugins/codex/skills/archdev/SKILL.md @@ -1,6 +1,6 @@ --- name: archdev -description: Core ArchDev workflow — use for anything involving ArchDev. Covers archdev CLI setup, upgrade, login, and model access; archdev.json configuration and validation (check); repo onboarding and readiness (repo status); mapping a repo's plans, tasks, agents, and review workflow into the activity taxonomy (repo map); harness monitor hooks (repo hook setup); reporting build events as unstructured notes or schema-validated payloads (archdev log post, log post --event); reading and searching the organization stream for prior lessons (log messages, log search); publishing team lifecycle posts — start, lesson, abandoned, done, handoff, question (log --kind); observing agent activity (repo monitor); generating, saving, and sharing live Ask dashboards (archdev ask); mandatory PR CI and risk follow-through after opening or updating PRs; and querying published PR risk/scope (inspect metadata) and repository rule candidates (rules candidates). Load at session start whenever the archdev CLI is installed, the repo contains archdev.json, or the task touches plans, tasks, sessions, commits, PRs, or harness hooks. +description: Core ArchDev workflow — use for anything involving ArchDev. Covers CLI setup, upgrades, login, and model access; archdev.json validation (check); repo onboarding and readiness (repo status); activity taxonomy mapping (repo map); harness hooks (repo hook setup); build-event reporting (log post, log post --event); prior lessons (log messages, log search); lifecycle posts — start, lesson, abandoned, done, handoff, question (log --kind); agent activity (repo monitor); generating, saving, and sharing live Ask dashboards (archdev ask); mandatory PR CI and risk follow-through; published PR risk/scope (inspect metadata); and repository rule candidates (rules candidates). Load at session start whenever the archdev CLI is installed, the repo contains archdev.json, or the task touches plans, tasks, sessions, commits, PRs, or harness hooks. --- # ArchDev diff --git a/plugins/copilot/skills/archdev/SKILL.md b/plugins/copilot/skills/archdev/SKILL.md index 7d1dd6e..c813954 100644 --- a/plugins/copilot/skills/archdev/SKILL.md +++ b/plugins/copilot/skills/archdev/SKILL.md @@ -1,6 +1,6 @@ --- name: archdev -description: Core ArchDev workflow — use for anything involving ArchDev. Covers archdev CLI setup, upgrade, login, and model access; archdev.json configuration and validation (check); repo onboarding and readiness (repo status); mapping a repo's plans, tasks, agents, and review workflow into the activity taxonomy (repo map); harness monitor hooks (repo hook setup); reporting build events as unstructured notes or schema-validated payloads (archdev log post, log post --event); reading and searching the organization stream for prior lessons (log messages, log search); publishing team lifecycle posts — start, lesson, abandoned, done, handoff, question (log --kind); observing agent activity (repo monitor); generating, saving, and sharing live Ask dashboards (archdev ask); mandatory PR CI and risk follow-through after opening or updating PRs; and querying published PR risk/scope (inspect metadata) and repository rule candidates (rules candidates). Load at session start whenever the archdev CLI is installed, the repo contains archdev.json, or the task touches plans, tasks, sessions, commits, PRs, or harness hooks. +description: Core ArchDev workflow — use for anything involving ArchDev. Covers CLI setup, upgrades, login, and model access; archdev.json validation (check); repo onboarding and readiness (repo status); activity taxonomy mapping (repo map); harness hooks (repo hook setup); build-event reporting (log post, log post --event); prior lessons (log messages, log search); lifecycle posts — start, lesson, abandoned, done, handoff, question (log --kind); agent activity (repo monitor); generating, saving, and sharing live Ask dashboards (archdev ask); mandatory PR CI and risk follow-through; published PR risk/scope (inspect metadata); and repository rule candidates (rules candidates). Load at session start whenever the archdev CLI is installed, the repo contains archdev.json, or the task touches plans, tasks, sessions, commits, PRs, or harness hooks. --- # ArchDev diff --git a/plugins/cursor/skills/archdev/SKILL.md b/plugins/cursor/skills/archdev/SKILL.md index 7d1dd6e..c813954 100644 --- a/plugins/cursor/skills/archdev/SKILL.md +++ b/plugins/cursor/skills/archdev/SKILL.md @@ -1,6 +1,6 @@ --- name: archdev -description: Core ArchDev workflow — use for anything involving ArchDev. Covers archdev CLI setup, upgrade, login, and model access; archdev.json configuration and validation (check); repo onboarding and readiness (repo status); mapping a repo's plans, tasks, agents, and review workflow into the activity taxonomy (repo map); harness monitor hooks (repo hook setup); reporting build events as unstructured notes or schema-validated payloads (archdev log post, log post --event); reading and searching the organization stream for prior lessons (log messages, log search); publishing team lifecycle posts — start, lesson, abandoned, done, handoff, question (log --kind); observing agent activity (repo monitor); generating, saving, and sharing live Ask dashboards (archdev ask); mandatory PR CI and risk follow-through after opening or updating PRs; and querying published PR risk/scope (inspect metadata) and repository rule candidates (rules candidates). Load at session start whenever the archdev CLI is installed, the repo contains archdev.json, or the task touches plans, tasks, sessions, commits, PRs, or harness hooks. +description: Core ArchDev workflow — use for anything involving ArchDev. Covers CLI setup, upgrades, login, and model access; archdev.json validation (check); repo onboarding and readiness (repo status); activity taxonomy mapping (repo map); harness hooks (repo hook setup); build-event reporting (log post, log post --event); prior lessons (log messages, log search); lifecycle posts — start, lesson, abandoned, done, handoff, question (log --kind); agent activity (repo monitor); generating, saving, and sharing live Ask dashboards (archdev ask); mandatory PR CI and risk follow-through; published PR risk/scope (inspect metadata); and repository rule candidates (rules candidates). Load at session start whenever the archdev CLI is installed, the repo contains archdev.json, or the task touches plans, tasks, sessions, commits, PRs, or harness hooks. --- # ArchDev diff --git a/plugins/grok/skills/archdev/SKILL.md b/plugins/grok/skills/archdev/SKILL.md index 7d1dd6e..c813954 100644 --- a/plugins/grok/skills/archdev/SKILL.md +++ b/plugins/grok/skills/archdev/SKILL.md @@ -1,6 +1,6 @@ --- name: archdev -description: Core ArchDev workflow — use for anything involving ArchDev. Covers archdev CLI setup, upgrade, login, and model access; archdev.json configuration and validation (check); repo onboarding and readiness (repo status); mapping a repo's plans, tasks, agents, and review workflow into the activity taxonomy (repo map); harness monitor hooks (repo hook setup); reporting build events as unstructured notes or schema-validated payloads (archdev log post, log post --event); reading and searching the organization stream for prior lessons (log messages, log search); publishing team lifecycle posts — start, lesson, abandoned, done, handoff, question (log --kind); observing agent activity (repo monitor); generating, saving, and sharing live Ask dashboards (archdev ask); mandatory PR CI and risk follow-through after opening or updating PRs; and querying published PR risk/scope (inspect metadata) and repository rule candidates (rules candidates). Load at session start whenever the archdev CLI is installed, the repo contains archdev.json, or the task touches plans, tasks, sessions, commits, PRs, or harness hooks. +description: Core ArchDev workflow — use for anything involving ArchDev. Covers CLI setup, upgrades, login, and model access; archdev.json validation (check); repo onboarding and readiness (repo status); activity taxonomy mapping (repo map); harness hooks (repo hook setup); build-event reporting (log post, log post --event); prior lessons (log messages, log search); lifecycle posts — start, lesson, abandoned, done, handoff, question (log --kind); agent activity (repo monitor); generating, saving, and sharing live Ask dashboards (archdev ask); mandatory PR CI and risk follow-through; published PR risk/scope (inspect metadata); and repository rule candidates (rules candidates). Load at session start whenever the archdev CLI is installed, the repo contains archdev.json, or the task touches plans, tasks, sessions, commits, PRs, or harness hooks. --- # ArchDev diff --git a/plugins/opencode/skills/archdev/SKILL.md b/plugins/opencode/skills/archdev/SKILL.md index 7d1dd6e..c813954 100644 --- a/plugins/opencode/skills/archdev/SKILL.md +++ b/plugins/opencode/skills/archdev/SKILL.md @@ -1,6 +1,6 @@ --- name: archdev -description: Core ArchDev workflow — use for anything involving ArchDev. Covers archdev CLI setup, upgrade, login, and model access; archdev.json configuration and validation (check); repo onboarding and readiness (repo status); mapping a repo's plans, tasks, agents, and review workflow into the activity taxonomy (repo map); harness monitor hooks (repo hook setup); reporting build events as unstructured notes or schema-validated payloads (archdev log post, log post --event); reading and searching the organization stream for prior lessons (log messages, log search); publishing team lifecycle posts — start, lesson, abandoned, done, handoff, question (log --kind); observing agent activity (repo monitor); generating, saving, and sharing live Ask dashboards (archdev ask); mandatory PR CI and risk follow-through after opening or updating PRs; and querying published PR risk/scope (inspect metadata) and repository rule candidates (rules candidates). Load at session start whenever the archdev CLI is installed, the repo contains archdev.json, or the task touches plans, tasks, sessions, commits, PRs, or harness hooks. +description: Core ArchDev workflow — use for anything involving ArchDev. Covers CLI setup, upgrades, login, and model access; archdev.json validation (check); repo onboarding and readiness (repo status); activity taxonomy mapping (repo map); harness hooks (repo hook setup); build-event reporting (log post, log post --event); prior lessons (log messages, log search); lifecycle posts — start, lesson, abandoned, done, handoff, question (log --kind); agent activity (repo monitor); generating, saving, and sharing live Ask dashboards (archdev ask); mandatory PR CI and risk follow-through; published PR risk/scope (inspect metadata); and repository rule candidates (rules candidates). Load at session start whenever the archdev CLI is installed, the repo contains archdev.json, or the task touches plans, tasks, sessions, commits, PRs, or harness hooks. --- # ArchDev diff --git a/plugins/pi/skills/archdev/SKILL.md b/plugins/pi/skills/archdev/SKILL.md index 7d1dd6e..c813954 100644 --- a/plugins/pi/skills/archdev/SKILL.md +++ b/plugins/pi/skills/archdev/SKILL.md @@ -1,6 +1,6 @@ --- name: archdev -description: Core ArchDev workflow — use for anything involving ArchDev. Covers archdev CLI setup, upgrade, login, and model access; archdev.json configuration and validation (check); repo onboarding and readiness (repo status); mapping a repo's plans, tasks, agents, and review workflow into the activity taxonomy (repo map); harness monitor hooks (repo hook setup); reporting build events as unstructured notes or schema-validated payloads (archdev log post, log post --event); reading and searching the organization stream for prior lessons (log messages, log search); publishing team lifecycle posts — start, lesson, abandoned, done, handoff, question (log --kind); observing agent activity (repo monitor); generating, saving, and sharing live Ask dashboards (archdev ask); mandatory PR CI and risk follow-through after opening or updating PRs; and querying published PR risk/scope (inspect metadata) and repository rule candidates (rules candidates). Load at session start whenever the archdev CLI is installed, the repo contains archdev.json, or the task touches plans, tasks, sessions, commits, PRs, or harness hooks. +description: Core ArchDev workflow — use for anything involving ArchDev. Covers CLI setup, upgrades, login, and model access; archdev.json validation (check); repo onboarding and readiness (repo status); activity taxonomy mapping (repo map); harness hooks (repo hook setup); build-event reporting (log post, log post --event); prior lessons (log messages, log search); lifecycle posts — start, lesson, abandoned, done, handoff, question (log --kind); agent activity (repo monitor); generating, saving, and sharing live Ask dashboards (archdev ask); mandatory PR CI and risk follow-through; published PR risk/scope (inspect metadata); and repository rule candidates (rules candidates). Load at session start whenever the archdev CLI is installed, the repo contains archdev.json, or the task touches plans, tasks, sessions, commits, PRs, or harness hooks. --- # ArchDev diff --git a/tools/plugin-gen/README.md b/tools/plugin-gen/README.md index 6a4bd14..2a64e79 100644 --- a/tools/plugin-gen/README.md +++ b/tools/plugin-gen/README.md @@ -20,7 +20,7 @@ the install guide. npm ci npm run build # regenerate after changing the catalog or a skill (git add new skill files first: only tracked files are copied) npm run check # CI: fails when committed output differs from the catalog -npm test # contracts for every harness's files, the hook guard, Pi and OpenCode code +npm test # harness contracts, hooks, Pi/OpenCode code, and all SKILL.md descriptions (<=1024 characters) npm run e2e # installs each plugin with the real harness CLI (local; skips missing CLIs) ``` diff --git a/tools/plugin-gen/package-lock.json b/tools/plugin-gen/package-lock.json index b059028..f6c5b45 100644 --- a/tools/plugin-gen/package-lock.json +++ b/tools/plugin-gen/package-lock.json @@ -9,7 +9,8 @@ "version": "0.0.0", "devDependencies": { "@types/node": "24.19.1", - "typescript": "7.0.2" + "typescript": "7.0.2", + "yaml": "2.9.1" }, "engines": { "node": ">=24" @@ -406,6 +407,22 @@ "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==", "dev": true, "license": "MIT" + }, + "node_modules/yaml": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz", + "integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } } } } diff --git a/tools/plugin-gen/package.json b/tools/plugin-gen/package.json index 71e9b5e..7144f5e 100644 --- a/tools/plugin-gen/package.json +++ b/tools/plugin-gen/package.json @@ -16,6 +16,7 @@ }, "devDependencies": { "@types/node": "24.19.1", - "typescript": "7.0.2" + "typescript": "7.0.2", + "yaml": "2.9.1" } } diff --git a/tools/plugin-gen/test/skill-descriptions.test.ts b/tools/plugin-gen/test/skill-descriptions.test.ts new file mode 100644 index 0000000..1e30f45 --- /dev/null +++ b/tools/plugin-gen/test/skill-descriptions.test.ts @@ -0,0 +1,77 @@ +import assert from "node:assert/strict"; +import { execFileSync } from "node:child_process"; +import { readFileSync } from "node:fs"; +import path from "node:path"; +import { describe, test } from "node:test"; +import { parse } from "yaml"; + +const MAX_DESCRIPTION_LENGTH = 1024; + +function checkDescription(markdown: string, file: string): void { + const frontmatter = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(markdown); + assert.ok(frontmatter, `${file}: missing YAML frontmatter`); + const description = parse(frontmatter[1]!)?.description; + assert.equal(typeof description, "string", `${file}: description must be a string`); + const length = [...description].length; + assert.ok( + length <= MAX_DESCRIPTION_LENGTH, + `${file}: description is ${length} characters (maximum ${MAX_DESCRIPTION_LENGTH})`, + ); +} + +function skill(yaml: string): string { + return `---\n${yaml}\n---\n# Skill\n`; +} + +describe("skill description validation", () => { + test("accepts exactly 1,024 characters and rejects 1,025", () => { + checkDescription(skill(`description: ${"a".repeat(1024)}`), "boundary/SKILL.md"); + assert.throws( + () => checkDescription(skill(`description: ${"a".repeat(1025)}`), "oversized/SKILL.md"), + /oversized\/SKILL\.md: description is 1025 characters \(maximum 1024\)/, + ); + }); + + test("counts Unicode characters, not UTF-8 bytes or UTF-16 code units", () => { + checkDescription(skill(`description: ${"🚀".repeat(1024)}`), "unicode/SKILL.md"); + assert.throws( + () => checkDescription(skill(`description: ${"🚀".repeat(1025)}`), "unicode/SKILL.md"), + /description is 1025 characters/, + ); + }); + + test("measures parsed quoted and multiline YAML values", () => { + checkDescription(skill(`description: "${"a".repeat(1024)}"`), "quoted/SKILL.md"); + checkDescription(skill(`description: >-\n ${"a".repeat(512)}\n ${"b".repeat(511)}`), "folded/SKILL.md"); + for (const style of [">-", "|-"]) { + assert.throws( + () => checkDescription(skill(`description: ${style}\n ${"a".repeat(512)}\n ${"b".repeat(512)}`), "multiline/SKILL.md"), + /description is 1025 characters/, + ); + } + }); + + test("rejects missing frontmatter and missing or non-string descriptions", () => { + assert.throws(() => checkDescription("# Skill", "missing/SKILL.md"), /missing YAML frontmatter/); + for (const yaml of ["name: example", "description: null", "description: 123", "description: [example]"]) { + assert.throws(() => checkDescription(skill(yaml), "invalid/SKILL.md"), /description must be a string/); + } + }); +}); + +describe("repository skill descriptions", () => { + const repoRoot = execFileSync("git", ["rev-parse", "--show-toplevel"], { encoding: "utf8" }).trim(); + // Discover all skills, not just the catalog: include generated copies and new local skills. + const skills = [...new Set(execFileSync( + "git", + ["ls-files", "-z", "--cached", "--others", "--exclude-standard", "--", "SKILL.md", "**/SKILL.md"], + { cwd: repoRoot, encoding: "utf8" }, + ).split("\0").filter(Boolean))].sort(); + assert.ok(skills.length > 0, "the repository must contain skills to validate"); + + for (const file of skills) { + test(`${file} has a description of at most 1,024 characters`, () => { + checkDescription(readFileSync(path.join(repoRoot, file), "utf8"), file); + }); + } +});