ast-grep

Solid

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.

AI & Automation 10 stars 0 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 80/100

Stars 20%
35
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# ast-grep Code Search > Adapted from upstream [ast-grep/agent-skill](https://github.com/ast-grep/agent-skill). Workspace-customized frontmatter; body refactored 2026-06-16 (CLI catalog split to `references/cli-cookbook.md`, voice/never sections added). ## Overview This skill helps translate natural language queries into ast-grep rules for structural code search. ast-grep uses Abstract Syntax Tree (AST) patterns to match code based on its structure rather than just text, enabling powerful and precise code search across large codebases. ## When to Use This Skill Use this skill when users: - Need to search for code patterns using structural matching (e.g., "find all async functions that don't have error handling") - Want to locate specific language constructs (e.g., "find all function calls with specific parameters") - Request searches that require understanding code structure rather than just text - Ask to search for code with particular AST characteristics - Need to perform complex code queries that traditional text search cannot handle ## General Workflow Follow this process to help users write effective ast-grep rules: ### Step 1: Understand the Query Clearly understand what the user wants to find. Ask clarifying questions if needed: - What specific code pattern or structure are they looking for? - Which programming language? - Are there specific edge cases or variations to consider? - What should be included or excluded from matches? ### Step 2: Create Example Co...

Details

Author
mishahanin
Repository
mishahanin/heading-os
Created
3 weeks ago
Last Updated
today
Language
Python
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category