| name | rename-symbol |
| description | Safely renames a function, variable, type, or class across the entire codebase |
| argument-hint | <old-name> <new-name> |
| user-invocable | true |
| allowed-tools | Bash Grep Read Edit |
| effort | low |
Rename Symbol
Old name: $1
New name: $2
- Find all occurrences:
grep -rn "\b$1\b" . --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" --exclude-dir=node_modules --exclude-dir=dist
-
Categorize occurrences:
- Definition (function/class/type declaration)
- Call sites
- Type annotations
- Imports/exports
- Test files
- Comments and documentation
- String literals (flag separately - may be API contracts)
-
Show the full list. Flag any in string literals or external-facing API contracts as risky.
-
Ask for confirmation, then rename all (except flagged ones).
-
Run type check to verify:
npx tsc --noEmit
Report any errors introduced.