feat(checks): add name-whitespace rule and fix model-unknown SARIF catalog gap#29
Merged
Merged
Conversation
…talog Warn when a skill's frontmatter name contains whitespace characters. Names with spaces or tabs cannot match typical filenames and create ambiguous lookups at runtime. Also adds the missing model-unknown entry to the SARIF RULES catalog so GitHub Code Scanning shows a proper rule description instead of falling back to the synthetic-rule path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Two small gaps in skillcheck's rule coverage:
A skill whose
name:contains spaces or tabs cannot match any typicalfilename and creates ambiguous lookups at runtime. There was no rule
catching this. Authors who type
name: my cool skillget no signalfrom the linter today.
The SARIF
RULEScatalog was missingmodel-unknown. When thatdiagnostic appeared in output, the SARIF serializer fell back to a
synthetic rule entry (id used as both name and short description),
which produces lower-quality output in GitHub Code Scanning.
What
src/checks.ts: addcheckNameWhitespace, called fromrunChecksafter
checkNameDrift. Rule id:name-whitespace, severity:warn.Fires when
/\s/.test(v.name)is true (spaces, tabs, newlines).src/sarif.ts: addname-whitespaceandmodel-unknownentries tothe
RULEScatalog with proper camelCase names and descriptions.test/checks.test.ts: 4 new test cases forname-whitespace.test/sarif.test.ts: 3 new test cases; also extend the existingfull-catalog assertion to cover both new rules.
Tests
warns when skill name contains spacesdoes not warn name-whitespace for a clean hyphenated namename-whitespace message includes the offending namewarns when skill name contains a leading spacemodel-unknown appears in the catalog with a proper camelCase namename-whitespace appears in the catalog with a proper camelCase nameruleIndex for name-whitespace points to the registered entrySelf-merge gate
Generated by Claude Code