Skip to content
Back to skills

Ast Grep Cli

ASecurity

Find code by AST shape or relationships with ast-grep. Use for structural searches that text matching cannot express.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 7, 2026
developmentjavascriptjavashellbashnodeexpress

Works with

  • cli

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned November 7, 2026

npx -y skills add BumpyClock/agent-templates --skill ast-grep-cli --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ast Grep Cli?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ast Grep Cli
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bumpyclock-ast-grep-cli/badge)](https://www.skillsdirectory.com/skills/bumpyclock-ast-grep-cli)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ast-grep-cli
description: Find 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:

```bash
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.
- `end` traverses to the root for `inside` or to the leaves for `has`, including nested scopes.
- A rule-valued `stopBy` stops 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](references/rule_reference.md) for syntax and examples.

Files in this skill

  • SKILL.md1.1 KB
  • agents/openai.yaml231 B
  • references/rule_reference.md14 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.