refactor(skills): clean skill names (strip NN- prefix from name:) — convention change
Some checks failed
Verify Skills / verify-skills (push) Has been cancelled

Adopt: directory keeps its NN- ordering prefix; skill `name:` is the clean form
without it (dir 16-seo-schema-validator → name: seo-schema-validator). Nicer to
invoke, matches the original desktop/SKILL.md names, still globally unique.

- 71 root SKILL.md: name: NN-foo → name: foo (flat skills + reference-curator suite).
  Plugins (mac-optimizer/multi-agent-guide/dintel-bootstrap) already clean; 95 already clean.
- scripts/migrate_skill_root.py: derive name = dirname minus NN- prefix (skill_name()).
- CLAUDE.md + SKILL-MIGRATION-GUIDE.md: document the dir-prefix / clean-name convention.

verify_skills.py: 0 name collisions across all renamed skills. (The ~/.claude/skills
symlinks were re-pointed to the clean names separately — filesystem only.)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-28 02:11:01 +09:00
parent 08cb20fc67
commit 6ac547e78f
74 changed files with 84 additions and 75 deletions

View File

@@ -4,7 +4,8 @@ migrate_skill_root.py — additive bulk migration: give each skill a root SKILL.
Non-destructive. For every skill directory under custom-skills/ that lacks a root
SKILL.md, it generates one by copying the skill's existing directive and:
- setting `name:` to the directory name (guaranteed kebab-case + unique),
- setting `name:` to the directory name MINUS its NN- ordering prefix
(dir `16-seo-schema-validator` -> name `seo-schema-validator`; clean + unique),
- preserving `description` and the markdown body verbatim,
- validating the result (frontmatter <= 1024 chars, kebab name, description present).
@@ -29,6 +30,11 @@ FM_RE = re.compile(r"^---\n(.*?)\n---\n?(.*)$", re.S)
MAX_FM = 1024
def skill_name(dirname):
"""Skill `name:` = directory name without its NN- ordering prefix."""
return re.sub(r"^\d+-", "", dirname)
def is_skill_dir(d):
"""A skill dir is a real skill, not shared infra."""
if not d.is_dir():
@@ -106,7 +112,7 @@ def main(argv=None):
rows.append((name, "MANUAL", "no desktop/ or code/ SKILL.md source (commands/README only)"))
manual += 1
continue
text, issues = build_root_skill(src.read_text(encoding="utf-8"), d.name)
text, issues = build_root_skill(src.read_text(encoding="utf-8"), skill_name(d.name))
rel = src.relative_to(d)
if text is None:
rows.append((name, "MANUAL", f"{rel}: {issues[0]}"))