reproduce-bug
它能做什么
使用原始代码和计划好的输入,尝试在本地项目中复现已知缺陷,并保存原始输出。适用于在修复前确认报告缺陷的开发者和审查人员。
适用场景
- ✓开发者需要在本地项目中复现指定缺陷的时候。
- ✓审查人员想确认报告的编译器或运行时缺陷是否真的会发生的时候。
- ✓团队在编写修复之前需要复现证据的时候。
技能链接
https://github.com/trailofbits/skills/blob/main/plugins/patching-bugs/skills/reproduce-bug/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请在我本地项目的原始代码上复现这个报告的崩溃,并保存输出。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能使用项目自身的命令构建当前代码,并运行计划好的输入,包括对照用例。它会保存标准输出、标准错误、退出状态和耗时,然后报告缺陷是已复现、未复现还是被阻塞。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Reproduce Bug
When to Use
Use for the reproduction step of patching-bugs with one finding.json and a local
baseline checkout. Read the record contract.
Before target commands, follow its project guidance.
When NOT to Use
Do not use for bug discovery, patching, or a claim that cannot be exercised locally. Report a blocker when the build or environment cannot exercise the claim.
Procedure
Select
failure_typefrom the record contract. Build the current baseline with the project's own command. Exercise the planned scoped inputs before any edit and retain their observations, including valid controls. Save raw stdout, stderr, exit status, and timing. If the behavior is absent with trustworthy evidence, reportnot_reproduced; if setup or observations are unreliable, reportblocked.Runtime: exercise the built
target_artifactwith a PoC that recordsPATCH_LOADEDas defined in the contract, then printsPATCH_REACHEDimmediately before the assertion. Exit nonzero for the bug, zero otherwise; a setup crash is inconclusive. Compile: record the targetexpected_diagnosticfrom the failed compiler invocation; use emptypoc_argvand nulltarget_artifact.Save any unchanged PoC source under
reproduce/poc/and raw receipts underreproduce/receipts/. Writereproduce.jsonwith the baseline commit, command argument arrays, artifact path, observed result, outcome, and your agent identity. Setfinding.statustoreproducedornot_reproducedfrom the result. If reproduction isblocked, leavefinding.statusashypothesis.
{
"schema_version": 1,
"failure_type": "runtime",
"outcome": "reproduced",
"baseline_commit": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"build_argv": ["python", "build.py"],
"poc_argv": ["python", "poc.py"],
"target_artifact": "dist/app.py",
"observed": "The PoC wrote outside uploads after PATCH_REACHED.",
"blocker": null,
"agent": "reproducer-1"
}
- Manifest the complete
reproduce/directory, including the PoC and record, using the record helper: runuv run --no-project <script> manifest <reproduce-step-dir>. Then check the record before handoff. Stateblockedwith the actual failure when build or setup prevents a valid run.
Rationalizations to Reject
| Shortcut | Required action |
|---|---|
| A unit test imitates the bug. | Exercise the target compiler or built runtime artifact. |
| A nonzero exit proves reproduction. | Require the target diagnostic, or runtime marker and assertion. |
常见问题
如果缺陷没有发生怎么办?
当它有可靠证据表明该行为不存在时,会报告未复现。
如果构建失败怎么办?
该技能会报告被阻塞,因为不可靠的设置无法证明缺陷不存在。
它会修复缺陷吗?
不会。它只负责复现缺陷。修补是另一个步骤。
详情
作者的原始描述
Use when a named runtime or compiler bug in a local repository needs independent reproduction.
repo: trailofbits/skills
热度
- GitHub 星标
- 8.0k
- 排名
- #12691
- 许可证
- CC-BY-SA-4.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
audit-context-building
8.0k帮你的智能体在安全审查之前熟悉一个陌生的代码库,梳理每个函数的假设、保证和依赖关系。
algorand-vulnerability-scanner
8.0k帮你的智能体扫描 TEAL 或 PyTeal 编写的 Algorand 智能合约,检查 11 类常见安全问题,如重新密钥攻击和未校验费用。
audit-prep-assistant
8.0k帮你的智能体为外部安全审查做好代码准备,包括静态分析、测试覆盖、死代码清理和清晰的文档。
cairo-vulnerability-scanner
8.0k帮你的智能体扫描 StarkNet 上的 Cairo 智能合约,检查 6 类严重问题,包括算术溢出、有风险的跨层消息和签名重放。