Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
poteto avatar

Ast Grep

  • 36 installs
  • 217 repo stars
  • Updated March 19, 2026
  • poteto/noodle

ast-grep is a Claude Code skill for ai & agent building.

About

ast-grep is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.

  • ast-grep
  • AI & Agent Building
  • AI-coding skill

Ast Grep by the numbers

  • 36 all-time installs (skills.sh)
  • Ranked #8,638 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/poteto/noodle --skill ast-grep

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs36
repo stars217
Last updatedMarch 19, 2026
Repositorypoteto/noodle

How do I helps with ai & agent building tasks.?

Helps with ai & agent building tasks.

Who is it for?

Best when you're working on ai & agent building and need structured help with ast grep.

Skip if: Teams with no ai & agent building needs, or anyone wanting a generic chat assistant without this specific workflow.

When should I use this skill?

When you need to helps with ai & agent building tasks., or when ast-grep is a claude code skill for ai & agent building.

What you get

Structured output aligned to ast-grep: ast-grep, AI & Agent Building.

Files

SKILL.mdMarkdownGitHub ↗

ast-grep

Workflow

1. Write a test snippet representing the target code 2. Write the rule (start with pattern, escalate to kind + has/inside if needed) 3. Test with --stdin before searching the codebase 4. Search the codebase once the rule matches

Critical Gotchas

Always use stopBy: end on relational rules

Without it, has/inside stop at the first non-matching node instead of traversing the full subtree:

# WRONG — will miss deeply nested matches
has:
  pattern: await $EXPR

# RIGHT
has:
  pattern: await $EXPR
  stopBy: end

Escape metavariables in shell

$VAR gets interpreted by the shell. Either escape or single-quote:

# Double-quoted: escape with backslash
ast-grep scan --inline-rules "id: test
language: javascript
rule:
  pattern: await \$EXPR" .

# Single-quoted: no escaping needed
ast-grep scan --inline-rules 'id: test
language: javascript
rule:
  pattern: await $EXPR' .

Metavariables must be the sole content of an AST node

These don't work: obj.on$EVENT, "Hello $WORLD", a $OP b, $jq

Use $$OP for unnamed nodes (operators, punctuation). Use $$$ARGS for zero-or-more nodes.

Testing with --stdin

echo "async function test() { await fetch(); }" | ast-grep scan --inline-rules 'id: test
language: javascript
rule:
  kind: function_declaration
  has:
    pattern: await $EXPR
    stopBy: end' --stdin

Debugging with --debug-query

When rules don't match, inspect the AST to find correct kind values:

ast-grep run --pattern 'your code here' --lang javascript --debug-query=cst

Formats: cst (all nodes), ast (named only), pattern (how ast-grep sees your pattern).

Rule syntax

See references/rule_reference.md for the full rule reference (atomic, relational, composite rules, and metavariables).

Related skills

FAQ

What does ast-grep do?

ast-grep is a Claude Code skill for ai & agent building.

When should I use ast-grep?

When you need to helps with ai & agent building tasks., or when ast-grep is a claude code skill for ai & agent building.

What are the main capabilities?

ast-grep; AI & Agent Building; AI-coding skill.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.