AST-Aware Code Refactoring

0•

Performs systematic, syntax-aware code transformations and pattern-based refactoring across entire repositories using ast-grep.

The AST-Aware Code Refactoring skill empowers Claude to perform complex, structural changes to source code by leveraging abstract syntax trees (AST). Unlike standard text-based search-and-replace, this skill understands language structure, allowing it to accurately rename variables, migrate API patterns, and modernize syntax across large codebases without breaking logic. It provides a comprehensive workflow from discovery and impact analysis to planning and interactive execution, ensuring that bulk transformations are handled safely and consistently across multiple files.

主な機能

01Syntax-aware search and replace using ast-grep
02Interactive refactoring with dry-run and verification steps
03Mass renaming of functions, classes, and variables across scopes
04Structural code architecture restructuring and module splitting
05Automated API migration and syntax modernization (e.g., var to const)
060 GitHub stars

ユースケース

01Standardizing logging or error handling patterns across multiple microservices
02Refactoring legacy variable declarations and function signatures with scope awareness
03Migrating deprecated library calls to modern equivalents across a large repository