skills/pproenca/dot-skills/ast-grep-best-practices

ast-grep-best-practices

SKILL.md

ast-grep Community Best Practices

Comprehensive best practices guide for ast-grep rule writing and usage, maintained by the ast-grep community. Contains 42 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

Rule Categories by Priority

Priority Category Impact Prefix
1 Pattern Correctness CRITICAL pattern-
2 Meta Variable Usage CRITICAL meta-
3 Rule Composition HIGH compose-
4 Constraint Design HIGH const-
5 Rewrite Correctness MEDIUM-HIGH rewrite-
6 Project Organization MEDIUM org-
7 Performance Optimization MEDIUM perf-
8 Testing & Debugging LOW-MEDIUM test-

Quick Reference

1. Pattern Correctness (CRITICAL)

2. Meta Variable Usage (CRITICAL)

3. Rule Composition (HIGH)

4. Constraint Design (HIGH)

5. Rewrite Correctness (MEDIUM-HIGH)

6. Project Organization (MEDIUM)

7. Performance Optimization (MEDIUM)

8. Testing & Debugging (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Full Compiled Document

  • AGENTS.md - Complete compiled guide with all rules

Reference Files

File Description
AGENTS.md Complete compiled guide with all rules
references/_sections.md Category definitions and ordering
assets/templates/_template.md Template for new rules
metadata.json Version and reference information
Weekly Installs
2
GitHub Stars
71
First Seen
Jan 24, 2026
Installed on
claude-code1
antigravity1
gemini-cli1