ast-grep

Translate natural language queries into ast-grep rules for C# syntax shapes.

1|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/woutervanranst/Arius7 --skill ast-grep-woutervanranst
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ast-grep
Source: https://github.com/woutervanranst/Arius7/tree/main/.agents/skills/ast-grep
Command: npx skills add https://github.com/woutervanranst/Arius7 --skill ast-grep-woutervanranst

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Structural, language-aware code search for C# without relying on Roslyn semantics, by translating natural language queries into ast-grep rules that target syntax shapes and patterns.

Core Features & Use Cases

  • Convert natural language prompts into ast-grep rules focused on C# syntax shapes (declarations, invocations, attributes, await, using, catch, etc.).
  • Emphasizes syntax-first matching over semantic analysis to enable robust searches across codebases.
  • Workflow guidance: clarify target shape, build minimal examples, start simple, verify with debug-query, test on real files, and iterate toward repo-scale searches.

Quick Start

Provide a simple C# snippet and iteratively refine an ast-grep rule to match your target syntax.

Frequently Asked Questions about ast-grep

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

FAQPage Schema
How do I search for specific C# syntax patterns like method declarations and catch blocks?

You can translate natural language queries into ast-grep rules to perform structural C# code search that targets syntax shapes including declarations, invocations, attributes, awaits, and catch blocks. This enables precise matching beyond semantic analysis.

What is structural code search and how does it differ from semantic analysis for C#?

Structural code search matches syntax shapes and patterns directly without relying on Roslyn semantic analysis. This approach uses ast-grep rules to find robust structural matches across codebases, enabling language-aware searches independent of semantic context.

How do I build and test ast-grep rules for a C# codebase?

Provide a simple C# snippet, build minimal examples, and start with a simple ast-grep rule. Use debug-query to verify the target shape, test on real files, and iterate step by step toward repo-scale structural searches.

Can I use ast-grep rules for structural searches across large C# repositories?

Yes, ast-grep rules support declarative rule construction with pattern, context, and selector components for C# codebases. The workflow guides you to test, iterate, and validate rules against real code to achieve repo-scale structural searches.

Does structural code search require Roslyn semantic analysis to match C# syntax?

No, ast-grep rules perform language-aware structural searches for C# without relying on Roslyn semantics. The rules target syntax shapes directly, enabling robust matching across codebases where semantic analysis is not required or available.

Why use syntax-first matching instead of semantic analysis for C# code search?

Syntax-first matching emphasizes targeting syntax shapes and patterns directly over semantic analysis. This enables robust structural searches across C# codebases by translating natural language queries into declarative ast-grep rules.