rename-sweep
Installation
SKILL.md
Rename Sweep
Treat a rename as a refactor. Map its references before editing, then verify the same surfaces after the change.
When to use
Use for requests such as "rename this everywhere", "update all references", "change a config key", or "find stale links after moving a file". A request to explain a possible rename authorizes discovery only.
Steps
- Define the change. Record the old and new identifier, exact scope, intended spelling variants, compatibility requirements, and any historical records the user wants preserved. Treat a public API, database field, or deployed setting as a compatibility change: identify consumers and required migration or alias before editing.
- Declare the search roots. Map code, documentation, configuration, tests, CI, instructions, notes, and open tickets that refer to the old name or behavior. Search filenames, content, and links. Resolve symlink roots to their actual targets, or explicitly follow them. Search declared paths rather than assuming one project-root walk covers linked directories. If a category is absent, record how you checked. If a category is inaccessible, label it unverified.
- Read and classify the hits. Inspect their context. Record each active reference, generated reference, historical exception, and unrelated match in a checklist. Identify the generator for generated files. Use literal search for literal identifiers and separate searches for casing, separator variants, and references by concept when relevant.
- Apply the authorized changes. Update the source that owns each value, its consumers, links, examples, tests, and active ticket wording. Preserve unrelated edits. Rename paths and repair callers when the task includes paths. Regenerate derived files using the project's documented command. If permission is missing for a surface, provide the precise proposed change as a handoff and continue independent authorized work.
- Verify the same roots. Search the old identifier and mapped variants in every declared path, including filenames. Record command, paths, exit status, and output. With
rg, exit 1 means no matches; exit 2 means the check failed. Accept zero active hits only when the search ran successfully and covered every declared surface. Name each preserved historical match with its path and reason. - Check behavior. Run the project's relevant validation for changed imports, links, config readers, tests, and consumers. If a surface is unavailable or a compatibility step remains pending, report the rename as partial and name the missing evidence. A local change alone does not prove deployed consumers use the new name.
For a literal search with ripgrep, a useful starting point is rg -n -F -- 'old_identifier' path/to/src path/to/docs path/to/config. Use the equivalent available tool if ripgrep is absent. Repeat the verified command over the same paths after editing. Search path names separately, since content search does not check filenames. Resolve each linked root before interpreting an empty result.