code-rename_skill

This skill renames symbols across a codebase safely, updating definitions and all references with precision and verification.
  • JavaScript

0

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill brettatoms/agent-skills --skill code-rename

  • SKILL.md6.5 KB

Overview

This skill renames symbols across a codebase safely and predictably. It guides you from locating definitions and usages to applying edits and verifying results. Focus is on avoiding false positives, handling qualified references, and keeping tests and linters green.

How this skill works

The skill inspects source code with syntax-aware tools (ast-grep for JavaScript/TypeScript, clj-kondo for Clojure) to find definitions and usages. It provides workflows for previewing changes, running structural rewrites, or falling back to ripgrep plus file edits. After edits, it recommends linting and running tests to verify correctness.

When to use it

  • Renaming functions, classes, variables, types, or methods across a repo
  • Refactoring exported symbols that affect multiple modules or packages
  • When you need structural accuracy beyond plain text search
  • Updating API names, class names, or constructor identifiers
  • Bulk renames where many occurrences must be consistent

Best practices

  • Commit or stash changes before starting so you can revert quickly
  • Preview all changes using --interactive or a dry run before applying --update-all
  • Prefer AST-aware tools (ast-grep, clj-kondo) over plain regex when possible
  • Search for namespace-qualified, aliased, and property-qualified forms (e.g., ns/name, obj.name)
  • Run linters and test suites after renaming and review diffs before committing

Example use cases

  • Rename a JavaScript function and all its call sites using ast-grep run with pattern + rewrite
  • Rename a class and update its instantiations and imports across a TypeScript codebase
  • Refactor a Clojure var using clj-kondo to locate definitions/usages, then apply edits with the Edit tool
  • Fallback: use ripgrep to list files containing a symbol and apply per-file edits when AST tooling isn’t available
  • Perform interactive review for string-literal or comment collisions to avoid unintended changes

FAQ

Use word boundaries or AST-aware patterns. For regex searches use \buser\b; with ast-grep use structural patterns so only the intended symbol nodes are matched.

What if the rename touches strings or comments I don’t want to change?

Preview results with --interactive or a dry run and skip matches in strings/comments. Review output and apply edits only to code locations.

Which tool is recommended for JavaScript/TypeScript bulk renames?

ast-grep is recommended for JS/TS because it’s syntax-aware and supports preview, interactive review, and --update-all for applying rewrites.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational