What problem does it solve?
This Skill solves inaccurate code searching and risky bulk refactoring by replacing text-based matching with syntax-aware AST analysis that finds, validates, and transforms code patterns reliably.
Core Features & Use Cases
- Structural Code Matching: Create ast-grep patterns and YAML rules for finding code structures, linting violations, and reusable analysis workflows.
- Safe Code Transformation: Design codemods and automated rewrites with positive and negative fixture validation before applying changes across a repository.
- Use Case: When migrating an API across a large TypeScript codebase, use this Skill to locate every call pattern, avoid false matches in comments or strings, and generate a validated rewrite rule.
Quick Start
Use the hai-ast-grep skill to create an ast-grep rule that finds all deprecated API calls in my repository and validates the matches before rewriting them.