Agent skill

Structural Search

by aiskillstore in aiskillstore/marketplace

Search code by AST structure using ast-grep. An agent skill from aiskillstore/marketplace.

MITAuto-check: notesDevelopment

Install Structural Search

skills CLI
$ npx skills add aiskillstore/marketplace --skill structural-search -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aiskillstore/marketplace structural-search --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aiskillstore/marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/0xdarkmatter/structural-search .claude/skills/structural-search && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
structural-search
GitHub stars
430
Used in
1 other repo
Token cost
~787 tokens
SKILL.md length
184 words
Files
9 (incl. scripts, references, assets)
Skills in repo
1,085
Repo updated
First seen
Licence
MIT

At a glance

Search code by AST structure using ast-grep. An agent skill from aiskillstore/marketplace.

  • : find all calls to X
  • SKILL.md covers Tools, Pattern Syntax, Top 10 Essential Patterns and Quick Reference, plus 2 more sections
  • Search for pattern
  • Refactor usages

What it does

Structural Search is an agent skill from aiskillstore/marketplace. 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.

Its SKILL.md is about 790 tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files, including scripts, reference files and assets (for example `assets/rule-template.yaml`, `references/advanced-usage.md` and `references/go-rust-patterns.md`). Compatibility notes: Requires ast-grep (sg) CLI tool. Install: brew install ast-grep (macOS) or cargo install ast-grep (cross-platform).

It sits in Development, covering Refactoring. It works with Python. The repository describes itself as: Security-audited skills for Claude, Codex & Claude Code. One-click install, quality verified. The licence is MIT.

When your agent uses it

  • : find all calls to X
  • Search for pattern
  • Refactor usages
  • Find where function is used

Example prompts

  • “/structural-search”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): Requires ast-grep (sg) CLI tool. Install: brew install ast-grep (macOS) or cargo install ast-grep (cross-platform).
  • Pre-approved tools (allowed-tools): Bash

What it can do on your machine

Read from SKILL.md and the folder at commit 4ac52da. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/, which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Requires ast-grep (sg) CLI tool. Install: brew install ast-grep (macOS) or cargo install ast-grep (cross-platform).

    From compatibility in the SKILL.md frontmatter.

Context cost

Structural Search loads about 787 tokens when it runs, and up to ~4.7k if it reads all its reference files. Until then it costs about 73 tokens; SKILL.md has 184 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~73
When it runs · the whole SKILL.md, loaded when a task matches
~787
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from aiskillstore/marketplace at commit 4ac52da, republished under its MIT licence (© aiskillstore). 184 words, ~787 tokens.

Download SKILL.mdSave it as .claude/skills/structural-search/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.
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.
allowed-tools
Bash
compatibility
Requires ast-grep (sg) CLI tool. Install: brew install ast-grep (macOS) or cargo install ast-grep (cross-platform).
license
MIT
metadata.author
claude-mods

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

Tools

ToolCommandUse For
ast-grepsg -p 'pattern'AST-aware code search

Pattern Syntax

PatternMatchesExample
$NAMENamed identifierfunction $NAME() {}
$_Any single nodeconsole.log($_)
$$$Zero or more nodesfunction $_($$$) {}

Top 10 Essential Patterns

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

Quick Reference

TaskCommand
Find patternsg -p 'pattern'
Specific languagesg -p 'pattern' --lang python
Replace (preview)sg -p 'old' -r 'new'
Replace (apply)sg -p 'old' -r 'new' --rewrite
Show contextsg -p 'pattern' -A 3
JSON outputsg -p 'pattern' --json
File list onlysg -p 'pattern' -l
Count matchessg -p 'pattern' --count
Run YAML rulessg 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

© aiskillstore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 8 other files (scripts, references, assets) in skills/0xdarkmatter/structural-search of aiskillstore/marketplace.

  • SKILL.md
  • assets/rule-template.yaml
  • references/advanced-usage.md
  • references/go-rust-patterns.md
  • references/js-ts-patterns.md
  • references/python-patterns.md
  • references/security-patterns.md
  • scripts/.gitkeep
  • skill-report.json

Open the folder on GitHubat commit 4ac52da

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in aiskillstore/marketplace, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Structural Search next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Structural Search compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Structural Search this skillaiskillstore/marketplace4301 repos~787Automated safety check: NotesMIT
Dignified Python Standardsdocling-project/docling68k—~1.5kAutomated safety check: PassApache-2.0
Readable Pycrazyguitar/pysheeet8.2k—~2.4kAutomated safety check: PassMIT
Nexus MapperHaaaiawd/Nexus-skills1661 repos~2.5kAutomated safety check: NotesNone
Refactor OpCVCUDA/CV-CUDA2.7k—~1.5kAutomated safety check: PassCustom licence
Readable Verilog GeneratorEriemon/verilog-generator308—~5.4kAutomated safety check: PassApache-2.0

