What problem does it solve? Text-based tools like sed and grep match raw strings, so they hit comments, string literals, and wrong scopes when modifying code. This Skill provides AST-aware search and replace patterns that understand code structure, making refactors precise and safe. ## Core Features & Use Cases - Structural Search: Find functions, calls, or patterns by syntax tree shape using metavariables like $NAME and $$$ARGS across 15+ languages. - Safe Rewrites: Preview and apply code transformations with pattern-based replacement that respects scope and syntax. - YAML Rule Files: Define reusable lint-style rules with constraints, context matching, and automatic fixes, then run them project-wide via ast-grep scan. - Use Case: Migrate an entire TypeScript codebase from an old API to a new one by matching call sites structurally and rewriting them in place, without touching comments or unrelated identifiers. ## Quick Start Ask the AI to use ast-grep to find all async functions in your TypeScript files or to rewrite every call to an old API with its replacement.