Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

bulk-sweep-classify

БесплатноБез исполняемых скриптовНе проверен

Classify every regex match before a bulk find-replace/syntax-modernization sweep — four match categories, scoped transform, allowlist-aware verification. Use…

laurigatesот laurigates★ 61 звезда на GitHub

Об этом скилле

Bulk Sweep — Classify Every Match First

When you modernize a syntax across many files with a regex / sed / perl pass — a command rename (/ns:cmd → /ns-cmd), a tool/binary rename, a path or import-style migration, an API-version bump in prose — the matched set is heterogeneous even though every hit looks textually identical. One pattern catches genuine stale targets and several look-alikes that must NOT be transformed. Blindly rewriting all matches corrupts the look-alikes silently: the sweep reports success, and the damage surfaces far downstream (a broken designed filename, a rewritten immutable record).

The discipline: enumerate the matches and bucket every one into a category before editing. The regex sees text; the transform needs semantics.

When to Use This Skill

Use this skill when... Use something else instead when...
A find-replace where the delimiter/token also appears in filenames, config keys, URLs, designs, or historical records The pattern is structural (function shape, call form) → code-quality-plugin:ast-grep-search. Also when the rename is textually simple but code-targeted (an API rename, call-site migration, or import-path change in source files): route it through ast-grep-search first — structural matching won't touch strings/comments/URLs, so category-2 false positives shrink to near-zero (see the routing step below)
Command-syntax migration (/ns:cmd → /ns-cmd), tool rename in docs, path/import migration, API-version bump in prose A one-off literal string search with no look-alike risk → tools-plugin:rg-code-search
Docs trees mixing live guidance with ADRs / changelogs / design PRDs, all matching the same regex The whole match-set is genuinely uniform and you have verified it

The Four Categories

Read the surrounding line of each match and bucket it. Each category needs different handling.

Category Handling Canonical example (command-syntax sweep)
1. Genuine stale target Transform /configure:mcp → /configure-mcp in live docs
2. False positive — merely matches the pattern Leave acme/dotfiles:latest (docker tag); redis://host:6379 (digit after :, not a command)
3. Out-of-scope design legitimately using the old form — esp. delimiter embedded in designed filenames/paths Leave — transforming corrupts the design /sync:daily PRD whose colon also appears in sync:daily-state.json, .claude/commands/sync:daily.md
4. Immutable / historical record matching the pattern Supersede-note; do NOT rewrite the body Accepted ADRs documenting the old /namespace:command convention

Category 3 is the sharpest trap. The delimiter you're replacing (:, /, ., -) often also appears in filenames, config keys, or URLs that the matched token participates in. Hyphenating /sync:daily → /sync-daily also rewrites every sync:daily-state.json path in the same doc — silently breaking a design.

Category 4 follows the standard supersede-don't-rewrite convention: set Status: Superseded plus a top-note, leave the body as a historical record.

Execution

Step 0: Route by sweep target — code vs. prose/docs

Before enumerating, decide what you are sweeping. This picks the transform engine and shrinks the classify workload:

  • Sweep target is code — an API rename, call-site migration, or import-path change in source files. Do the transform structurally with ast-grep -p '<old>' -r '<new>' --lang <l>, delegating the transform mechanics to code-quality-plugin:ast-grep-search. An ast-grep pattern matches AST nodes, so it inherently won't match inside strings, comments, or URLs — the whole category-2 false-positive bucket shrinks to near-zero. The classify pass then focuses on categories 3 (designed filenames/paths) and 4 (immutable records) only, and Steps 1–2's false-positive tightening is largely unnecessary. Proceed to Step 3 with the ast-grep result in hand.

  • Sweep target is prose/docs/mixed — command renames in markdown, tool names in docs trees, an API-version bump in prose. Regex sees text, not semantics, so the four-category discipline below is unchanged and remains this skill's core case. Run the full Step 1 → Step 5 pipeline.

The decision hinges on whether a structural matcher can see your target: code has an AST, prose does not. When in doubt (a rename that spans both source and its surrounding docs), split it — ast-grep the source, then run the four-category pass over the docs.

Run this classify-then-transform sweep:

Step 1: Enumerate every match, deduped, before touching anything

git grep -nhoE '/[a-z][a-z0-9-]*:[a-z][a-z0-9-]*' -- <scope> | sort -u

Adjust the pattern to your migration. The point is a complete, deduped inventory in hand before any edit.

Полный SKILL.md на GitHub

Установить bulk-sweep-classify в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Bash(git grep *)
Bash(sort *)
Bash(ast-grep *)
Read
Grep
Edit

Вложенные файлы

REFERENCE.mdreferences/commands.mdreferences/evidence.mdreferences/related.md

FAQ

Что делает скилл bulk-sweep-classify?

Classify every regex match before a bulk find-replace/syntax-modernization sweep — four match categories, scoped transform, allowlist-aware verification. Use when bulk-renaming commands/tools/paths or migrating syntax across many files.

Как установить скилл bulk-sweep-classify?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл bulk-sweep-classify запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить bulk-sweep-classify с