SkillAgentSearch skills...

structural-search

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.

Install / Use

npx skills add aiskillstore/marketplace --skill structural-search

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

83/100

Supported Platforms

Claude Code

Tags

Our assessment of structural-search

structural-search scores 83/100 on our quality scale, 3209th of 4,717 Development & Engineering skills we index.

Its SKILL.md is 3.1 KB long, well organised into 17 sections with 1 code example: a solid amount of guidance for an agent.

It has 428 GitHub stars, a meaningful sign that others use it.

Substance
26/30
Structure
17/20
Description
15/15
Adoption
11/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated about 2 months ago, so structural-search is actively maintained.
  • Our last check on 2026-11-07 found the source still online.
  • No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
  • Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

Safety scan

No issues found

Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.

AI review by kimi-k2.7-code on 2026-10-08. Automated pattern scan on 2026-10-07. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.

structural-search compared with similar skills

All 4 of these similar skills score higher than structural-search; compare them before choosing.

SkillScoreStarsUpdatedFormat
structural-search (this skill)by aiskillstore8342855d agoSKILL.md
taste-skillby Leonxlnx100118.3k10d agoCLAUDE.md
hyperframesby heygen-com10086.4ktodayCLAUDE.md
ai-job-searchby ai-job-search-dev10072.4ktodayCLAUDE.md
claude-howtoby luongnv8910047.4k4d agoCLAUDE.md

Frequently asked questions

How do I install structural-search?
Run npx skills add aiskillstore/marketplace --skill structural-search. The install tabs above show the steps for each supported agent.
Which AI agents does structural-search work with?
It is written for Claude Code, as a SKILL.md file. Other agents that read the same format can often use it too.
Is structural-search safe to use?
Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It declares no license and scores 88/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is structural-search still maintained?
The repository was last updated about 2 months ago, so structural-search is actively maintained.

name: structural-search description: "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." license: MIT compatibility: "Requires ast-grep (sg) CLI tool. Install: brew install ast-grep (macOS) or cargo install ast-grep (cross-platform)." allowed-tools: "Bash" metadata: author: claude-mods

Structural Search

Search code by its abstract syntax tree (AST) structure. Finds semantic patterns that regex cannot match reliably.

Tools

| Tool | Command | Use For | |------|---------|---------| | ast-grep | sg -p 'pattern' | AST-aware code search |

Pattern Syntax

| Pattern | Matches | Example | |---------|---------|---------| | $NAME | Named identifier | function $NAME() {} | | $_ | Any single node | console.log($_) | | $$$ | Zero or more nodes | function $_($$$) {} |

Top 10 Essential Patterns

# 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

Quick Reference

| 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 |

When to Use

  • Finding all usages of a function/method
  • Locating specific code patterns (hooks, API calls)
  • Preparing for large-scale refactoring
  • When regex would match false positives
  • Detecting anti-patterns and security issues
  • Creating custom linting rules

Additional Resources

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

Related Skills

View on GitHub
GitHub Stars428
CategoryDevelopment
Updated1mo ago
Forks45

Languages

Python

Trust signals

88/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

1 medium