ast-grep

Installation
SKILL.md

ast-grep Skill

You now have access to ast-grep, a powerful AST-based code search, lint, and rewrite tool. Use this skill when working with code analysis, refactoring, or pattern matching tasks.

What is ast-grep?

ast-grep is a command-line tool that searches, lints, and rewrites code using Abstract Syntax Trees (ASTs) rather than plain text. Think of it as "a hybrid of grep, eslint, and codemod."

Key advantages over text-based tools:

  • Structurally aware: matches code patterns, not just text
  • Language-aware: understands syntax across 20+ languages
  • Precise: avoids false positives from string/comment matches
  • Fast: written in Rust with multi-core support

Supported languages: C, C++, Rust, Go, Java, Python, C#, JavaScript, TypeScript, HTML, CSS, Kotlin, Swift, JSON, YAML, and more.

Core Commands

Installs
17
First Seen
Mar 19, 2026
ast-grep from smithery.ai