Repository navigation
Description
Summary
Pre-emptive issue, not an active bug. Filed as the follow-up promised in #562's Non-Goals: "Not auditing other sequant skills for similar unqualified Skill() calls. If any exist that hit collisions, file separately."
#562 fixed the silent-misroute pattern for loop. The same structural collision exists for security-review:
- Anthropic ships a top-level
security-reviewskill (built-in, ships with Claude Code): "Complete a security review of the pending changes on the current branch". - Sequant ships
sequant:security-review: "Deep security analysis for sensitive features (auth, payments, admin, API routes, file operations)".
Both are visible at the top level. Per #562's empirical observation, when both are present the bare name resolves to Anthropic's. So Skill(skill: \"security-review\", args: ...) from any sequant skill would silently invoke Anthropic's review instead of sequant's.
No Active Bug Today
Verified across the entire repo:
```
$ grep -rn 'Skill(skill: "security-review"' . --include='*.md' | grep -v node_modules | grep -v '.git/'
(no matches)
```
No sequant skill currently calls Skill(skill: \"security-review\", ...). The same is true for the other Anthropic top-level names (init, review, simplify, etc.). Only loop had active call sites — those got fixed in #562 / #565.
Why File This Now
The bug surfaces only at runtime, only when an affected branch fires. It's invisible to TypeScript, build, lint, and unit tests (per #562). Adding a Skill(skill: \"security-review\", ...) call months from now without remembering this footgun will reproduce the same silent misroute.
Acceptance Criteria
- AC-1: Defensive guard. Pick ONE of:
- (a) Pre-emptively qualify all future calls. Add a memory/CLAUDE.md note instructing skill authors to always use
Skill(skill: \"sequant:<name>\", ...)when invoking sequant skills, regardless of whether the bare name collides today. - (b) Lint check. Add a script (e.g.,
scripts/lint-skill-calls.ts) that scans all*/SKILL.mdfiles forSkill(skill: \"<name>\", ...)patterns where<name>matches a known Anthropic top-level skill (loop,security-review,init,review,simplify,setup,schedule, etc.) and flags as a CI failure. - (c) Both. Belt-and-suspenders.
- (a) Pre-emptively qualify all future calls. Add a memory/CLAUDE.md note instructing skill authors to always use
- AC-2: If (a), update CLAUDE.md / memory; if (b), wire script into a CI step (
validate-skillsor new); if (c), do both. - AC-3: Document the chosen approach in the PR body, citing bug(fullsolve): unqualified Skill("loop") resolves to recurring-prompt skill, breaking quality loop #562 as the precedent.
Non-Goals
- Not changing how the
Skilltool resolves names — harness behavior, out of scope. - Not auditing skill-name collisions in other plugins — sequant-only.
Complexity
trivial-to-small — depends on which AC-1 option is chosen. (a) is doc-only. (b) is a small script + CI wiring (~50–100 LOC). (c) is both.
Self-Assessed Workflow
spec → exec → qa — non-trivial design choice (which option), so spec is warranted.
Related
- bug(fullsolve): unqualified Skill("loop") resolves to recurring-prompt skill, breaking quality loop #562 (the original bug for
loop— same pattern, same silent failure mode) - fix(#562): qualify Skill("loop") in fullsolve as sequant:loop #565 (the fix PR for bug(fullsolve): unqualified Skill("loop") resolves to recurring-prompt skill, breaking quality loop #562)
Activity
admarble commentedon May 4, 2026
Assessment
→ PROCEED — Defensive guard mirroring #562 pattern; spec needs to pick AC-1 option (a/b/c)
Workflow:
spec → exec → qa⚠ AC-1 offers 3 options (doc-only / lint script / both) — spec must choose before exec
admarble commentedon May 6, 2026
Plan Complete (
/spec)Complexity: Standard (3 ACs, ~3 directories)
AC Checklist (verified zero current violations across
.claude/skills/,templates/skills/,skills/)lint:skill-callsscript into the existingvalidate-skillsCI job.Implementation Plan
Phase 1 — Lint script: Create
scripts/lint-skill-calls.ts(~80–120 LOC). HardcodedANTHROPIC_TOP_LEVEL_NAMES = ["loop", "security-review", "init", "review", "simplify", "schedule", "release"]. Walks all three skill mirror dirs for**/SKILL.md, per-line regex/Skill\(skill:\s*"(?!sequant:)([a-z-]+)"/g, flags any captured name in the list, exits 1 on violations. Mirrors style ofscripts/check-skill-sync.ts.Phase 2 — Test:
scripts/lint-skill-calls.test.ts(vitest, fixture-based). Cases: unqualified colliding name flagged;sequant:loopignored; non-collidingspecignored; clean repo → exit 0.Phase 3 — CI + package wiring: Add
"lint:skill-calls"script entry topackage.json. Append aLint skill callsstep inside the existingvalidate-skillsjob in.github/workflows/ci.yml.Phase 4 — Docs: One-paragraph note in
CLAUDE.mdpointing at the lint script and citing #562/#568. CHANGELOG entry under[Unreleased] / ### Added.Key Decisions
validate-skillsjob (no new CI job) to keep skill-related guards co-located.available-skillsreminder. Drift detection is out of scope (one-line const edit if Anthropic adds more).Design Review (Q1/Q3)
scripts/lint-skill-calls.tsparallel toscripts/check-skill-sync.ts. CI-time guard, not runtime, so not undersrc/.check-skill-sync.ts+validate-skillsCI job — same shape (walk dirs, regex check, exit code).Open Questions
Recommended Workflow
spec → testgen → exec → qa— quality loop disabled. ACs include Unit/Integration Test verification methods, so testgen is recommended to stub the script's test cases before implementation.admarble commentedon May 6, 2026
Implementation Complete (
/exec)PR: #590 — #590
Branch:
feature/568-bug-skills-potential-silent-misroute-when-unquPre-PR AC Verification
scripts/lint-skill-calls.ts,CLAUDE.md## SkillsLint skill callsstep invalidate-skillsjob,npm run lint:skill-callsKey Files Changed
scripts/lint-skill-calls.ts(new, ~120 LOC) —ANTHROPIC_TOP_LEVEL_NAMESconst +findViolations()+lintSkillCalls()+ CLI wrapperscripts/lint-skill-calls.test.ts(new, 10 vitest cases).github/workflows/ci.yml— newLint skill callsstep invalidate-skillsjobpackage.json—lint:skill-callsscriptCLAUDE.md— new## SkillsparagraphCHANGELOG.md—[Unreleased] / ### AddedentryQuality Plan Alignment
N/A — no formal quality plan was generated by
/spec; the spec output's "Feature Quality Planning" section flagged only false-positive risk (mitigated via YAGNI defer) and cross-platform/three-mirror concerns, both addressed.Verification
npm run build(tsc)npm run lint(eslint)npx vitest run scripts/lint-skill-calls.test.tsnpm run lint:skill-calls(smoke against live repo, 51 SKILL.md files)Pre-PR Confidence Check
ANTHROPIC_TOP_LEVEL_NAMESlist is a manually-maintained snapshot. If Anthropic ships a new top-level skill that collides with a future sequant skill, the list won't auto-detect it. Mitigation: theupstreamskill's release-monitoring flow surfaces new Anthropic skills; the list is a one-lineconstedit when needed. Documented inline.scripts/lint-skill-calls.tshas full unit + filesystem coverage inlint-skill-calls.test.ts(10 cases including every name in the catalog, the qualified-form ignore path, multi-line position tracking, scan-only-SKILL.md filtering, and empty-tree handling). The CLI wrapper's exit-code path is not directly unit-tested but is exercised by the live smoke run reported above. Acceptable: the wrapper is 4 lines and trivially auditable.admarble commentedon May 6, 2026
QA Review for Issue #568
AC Coverage
scripts/lint-skill-calls.tsexportsfindViolations()+lintSkillCalls(), walks.claude/skills,templates/skills,skillsfor**/SKILL.md, flags anySkill(skill: "<name>", ...)whose<name>∈ANTHROPIC_TOP_LEVEL_NAMESand isn'tsequant:-prefixed. Exit 1 on violations, withfile:line+ offending snippet. CLAUDE.md## Skillsparagraph added.Lint skill callsstep appended to existingvalidate-skillsjob in.github/workflows/ci.yml.npm run lint:skill-callsexposed locally. CI run on this PR'svalidate-skillsjob ran the new step and passed.Coverage: 3/3 AC items fully met
Original ACs: 3/3 met
Derived ACs: None (no formal Derived AC table in spec)
Quality Plan Verification
N/A —
/specdid not emit a formal Feature Quality Planning section. Standard QA only.CI Status
validate-skillsLint skill callsstep)build (20.x)build (22.x)typecheckvalidate-pluginCI Summary: 5 passed, 0 pending, 0 failed.
CI-related: AC-2 (CI wiring) is empirically verified — the new step ran in CI and passed.
Quality Metrics
any) in diffTest Coverage Analysis
scripts/lint-skill-calls.tsscripts/lint-skill-calls.test.ts(10 cases)Coverage: 1/1 new source files have tests.
Critical paths without tests: None.
Test file covers: every name in
ANTHROPIC_TOP_LEVEL_NAMESflagged;sequant:-qualified ignored; non-colliding bare names ignored; line-number tracking; multiple violations in one file; whitespace-tolerant regex; clean tree; violation in any of three mirror dirs; SKILL.md-only filtering; empty-tree (scanned=0).Code Review
Strengths:
findViolationsper content,walkSkillFilesper dir,lintSkillCallsorchestrator) makes the script trivially unit-testable without subprocesses.ANTHROPIC_TOP_LEVEL_NAMESis exported, so the test iterates the catalog (catches drift if a name is removed).isDirectRunguard (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) prevents the CLI side effects (printReport+process.exit) from firing when imported by the test, which is why tests can run cleanly withoutmockingprocess.scripts/check-skill-sync.tsstyle end-to-end (fileURLToPath(import.meta.url),__dirname,PROJECT_ROOT = join(__dirname, ".."),process.exit(...)).name.startsWith("sequant:")skip is explicit and conservative — avoids false-flagging the legitimate qualified form./Skill\(\s*skill:\s*"([^"]+)"/gis intentionally narrow: tolerates whitespace variants but requires the exactskill:keyword and double-quoted string. Test covers the whitespace case.__dirnamesymbol is reused forPROJECT_ROOT, matchingcheck-skill-sync.ts. (__filenameis declared but only used as the input tofileURLToPath-derived__dirname— same shape as the sibling script.scripts/is excluded fromnpm run lint's eslint scope, so this isn't a lint regression.)Issues: None blocking.
Suggestions (non-blocking):
Exit codes: 1 - Violations found (or invalid args)mentions arg validation that the script doesn't actually do (no args are accepted). Minor cosmetic; not worth a follow-up commit.Skill(skill: 'loop', ...)(single-quoted name). Acceptable today: every existingSkill(skill: ...)call in the repo's SKILL.md tree uses double quotes, and the issue body's verbatim grep pattern uses double quotes. If a single-quoted variant ever appears, the regex can be extended; not worth pre-emptive complexity.Test Quality Review
findViolations()/lintSkillCalls()outputs (counts, names, line numbers, file paths) — not on internals.mkdtempSyncper case withafterEachcleanup — no shared state.Issues Found: None.
Anti-Pattern Detection
Dependency Audit
N/A —
package.jsonwas modified only to add a script entry (lint:skill-calls). Nodependencies/devDependencieschanges.Code Patterns
Critical Issues: 0
Warnings: 0
Call-Site Review
N/A — the new exported functions (
findViolations,lintSkillCalls,ANTHROPIC_TOP_LEVEL_NAMES) are call-only fromscripts/lint-skill-calls.test.ts(verified via test-suite pass). The CLI wrapper at the bottom oflint-skill-calls.tsis the sole runtime caller and is gated byisDirectRunso it doesn't fire under test imports. No misalignment with AC.Execution Evidence
npm run lint:skill-callsprintf '\nSkill(skill: "loop", args: "x")\n' >> qa/SKILL.md && npm run lint:skill-calls.claude/skills/qa/SKILL.md:2909: Skill(skill: "loop") collides ... — qualify as "sequant:loop"thenFound 1 violation(s). Restored file → exit 0 again.npx vitest run scripts/lint-skill-calls.test.tsvalidate-skills)validate-skillsjob passed.Evidence status: Complete.
Skill Command Verification
N/A — no
.claude/skills/**/*.md,templates/skills/**/*.md, orskills/**/*.mdfiles modified.Detection Pattern Verification
N/A — no skill markdown files were modified, so no
grep/awk/jq/sedor regex literals inside skill prose were added or changed. The regex inscripts/lint-skill-calls.tsis TypeScript code (covered by the unit tests), not skill prose.CLI Registration Verification
N/A —
RunOptionsandbin/cli.tswere not modified. The newlint:skill-callsis a top-level npm script invocation, not a sequant CLI subcommand.Smoke Test
npm run lint:skill-calls(clean tree)Skill(skill: "loop", ...)then re-runvalidate-skillsGitHub Actions jobnpm run lint:skill-callsand exits 0Smoke Test Status: Complete.
Manual Test ACs
N/A — no ACs in the spec plan use Manual Test verification. AC-1 → Integration Test (covered by unit/filesystem tests + live smoke). AC-2 → Integration Test (covered by CI run on this PR). AC-3 → PR body review (this comment + PR #590 description).
CHANGELOG Verification
[Unreleased]entry### Added, top of section)(#568))Result: CHANGELOG requirements met.
Risk Assessment
Skill(skill: "<colliding>", ...)call from a script that uses single quotes (') instead of double quotes — the lint would silently miss it. Same failure mode applies if Anthropic ships a new top-level skill (e.g.assess) and a sequant skill of the same name pre-dates the manual update ofANTHROPIC_TOP_LEVEL_NAMES. Both are acceptable: single-quoted invocations are not the convention in this repo, and Anthropic-skill drift is monitored by/upstream.printReportformatting paths are not asserted by unit tests; live smoke covers them and the wrapper is 4 lines (if (isDirectRun) { … process.exit(...) }), trivially auditable.scripts/lint-skill-calls.ts) with no in-tree siblings sharing the same root cause; the closest pattern peer isscripts/check-skill-sync.ts, which addresses a different concern (file-content sync, not Skill-call shape). The single-pattern criterion is satisfied.Adversarial Re-Read
$ grep -rn 'Skill(skill: "security-review"' . --include='*.md' | grep -v node_modules | grep -v '\.git/'returning(no matches). Re-ran the exact pattern against the worktree: 0 matches across.claude/skills/,templates/skills/,skills/. The lint script's behavior on this corpus matches the issue's claim of zero current violations (Files scanned: 51, no violations). Fixture verified.Skill(skill: "loop", args: "x")and observing exit 1 at line 2909 — this is post-fix validation of the new lint, not a pre-fix bug repro. Correctly framed. (b) "validate-skills CI job passed running the new step" — also post-fix validation; the CI checkpoint in this PR exercises the new step. Correctly framed. No bug-repro/validation conflation.git status --shortshowed only the staged/committed diff before commit; HEAD is7b27afb; no stash; onfeature/568-…, not main). The negative-case smoke modified.claude/skills/qa/SKILL.mdand reverted via backup file, leaving zero residual changes.validate-skillsCI job already had two steps (Validate all skills, nowLint skill calls); both delegate to disjoint mechanisms. Nothing else in.github/workflows/mirrors this concern.Skill()names — confirmed, harness behavior untouched; the lint is a static guard, not a runtime intercept. (ii) Not auditing collisions in other plugins — confirmed,SCAN_DIRSis hardcoded to sequant's three skill mirror dirs. Neither boundary was crossed. TheANTHROPIC_TOP_LEVEL_NAMESlist is bounded to known top-level names that collide with sequant skills today.Findings: No gaps found because: (a) the issue's verbatim grep fixture was re-run and matched the pre-fix expected zero-match outcome that the lint preserves on the post-fix tree; (b) every "evidence" claim above is post-fix validation, not pre-fix repro; (c) the working tree is clean post-revert; (d) no sibling pattern exists in the same module/file; (e) Non-Goals were respected.
Status: Clean.
Verdict: READY_FOR_MERGE
All three ACs are MET literally (not just in spirit):
## Skillsnote in CLAUDE.md cites the lint and links bug(fullsolve): unqualified Skill("loop") resolves to recurring-prompt skill, breaking quality loop #562 / bug(skills): potential silent misroute when unqualified Skill("security-review") added — mirrors #562 #568.validate-skillsjob on this PR (the new step ran and exited 0).Quality gates: build ✅, lint ✅, unit tests ✅ (10/10), CI ✅ (5/5), smoke positive + negative + recovery ✅, CHANGELOG ✅, CLAUDE.md note ✅. No anti-patterns; no test-coverage gaps; no AC literal-text divergence; Adversarial Re-Read clean; Non-Goals respected.
Documentation
## Skillsparagraph)[Unreleased] / ### Addedreferencing bug(skills): potential silent misroute when unqualified Skill("security-review") added — mirrors #562 #568docs/topic specifically addresses skill authoring (existing memory note is the canonical reference)Next Steps
validate-skillsjob on every future PR will runnpm run lint:skill-callsautomatically — no further action needed.ANTHROPIC_TOP_LEVEL_NAMESinscripts/lint-skill-calls.ts(one-line const edit).fix(#568): close 4 gaps surfaced by adversarial QA on lint:skill-calls
admarble commentedon May 7, 2026
QA Follow-up (post-adversarial)
After the structured QA pass returned
READY_FOR_MERGE, an adversarial re-read prompted by the user surfaced four gaps. Pushedb80f85con top of7b27afbto fix all four in this PR rather than spawning follow-up issues.Gaps Closed
Multi-line
Skill()false negative. The regex\s*already matched newlines, butfindViolationswas iteratingcontent.split("\n")per-line, soSkill(\n skill: "loop", ...\n)escaped the lint. Verified locally with a fixture: the per-line walker found 1/2 calls (only the single-line one). Fix: run the regex against the full file content; derive line numbers frommatch.index. Two new tests pin the behavior (one violation, one qualified-OK).Markdown scope too narrow.
walkSkillFilesfilteredentry === "SKILL.md"only, but the harness loads referenced markdown (references/*.md,_shared/*.md, prompt-templates.md, etc.) alongside SKILL.md, and aSkill()call in any of those is equally runtime-dangerous. The issue body's verbatim grep used--include='*.md'(broader than my implementation). Fix: broaden toentry.endsWith(".md"). Live scan went from 51 → 100 files; still 0 violations across all colliding names.ANTHROPIC_TOP_LEVEL_NAMESdrift. Cross-checked against this session'savailable-skillsblock:release— Anthropic no longer ships a top-levelrelease; sequant shipssequant:release, so flagging bareSkill(skill: "release", ...)would produce false positives with broken advice.claude-api,update-config,keybindings-help,fewer-permission-prompts— all currently registered Anthropic top-level skills. Defensive coverage against a future sequant skill collision.loop, security-review, init, review, simplify, schedule.Doc-comment nit. Removed the spurious "(or invalid args)" exit-1 case from the script header — the script accepts no args.
Verification
npx vitest run scripts/lint-skill-calls.test.ts→ 13/13 passed (was 10/10).npm run lint:skill-calls→ 0 violations across 100 .md files.Skill(\n skill: "loop", ...\n)into a SKILL.md): exit 1, file:line reported correctly, revert → exit 0.npm run build,npm run lint→ green.Adversarial Re-Read (after fix)
Status: Clean. The 4 gaps were the surface area; verbatim issue-body grep still produces 0 matches; multi-line and broadened-md scope are now empirically covered; names list matches the current harness output.
Verdict: Still
READY_FOR_MERGE, with the gap fixes folded into the PR.chore: merge origin/main into feature/571-ac-linter-title-body-tension