Similar skills

  • Dignified Python Standards

    docling-project/docling

    Applies opinionated production Python conventions chosen by the project's Python version: modern type syntax, pathlib, explicit checks and interface guidance.

    68k GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Readable Py

    crazyguitar/pysheeet

    Readable Python code rules inspired by The Art of Readable Code.

    8.2k GitHub stars~2.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Nexus Mapper

    Haaaiawd/Nexus-skills

    Generate a persistent .nexus-map/ knowledge base that lets any AI session instantly understand a codebase's architecture, systems, dependencies, and change hotspots.

    166 GitHub starsUsed in 1 repo~2.5k tokens
    DevelopmentAuto-check: notes
  • Refactor Op

    CVCUDA/CV-CUDA

    Find and safely apply per-operator refactoring / redundancy-reduction opportunities in a CV-CUDA operator (near-duplicate Tensor/VarShape kernels, reinvented shared utilities, dead code).

    2.7k GitHub stars~1.5k tokensUpdated 20 days ago
    DevelopmentAuto-check passed
  • Readable Verilog Generator

    Eriemon/verilog-generator

    A skill your agent uses when creating, writing, reviewing, annotating, repairing, refactoring, or validating readable Verilog RTL, including synthesizable Verilog-2001 .v files, existing-RTL…

    308 GitHub stars~5.4k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Python Design

    mindfold-ai/Trellis

    Python design patterns for CLI scripts and utilities — type-first development, deep modules, complexity management, and red flags.

    15k GitHub stars~4k tokensUpdated 8 days ago
    DevelopmentAuto-check passed

More from aiskillstore/marketplace

All 1,085 skills in this repo
  • Code Stats

    aiskillstore/marketplace

    Analyze codebase with tokei (fast line counts by language) and difft (semantic AST-aware diffs).

    430 GitHub starsUsed in 2 repos~697 tokens
    Auto-check: notes
  • Data Processing

    aiskillstore/marketplace

    Process JSON with jq and YAML/TOML with yq. An agent skill from aiskillstore/marketplace.

    430 GitHub starsUsed in 1 repo~720 tokens
    Auto-check: notes
  • Doc Scanner

    aiskillstore/marketplace

    Scans for project documentation files (AGENTS.md, CLAUDE.md, GEMINI.md, COPILOT.md, CURSOR.md, WARP.md, and 15+ other formats) and synthesizes guidance.

    430 GitHub starsUsed in 1 repo~644 tokens
    Auto-check: notes
  • File Search

    aiskillstore/marketplace

    Modern file and content search using fd, ripgrep (rg), and fzf.

    430 GitHub starsUsed in 1 repo~598 tokens
    Auto-check: notes
  • Find Replace

    aiskillstore/marketplace

    Modern find-and-replace using sd (simpler than sed) and batch replacement patterns.

    430 GitHub starsUsed in 1 repo~527 tokens
    Auto-check: notes
  • Investigating Codebases

    aiskillstore/marketplace

    Automatically activated when user asks how something works, wants to understand unfamiliar code, needs to explore a new codebase, or asks questions like "where is X implemented?", "how does Y…

    430 GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check: notes

Works with

Categories

Questions about Structural Search

What does Structural Search do?

Search code by AST structure using ast-grep. An agent skill from aiskillstore/marketplace. Structural Search is an agent skill from aiskillstore/marketplace. Search code by AST structure using ast-grep.

When should I use Structural Search?

Structural Search fits situations like: : find all calls to X; search for pattern; refactor usages; find where function is used.

How do I install Structural Search in Claude Code?

Run `npx skills add aiskillstore/marketplace --skill structural-search -a claude-code`. Or copy the skill folder (skills/0xdarkmatter/structural-search in aiskillstore/marketplace) into .claude/skills/structural-search in your project. Claude Code loads it when a task matches its description.

How do I install Structural Search in Codex?

Run `npx skills add aiskillstore/marketplace --skill structural-search -a codex`. Or copy the skill folder (skills/0xdarkmatter/structural-search in aiskillstore/marketplace) into .agents/skills/structural-search in your project. Codex loads it when a task matches its description.

Can I use Structural Search in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aiskillstore/marketplace --skill structural-search -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/structural-search, .gemini/skills/structural-search, .github/skills/structural-search and .opencode/skills/structural-search in your project.

What does Structural Search need to run?

SKILL.md names no scripts, command-line tools or credentials: Structural Search is instructions for the agent only. Our summary lists: Python 3. Its frontmatter pre-approves these tools: Bash. Compatibility (from SKILL.md): Requires ast-grep (sg) CLI tool. Install: brew install ast-grep (macOS) or cargo install ast-grep (cross-platform)..

Does Structural Search access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Structural Search safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Structural Search use?

Structural Search is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Structural Search use?

About 787 tokens (SKILL.md is roughly 3.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.9k tokens, read only when the agent opens those files.

What are the alternatives to Structural Search?

Skills that share tags, products or a category with Structural Search: Dignified Python Standards (docling-project/docling, 68k stars), Readable Py (crazyguitar/pysheeet, 8.2k stars), Nexus Mapper (Haaaiawd/Nexus-skills, 166 stars) and Refactor Op (CVCUDA/CV-CUDA, 2.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Structural Search?

aiskillstore (a GitHub organization) maintains it in aiskillstore/marketplace, which has 430 GitHub stars. The repository holds 1,085 skills in this directory. The repository was last updated on October 7, 2026.

Source: aiskillstore/marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.