Ast Grep
Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for code patterns, find specific language constructs, or locate code with particular structural characteristics.
- Type
- Skill
- Author
- ast-grep
- Category
- Code Review
- GitHub stars
- 898
- Installs
- 18.0K
- Last updated
- September 13, 2026
Install
npx skills add https://github.com/ast-grep/agent-skill --skill ast-grepUse cases
- Search a codebase for a specific language construct by AST pattern.
- Write ast-grep rules to find code structures plain grep cannot express.
- Locate code with particular structural characteristics across a repository.
Frequently Asked Questions
How is ast-grep different from plain text search?
It matches code by its abstract syntax tree, so queries can go beyond simple text patterns.
What can I do with the rules this skill helps write?
Structural code search and analysis, such as finding specific language constructs or code with particular structural characteristics.
Who is it for?
Anyone doing codebase-wide analysis, refactors, or lint rule authoring.
About this skill
A guide to writing ast-grep rules for structural code search, letting you match code by its abstract syntax tree rather than by text. Use it when you need to find specific language constructs or patterns that plain grep cannot express. Aimed at anyone doing codebase-wide analysis, refactors, or lint rule authoring.
Summary written with AI assistance from the project's public description.
Categories
More from ast-grep
Similar Skills
Find Skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", o...
by vercel-labs
Grill Me
A relentless interview to sharpen a plan or design.
by mattpocock
Ai Video Generation
Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0,...
by inference-sh
Ai Image Generation
Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FL...
by inference-sh