agents/skills/minimize-reproducer/SKILL.md
Before minimizing, understand exactly what "reproduction" looks like.
Find the minimal set of V8 flags required to reproduce the issue.
Reduce the input JavaScript file systematically. Always work on a copy (e.g., `poc-copy.js`) and maintain a `poc-min.js` as your "best known" version.
WebAssembly reproductions often start as opaque Uint8Array blobs. Converting
these to readable WasmModuleBuilder JS is critical for understanding and
minimizing the logic.
wami: Use the wami tool to automatically generate
WasmModuleBuilder code from a Wasm binary. This is much less error-prone
than manual conversion.
out/x64.release/wami --mjsunit input.wasm > poc.jsWasmModuleBuilder Specifics:
struct.get), use wasmRefNullType(typeIndex) or similar helpers where the
builder expects a type object rather than a raw integer.WasmModuleBuilder might require minor
manual adjustments if the original binary had subtle validation errors.Sandbox.markForCorruptionOnAccess)
require specific alignments (e.g., tagged-size-aligned offsets like 8, 12, or
16).%DebugPrint(obj) with
--allow-natives-syntax to inspect the internal structure.__v_0 should be renamed to
something descriptive like str or targetObj.poc-min.js is completely self-contained
and does not rely on external fuzzer libraries unless strictly necessary.