ast-grep
Installation
SKILL.md
ast-grep
Use this skill when the task benefits from AST-based search, linting, or rewrites instead of regex- or line-based editing.
Use this skill when
- You need structural search over code, lint-rule authoring, or rewrite changes with AST-aware patterns.
- You want repeatable, reviewable edits across many files.
- You want to preview candidate matches before applying a codemod.
- A request explicitly mentions
ast-grep,sg, codemod, rule files, or syntax-aware edit work.
Do not use this skill when
- The task is simple literal string search; route to normal
rg/globusage. - The request is under-specified and needs sharpening first; route to
reverse-prompt. - The main work is root-cause analysis of a failure; route to
systematic-debugging. - The task is writing behavior tests first for a feature or bugfix; route to
test-driven-development.