Individual skill
ast-grep
AST-aware structural code search and rewrite via ast-grep.
optional-skills/software-development/ast-grep/SKILL.md
Source commit 10ecd43a33134a935a7abd1a48684953393e1ffa
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- Yes
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Network or broad shell
- Last checked
- Nov 9, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 262,039
- Repository last updated
- Nov 9, 2026
- License
- MIT
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
LICENSEasset · 1,068 bytesSKILL.mdcore · 13,081 bytesSKILL.mdcore · 13,081 bytesSKILL.mdcore · 13,081 bytesSKILL.mdcore · 13,081 bytesSKILL.mdcore · 13,081 bytesSKILL.mdcore · 13,081 bytesSKILL.mdcore · 13,081 bytesSKILL.mdcore · 13,081 bytesSKILL.mdcore · 13,081 bytesinstall.ps1runs · 7,165 bytesinstall.shruns · 7,581 bytesreferences/cli.mddoc · 7,273 bytesreferences/install.mddoc · 5,673 bytesreferences/patterns.mddoc · 5,538 bytesreferences/pitfalls.mddoc · 8,914 bytesreferences/recipes.mddoc · 7,870 bytesreferences/sgconfig.mddoc · 6,413 bytesreferences/yaml-rules.mddoc · 11,383 bytesscripts/ast_grep_helper.pyruns · 27,912 bytestests/smoke.ps1runs · 5,701 bytestests/smoke.shruns · 7,765 bytes
Read excerpt
# ast-grep
`ast-grep` (binary also named `sg`) is an **AST-aware search and rewrite tool** across 25 languages. It treats your pattern as code, parses it the same way it parses your project, and matches structurally. It is the right tool whenever your question depends on **code shape** rather than text bytes.
This skill ships a Python wrapper at `scripts/ast_grep_helper.py` and platform install scripts at `install.sh` (POSIX) and `install.ps1` (Windows). The helper adds offline pattern validation, the two-pass write trick, and binary auto-resolution. Use it as your default entry point.
Upstream source: vendored from [code-yeongyu/ast-grep-skill](https://github.com/code-yeongyu/ast-grep-skill) (MIT), as shipped in oh-my-openagent's shared-skills bundle.
---
## When to use this skill
Use it whenever the question is about **code structure**, not bytes: