What problem does it solve?
This Skill eliminates the limitations of text-based code search and manual cross-file refactoring, which fail when code formatting varies or when you need to match syntactic patterns instead of literal strings.
Core Features & Use Cases
- Structural Code Search: Match code patterns including function calls, decorators, import statements, and class definitions regardless of whitespace or formatting differences.
- Automated Cross-File Refactoring: Rewrite matching code patterns across entire codebases using consistent meta-variables to avoid manual errors.
- Use Case: For example, if you need to rename a function parameter across 50 Python files, this Skill will match all instances of the old parameter in function calls and rewrite them to the new name without missing any due to formatting variations.
Quick Start
Use the ast-grep skill to find all Python function calls using the old 'timeout' parameter and rewrite them to use the new 'connect_timeout' parameter across the entire src/ directory.