adversarial-reviewer
它能做什么
这项技能对代码变更进行深入剖析,找出普通审查可能遗漏的具体缺陷。适合希望在变更合并或发布之前进行深入缺陷排查的开发者。
适用场景
- ✓当你明确要求进行深入的缺陷排查或对抗式审查的时候。
- ✓当你想在提交自己的变更之前,检查其中隐藏的故障模式的时候。
- ✓当你怀疑某项变更对数据、错误或并发做了不安全的假设的时候。
技能链接
https://github.com/emdash-cms/emdash/blob/main/skills/adversarial-reviewer/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请对我最新的变更做一次对抗式审查,找出任何真正的缺陷或不安全的假设?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会确定变更的目的,阅读其周围的代码,并把每个假设都当作需要验证的对象。它会寻找边界情况、错误处理漏洞和状态问题,且只报告有证据支持的问题。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Adversarial code review
Look for defects that survive an ordinary review. Treat the implementation's assumptions as claims to verify, while keeping every finding tied to evidence.
Establish the review boundary
- Identify the exact diff, branch, pull request head, or files under review.
- Read the surrounding code needed to understand data flow and invariants.
- Check repository instructions and the tests that define expected behavior.
- Compare the change with its stated purpose. Trace the scenario and configuration from the issue, discussion, or accepted design it addresses through the real code, and treat each claim in the description and changeset as something to verify.
- Separate defects introduced by the reviewed change from unrelated observations. Report an out-of-scope issue only when it materially affects the change's safety.
Do not modify code, post a review, or expand the review target unless the user asks.
Hunt for failures
Choose the checks that fit the change instead of mechanically applying every category.
- Logic and boundaries: empty and single-item inputs, pagination edges, invalid state transitions, locale handling, Unicode, maximum values, and repeat invocation.
- Errors and cleanup: swallowed failures, partial cleanup, misleading status codes, exposed internals, missing timeouts, and unbounded retries.
- State and concurrency: stale reads, lost updates, time-of-check/time-of-use races, duplicate delivery, non-idempotent retries, leaked listeners, and shared mutable state.
- Authorization and trust: missing permission checks, confused caller identity, CSRF, unsafe redirects, injection, path traversal, secret exposure, and trust transferred across a boundary without validation.
- Data integrity: partial writes, migration restart behavior, dialect differences, uniqueness assumptions, destructive cascades, and old/new version compatibility.
- Resources and performance: unbounded collections, repeated round trips, retained resources, logged-out hot-path regressions, and work that scales with attacker-controlled input.
- Scope: the same defect left in place elsewhere, such as sibling call sites, other storage backends or render paths, and data already stored in the old shape.
- Interfaces: exported types, generated schemas, generated types, and documentation that no longer match the new behavior.
Trace concrete inputs and event sequences through the real implementation. Run focused tests or a minimal reproduction when that is the fastest way to establish a claim. Do not infer a bug solely from an unfamiliar pattern.
Findings standard
A finding needs all of the following:
- the violated behavior or invariant;
- the exact code location;
- a concrete trigger or execution path;
- the observable consequence;
- a proportionate fix direction.
Use calibrated language. State confirmed defects directly. Label an unresolved concern as uncertain and explain what evidence is missing. Do not turn naming, formatting, optional hardening, or personal design preference into a correctness finding.
Prioritize by impact and likelihood:
- Critical: exploitable security issue, unrecoverable data loss, or broad production outage.
- High: likely user-visible wrong behavior, authorization bypass, or recoverable data corruption.
- Medium: real failure under a plausible edge case, race, or sustained load.
- Low: limited correctness issue with small impact. Omit purely cosmetic observations.
Report
Lead with findings, ordered by severity. For each finding, include a short title, file and line, the failing scenario, impact, and fix direction. Keep line ranges tight.
If no actionable defects are supported by the evidence, say so. Mention meaningful residual risks or untested boundaries, but do not manufacture findings to make the review appear thorough.
常见问题
它会找哪些类型的问题?
空输入等边界情况、错误处理和清理方面的漏洞,以及状态或时序问题。
它会修改我的代码吗?
不会。它只进行审查并报告,除非你要求,否则不会修改代码或发布审查意见。
它和普通的代码审查有什么不同?
它旨在深入排查那些普通审查中遗漏的缺陷,而不是提供风格方面的反馈。
详情
作者的原始描述
Stress-test a code change for concrete correctness defects, unsafe assumptions, and failure modes. Use when the user explicitly asks for an adversarial review, a deep bug hunt, or to tear a change apart, or to check your own change before submitting it. Do not use for ordinary review, style feedback, or general improvement suggestions.
repo: emdash-cms/emdash
热度
- GitHub 星标
- 14k
- 排名
- #11244
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-browser
14k让你的智能体在真实浏览器中测试网页,检查用户看到的内容,验证操作,并截图作为证据。
building-emdash-site
14k帮你的智能体在 Astro 上构建 EmDash CMS 项目的网站部分,涵盖内容、结构、菜单、分类法和部署。
creating-plugins
14k帮你的智能体为 EmDash CMS 构建插件,包括安全的钩子、路由、存储和管理界面。
emdash-cli
14k让你的智能体通过命令行管理 EmDash 网站,包括内容、媒体、菜单、迁移,以及整站导出或导入。