rename-code

Renames code symbols and tracked repository paths while updating every in-scope reference.

Updated May 19, 2026
One-click install
npx skills add https://github.com/wenyue/SmartKit --skill rename-code-wenyue
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rename-code
Source: https://github.com/wenyue/SmartKit/tree/main/docs/zh-CN/skills/rename-code
Command: npx skills add https://github.com/wenyue/SmartKit --skill rename-code-wenyue

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Renaming a public symbol or repository path is risky: text search misses identity, breaks compatibility contracts, and leaves stale references. This Skill performs identity-based renames that update every confirmed in-scope reference without touching unrelated same-named items or changing behavior. ## Core Features & Use Cases - Identity-first renaming: Resolves the declaration or tracked path before searching, distinguishing overloads, shadowing, inheritance, and generated identities from the actual target. - Compatibility governance: Requires an approved breaking-change, phased migration, alias, or adapter decision before renaming externally observable names such as API fields, config keys, or database columns. - Evidence-based verification: Re-runs identity-aware exploration after edits, classifies remaining old-name occurrences, and executes all owner-required checks (formatting, static analysis, build, tests). - Use Case: Rename a public API method across a multi-language repository, updating call sites, tests, docs, and generated code through its canonical generator, then verify with the project's build and test suite. ## Quick Start Rename the function 'getUserData' to 'fetchUserProfile' across the repository and update all its references, tests, and documentation.

Frequently Asked Questions about rename-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely rename a function across an entire codebase?▼

Resolve the function's declaration first to establish its identity, then use semantic reference search when available, supplemented by lexical search across imports, call sites, tests, and docs. After editing, re-run identity-aware exploration and execute the project's build and test checks to confirm completeness.

How to rename a public API field without breaking consumers?▼

Externally observable names are contracts, so obtain an approved compatibility decision first: a breaking rename, phased migration, alias, or adapter. Without approval, serialized keys, protocol fields, database columns, and config keys must remain unchanged.

Can I rename a file or directory with only case changes on macOS or Windows?▼

Yes, but case-insensitive filesystems require a two-step move through a unique temporary name. Use the repository's version control mechanism (such as git mv) for tracked paths rather than plain filesystem moves.

Why is text search alone not enough for renaming code?▼

Identical spelling does not imply identical identity: overloads, shadowed variables, and unrelated same-named symbols would be wrongly changed, while dynamic strings, generated code, and reflection-based references would be missed. Identity-aware exploration distinguishes these cases.

What happens if required checks fail after a rename?▼

The rename cannot be reported complete. The Skill returns FAILED, preserving useful partial state and evidence, and reports the failing checks, unresolved occurrences, and the next owner or decision needed.