Fernando Ramos← All skills06 of 09
← All skills

/reproduce

Build · Failing-test bug reproduction and bisect

Turns a bug into a failing regression test in the repository suite first, confirms it 3× for flakiness, and optionally bisects in an isolated worktree.

npx skills@latest add luci-efe/skills -s reproduce

  • BuildStage
  • 03 Evidence of done · 01 ObservableMethod
  • Regression test in repo suite · .ramos/reproduce/{predicate.sh,bisect.log} (bisect)Produced artifact / output

Use when

Something is broken — a bug report, a failing test, a regression, or "it used to work" — before changing any code to fix it.

Support & adapters

  • Instructions usable across harnesses

Decision tree

  1. 01

    1–2. Classify report & write failing test

    Record HEAD baseline, locate throw site with rg, and write the smallest failing test in the existing suite (max 3 attempts)

    → Observed pre-fix failure
  2. 02

    3–4. Flakiness check & optional bisect

    Run failing test 3×; if "it used to work", bisect in isolated .ramos/worktrees/bisect with .ramos/reproduce/predicate.sh

    → .ramos/reproduce/bisect.log
  3. 03

    5–6. Fix & verify without editing test

    Apply fix so the unmodified regression test passes and full suite is no worse than baseline; hand off to /proof

    → Committed regression test

Prerequisites & install recipes

  • gitrequired · default & bisect branchesgit
    brew install git

Completion criteria

  • Deliverable is a regression test committed in the repository suite that fails before the fix and passes after.
  • Never runs stash, reset, or checkout over the user working tree; bisect runs in .ramos/worktrees/bisect.
  • Distinguishes a broken test environment from the reported bug before editing source code.

Example

Two runs on a public project: a bisect to find the commit that fixed a parser bug, then a regression test for a second bug that has to fail before the fix.

What was run

git worktree add $RAMOS_STATE_DIR/worktrees/bisect HEAD --detach
git -C $WT bisect start --term-old=broken --term-new=fixed HEAD 8d96048
git -C $WT bisect run sh $RAMOS_STATE_DIR/reproduce/predicate.sh

# regression test, dropped into a worktree at the commit before the fix, three runs

Output (excerpt)

Bisecting: 27 revisions left to test after this (roughly 5 steps)
ab38e02133b7edbdfb4c9ce255a59949200df587 is the first fixed commit

99f4854~1 (before the fix), runs 1 to 3, identical:
  × unmet runtime_requirements do not block routing when forced
  AssertionError: expected null to be 'hermes'
99f4854 and main, x3:   Tests  1 passed (1)

What it found. The bisect pinpointed the fix commit (ab38e02) in about five steps, and the regression test fails 3 of 3 runs before the fix and passes after it, with the same file at both commits.

Caveat. In this bisect every tested midpoint already contained the fix through merge ancestry, so the answer came from the git graph, not from observing a failing commit. Check both endpoints by hand first.

View skill source on GitHub

Want something like this built for your company?

Book a callMessage me on LinkedInSee Agentic Engineering
← All skills