Prompt EngineeringPatterns

Pattern — debugging

Reproduce the failure before touching code, then prove the fix against the same repro.

The failure mode of agent debugging is "try this and see" — a plausible change, no proof it addressed the actual problem. The fix is a discipline: reproduce first, then prove the fix against that same reproduction.

The workflow

  1. Reproduce before touching code. Get the failure to happen with the smallest possible case. If the agent can't reproduce it, it doesn't understand it yet — and any fix is a guess.
  2. Locate, don't guess. Use tools to read the real state — the actual code path, the live value — instead of theorizing. Grounding beats guessing.
  3. Change one thing. A single, explained change tied to the reproduced cause — not a scattershot of "maybe this."
  4. Prove it against the original repro. Re-run the same case that failed. Passing a new, different test proves nothing; verifying against the original goal is the point.

Why this order is load-bearing

Reproduce-first isn't ceremony. It converts "I think this fixes it" into "this failed, I changed X, now it passes" — a claim you can actually trust.

Try it free

This exact discipline is the free repro-first-debugging skill — install it and watch your agent refuse to guess.