Skip to content

feat(checks): add duplicate-name rule#19

Merged
protosphinx merged 1 commit into
mainfrom
bot/duplicate-name-check
May 18, 2026
Merged

feat(checks): add duplicate-name rule#19
protosphinx merged 1 commit into
mainfrom
bot/duplicate-name-check

Conversation

@protosphinx
Copy link
Copy Markdown
Member

Why

Two skills that declare the same name: in frontmatter cause ambiguous
resolution 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

  • Adds checkDuplicateNames(skills) in src/checks.ts, a cross-skill
    check that groups validated skills by lowercased name and emits one
    duplicate-name warn 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.
  • Calls checkDuplicateNames from runChecks alongside checkCollisions.
  • Adds the rule to the README rule table.

Tests

Four new cases in test/checks.test.ts:

  • Two skills with the same name produce exactly two duplicate-name warns.
  • Skills with different names produce no duplicate-name diagnostic.
  • Three skills sharing a name produce exactly three warns (one per skill).
  • The diagnostic message for a skill names the other file in the conflict.

Self-merge gate

  • all CI checks pass
  • LOC delta < 250 (added + removed)
  • no public-API surface change
  • no runtime-dependency additions
  • no workflow file changes
  • tests added or extended

Generated by Claude Code

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.
@protosphinx protosphinx added the automated Opened by the daily bot label May 18, 2026 — with Claude
@protosphinx protosphinx merged commit ca6dbf2 into main May 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated Opened by the daily bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant