Ast Grep

Use this skill ANY time you must search, lint, or rewrite code by its syntax structure. ast-grep is an AST-based CLI tool. It matches code by syntax tree, not by text. ALWAYS prefer it over grep/ripgrep when the query is about code structure. Trigger categories: structural code search (find all calls to X, functions without Y), bulk code rewrite/codemod (replace API calls, migrate deprecated patterns), custom lint rules (enforce project patterns), multi-pass symbol renaming, code outline/structure exploration, ast-grep rule authoring. Trigger keywords: ast-grep, sg, structural search, codemod, rewrite pattern, metavariable, tree-sitter pattern, lint rule, sgconfig, find all calls, refactor across files, AST. Do NOT trigger for: plain string or regex searches, file-name lookups, log/config searches, single-file edits you can do by hand.

rolandbrecht 796076b 8 files · 47.4 KB Updated

File contents

rolandbrecht/agent-skills/tree/main/ast-grep commit 796076bac0

Frequently asked questions

npx skillmds@latest add rolandbrecht/ast-grep