Skip to content
Back to skills

Ast Grep

ASecurity

Use when searching code with ast-grep or sg, matching AST structural syntax patterns, not for plain regex search.

  • 2 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 14, 2026
educationrails

Works with

  • cli

Security analysis

A100/100

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

Scanned November 14, 2026

npx -y skills add anntnzrb/agents --skill ast-grep --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ast Grep?

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

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

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
description: "Use when searching code with ast-grep or sg, matching AST structural syntax patterns, not for plain regex search."
license: AGPL-3.0-or-later
metadata:
  author: anntnzrb

---

# ast-grep

## Overview

AST-aware, read-only search for code exploration.

## Public entrypoint

Run `uv run --script <skill-dir>/scripts/cli.py run <args>`. The wrapper requires Bun and runs the version pinned in `UPSTREAM.json`.

## Quick start

- Search: `uv run --script <skill-dir>/scripts/cli.py run -p 'console.log($MSG)' -l ts src`
- Files only: add `--files-with-matches`.

For maintenance, update `UPSTREAM.json` to a stable release at least 14 days old. Confirm the npm package version matches the upstream tag and review changes in the tracked npm directory.

## Guardrails

- Read-only: never use `--rewrite`, `-r`, `--update-all`, or `--interactive`
- Stdin requires `--lang`

## Required follow-up reads

| Need | Read | When |
| --- | --- | --- |
| Flags and matching semantics | `reference.md` | For strictness, selectors, output, globs, config, or stdin |
| Basic patterns | `cookbook/basics.md` | For common read-only find-usage recipes |
| Advanced patterns | `cookbook/advanced.md` | For selectors, relationships, or tighter scope control |
| Recovery | `cookbook/troubleshooting.md` | When parsing, language detection, quoting, or binary resolution fails |

Files in this skill

  • NOTICE.md1.2 KB
  • SKILL.md1.4 KB
  • UPSTREAM.json185 B
  • cookbook/advanced.md1.4 KB
  • cookbook/basics.md1.2 KB
  • cookbook/troubleshooting.md1.3 KB
  • pyproject.toml525 B
  • reference.md2 KB
  • scripts/cli.py1.6 KB
  • tests/test_cli.py4.1 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.

View all in education →

Comments

Loading comments…

Newsletter

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