Skip to content

aiskillstore/marketplace / skills/0xdarkmatter/structural-search

structural-search

Verified

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.

assets/rule-template.yaml

View on GitHub
# ast-grep Rule Template
# Place in project root or rules/ directory
# Run with: sg scan

id: rule-id-here
language: typescript  # js, python, go, rust, etc.

rule:
  # Basic pattern match
  pattern: console.log($$$)

  # Or use conditions:
  # any:
  #   - pattern: console.log($$$)
  #   - pattern: console.warn($$$)
  #
  # not:
  #   pattern: console.error($$$)
  #
  # inside:
  #   pattern: function $_ { $$$ }

message: "Description of the issue"
severity: warning  # error | warning | info | hint

# Optional auto-fix
# fix: "replacement using $METAVARS"

# Optional additional context
# note: "Explanation for developers"

# Optional metadata
# metadata:
#   category: security
#   references:
#     - https://example.com/docs
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall