# Bug fix proof with tests

> Writes a test that fails on the bug, fixes it, then reverts to check the test fails again, so every fix is proven.

- Page: https://youraiskill.com/skill/alirezarezvani-red-green-proof
- What it does: Turns a suspected bug into a proven one. Verify the cause against reality before claiming it, write a test that FAILS on the current code, apply the fix, watch it pass — then revert the fix and confirm the test goes red again, because a test that passes both ways proves nothing. Invoked bare after a debugging conversation, it takes the target from context rather than asking. Use when fixing a bug, investigating an incident, hardening a flaky area, or when asked to "add tests that reveal the bug". Triggers on "/red-green-proof", "prove the bug", "red-green", "make the test fail first", "is that test load-bearing", "reveal the bug with a test".
- Niches: testing, coding
- Licence: MIT
- Status: Checked: open licence, author credited, passed the YourAISkill safety scan. Can be added to a paid pack.
- Contents: instructions plus scripts (4 files)

To add it, see https://youraiskill.com/guides/how-to-add-a-skill-to-claude
