ast-grep
Skill15 starsChanged 8 months agoApache-2.0View on GitHub
Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for code patterns, find specific language constructs, or locate code with particular structural characteristics.
- Installs packages
23 other projects use a version of this, 10 of them edited.
Adopted by
Most recently taken up by
- matt-riley/agent-skillstheir own version, first seen Nov 15, 2026
- D-Shey/autoharnessedited, first seen Nov 15, 2026
- coleam00/skillsedited, first seen Nov 14, 2026
- zxyycom/skillstheir own version, first seen Nov 8, 2026
- hugefiver/dsmmtheir own version, first seen Nov 1, 2026
- AprilNEA/OpenLogiedited, first seen Oct 17, 2026
Used with
Projects with it also use tdd and skill-creator.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
GoogleSkilltdd
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
Also in 4 projects that use this
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 5 projects that use this
Other versions23 projects use a version of this.
Word for word · 0
None found.
Edited · 10
- AprilNEA/OpenLogi★ 26k81% same
- warp-drive-data/warp-drive★ 3.2k96% same
- coleam00/skills★ 73897% same
- nodetool-ai/nodetool★ 63790% same
- moeru-ai/auv★ 20797% same
- D-Shey/autoharness★ 1077% same
- trotsky1997/My-Claude-Agent-Skills★ 797% same
- tentacle-pro/skills★ 497% same
- acgs-ai/ACGS★ 297% same
- phalbohr/skills★ 197% same
Wrote their own version · 13
- ccusage/ccusage★ 19ksame name
- ryoppippi/ccusage★ 19ksame name
- damusix/skills★ 63same name
- tstapler/dotfiles★ 8same name
- drunkcoding/AgentSkillsArxiv★ 5same name
- rolandbrecht/agent-skills★ 4same name
- matt-riley/agent-skills★ 3same name
- shalomb/agent-skills★ 3same name
- tizee/skills★ 2same name
- zxyycom/skills★ 2same name
3 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository63 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-browserSkill
- ast-grepSkill
- branch-review-before-prSkill
- browse-qaSkill
- browser-useSkill
- browseSkill
- bugfixSkill
- build-dmgSkill
- claude-reviewSkill
- codemapSkill
- code-simplifySkill
- codex-reviewSkill
- commitSkill
- cost-estimateSkill
- create-prSkill
- find-agentsSkill
- find-bugsSkill
- frontend-design-ui-uxSkill
- git-merge-expertSkill
- git-merge-expert-worktreeSkill
- kiro-reviewSkill
- laravel-filamentSkill
- laravelSkill
- lokeiSkill
- map-project-monorepoSkill
- map-projectSkill
- nextjsSkill
- plan-founder-reviewSkill
- plan-to-task-list-with-dagSkill
- pr-retroSkill
- run-parallel-agents-feature-buildSkill
- run-parallel-agents-feature-debugSkill
- rustSkill
- secretsSkill
- startSkill
- update-agent-learningsSkill
- update-claude-learningsSkill
- update-claude-settingsSkill
- update-skill-learningsSkill
- branch-review-before-prSkill
- codemapSkill
- code-simplifySkill
- commitSkill
- cost-estimateSkill
- create-prSkill
- find-bugsSkill
- frontend-design-ui-uxSkill
- git-merge-expertSkill
- git-merge-expert-worktreeSkill
- map-project-monorepoSkill
- map-projectSkill
- plan-founder-reviewSkill
- plan-to-task-list-with-dagSkill
- pr-retroSkill
- run-parallel-agents-feature-buildSkill
- run-parallel-agents-feature-debugSkill
- startSkill
- update-agent-learningsSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
45 rules. 0 are common, 26 are distinctive, and 19 are very specific to this project.
0
Common
Most of the 22 edited versions we read keep these.
26
Distinctive
This author's own choices. Worth a look.
19
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 7
Before writing ANY ast-grep rule, you ABSOLUTELY MUST:
- Distinctive: line 9
Create example code that represents what you want to match
- Very specific: line 10
Use --debug-query=cst to understand the actual AST structure
- Very specific: line 11
Always add stopBy: end to relational rules (inside/has)
- Distinctive: line 12
Test the rule against example code BEFORE searching the codebase
- Distinctive: line 24
Before writing ANY ast-grep rule, you MUST complete this checklist:
- Distinctive: line 47
Check if ast-grep is available:
- Distinctive: line 56
If user confirms, provide installation instructions:
- Very specific: line 79
After installation, verify with ast-grep --version
- Distinctive: line 80
Only proceed with ast-grep search after installation is confirmed
- Distinctive: line 86
Use this skill when users:
- Distinctive: line 90
Ask to search for code with particular AST characteristics
- Distinctive: line 95
Follow this process to help users write effective ast-grep rules:
- Distinctive: line 101
Before doing anything else, check if ast-grep is installed:
- Distinctive: line 111
Do NOT proceed until user confirms installation
- Distinctive: line 131
Write a simple code snippet that represents what the user wants to match.
- Distinctive: line 134
If searching for "async functions that use await", create a test file:
- Very specific: line 151
Always use stopBy: end for relational rules (inside, has) to ensure search goes to the end of the direction
- Very specific: line 152
Use pattern for simple structures
- Very specific: line 153
Use kind with has/inside for complex structures
- Distinctive: line 173
Use ast-grep CLI to verify the rule matches the example code.
- Very specific: line 193
Add stopBy: end to relational rules if not present
- Very specific: line 194
Use --debug-query to understand the AST structure (see below)
- Very specific: line 195
Check if kind values are correct for the language
- Distinctive: line 258
Test a rule against code snippet without creating files:
- Distinctive: line 290
When you don't need relational rules (inside/has)
- Distinctive: line 317
When you need the power of full YAML rules
- Very specific: line 339
If that doesn't work, try kind to match the node type
- Very specific: line 340
Add relational rules (has, inside) as needed
- Distinctive: line 351
When rules don't match:
- Very specific: line 352
Use --debug-query=cst to see the actual AST structure
- Distinctive: line 353
Check if metavariables are being detected correctly
- Very specific: line 354
Verify the node kind matches what you expect
- Distinctive: line 355
Ensure relational rules are searching in the right direction
- Very specific: line 359
When using --inline-rules, escape metavariables in shell commands:
- Very specific: line 360
Use \$VAR instead of $VAR (shell interprets $ as variable)
- Distinctive: line 431
After searching the codebase, verify the complete workflow:
- Distinctive: line 454
Gate: Do NOT mark search complete until all 5 checks pass.
- Distinctive: line 468
0 points: No example code created
- Very specific: line 510
Fix: Add stopBy: end to ensure search traverses the entire subtree
- Very specific: line 514
Fix: Use --debug-query=cst to find the actual kind name (e.g., arrow_function vs function_declaration)
- Very specific: line 518
Fix: Ensure metavariable is the only content in its AST node.
- Very specific: line 526
Fix: Verify --lang flag matches file extension (e.g., typescript not javascript for .tsx files)
- Distinctive: line 584
When ast-grep search is complete, announce:
- Distinctive: line 654
If ast-grep rule becomes too complex (5+ nested conditions), consider:
“Common” is measured: kept by at least 6 in 10 of the 22 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<EXTREMELY-IMPORTANT>
Before writing ANY ast-grep rule, you **ABSOLUTELY MUST**:- Create example code that represents what you want to match
- Use
--debug-query=cstto understand the actual AST structure - Always add
stopBy: endto relational rules (inside/has) - Test the rule against example code BEFORE searching the codebase
- Escape metavariables in shell commands ($VAR or use single quotes)
Writing rules without testing = false negatives, missed matches, wasted time
This is not optional. Every ast-grep search requires disciplined verification.
</EXTREMELY-IMPORTANT>
ast-grep Code Search
MANDATORY FIRST RESPONSE PROTOCOL
Before writing ANY ast-grep rule, you MUST complete this checklist:
- ☐ Verify ast-grep is installed (run
ast-grep --version) - ☐ If not installed, provide installation instructions and STOP
- ☐ Clarify what the user wants to find (pattern, language, edge cases)
- ☐ Create example code snippet representing the target pattern
- ☐ Use
--debug-query=cstto inspect the AST structure - ☐ Identify the correct
kindvalues for target nodes - ☐ Write the simplest rule that could work (pattern first)
- ☐ Add
stopBy: endto any relational rules (inside/has) - ☐ Test rule against example code with
--stdin - ☐ Announce: "Searching for [pattern description] using [rule type]"
Writing ast-grep rules WITHOUT completing this checklist = missed matches.
Overview
This skill helps translate natural language queries into ast-grep rules for structural code search. ast-grep uses Abstract Syntax Tree (AST) patterns to match code based on its structure rather than just text, enabling powerful and precise code search across large codebases.
Prerequisites Check
CRITICAL: Before proceeding with any ast-grep search, verify ast-grep is installed.
Check if ast-grep is available:
ast-grep --versionIf ast-grep is NOT installed:
- Inform the user: "ast-grep is not installed. Would you like installation instructions?"
- If user confirms, provide installation instructions:
macOS (Homebrew):
brew install ast-grepLinux (Cargo):
cargo install ast-grepnpm (all platforms):
npm install -g @ast-grep/cliManual installation:
# Download from GitHub releases
# https://github.com/ast-grep/ast-grep/releases- After installation, verify with
ast-grep --version - Only proceed with ast-grep search after installation is confirmed
Do NOT attempt to run ast-grep commands if it's not installed.
When to Use This Skill
Use this skill when users:
- Need to search for code patterns using structural matching (e.g., "find all async functions that don't have error handling")
- Want to locate specific language constructs (e.g., "find all function calls with specific parameters")
- Request searches that require understanding code structure rather than just text
- Ask to search for code with particular AST characteristics
- Need to perform complex code queries that traditional text search cannot handle
General Workflow
Follow this process to help users write effective ast-grep rules:
Step 0: Verify Installation (MANDATORY)
Gate: ast-grep installed and verified before proceeding to Step 1.
Before doing anything else, check if ast-grep is installed:
ast-grep --versionIf NOT installed:
- Stop immediately
- Inform the user that ast-grep is required
- Provide installation instructions (see Prerequisites Check section above)
- Do NOT proceed until user confirms installation
If installed:
- Note the version for reference
- Proceed to Step 1
Step 1: Understand the Query
Gate: Pattern and language clarified before proceeding to Step 2.
Clearly understand what the user wants to find. Ask clarifying questions if needed:
- What specific code pattern or structure are they looking for?
- Which programming language?
- Are there specific edge cases or variations to consider?
- What should be included or excluded from matches?
Step 2: Create Example Code
Gate: Example code saved to temp file before proceeding to Step 3.
Write a simple code snippet that represents what the user wants to match. Save this to a temporary file for testing.
Example: If searching for "async functions that use await", create a test file:
// test_example.js
async function example() {
const result = await fetchData();
return result;
}Step 3: Write the ast-grep Rule
Gate: Rule compiles without errors before proceeding to Step 4.
Translate the pattern into an ast-grep rule. Start simple and add complexity as needed.
Key principles:
- Always use
stopBy: endfor relational rules (inside,has) to ensure search goes to the end of the direction - Use
patternfor simple structures - Use
kindwithhas/insidefor complex structures - Break complex queries into smaller sub-rules using
all,any, ornot
Example rule file (test_rule.yml):
id: async-with-await
language: javascript
rule:
kind: function_declaration
has:
pattern: await $EXPR
stopBy: endSee references/rule_reference.md for comprehensive rule documentation.
Step 4: Test the Rule
Gate: Rule matches example code correctly before proceeding to Step 5.
Use ast-grep CLI to verify the rule matches the example code. There are two main approaches:
Option A: Test with inline rules (for quick iterations)
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" --stdinOption B: Test with rule files (recommended for complex rules)
ast-grep scan --rule test_rule.yml test_example.jsDebugging if no matches:
- Simplify the rule (remove sub-rules)
- Add
stopBy: endto relational rules if not present - Use
--debug-queryto understand the AST structure (see below) - Check if
kindvalues are correct for the language
Step 5: Search the Codebase
Gate: Results returned and reviewed before proceeding to Step 6.
Once the rule matches the example code correctly, search the actual codebase:
For simple pattern searches:
ast-grep run --pattern 'console.log($ARG)' --lang javascript /path/to/projectFor complex rule-based searches:
ast-grep scan --rule my_rule.yml /path/to/projectFor inline rules (without creating files):
ast-grep scan --inline-rules "id: my-rule
language: javascript
rule:
pattern: \$PATTERN" /path/to/projectast-grep CLI Commands
Inspect Code Structure (--debug-query)
Dump the AST structure to understand how code is parsed:
ast-grep run --pattern 'async function example() { await fetch(); }' \
--lang javascript \
--debug-query=cstAvailable formats:
cst: Concrete Syntax Tree (shows all nodes including punctuation)ast: Abstract Syntax Tree (shows only named nodes)pattern: Shows how ast-grep interprets your pattern
Use this to:
- Find the correct
kindvalues for nodes - Understand the structure of code you want to match
- Debug why patterns aren't matching
Example:
# See the structure of your target code
ast-grep run --pattern 'class User { constructor() {} }' \
--lang javascript \
--debug-query=cst
# See how ast-grep interprets your pattern
ast-grep run --pattern 'class $NAME { $$$BODY }' \
--lang javascript \
--debug-query=patternTest Rules (scan with --stdin)
Test a rule against code snippet without creating files:
echo "const x = await fetch();" | ast-grep scan --inline-rules "id: test
language: javascript
rule:
pattern: await \$EXPR" --stdinAdd --json for structured output:
echo "const x = await fetch();" | ast-grep scan --inline-rules "..." --stdin --jsonSearch with Patterns (run)
Simple pattern-based search for single AST node matches:
# Basic pattern search
ast-grep run --pattern 'console.log($ARG)' --lang javascript .
# Search specific files
ast-grep run --pattern 'class $NAME' --lang python /path/to/project
# JSON output for programmatic use
ast-grep run --pattern 'function $NAME($$$)' --lang javascript --json .When to use:
- Simple, single-node matches
- Quick searches without complex logic
- When you don't need relational rules (inside/has)
Search with Rules (scan)
YAML rule-based search for complex structural queries:
# With rule file
ast-grep scan --rule my_rule.yml /path/to/project
# With inline rules
ast-grep scan --inline-rules "id: find-async
language: javascript
rule:
kind: function_declaration
has:
pattern: await \$EXPR
stopBy: end" /path/to/project
# JSON output
ast-grep scan --rule my_rule.yml --json /path/to/projectWhen to use:
- Complex structural searches
- Relational rules (inside, has, precedes, follows)
- Composite logic (all, any, not)
- When you need the power of full YAML rules
Tip: For relational rules (inside/has), always add stopBy: end to ensure complete traversal.
Tips for Writing Effective Rules
Always Use stopBy: end
For relational rules, always use stopBy: end unless there's a specific reason not to:
has:
pattern: await $EXPR
stopBy: endThis ensures the search traverses the entire subtree rather than stopping at the first non-matching node.
Start Simple, Then Add Complexity
Begin with the simplest rule that could work:
- Try a
patternfirst - If that doesn't work, try
kindto match the node type - Add relational rules (
has,inside) as needed - Combine with composite rules (
all,any,not) for complex logic
Use the Right Rule Type
- Pattern: For simple, direct code matching (e.g.,
console.log($ARG)) - Kind + Relational: For complex structures (e.g., "function containing await")
- Composite: For logical combinations (e.g., "function with await but not in try-catch")
Debug with AST Inspection
When rules don't match:
- Use
--debug-query=cstto see the actual AST structure - Check if metavariables are being detected correctly
- Verify the node
kindmatches what you expect - Ensure relational rules are searching in the right direction
Escaping in Inline Rules
When using --inline-rules, escape metavariables in shell commands:
- Use
\$VARinstead of$VAR(shell interprets$as variable) - Or use single quotes:
'$VAR'works in most shells
Example:
# Correct: escaped $
ast-grep scan --inline-rules "rule: {pattern: 'console.log(\$ARG)'}" .
# Or use single quotes
ast-grep scan --inline-rules 'rule: {pattern: "console.log($ARG)"}' .Common Use Cases
Find Functions with Specific Content
Find async functions that use await:
ast-grep scan --inline-rules "id: async-await
language: javascript
rule:
all:
- kind: function_declaration
- has:
pattern: await \$EXPR
stopBy: end" /path/to/projectFind Code Inside Specific Contexts
Find console.log inside class methods:
ast-grep scan --inline-rules "id: console-in-class
language: javascript
rule:
pattern: console.log(\$\$\$)
inside:
kind: method_definition
stopBy: end" /path/to/projectFind Code Missing Expected Patterns
Find async functions without try-catch:
ast-grep scan --inline-rules "id: async-no-trycatch
language: javascript
rule:
all:
- kind: function_declaration
- has:
pattern: await \$EXPR
stopBy: end
- not:
has:
pattern: try { \$\$\$ } catch (\$E) { \$\$\$ }
stopBy: end" /path/to/projectResources
references/
Contains detailed documentation for ast-grep rule syntax:
rule_reference.md: Comprehensive ast-grep rule documentation covering atomic rules, relational rules, composite rules, and metavariables
Load these references when detailed rule syntax information is needed.
Step 6: Verification (MANDATORY)
After searching the codebase, verify the complete workflow:
Check 1: Rule Matches Example
- Rule matches the example code created in Step 2
- No false negatives on known examples
Check 2: Results Are Valid
- Spot-check 3-5 results to confirm they match intent
- No obvious false positives
Check 3: Edge Cases Covered
- Rule handles variations mentioned by user
- Nested cases handled (if applicable)
Check 4: Rule Is Reproducible
- Rule can be re-run with same results
- Rule file or inline command documented for user
Check 5: Results Reported
- Match count reported to user
- File paths and line numbers provided
- Example matches shown
Gate: Do NOT mark search complete until all 5 checks pass.
Quality Checklist (Must Score 8/10)
Score yourself honestly before marking search complete:
Query Understanding (0-2 points)
- 0 points: Wrote rule without clarifying requirements
- 1 point: Partial clarification (language or pattern, not both)
- 2 points: Full clarification: pattern, language, edge cases, exclusions
Example Code (0-2 points)
- 0 points: No example code created
- 1 point: Example code in memory only (not tested)
- 2 points: Example code saved and verified with --debug-query
Rule Quality (0-2 points)
- 0 points: Rule doesn't compile or match anything
- 1 point: Rule matches but missing stopBy: end on relational rules
- 2 points: Rule is minimal, correct, uses stopBy: end where needed
Testing (0-2 points)
- 0 points: Searched codebase without testing
- 1 point: Tested but didn't verify against example
- 2 points: Tested against example with --stdin, verified matches
Result Validation (0-2 points)
- 0 points: Returned results without checking
- 1 point: Checked count only
- 2 points: Spot-checked results, confirmed they match intent
Minimum passing score: 8/10
Common Rationalizations (All Wrong)
These are excuses. Don't fall for them:
- "I know the AST structure" → STILL use --debug-query=cst to verify
- "It's a simple pattern" → STILL test against example code first
- "stopBy: end slows it down" → STILL add it to relational rules (correctness > speed)
- "The rule compiled" → STILL verify it matches the example
- "I'll check the results later" → Spot-check NOW before returning them
- "This is similar to a previous search" → STILL write fresh example code
- "The user knows what they want" → STILL clarify language and edge cases
- "Inline rules are harder" → Learn to escape $VAR properly, it's not optional
Failure Modes
Failure Mode 1: Missing stopBy: end
Symptom: Relational rule (inside/has) returns no matches even though they exist
Fix: Add stopBy: end to ensure search traverses the entire subtree
Failure Mode 2: Wrong Node Kind
Symptom: Pattern doesn't match even though code looks correct
Fix: Use --debug-query=cst to find the actual kind name (e.g., arrow_function vs function_declaration)
Failure Mode 3: Metavariable Not Detected
Symptom: $VAR appears literally in output instead of matching
Fix: Ensure metavariable is the only content in its AST node; use --debug-query=pattern to verify
Failure Mode 4: Shell Escaping Issues
Symptom: Inline rule fails with "unexpected token" or empty results
Fix: Escape $ as \$ in double quotes, or use single quotes around the pattern
Failure Mode 5: Wrong Language
Symptom: Rule matches nothing in a codebase that clearly has the pattern
Fix: Verify --lang flag matches file extension (e.g., typescript not javascript for .tsx files)
Quick Workflow Summary
STEP 0: VERIFY INSTALLATION (MANDATORY)
├── Run ast-grep --version
├── If NOT installed: provide instructions and STOP
├── If installed: note version and proceed
└── Gate: ast-grep installed and verified
STEP 1: UNDERSTAND THE QUERY
├── What pattern to find?
├── Which programming language?
├── Any edge cases or exclusions?
└── Gate: Pattern and language clarified
STEP 2: CREATE EXAMPLE CODE
├── Write code snippet that should match
├── Save to temp file (test_example.js/ts/py)
├── Run --debug-query=cst to see AST structure
└── Gate: Example code created and AST understood
STEP 3: WRITE THE AST-GREP RULE
├── Start simple: try pattern first
├── If complex: use kind + relational rules
├── Always add stopBy: end to inside/has
├── Combine with all/any/not as needed
└── Gate: Rule compiles without errors
STEP 4: TEST THE RULE
├── Test with --stdin against example code
├── Verify matches are correct
├── Adjust rule if needed
├── Iterate until example matches
└── Gate: Rule matches example correctly
STEP 5: SEARCH THE CODEBASE
├── Run ast-grep scan or run
├── Review results count
├── Spot-check 3-5 results
└── Gate: Results returned and validated
STEP 6: VERIFICATION
├── Check 1: Rule matches example
├── Check 2: Results are valid
├── Check 3: Edge cases covered
├── Check 4: Rule is reproducible
├── Check 5: Results reported
└── Gate: All 5 checks passCompletion Announcement
When ast-grep search is complete, announce:
ast-grep search complete.
**Quality Score: X/10**
- Query Understanding: X/2
- Example Code: X/2
- Rule Quality: X/2
- Testing: X/2
- Result Validation: X/2
**Search:**
- Pattern: [description]
- Language: [language]
- Rule type: [pattern/kind+relational/composite]
**Results:**
- Matches: [count]
- Files: [file count]
**Example matches:**
[Show 2-3 example file:line matches]
**Rule (for re-use):**
```yaml
[The rule used]Next steps: [Review matches, refine search, or proceed with refactoring]
---
## Integration with Other Skills
The `ast-grep` skill integrates with:
- **`start`** — Use `start` to identify if ast-grep is the right tool for the search
- **`Grep` tool** — Use Grep for text search; use ast-grep for structural search
- **`Explore` agent** — Use Explore for broad discovery; use ast-grep for precise patterns
**When to use ast-grep vs Grep:**
| Scenario | Tool |
|----------|------|
| Find text "TODO" anywhere | Grep |
| Find function calls with specific structure | ast-grep |
| Find variable names matching regex | Grep |
| Find async functions without try-catch | ast-grep |
| Find imports from specific package | Either (ast-grep more precise) |
| Find code patterns across language constructs | ast-grep |
**Workflow Chain:**
User asks "find X" │ ▼ Is X structural (AST-level)? │ Yes──┼──No │ │ ▼ ▼ ast-grep Grep/Explore
**Escalation Pattern:**
If ast-grep rule becomes too complex (5+ nested conditions), consider:
1. Breaking into multiple simpler searches
2. Using Explore agent for discovery first
3. Asking user to narrow the patternDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

