claude-skills/scripts/check_skill_names.py
Claude 3aa22f1c9f
refactor(research): rename deep-research to meta-research; fix /review clash
Claude Code 2.1.316 bundles a deep-research skill (its fan-out web research
workflow), and our research plugin used the same skill name. Rename the
plugin, skill, agent (cs-meta-research) and command (/cs-meta-research);
update marketplace, Codex/Gemini/Vibe/Hermes mirrors, docs pages, harness
manifest, eval cases, listing baseline and cross-references. Upstream
catalog URL keeps its name. Reserve deep-research and the other bundled
skills/workflows seen in 2.1.316 in check_skill_names.py.

The maintainer project command .claude/commands/review.md hid /review,
which Claude Code uses as an alias of built-in /code-review: renamed to
/quality-gate. The commands README loaded as a /README command, said
/git:pr targets main, and listed half the commands: moved to
.claude/COMMANDS.md and rewritten. /git:* commands verified working.

Bump changed plugins (G11): meta-research, research-orchestrator,
deepread 2.14.7; agent-harness 2.14.11; engineering-advanced-skills 2.14.14.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L8KYFK8uNKfEuEFhyaapiR
2026-11-02 15:24:54 +00:00

102 lines
4 KiB
Python

#!/usr/bin/env python3
"""Guard against plugin skill names that shadow Claude Code built-in commands.
Issue #885: a plugin skill whose frontmatter `name:` equals a built-in slash
command word (e.g. `status`, `review`) shadows the built-in for every user who
installs the plugin — Claude Code's slash resolver matches the bare leaf name.
The fix convention is a namespaced leaf name (`memory-status`, `hub-status`,
`pw-review`, ...). This gate fails CI when a new bare reserved name appears.
Scans every SKILL.md outside mirror trees / docs / eval output and checks the
frontmatter `name:` against the reserved-word list below (Claude Code built-in
commands as of CC 2.1.x — extend the set when new built-ins land).
Exit codes: 0 = clean, 1 = at least one shadowing name found.
"""
import argparse
import os
import re
import sys
REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Claude Code built-in slash commands a plugin skill name must never equal.
RESERVED = {
"add-dir", "agents", "bug", "clear", "compact", "commit", "config",
"context", "cost", "doctor", "export", "help", "hooks", "init", "login",
"logout", "mcp", "memory", "model", "permissions", "plugin", "pr",
"resume", "review", "rewind", "settings", "status", "terminal", "todos",
"usage", "vim",
# Bundled skill, not a built-in command, but two plugins both named a skill
# `run`, which also made the .codex/skills/run symlink flip between them.
"run",
# Bundled skills in CC 2.1.314. `skill-doctor` was our engineering plugin's
# skill name until v2.14.5 (renamed skill-retro) and hid the built-in report.
# `loop` was autoresearch-agent's skill name until v2.14.5 (renamed ar-loop).
"skill-doctor", "simplify", "code-review", "security-review", "loop",
# Built-in commands seen in a CC 2.1.314 init (2026-10-31).
"advisor", "batch", "debug", "effort", "fast", "focus", "goal", "insights",
"recap", "rename", "verify",
# Bundled skills and workflows in CC 2.1.316 (2026-11-02). `deep-research`
# was research/deep-research's skill name until v2.14.7 (renamed
# meta-research) and hid the built-in research workflow.
"deep-research", "autopilot", "bugfix", "dashboard", "docs", "investigate",
"design", "slides", "dataviz", "team-onboarding", "import", "color",
}
SKIP_DIRS = {".git", ".gemini", ".codex", ".vibe", ".hermes", "docs",
"eval-workspace", "node_modules"}
NAME_RE = re.compile(r'^name:\s*["\']?([A-Za-z0-9_-]+)["\']?\s*$', re.M)
def find_skill_files():
out = []
for root, dirs, files in os.walk(REPO):
rel = os.path.relpath(root, REPO)
top = rel.split(os.sep)[0]
if top in SKIP_DIRS:
dirs[:] = []
continue
if "SKILL.md" in files:
out.append(os.path.join(root, "SKILL.md"))
return sorted(out)
def check(path):
try:
with open(path, encoding="utf-8", errors="replace") as f:
head = f.read(2048)
except OSError as e:
return f"unreadable: {e}"
m = NAME_RE.search(head)
if m and m.group(1).lower() in RESERVED:
return (f"skill name {m.group(1)!r} shadows the built-in "
f"/{m.group(1).lower()} command (issue #885) — use a "
f"namespaced leaf name like '<plugin>-{m.group(1).lower()}'")
return None
def main():
ap = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
ap.add_argument("--all", action="store_true",
help="Check every SKILL.md in the repo (default behavior)")
ap.parse_args()
failed = 0
for f in find_skill_files():
msg = check(f)
rel = os.path.relpath(f, REPO)
if msg:
failed += 1
print(f"FAIL {rel}\n - {msg}")
if failed:
print(f"\n{failed} skill(s) shadow built-in commands", file=sys.stderr)
return 1
print("OK: no plugin skill name shadows a Claude Code built-in command")
return 0
if __name__ == "__main__":
sys.exit(main())