Skip to content

Best-practice rule-writing guide for ast-grep, covering patterns, meta variables, composition, constraints, and rewrites.

CCM score
50 of 100
skills.sh installs
351
GitHub stars
228
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers a 5-step workflow from understanding the query through testing and codebase search, plus quick tips
  • Includes 46 rules across 8 prioritized categories, from pattern correctness and meta variables to performance and testing
  • Enforces stopBy: end on relational rules (inside, has) so subtree searches stay complete
  • Designed for writing, reviewing, or debugging YAML rules, pattern syntax, and code rewrites in ast-grep

Install

$ npx -y skills add pproenca/dot-skills --skill ast-grep -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

ast-grep Community Best Practices

Comprehensive best practices guide for ast-grep rule writing and usage, maintained by the ast-grep community. Contains 46 rules across 8 categories, prioritized by impact to guide automated rule generation and code transformation.

When to Apply

Reference these guidelines when:

  • Writing new ast-grep rules for linting or search
  • Debugging patterns that don't match expected code
  • Optimizing rule performance for large codebases
  • Setting up ast-grep projects with proper organization
  • Reviewing ast-grep rules for correctness and maintainability

General Workflow

Follow this workflow when creating ast-grep rules for code search:

Step 1: Understand the Query

Clarify what you want to find:

  • Target programming language
  • Edge cases to handle
  • What to include vs exclude

Step 2: Create Example Code

Write a sample code snippet representing the desired match pattern.

Step 3: Write the ast-grep Rule

Details

Repository
github.com/pproenca/dot-skills
Categories
Code Review & Quality, CLI & Terminal
First seen
Jun 3, 2026

Questions

What is ast-grep?

ast-grep is an agent skill listed on Claude Marketplaces in the Code Review & Quality category. The listing describes ast-grep like this: ast-grep rule writing and usage best practices.

How do I install ast-grep?

Run npx -y skills add pproenca/dot-skills --skill ast-grep -y in a project to install ast-grep. After that, the agent can use ast-grep in that project.

Which category is ast-grep in?

ast-grep is in the Code Review & Quality category on Claude Marketplaces. Other listings in that category next to ast-grep include improve-codebase-architecture, codebase-design and code-review.

Where is the source code of ast-grep?

The source code of ast-grep is on GitHub at https://github.com/pproenca/dot-skills. The pproenca account on GitHub publishes ast-grep.

More from pproenca/dot-skills

All 100

Similar to Ast Grep

More Code Review & Quality