rename-refslisted
Install: claude install-skill Borda/AI-Rig
<objective>
Rename Python symbol or module atomically. Coverage:
- Definition site (def/class line)
- `__all__` re-exports in `__init__.py` files
- Import call sites across all callers (located via fn-rdeps + symbol line-range narrowing)
- Sphinx docstring cross-refs across `.py` and `.rst`
- Optional `@deprecated` alias for old name (pydeprecate with `warnings.warn` fallback)
- Optional hard-delete when exhaustive=true and zero callers
**Subcommands**:
- `symbol <old_qname> <new_qname>` — function, class, or method. qname = bare name (`MyClass`), qualified (`MyClass.method`), or full (`mypackage.auth::validate_token`)
- `module <old_module_path> <new_module_path>` — dotted path (`mypackage.old_name`). Renames file + all import lines.
**Flags**:
- `--dry-run` — print all sites that would change; no edits
- `--deprecate` — symbol only: keep old name as `@deprecated` wrapper pointing to new name
- `--since <ver>` / `--removed-in <ver>` — passed to deprecation decorator; optional, defaults to `"?"`
- `--remove-if-no-callers` — symbol only: delete definition when exhaustive=true + zero callers; requires explicit confirmation
**Hard limits** (static analysis boundary — not fixable):
- `getattr(obj, "old_name")` — string not statically bound to symbol; Step 6 emits grep advisory
- Cross-repo callers — out of scope by definition; use `--deprecate` + semver bump for public APIs
NOT for: building index (`/codemap:scan-codebase`); querying without rename intent (`/codemap:query-co