Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Search code by AST structure using ast-grep. Find semantic patterns like function calls, imports, class definitions instead of text patterns. Triggers on: find all calls to X, search for pattern, refactor usages, find where function is used, structural search, ast-grep, sg.
.claude/skills/aiskillstore-structural-search/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -9% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -3% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -29% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 0% | 0% |
| case-10 | ✗→✓ | ▲ Improved | -44% | 0% |
Search code by its abstract syntax tree (AST) structure. Finds semantic patterns that regex cannot match reliably.
| Tool | Command | Use For | |------|---------|---------| | ast-grep | sg -p 'pattern' | AST-aware code search |
| Pattern | Matches | Example | |---------|---------|---------| | $NAME | Named identifier | function $NAME() {} | | $_ | Any single node | console.log($_) | | $$$ | Zero or more nodes | function $_($$$) {} |
bash# 1. Find console.log calls sg -p 'console.log($_)' # 2. Find React hooks sg -p 'const [$_, $_] = useState($_)' sg -p 'useEffect($_, [$$$])' # 3. Find function definitions sg -p 'function $NAME($$$) { $$$ }' sg -p 'def $NAME($$$): $$$' --lang python # 4. Find imports sg -p 'import $_ from "$_"' sg -p 'from $_ import $_' --lang python # 5. Find async patterns sg -p 'await $_' sg -p 'async function $NAME($$$) { $$$ }' # 6. Find error handling sg -p 'try { $$$ } catch ($_) { $$$ }' sg -p 'if err != nil { $$$ }' --lang go # 7. Find potential issues sg -p '$_ == $_' # == instead of === sg -p 'eval($_)' # Security risk sg -p '$_.innerHTML = $_' # XSS vector # 8. Preview refactoring sg -p 'console.log($_)' -r 'logger.info($_)' # 9. Apply refactoring sg -p 'var $NAME = $_' -r 'const $NAME = $_' --rewrite # 10. Search specific language sg -p 'pattern' --lang typescript
| Task | Command | |------|---------| | Find pattern | sg -p 'pattern' | | Specific language | sg -p 'pattern' --lang python | | Replace (preview) | sg -p 'old' -r 'new' | | Replace (apply) | sg -p 'old' -r 'new' --rewrite | | Show context | sg -p 'pattern' -A 3 | | JSON output | sg -p 'pattern' --json | | File list only | sg -p 'pattern' -l | | Count matches | sg -p 'pattern' --count | | Run YAML rules | sg scan |
For complete patterns, load:
./references/js-ts-patterns.md - JavaScript/TypeScript patterns./references/python-patterns.md - Python patterns./references/go-rust-patterns.md - Go and Rust patterns./references/security-patterns.md - Security vulnerability detection./references/advanced-usage.md - YAML rules and tool integration./assets/rule-template.yaml - Starter template for custom rules| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 9,754 | 3,869 | -60% | 1 | 1 | 0% | 1,571 | 1,433 | -9% | 0 | 0 | — |
case-02 | fail→fail | 9,445 | 4,023 | -57% | 1 | 1 | 0% | 1,701 | 1,493 | -12% | 0 | 0 | — |
case-03 | pass→pass | 8,065 | 4,147 | -49% | 1 | 1 | 0% | 1,382 | 1,483 | +7% | 0 | 0 | — |
case-04 | fail→fail | 8,587 | 5,758 | -33% | 1 | 1 | 0% | 1,441 | 1,639 | +14% | 0 | 0 | — |
case-05 | fail→pass | 10,203 | 5,029 | -51% | 1 | 1 | 0% | 1,738 | 1,694 | -3% | 0 | 0 | — |
case-06 | fail→fail | 11,349 | 4,887 | -57% | 1 | 1 | 0% | 1,903 | 1,546 | -19% | 0 | 0 | — |
case-07 | fail→fail | 7,827 | 4,613 | -41% | 1 | 1 | 0% | 1,342 | 1,592 | +19% | 0 | 0 | — |
case-08 | fail→pass | 11,850 | 3,477 | -71% | 1 | 1 | 0% | 1,952 | 1,388 | -29% | 0 | 0 | — |
case-09 | fail→pass | 8,673 | 3,967 | -54% | 1 | 1 | 0% | 1,434 | 1,432 | -0% | 0 | 0 | — |
case-10 | fail→pass | 12,042 | 4,658 | -61% | 1 | 1 | 0% | 2,258 | 1,266 | -44% | 0 | 0 | — |
case-11 | fail→fail | 8,705 | 3,906 | -55% | 1 | 1 | 0% | 1,450 | 1,400 | -3% | 0 | 0 | — |
case-12 | fail→pass | 11,194 | 3,414 | -70% | 1 | 1 | 0% | 1,705 | 1,301 | -24% | 0 | 0 | — |
case-13 | fail→fail | 11,840 | 5,131 | -57% | 1 | 1 | 0% | 1,999 | 1,684 | -16% | 0 | 0 | — |
case-14 | fail→pass | 13,916 | 6,445 | -54% | 1 | 1 | 0% | 2,355 | 1,895 | -20% | 0 | 0 | — |
case-15 | pass→pass | 6,748 | 3,539 | -48% | 1 | 1 | 0% | 1,146 | 1,365 | +19% | 0 | 0 | — |
case-16 | pass→pass | 10,048 | 3,424 | -66% | 1 | 1 | 0% | 976 | 1,365 | +40% | 0 | 0 | — |
case-17 | pass→pass | 7,289 | 2,606 | -64% | 1 | 1 | 0% | 1,299 | 1,173 | -10% | 0 | 0 | — |
case-18 | fail→pass | 8,936 | 2,070 | -77% | 1 | 1 | 0% | 1,448 | 1,098 | -24% | 0 | 0 | — |
case-19 | pass→pass | 7,148 | 2,255 | -68% | 1 | 1 | 0% | 1,062 | 1,058 | -0% | 0 | 0 | — |
case-20 | pass→pass | 9,449 | 2,873 | -70% | 1 | 1 | 0% | 1,433 | 1,209 | -16% | 0 | 0 | — |
case-21 | pass→pass | 20,396 | 2,769 | -86% | 1 | 1 | 0% | 1,909 | 1,121 | -41% | 0 | 0 | — |
case-22 | fail→fail | 7,268 | 3,819 | -47% | 1 | 1 | 0% | 1,315 | 1,477 | +12% | 0 | 0 | — |
case-23 | pass→pass | 8,350 | 7,378 | -12% | 1 | 1 | 0% | 1,434 | 1,961 | +37% | 0 | 0 | — |
case-24 | pass→pass | 10,638 | 7,733 | -27% | 1 | 1 | 0% | 2,060 | 2,350 | +14% | 0 | 0 | — |
case-25 | pass→pass | 8,144 | 7,121 | -13% | 1 | 1 | 0% | 1,344 | 1,967 | +46% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted. The headline lift of +32 percentage points is the difference between those two pass rates over the 25 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.