Ast Grep
Use this skill when the user wants to search code structurally using AST patterns, perform linting, or rewrite code automatically across multiple files.
Install
npx skills add javimosch/supercli --skill ast-grepgit clone --depth 1 https://github.com/javimosch/supercli.git /tmp/supercli
mkdir -p ~/.claude/skills
cp -r /tmp/supercli/plugins/ast-grep/skills/quickstart ~/.claude/skills/ast-grepPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# ast-grep Plugin AST-based code structural search, lint, and rewriting. ## Commands ### Search - `ast-grep search run` — Search using AST pattern ### Rewrite - `ast-grep rewrite run` — Rewrite code using pattern and replacement ### Lint - `ast-grep lint run` — Run linting rules - `ast-grep scan run` — Scan directory with rules ## Usage Examples - "Find all usages of $A && $A() pattern in TypeScript" - "Replace null coalescing patterns" - "Lint the codebase for specific patterns" - "Scan src directory for violations" ## Installation ```bash npm install --global @ast-grep/cli # or cargo install ast-grep # or brew install ast-grep ``` ## Examples ```bash # Search for AST pattern ast-grep --pattern 'const $X = $Y' --lang ts # Rewrite code ast-grep --pattern '$A && $A()' --lang ts --rewrite '$A?.()' # Run lint ast-grep lint # Scan directory ast-grep scan src/ ``` ## Key Features - Pattern looks like real code - Supports JS, TS, Python, Rust, Go, Java, etc. - Use `$VAR` as wildcard for AST nodes - YAML-based lint rules -批量 code rewriting
Details
- Skill name
ast-grep- Repository
- javimosch/supercli
- Path
plugins/ast-grep/skills/quickstart/SKILL.md- License
- MIT
- Repo updated
- 2 November 2026
- Listed in
- heilcheng/awesome-agent-skills
FAQ
What does the Ast Grep skill do?
Use this skill when the user wants to search code structurally using AST patterns, perform linting, or rewrite code automatically across multiple files.
How do I install the Ast Grep skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add javimosch/supercli --skill ast-grep. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Ast Grep popular?
It lives in javimosch/supercli, which has 57 GitHub stars and 5 forks, and is included in 1 curated skill list.
Related skills
100 Exercises to Learn Rust
57javimosch/supercli
Use this skill when the user wants to use 100-exercises-to-learn-rust.
2to3
57javimosch/supercli
Use this skill when the user wants to use 2to3, cli tool: 2to3.
2to3 2.7
57javimosch/supercli
Use this skill when the user wants to use 2to3-2.7, cli tool: 2to3-2.7.
Attw
57javimosch/supercli
Use this skill when the user wants to verify that an npm package's TypeScript types resolve correctly for consumers, using attw (Are the Types Wrong).
Asciiquarium
57javimosch/supercli
asciiquarium — ASCII aquarium CLI. Animated aquarium with fish, bubbles, and seaweed in terminal.
Autocannon
57javimosch/supercli
autocannon — HTTP/1.1 benchmarking CLI. Fast, distributed HTTP load tester with real-time results.
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.