ast-grep-search
Installation
SKILL.md
ast-grep Structural Code Search & Refactoring
Structural code search and refactoring using ast-grep — matches code by its AST (abstract syntax tree) rather than text patterns.
When to Use This Skill
| Use this skill when... | Use something else instead when... |
|---|---|
| The pattern depends on AST structure (function shape, call form, argument count) | Searching plain text or regex matches → tools-plugin:rg-code-search |
| Refactoring API call sites across many files while preserving captured variables | Running a one-shot anti-pattern scan with a report → code-antipatterns |
| Hand-written structural search/replace for an ad-hoc migration | Functional refactors of a known file/directory → code-refactor |
| Building a new ast-grep rule for a codebase-specific smell | Looking up agentic flags for an existing linter → code-lint |