ast-grep-practice

Analyze ast-grep linting rules for structural patterns across multi-language codebases.

320|3|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/mizchi/skills --skill ast-grep-practice
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ast-grep-practice
Source: https://github.com/mizchi/skills/tree/main/tooling/ast-grep-practice
Command: npx skills add https://github.com/mizchi/skills --skill ast-grep-practice

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Structural linting that expresses complex AST-based rules which general-purpose linters can't capture, enabling repeatable, codified checks across a codebase.

Core Features & Use Cases

  • Rule authoring: define precise AST patterns to detect anti-patterns and enforce project-wide standards.
  • Testing & CI: supports classification and snapshot tests for rule changes and integrates with sgconfig.yml for CI enforcement.
  • Reusable workflows: enables end-to-end linting, rule distribution, and automation across multi-language codebases.

Quick Start

Create a rule under rules/ with tests under rule-tests, then run ast-grep test to validate it.

Frequently Asked Questions about ast-grep-practice

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write ast-grep rules to detect structural patterns that traditional linters miss?

Structural linting with ast-grep lets you define precise AST patterns using YAML fields like id, language, rule, constraints, and transform to detect anti-patterns that general-purpose linters cannot capture.

How do I test ast-grep rules before integrating them into CI?

You can validate ast-grep rules by creating rule files under rules/ with corresponding tests under rule-tests, then running ast-grep test to execute classification and snapshot tests for your rule changes.

Can I use ast-grep for structural linting across multi-language projects like TypeScript, Rust, Go, and Python?

Yes, ast-grep supports structural linting across multi-language projects including TypeScript, Rust, Go, and Python by managing rule directories and configurations through a centralized sgconfig.yml file.

What YAML fields are available when authoring ast-grep rules for project-wide linting?

Ast-grep rule YAML exposes fields including id, language, rule, severity, fix, constraints, transform, files, ignores, and url, allowing precise control over structural pattern matching and automated fixes.

How does ast-grep compare to general-purpose linters for enforcing project-wide code standards?

Ast-grep enables structural linting by expressing complex AST-based rules that general-purpose linters cannot capture, providing repeatable and codified checks across an entire codebase for enforcing custom standards.

How do I configure ast-grep rule distribution and CI enforcement for a codebase?

You manage ast-grep CI enforcement and rule distribution by configuring sgconfig.yml to define rule directories, enabling automated structural pattern checks across multi-language codebases in your workflow.