What problem does it solve?
This skill solves the difficulty of performing complex, structural code searches and refactors that standard text-based grep tools cannot handle, such as identifying specific AST patterns or transforming code syntax across a large codebase.
Core Features & Use Cases
- Structural Pattern Matching: Search for code based on its abstract syntax tree rather than just text, allowing for precise identification of function calls, class definitions, or control flow structures.
- Automated Code Transformation: Perform safe, structural code rewrites across multiple files using pattern-based replacement.
- Use Case: Use this skill to identify all instances of a specific deprecated function call pattern and automatically rewrite them to the new API signature across the entire project.
Quick Start
Use the ast-grep skill to search for all class definitions in the current directory and display the results.