What problem does it solve?
This skill solves the risk of using naive find-and-replace tools for structural code changes, which often mangle strings, comments, or shadowed variables. It provides a reliable way to perform mechanical edits across large codebases while maintaining semantic correctness.
Core Features & Use Cases
- Grammar-Aware Transformation: Uses AST-based tools like jscodeshift, ast-grep, and ts-morph to ensure edits only target valid code nodes.
- Safety-First Workflow: Enforces fixture-based testing and dry-run verification before applying changes to the filesystem.
- Use Case: Automatically migrate an entire repository from a deprecated API to a new one, such as renaming a function across all imports, exports, and call sites without breaking unrelated string literals or comments.
Quick Start
Use the author-codemod skill to generate and run a transformation script that renames the function getUser to fetchUser across all files in the current directory.