reproduce-bug

$npx mdskill add trailofbits/skills/reproduce-bug

Use for the reproduction step of `patching-bugs` with one `finding.json` and a local baseline checkout. Read the [record contract](../../references/records.md). Before target commands, follow its [project guidance](../../references/records.md#project-guidance).

SKILL.md

.github/skills/reproduce-bugView on GitHub ↗
---
name: reproduce-bug
description: Use when a named runtime or compiler bug in a local repository needs independent reproduction.
---

# 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](../../references/records.md).
Before target commands, follow its [project guidance](../../references/records.md#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

1. Select `failure_type` from 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,
   report `not_reproduced`; if setup or observations are unreliable, report `blocked`.
2. Runtime: exercise the built `target_artifact` with a PoC that records `PATCH_LOADED`
   as defined in the contract, then prints `PATCH_REACHED` immediately before the assertion.
   Exit nonzero for the bug, zero otherwise; a setup crash is inconclusive.
   Compile: record the target `expected_diagnostic` from the failed compiler invocation;
   use empty `poc_argv` and null `target_artifact`.
3. Save any unchanged PoC source under `reproduce/poc/` and raw receipts
   under `reproduce/receipts/`. Write `reproduce.json` with the baseline commit,
   command argument arrays, artifact path, observed result, outcome, and your agent
   identity. Set `finding.status` to `reproduced` or `not_reproduced` from the result.
   If reproduction is `blocked`, leave `finding.status` as `hypothesis`.

   [Reproduce record schema](../../schemas/reproduce.schema.json):
```json
{
  "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"
}
```

4. Manifest the complete `reproduce/` directory, including the PoC and record, using
   the [record helper](../../scripts/records.py): run
   `uv run --no-project <script> manifest <reproduce-step-dir>`. Then check the
   record before handoff. State `blocked` with 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. |

More from trailofbits/skills

SkillDescription
address-sanitizerBuilds and runs code under AddressSanitizer to catch buffer overflows, use-after-free, and other memory errors during fuzzing or tests. Covers -fsanitize=address builds, ASAN_OPTIONS, reading the crash report, LeakSanitizer, and the overhead and platform trade-offs. Use when fuzzing C/C++ or Rust that has unsafe blocks or FFI, when debugging a memory corruption crash, or when reading an ASan stack trace.
adjudicate-regressionUse when deciding whether source and live reproduction evidence establish a new regression or an exclusion.
aflppSets up and runs AFL++ for multi-core fuzzing of C/C++ projects built with afl-clang-fast or afl-gcc-fast. Covers instrumentation modes, parallel main and secondary campaigns, persistent mode, corpus minimization, and crash triage. Use when scaling fuzzing across cores, fuzzing a mature C/C++ codebase, reading the afl-fuzz status screen, or moving on after libFuzzer has plateaued.
agentic-actions-auditorAudits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI, OpenAI Codex, and GitHub AI Inference. Detects attack vectors where attacker-controlled input reaches AI agents running in CI/CD pipelines, including env var intermediary patterns, direct expression injection, dangerous sandbox configurations, and wildcard user allowlists. Use when reviewing workflow files that invoke AI coding agents, auditing CI/CD pipeline security for prompt injection risks, or evaluating agentic action configurations.
algorand-vulnerability-scannerScans Algorand smart contracts for 11 common vulnerabilities including rekeying attacks, unchecked transaction fees, missing field validations, and access control issues. Use when auditing Algorand projects (TEAL/PyTeal).
atherisSets up and runs Atheris, the coverage-guided Python fuzzer built on libFuzzer. Covers TestOneInput harnesses, FuzzedDataProvider, instrumenting both pure Python and native C extensions, and running under AddressSanitizer. Use when fuzzing a Python package, hunting memory corruption in a Python C extension, or choosing between Atheris and Hypothesis for a Python target.
audit-augmentation>
audit-context-buildingUnderstand a codebase before looking for bugs in it - what each function assumes, what it guarantees, and what it depends on elsewhere. Use when starting an audit, threat model, or architecture review on unfamiliar code, and before any vulnerability-hunting pass.
audit-prep-assistantPrepares codebases for security review using Trail of Bits' checklist. Helps set review goals, runs static analysis tools, increases test coverage, removes dead code, ensures accessibility, and generates documentation (flowcharts, user stories, inline comments). Use when preparing your own codebase to be audited by someone else, getting a repository review-ready before an external security review, deciding what to fix before auditors start, or asking what assessors need from a project. For understanding unfamiliar code you are about to audit, use audit-context-building instead.
burpsuite-project-parserSearches and explores Burp Suite project files (.burp) from the command line. Use when searching response headers or bodies with regex patterns, extracting security audit findings, dumping proxy history or site map data, or analyzing HTTP traffic captured in a Burp project.