·structural-search
</>

structural-search

0xdarkmatter/claude-mods

使用 ast-grep 按 AST 结构搜索代码。查找函数调用、导入、类定义等语义模式,而不是文本模式。触发条件:查找对 X 的所有调用、搜索模式、重构用法、查找使用函数的位置、结构搜索、ast-grep、sg。

15安装·0热度·@0xdarkmatter

安装

$npx skills add https://github.com/0xdarkmatter/claude-mods --skill structural-search

SKILL.md

Search code by its abstract syntax tree (AST) structure. Finds semantic patterns that regex cannot match reliably.

| ast-grep | sg -p 'pattern' | AST-aware code search |

| $NAME | Named identifier | function $NAME() {} | | $ | Any single node | console.log($) | | $$$ | Zero or more nodes | function $($$$) {} |

使用 ast-grep 按 AST 结构搜索代码。查找函数调用、导入、类定义等语义模式,而不是文本模式。触发条件:查找对 X 的所有调用、搜索模式、重构用法、查找使用函数的位置、结构搜索、ast-grep、sg。 来源:0xdarkmatter/claude-mods。

查看原文

可引用信息

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

安装命令
npx skills add https://github.com/0xdarkmatter/claude-mods --skill structural-search
分类
</>开发工具
认证
收录时间
2026-02-01
更新时间
2026-02-18

快速解答

什么是 structural-search?

使用 ast-grep 按 AST 结构搜索代码。查找函数调用、导入、类定义等语义模式,而不是文本模式。触发条件:查找对 X 的所有调用、搜索模式、重构用法、查找使用函数的位置、结构搜索、ast-grep、sg。 来源:0xdarkmatter/claude-mods。

如何安装 structural-search?

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

这个 Skill 的源码在哪?

https://github.com/0xdarkmatter/claude-mods