Skip to content

feat(#568): lint:skill-calls CI guard for unqualified Skill() collisions - #590

Merged
admarble merged 2 commits into
mainfrom
feature/568-bug-skills-potential-silent-misroute-when-unqu
May 7, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/568-bug-skills-potential-silent-misroute-when-unqu

Conversation

@admarble

@admarble admarble commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Pre-emptive guard mirroring #562's fix for loop. Adds scripts/lint-skill-calls.ts which scans every **/SKILL.md across .claude/skills/, templates/skills/, and skills/ and fails CI if it finds an unqualified Skill(skill: "<name>", ...) call where <name> matches an Anthropic top-level skill.

  • New scripts/lint-skill-calls.ts (~120 LOC) — exports findViolations() + lintSkillCalls(), plus a CLI wrapper that exits 1 on violations.
  • New scripts/lint-skill-calls.test.ts (10 vitest cases) — unit-tests the regex against synthetic fixtures and the FS walker against per-test temp directories.
  • Wired into the existing validate-skills GitHub Actions job as a new Lint skill calls step.
  • CLAUDE.md gains a ## Skills paragraph pointing at the lint script.
  • CHANGELOG [Unreleased] / ### Added entry referencing bug(fullsolve): unqualified Skill("loop") resolves to recurring-prompt skill, breaking quality loop #562.

Approach

AC-1 is a choice (a doc-only / b lint check / c both). Implemented effectively (c) lint + a thin doc note, with the lint as the load-bearing guard:

Per #562 / project_skill_namespace_collisions memory: no existing Skill() calls were modified — the only sequant:-qualified calls in-tree remain the 6 in fullsolve/SKILL.md from #565.

Names list

Hardcoded in ANTHROPIC_TOP_LEVEL_NAMES:

  • loop, security-review, init, review, simplify, schedule, release

Sourced from the session-start available-skills reminder (which is where the harness surfaces the harness-owned competing names) plus the prior memory note. New names can be added with a one-line const edit when Anthropic ships another colliding skill.

AC coverage

AC Status Evidence
AC-1 (defensive guard, choice b/c) ✅ Implemented scripts/lint-skill-calls.ts + CLAUDE.md note
AC-2 (CI wiring) ✅ Implemented Lint skill calls step in validate-skills job; npm run lint:skill-calls
AC-3 (PR documents approach + cites #562) ✅ This PR body

Verification

  • Unit tests pass: npx vitest run scripts/lint-skill-calls.test.ts → 10/10 in 2.27s.
  • Smoke test against the live repo (3 skill mirror dirs, 51 SKILL.md files) → exit 0, no violations.
  • npm run build (tsc) → clean.
  • npm run lint (eslint src/ bin/) → clean.

Test plan

  • CI validate-skills job runs the new Lint skill calls step and exits 0 on a clean tree.
  • Reviewer can verify the negative case locally by adding a single line Skill(skill: "loop", args: "x") to any SKILL.md, running npm run lint:skill-calls, and observing exit 1 with a file:line violation report.

Closes #568

Adds scripts/lint-skill-calls.ts which scans every **/SKILL.md under
.claude/skills/, templates/skills/, and skills/ and flags any
Skill(skill: "<name>", ...) call whose <name> matches an Anthropic
top-level skill (loop, security-review, init, review, simplify,
schedule, release) and is not qualified as sequant:<name>.

Wired as a new "Lint skill calls" step in the existing validate-skills
GitHub Actions job, and exposed locally via npm run lint:skill-calls.
CLAUDE.md gains a brief Skills section pointing at the lint script.

Pre-emptively guards the same silent-misroute pattern that #562 fixed
for `loop`, before a future contributor or LLM agent reintroduces it
under a different colliding name (notably security-review). Per #562
AC-3, no existing non-colliding bare-name calls are touched.

Closes #568
Gap 1 (multi-line false negative): findViolations now runs the regex
against full file content rather than line-by-line, so the readable
multi-line form

  Skill(
    skill: "loop",
    args: "x"
  )

is detected. Line numbers are derived from the match index. Two new
test cases pin the multi-line behavior (one violation, one qualified-OK).

Gap 2 (markdown scope): walkSkillFiles broadened from `entry === "SKILL.md"`
to `entry.endsWith(".md")`. The harness loads referenced markdown
(references/*.md, prompt-templates.md, _shared/*.md) alongside SKILL.md
itself, and a Skill() call in any of them is equally runtime-dangerous.
Live scan now covers 100 .md files (up from 51); zero violations.

Gap 3 (names list drift): aligned ANTHROPIC_TOP_LEVEL_NAMES to the
current harness `available-skills` block. Removed `release` (Anthropic
no longer ships it as top-level; sequant does, so flagging bare calls
was over-defensive with broken advice). Added `claude-api`,
`update-config`, `keybindings-help`, `fewer-permission-prompts` so the
list mirrors all currently-registered Anthropic top-level names that
could collide with a future sequant skill.

Gap 4 (doc nit): script header no longer claims an "(or invalid args)"
exit-1 case — the script accepts no args.

Test count: 10 → 13. CI lint step still passes on the worktree
(0 violations, 100 files scanned).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(skills): potential silent misroute when unqualified Skill("security-review") added — mirrors #562

1 participant