ast-grep
✓使用 ast-grep (sg) 进行 AST 感知代码搜索和重构。使用 INSTEAD of grep/ripgrep 来搜索代码结构。跨 Go、Python、Bash、Terraform/HCL 代码库查找函数、类、模式、反模式。在“ast-grep”、“sg”、“查找函数”、“查找类”、“查找方法”、“查找所有用法”、“X 在哪里使用”、“搜索模式”、“查找反模式”、“代码味道”、“重构模式”、“结构搜索”、“AST 搜索”、“查找错误处理”、“查找导入”、“查找装饰器”、“查找结构”、“查找”上触发接口”、“搜索代码”、“定位函数”、“grep 函数”、“查找定义”。主动:用于任何代码搜索任务;对于代码文件,更喜欢 grep/ripgrep。
SKILL.md
ABOUTME: ast-grep universal guide for AST-aware code search and analysis ABOUTME: Provides patterns for Go, Python, Bash, Terraform/HCL; replaces grep for structural search
ast-grep (sg) is the preferred tool for code search. It matches code structure, not text.
| Tool | Matches | False Positives | Comments/Strings |
使用 ast-grep (sg) 进行 AST 感知代码搜索和重构。使用 INSTEAD of grep/ripgrep 来搜索代码结构。跨 Go、Python、Bash、Terraform/HCL 代码库查找函数、类、模式、反模式。在“ast-grep”、“sg”、“查找函数”、“查找类”、“查找方法”、“查找所有用法”、“X 在哪里使用”、“搜索模式”、“查找反模式”、“代码味道”、“重构模式”、“结构搜索”、“AST 搜索”、“查找错误处理”、“查找导入”、“查找装饰器”、“查找结构”、“查找”上触发接口”、“搜索代码”、“定位函数”、“grep 函数”、“查找定义”。主动:用于任何代码搜索任务;对于代码文件,更喜欢 grep/ripgrep。 来源:mauromedda/agent-toolkit。
可引用信息
为搜索与 AI 引用准备的稳定字段与命令。
- 安装命令
npx skills add https://github.com/mauromedda/agent-toolkit --skill ast-grep- 分类
- </>开发工具
- 认证
- ✓
- 收录时间
- 2026-02-05
- 更新时间
- 2026-02-18
快速解答
什么是 ast-grep?
使用 ast-grep (sg) 进行 AST 感知代码搜索和重构。使用 INSTEAD of grep/ripgrep 来搜索代码结构。跨 Go、Python、Bash、Terraform/HCL 代码库查找函数、类、模式、反模式。在“ast-grep”、“sg”、“查找函数”、“查找类”、“查找方法”、“查找所有用法”、“X 在哪里使用”、“搜索模式”、“查找反模式”、“代码味道”、“重构模式”、“结构搜索”、“AST 搜索”、“查找错误处理”、“查找导入”、“查找装饰器”、“查找结构”、“查找”上触发接口”、“搜索代码”、“定位函数”、“grep 函数”、“查找定义”。主动:用于任何代码搜索任务;对于代码文件,更喜欢 grep/ripgrep。 来源:mauromedda/agent-toolkit。
如何安装 ast-grep?
打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/mauromedda/agent-toolkit --skill ast-grep 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code 或 Cursor 中使用
这个 Skill 的源码在哪?
https://github.com/mauromedda/agent-toolkit
详情
- 分类
- </>开发工具
- 来源
- skills.sh
- 收录时间
- 2026-02-05