safe-rename

Rename exported symbols across codebases and verify all consumer references.

437|45|Updated Jan 27, 2026
One-click install
npx skills add https://github.com/ZaxbyHub/opencode-swarm --skill safe-rename
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: safe-rename
Source: https://github.com/ZaxbyHub/opencode-swarm/tree/main/.opencode/skills/generated/safe-rename
Command: npx skills add https://github.com/ZaxbyHub/opencode-swarm --skill safe-rename

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manually renaming exported symbols (functions, classes, interfaces, etc.) across a codebase is extremely error-prone, often leading to missed import statements, stale usage sites, broken builds, failing tests, and silent runtime errors that take hours to debug and fix.

Core Features & Use Cases

  • Full consumer discovery: Uses repo_map to identify all direct importers and transitive dependents of the target symbol or file, so no consumer is missed.
  • Mandatory end-to-end verification: Requires type checking, test execution, and full codebase search for stale references to confirm no breakage after the rename.
  • Real-world use case: When renaming a core utility function used across 20+ modules, this workflow automatically updates all import statements and usage sites, runs validation checks, and confirms zero remaining references to the old name.

Quick Start

Use the safe-rename skill to rename the exported calculateTotal function defined in utils/payment.ts across all files that import or use it.

Frequently Asked Questions about safe-rename

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

FAQPage Schema
How do I safely rename exported functions across multiple files without breaking imports?

Safely renaming exported symbols requires updating all consumer references, including direct imports, namespace imports, and re-exports, across transitive dependent modules. This systematic workflow ensures zero stale references and prevents silent runtime errors post-rename.

What is the best way to rename a code symbol in a large codebase without causing runtime errors?

The best way to rename code symbols in a large codebase is using a systematic workflow that discovers all direct importers and transitive dependents. This ensures all consumer references are updated and validated with type checks and test execution to prevent runtime errors.

How do I update aliased imports and dynamic property access when renaming a class?

Updating aliased imports and dynamic property access when renaming a class requires explicit edge-case guidance within the rename workflow. This ensures all specialized consumer references are correctly updated alongside standard direct imports to maintain code safety.

Does codebase refactoring for symbol renames work with transitive dependent modules?

Codebase refactoring for symbol renames works with transitive dependent modules by utilizing repo mapping to identify all direct importers and downstream consumers. This ensures renaming an exported interface or constant updates every affected file across the codebase.

Why does renaming an exported constant still cause broken builds and failing tests?

Renaming an exported constant causes broken builds and failing tests when manual refactoring misses stale usage sites or import statements. A systematic rename workflow eliminates these issues by enforcing mandatory type checking and test execution to verify zero breakage.