diff --git a/README.md b/README.md index 5121c57..b766d01 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ **Lint the manifest. Verify the refs. Catch the collisions before runtime.** [![ci](https://github.com/erphq/skillcheck/actions/workflows/ci.yml/badge.svg)](https://github.com/erphq/skillcheck/actions/workflows/ci.yml) -![tests](https://img.shields.io/badge/tests-70%20passing-yellowgreen) +![tests](https://img.shields.io/badge/tests-77%20passing-yellowgreen) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE) [![status](https://img.shields.io/badge/status-pre--v0-orange.svg)](#roadmap) @@ -97,6 +97,7 @@ Exit codes: | `description-length` | warn | Description longer than 500 chars dilutes the trigger signal | | `name-drift` | warn | Frontmatter `name:` doesn't match the filename or directory | | `description-collision` | warn | Two skills' descriptions have Jaccard ≥ 0.6 | +| `tools-overloaded` | warn | `tools:` lists 10 or more entries; narrow the list to what this skill actually needs | | `parse` | error | The file doesn't have valid frontmatter / YAML | The MCP and built-in tool checks read `~/.claude/settings.json` and diff --git a/test/sarif.test.ts b/test/sarif.test.ts index d46917a..0fc7b82 100644 --- a/test/sarif.test.ts +++ b/test/sarif.test.ts @@ -20,9 +20,25 @@ describe("reportSarif", () => { expect(ruleIds).toContain("frontmatter-schema"); expect(ruleIds).toContain("tool-unknown"); expect(ruleIds).toContain("description-collision"); + expect(ruleIds).toContain("tools-overloaded"); expect(out.runs[0].results).toEqual([]); }); + it("emits tools-overloaded at warning level with correct ruleIndex", () => { + const diagnostics: Diagnostic[] = [ + { + severity: "warn", + rule: "tools-overloaded", + message: "tools: lists 11 tools; narrow the list to the tools this skill actually needs", + file: "/test/a.md", + }, + ]; + const out = JSON.parse(reportSarif(diagnostics, "/test", opts)); + expect(out.runs[0].results[0].level).toBe("warning"); + const idx = out.runs[0].results[0].ruleIndex; + expect(out.runs[0].tool.driver.rules[idx].id).toBe("tools-overloaded"); + }); + it("converts severities to SARIF levels", () => { const diagnostics: Diagnostic[] = [ { severity: "error", rule: "frontmatter-schema", message: "boom", file: "/test/a.md" },