- AI Coding Agents
- Agent
- Intermediate
- Claude Code
- Published
Reproduce-First Bug Fix: Failing Test, Minimal Patch, and Regression Proof
Directs Claude Code to reproduce a reported bug with a failing test, apply the smallest fix, and prove the fix with command output. Use it to decide whether a bug is fixed and safe to merge.
You get: Job-to-be-done and merge decision supported, root cause and hypotheses table
The prompt
mkdir -p .agents/skills/reproduce-first-bug-fix-failing-test-minimal-patch-and-regressio && curl -sL "https://prompts-gpt.com/prompts/reproduce-first-bug-fix-failing-test-minimal-patch-and-regression-proof/raw" -o .agents/skills/reproduce-first-bug-fix-failing-test-minimal-patch-and-regressio/SKILL.mdTips and common edits
Works best when the bug report includes exact error text and steps. Use a clean working tree so the diff review is meaningful. If tests need services such as a database, list that in the environment variable.
Questions about this prompt
More like this
More in AI Coding AgentsClaude Code Root-Cause Bug Investigation with Failing Test and Minimal Patch
Directs Claude Code to reproduce a bug, trace it to a root cause using repository evidence, write a failing regression test, and apply the smallest safe fix. Ends with a verified diff, risks, and next actions.
Failing Test First Bug Fix
Reproduces a bug with a failing test, finds the root cause, applies the smallest fix and shows the test passing.
Agent Session Handoff Brief with Resume Checklist and Verified State
Makes Claude Code produce a handoff file capturing goal, verified repo state, decisions, blockers, and exact resume commands so another engineer or agent session can continue without rework. Use it before ending a long task.
Characterization-Test-Backed Refactor with Incremental Commits
Guides Claude Code to refactor a module safely by first pinning current behavior with characterization tests, then making small, reversible commits. Helps you decide whether the refactor preserved behavior and is worth merging.
Claude Code Repo Recon and Implementation Plan for a New Feature
Has Claude Code inspect a repository read-only and produce an evidence-based implementation plan with file-level changes, tests, risks, and open questions. Use it to decide whether to start, split, or clarify a feature before any code is written.
Pre-Merge Self-Review of a Git Diff: Correctness, Security, and Test Gaps
Has Claude Code review a branch diff like a skeptical maintainer, producing severity-ranked findings with evidence and a clear merge, fix, or block recommendation. Use it before opening or approving a pull request.
Cursor Agent Bug Triage: Reproduce, Root-Cause, Fix, and Regression Test
Guides Cursor Agent through reproducing a bug, isolating the root cause with evidence, applying a minimal diff, and adding a regression test, ending with a verification checklist and risks.
Claude Code Feature Implementation Plan and Build from a Ticket with Repo Convention Discovery
Has Claude Code investigate how similar features are built in the repository, produce an implementation plan with acceptance tests, then implement it in verified increments. Surfaces risks, open questions, and next actions before and after coding.
Debug an Error From the Message and the Code Around It
Finds the most likely cause of an error from the message and the relevant code, ranks other possible causes, and gives the smallest fix plus a way to prove it worked.
Agent Run Post-Mortem: Trace Root Cause and Prompt or Tool Fixes
Analyzes a pasted agent trace to find the first real failure and proposes exact prompt rewrites or tool changes, each with a test.
Characterization Tests Before a Refactor
Writes tests that lock in a module's current behavior, including edge cases and quirks, so you can refactor safely.
Checkpoint and Rollback Manager with Compensation Steps and Failure Injection Tests
Guides Claude Code to implement checkpoint snapshots, rollback modes, and compensating actions for side-effecting agent phases, then prove them with failure-injection tests. Helps you decide the rollback strategy per phase.