此技能使用系统化的多阶段方法审查代码变更中的漏洞、安全弱点和问题。它会映射攻击面、运行安全检查清单,并提供按优先级排序的发现结果,附带证据和修复建议。
下载技能 ZIP
在 Claude 中上传
前往 设置 → 功能 → 技能 → 上传技能
开启并开始使用
测试它
正在使用“find-bugs”。 Find bugs in the current branch changes
预期结果:
## 代码审查发现
### 安全漏洞
**src/auth.js:42 - SQL 注入风险**
- 严重程度:严重
- 问题:用户输入直接拼接到 SQL 查询中
- 证据:第 42 行未使用参数化,直接使用 user.id
- 修复:使用参数化查询或 ORM
- 参考资料:OWASP A03:2021
### 漏洞
**src/parser.js:15 - 空引用**
- 严重程度:中等
- 问题:尝试访问未定义的属性
- 证据:访问 user.preferences 前未进行空值检查
- 修复:添加空值检查或使用可选链操作符
正在使用“find-bugs”。 Review for security issues only
预期结果:
## 安全审计
已审查 12 个文件。发现 2 个安全问题:
1. **api/handler.js:28** - 命令注入(严重)
2. **utils/crypto.js:8** - 弱随机数(高)
身份验证、授权或数据验证方面未发现问题。
安全审计
安全All static findings evaluated as false positives. External commands (git/gh CLI) are legitimate code review tooling. Network URL is documentation only. Cryptographic warnings are keyword false positives. Skill is safe for publication.
高风险问题 (2)
中风险问题 (2)
风险因素
⚙️ 外部命令 (3)
🌐 网络访问 (1)
质量评分
你能构建什么
提交前代码审查
在提交拉取请求前运行,及早发现漏洞和安全问题
拉取请求安全审计
系统性地审查变更内容,检查安全漏洞和 OWASP 问题
自动化质量门禁
集成到 CI/CD 流程中,阻止包含严重安全问题的提交
试试这些提示
Find bugs in the current branch changes
Review the changes on this branch for security vulnerabilities. Check for injection risks, authentication issues, and data exposure.
Perform a full security and quality audit of the changes on this branch. Map attack surfaces, run the security checklist, and provide prioritized findings with evidence and fixes.
Quickly scan the branch changes for critical bugs and high-severity security issues. Skip stylistic issues.
最佳实践
- 每次拉取请求前运行以尽早发现问题
- 合并前处理严重和高级别的发现
- 利用发现结果向团队传授安全模式知识
- 集成到 CI 中防止安全回归
避免
- 未调查就忽略发现结果,因为它们看起来像误报
- 仅在明确询问时才运行,而不是主动运行
- 将所有发现视为同样紧急而不是按优先级处理
- 直接进行更改而不是让用户决定