structural-search
按 AST 结构搜索代码
文本搜索会遗漏语义关系并产生大量噪声匹配。此技能使用 ast-grep 模式定位代码结构,并为针对性重构做好准备。
使用我的智能体安装
将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。
Review the Skillstore skill "structural-search" from https://skillstore.io/skills/0xdarkmatter-structural-search.md and its manifest at https://skillstore.io/api/skills/0xdarkmatter-structural-search/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智能体仍应展示其计划,并按安全策略请求必要确认。
Agent 可读资源
当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。
测试它
正在使用“structural-search”。 查找依赖项列表为空的 React effects。
预期结果:
一条针对性强的 ast-grep 搜索命令、匹配文件列表,以及说明每个匹配项都需要进行行为审查的备注。
正在使用“structural-search”。 规划从 var 到 const 的迁移,但不要更改文件。
预期结果:
- 结构化搜索和替换预览。
- 按文件汇总候选匹配项。
- 需要审查的被重新赋值声明列表。
安全审计
安全All 57 static findings are false positives caused by documented ast-grep search patterns, Markdown formatting, or fixed command examples. No executable skill scripts, credential access, malicious network behavior, prompt injection, or unsafe deserialization implementation was found.
风险因素
🌐 网络访问 (5)
⚙️ 外部命令 (35)
⚡ 包含脚本 (13)
分享与引用此报告
分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。
复制报告链接
https://skillstore.io/skills/0xdarkmatter-structural-search/audits/12?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/0xdarkmatter-structural-search?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/0xdarkmatter-structural-search?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/0xdarkmatter-structural-search/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/0xdarkmatter-structural-search.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学术引用 (APA · BibTeX · CFF)
APA 引用
0xDarkMatter. (2026). structural-search security audit report (audit version 12) [Author version unspecified]. Skillstore. https://skillstore.io/skills/0xdarkmatter-structural-search/audits/12BibTeX 引用
@techreport{0xdarkmatter-0xdarkmatter-structural-search-2026,
author = {0xDarkMatter},
title = {structural-search security audit report (audit version 12)},
institution = {Skillstore},
year = {2026},
number = {12},
url = {https://skillstore.io/skills/0xdarkmatter-structural-search/audits/12},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "structural-search security audit report (audit version 12)"
version: "unspecified"
type: report
authors:
- name: "0xDarkMatter"
date-released: "2026-07-12"
url: "https://skillstore.io/skills/0xdarkmatter-structural-search/audits/12"
identifiers:
- type: other
value: "skillstore:0xdarkmatter-structural-search:audit:12"
description: "Skillstore immutable audit report identifier"
Skillstore 评分
评分依据 证据置信度: 高你能构建什么
梳理 API 使用情况
在更改共享接口之前,定位所有调用、导入或方法结构。
准备大型重构
在应用受控编辑之前,预览整个代码仓库中的结构化替换。
创建安全检查
将高风险语法模式转换为可复用的 ast-grep 规则,用于本地和 CI 扫描。
试试这些提示
查找 [directory] 中对 [function name] 的每一次调用。显示 ast-grep 命令并汇总匹配的文件。
为 [language] 中的 [code structure] 创建 ast-grep 模式。包含上下文标志,并解释每个元变量。
查找 [old structure],并预览使用 [new structure] 进行替换的结果。不要应用更改。报告需要审查的边界情况。
为 [policy] 创建经过测试的 ast-grep YAML 规则。包含有效示例、无效示例、严重级别、CI 命令和误报审查指南。
最佳实践
- 先指定较小的目录范围和明确的语言,再逐步扩大搜索范围。
- 预览每次替换并审查具有代表性的匹配项,然后再启用重写模式。
- 将可复用的 YAML 规则添加到 CI 之前,使用有效和无效的测试样例对其进行测试。
避免
- 不要将每个安全模式匹配项都视为已确认的漏洞。
- 在审查预览结果和版本控制状态之前,不要应用覆盖整个代码仓库的重写。
- 当需要特定语言的语法时,不要使用通用模式。
常见问题
什么是结构化搜索?
涵盖哪些语言?
此技能会安装 ast-grep 吗?
它可以修改源文件吗?
它可以发现安全漏洞吗?
我可以在 CI 中使用规则吗?
开发者详情
作者
0xDarkMatter许可证
MIT
Skillstore 修订
r1
版本提示
作者未声明版本。
引用
d71c7417a35d5c2624161bd2fe8de8a41a362128
维护新鲜度
2026/7/20
使用量
28 次下载 · 402 次浏览