·ast-grep
{}

ast-grep

ampcode/amp-contrib

编写 ast-grep 规则以执行结构代码搜索和分析的指南。当用户需要使用抽象语法树 (AST) 模式搜索代码库、查找特定代码结构或执行简单文本搜索之外的复杂代码查询时使用。当用户要求搜索代码模式、查找特定的语言结构或查找具有特定结构特征的代码时,应该使用此技能。

29安装·0热度·@ampcode

安装

$npx skills add https://github.com/ampcode/amp-contrib --skill ast-grep

SKILL.md

This skill helps translate natural language queries into ast-grep rules for structural code search. ast-grep uses Abstract Syntax Tree (AST) patterns to match code based on its structure rather than just text, enabling powerful and precise code search across large codebases.

Follow this process to help users write effective ast-grep rules:

Clearly understand what the user wants to find. Ask clarifying questions if needed:

编写 ast-grep 规则以执行结构代码搜索和分析的指南。当用户需要使用抽象语法树 (AST) 模式搜索代码库、查找特定代码结构或执行简单文本搜索之外的复杂代码查询时使用。当用户要求搜索代码模式、查找特定的语言结构或查找具有特定结构特征的代码时,应该使用此技能。 来源:ampcode/amp-contrib。

查看原文

可引用信息

为搜索与 AI 引用准备的稳定字段与命令。

安装命令
npx skills add https://github.com/ampcode/amp-contrib --skill ast-grep
分类
{}数据分析
认证
收录时间
2026-02-01
更新时间
2026-02-18

快速解答

什么是 ast-grep?

编写 ast-grep 规则以执行结构代码搜索和分析的指南。当用户需要使用抽象语法树 (AST) 模式搜索代码库、查找特定代码结构或执行简单文本搜索之外的复杂代码查询时使用。当用户要求搜索代码模式、查找特定的语言结构或查找具有特定结构特征的代码时,应该使用此技能。 来源:ampcode/amp-contrib。

如何安装 ast-grep?

打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/ampcode/amp-contrib --skill ast-grep 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code 或 Cursor 中使用

这个 Skill 的源码在哪?

https://github.com/ampcode/amp-contrib

详情

分类
{}数据分析
来源
skills.sh
收录时间
2026-02-01