BumpyClock/agent-templates / skills/ast-grep-cli
ast-grep-cli
UnverifiedFind code by AST shape or relationships with ast-grep. Use for structural searches that text matching cannot express.
ast-grep code search
Use run for a single-node pattern:
ast-grep run --pattern 'console.log($$$ARGS)' --lang javascript src
Use scan --inline-rules for relational or combined conditions. Check uncertain rules against a positive and a negative example with --stdin.
Relational stopBy changes the search boundary:
neighbor(default) checks immediate relations.endtraverses to the root forinsideor to the leaves forhas, including nested scopes.- A rule-valued
stopBystops at a matching syntax node. That node can also match the relational rule.
For function-local queries, bound traversal so nested function bodies cannot satisfy an outer function's rule.
Single-quote shell patterns containing $ metavariables. Use --debug-query with cst, ast, or pattern when parsing is unclear. See the rule and CLI reference for syntax and examples.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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 implementation | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| 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 fallback | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| 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 always | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |