feat(checks): add duplicate-name rule#19
Merged
Conversation
Warn when two or more skills declare the same frontmatter name. At runtime the selection is ambiguous and one skill silently shadows the other, so this is a real bug with no visible signal in model output. The check follows the cross-skill pattern of description-collision: collect all validated skills, group by lowercased name, then emit one diagnostic per skill in any group with two or more members. Each diagnostic names the conflicting file so the author knows exactly which skill to rename. Four new tests cover: two-way duplicate, three-way duplicate, no duplicate (no diagnostic), and the diagnostic message content.
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 skills that declare the same
name:in frontmatter cause ambiguousresolution at runtime. The model must pick one and the other silently
never fires. This is a real authoring bug with no visible signal in
model output - exactly the class of bug skillcheck exists to catch.
Addresses the v1.0 goal of catching every authoring pitfall before CI.
What
checkDuplicateNames(skills)insrc/checks.ts, a cross-skillcheck that groups validated skills by lowercased name and emits one
duplicate-namewarn per skill in any group with two or more members.Each diagnostic message names the conflicting file so the author knows
exactly which skill to rename.
checkDuplicateNamesfromrunChecksalongsidecheckCollisions.Tests
Four new cases in
test/checks.test.ts:duplicate-namewarns.duplicate-namediagnostic.Self-merge gate
Generated by Claude Code