rename-refs

Solid

Atomic rename of Python symbols or modules via the structural index — static callers, import sites, `__all__` re-exports, Sphinx cross-refs; optional deprecated alias (`--deprecate`) or hard-delete (`--remove-if-no-callers`). Trigger with `$codemap-py:rename-refs symbol <old> <new> [flags]` or `$codemap-py:rename-refs module <old_path> <new_path> [--dry-run]` for: "rename X to Y" (function/class/method/ module), "move module X to Y", "update all references to X". Skip for: non-Python; index not built (run `$codemap-py:scan-codebase` first); local-variable rename; grep-only rename wanted; 1:N symbol splits; package directory rename (use `git mv` directly).

AI & Automation 23 stars 3 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 81/100

Stars 20%
46
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Rename Refs Renames a Python symbol or module atomically. Coverage: - Definition site (`def`/`class` line) - `__all__` re-exports in `__init__.py` files - Import call sites across all callers (`fn-rdeps` + symbol line-range narrowing) - Sphinx docstring cross-refs across `.py` and `.rst` - Optional `@deprecated` alias via pyDeprecate (`--deprecate`; requires `pyDeprecate` installed) - Optional hard-delete when the caller graph is exhaustive and callers = 0 **Subcommands**: - `symbol <old_qname> <new_qname>` — function, class, or method. qname = bare (`MyClass`), qualified (`MyClass.method`), or full (`mypackage.auth::validate_token`) - `module <old_module_path> <new_module_path>` — dotted path (`mypackage.old_name`). Renames the file and every import line. **Flags**: - `--dry-run` — print sites that would change; no edits - `--deprecate[=<decorator>]` — symbol only: keep the old name as a pyDeprecate `@deprecated` wrapper → new name; requires `pyDeprecate` - `--since <ver>` / `--removed-in <ver>` — passed to the deprecation decorator; default `"?"` - `--remove-if-no-callers` — symbol only: delete the definition when the caller graph is exhaustive and callers = 0 `--deprecate` and `--remove-if-no-callers` are incompatible (one aliases, the other deletes) — reject the combination before doing any analysis. **Hard limits** (static-analysis boundary — not fixable): - `getattr(obj, "old_name")` — string not statically bound; emit a search advisory in the final sum...

Details

Author
Borda
Repository
Borda/AI-Rig
Created
5 months ago
Last Updated
today
Language
Python
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

rename-references

Sweep stale references after renames — the syntactic forms token-only grep misses (slash-tokens, paths, chain prose, numbered table rows, frontmatter chains and globs). Use when: 'rename X to Y', 'I renamed X', 'audit rename', 'find stale refs', 'check for stragglers', 'after git mv', 'sweep references', 'rename impact preview', 'find half-renamed state', 'broken refs after rename', 'pre-PR rename check' — actions: audit, audit blast, audit half-rename, audit orphans, apply, preview, blocklist; not for framework migrations or repo-wide dead-reference audits.

4 Updated today
melodic-software
Code & Development Featured

code-refactor

Perform bulk code refactoring operations like renaming variables/functions across files, replacing patterns, and updating API calls. Use when users request renaming identifiers, replacing deprecated code patterns, updating method calls, or making consistent changes across multiple locations.

656 Updated 2 days ago
mhattingpete
AI & Automation Solid

query-code

Query the codemap structural index — module deps/rdeps/central/coupled/path, symbol-level source extraction, function call graph (fn-deps, fn-rdeps, fn-central, fn-blast), plus quality/coverage queries. Trigger with `$codemap-py:query-code <subcommand> ...` for: "what depends on", "who calls", "imports of", "dependency graph", "blast radius of", "list central modules". Skip for: rename intent (use `$codemap-py:rename-refs`); simple grep suffices; non-Python repo. Missing/stale index auto-builds — no manual scan-codebase needed.

23 Updated today
Borda