What problem does it solve? Text-based search tools like grep cannot understand code structure, so finding every function with a specific signature or rewriting a call pattern across hundreds of files produces false positives and missed matches. This Skill performs AST-aware structural search and rewrite, matching code by its syntax tree rather than raw bytes. ## Core Features & Use Cases - Structural Search: Find code by AST pattern using meta-variables like $VAR and $$$ across TypeScript, Python, Go, Rust, Java, and 20 other languages. - Pattern-Driven Rewrites: Preview codemods with dry-run output, then apply bulk rewrites with a two-pass flow that avoids the silent --update-all/--json conflict. - YAML Rule Scanning: Run reusable lint rules with constraints, auto-fixes, and CI-friendly report formats via sg scan. - Offline Pattern Validation: Catch regex misuse and malformed patterns before invoking the binary, saving debugging round-trips. - Use Case: Migrate every console.log(x) call to logger.info(x) across a 200-file TypeScript repo: validate the pattern, dry-run the rewrite to inspect the blast radius, then apply and review with git diff. ## Quick Start Ask the agent to find every console.log call in the src directory and rewrite them to logger.info using the ast-grep helper script.