Check skill frontmatter in the gate

Merged
JS
4d ago
+113-4

scripts/check-skill-refs.py checked links and paths but never read frontmatter, so a skill whose name: drifted from its directory passed the gate and routing broke silently until the paid routing run. It now rejects a SKILL.md with no frontmatter, a name that is not lowercase-hyphen or differs from its directory, or an empty description, decoding quoted values and trailing comments the way YAML does. It also adds five Rust-sounding queries that belong to no skill to scripts/skill-routing-queries.json as near-miss negatives.

Verified: renaming a name: locally fails the script and restoring it passes; the new cases in tests/test_skill_scripts.py cover a good skill (folded description), a renamed name, a bad pattern, an empty or comment-only description and missing frontmatter, and disabling the name-pattern check fails them; ruff is clean. scripts/test.sh passes except task-authoring-tests, which failed in the full run while it downloads task packages and passes on its own (28 tests, 4 skipped); it touches none of these files. scripts/check-skill-routing.py --only 60,61,62,63,64 --runs 2 fired no skill in all 10 runs; it needs claude and credits, so it sits outside the credential-free gate.


Summary by cubic

Makes the skill-refs gate check skill frontmatter so a skill whose name drifted from its directory, has no frontmatter, or has an empty description now fails the gate instead of breaking routing silently.

  • Rejects a SKILL.md whose frontmatter name is not lowercase-hyphen, differs from its directory, or whose description is empty, decoding quoted values and trailing comments.
  • Adds five Rust-sounding queries that match no skill to scripts/skill-routing-queries.json as near-miss negatives.
  • Extends tests/test_skill_scripts.py with cases for folded descriptions, renamed names, bad name patterns, empty descriptions, missing frontmatter, and valid YAML spellings.