Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions test/sarif.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down