Fix a bug for good, with the cause proven and a test that would have caught it
Give it a bug. Get the cause proven, a small fix, missing tests found and a pull request.
Fix a bug with proof and a clear pull request is a free AI workflow for the job "Test and fix code". It guides your AI through several skills in order, passing each step's output to the next.
Free · No account · Made by AI Blocks · Thinking: high
What it does
Many bugs come back because the first fix treated a guess. The AI sees an error, edits the nearest code, the error moves, and nobody knows why. You end up with a fix that has no proof and no test that would catch it again. These steps put the proof first. The first step reproduces the bug, narrows it down and states the cause. It waits for your yes before it edits anything, then makes the smallest change. The second lists what the fix changes and which of that no test checks. You then add the tests, starting with one that fails on the old code. The third reviews the fix and tests against your standards. The last writes a pull request that shows the failing run before and the passing run after.
You give it
- What is broken, how to trigger it and the exact error if you have it
- Access to your project code
- Your written coding standards or the original issue (optional)
You get
- The cause of the bug, shown with evidence and agreed by you
- The smallest fix, checked by re-running the failing test
- A list of behaviours the fix touches that no test checks, and the tests to add
- A review of the fix against your standards and the issue
- A pull request showing the failing run before and the passing run after
Use it when
- A bug keeps coming back after being fixed.
- Your AI keeps changing the wrong code and the error just moves.
- You need a fix a teammate can review without redoing the investigation.
Steps
- Bug root cause finder: Describe the bug. Get the cause proven with evidence before any code is changed, so fixes stop being guesses.
- Code change test coverage review: Give it a code change and your tests. Get each new behaviour marked covered or not, plus test cases for the gaps.
- Code change reviewer: Point it at a set of changes. Get a review against your coding standards and your spec, side by side.
- Pull request writer: Give it your changes. Get a clear pull request description a reviewer can follow.
How to use it
- Download the handoff pack. It's a zip with HANDOFF.md and every skill file this workflow uses.
- Open your project in Claude Code, give it the folder and say "Follow HANDOFF.md".
- Give it the steps that trigger the bug. When it states the cause, read it and say yes or no. It will not edit until you do.
- After the missing-test step, add the tests it proposes and run them. Make sure one fails on the old code.
- Read the review, then use the pull request text as it is or trim it.