Agent skill · alirezarezvani
red-green-proof
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".
What it needs
About 7k tokens when loaded.
What this skill does
Red-Green-Proof A bug is not fixed because the tests pass. A bug is fixed when a test fails without your fix and passes with it, and you have watched it do both. Overview Use this skill when a bug, incident, flaky test, or unproven regression test is under investigation. It applies a strict red-green-red loop: establish the cause, observe a focused test fail, make the smallest fix, then remove the fix and observe the test fail again. The final revert is the proof that the test is actually coupled to the defect. Workflow Keep evidence for each phase separate. A test command that exits zero is not evidence that it exercised the defect; record the assertion and the observed failure or success. Do not proceed when the current phase is unobserved. Before changing code, identify the exact test command and expected red signal. After the fix, run that same command without changing its assertions. During the revert, use the same command again and preserve the failure output. Restore the fix before running the broader suite. Proactive Triggers A pull request adds a regression test but no pre-fix failure is recorded → ask for the red run before calling it coverage. A bug fix changes production code and tests in one step → verify the test fails against the parent revision or label the evidence as missing. A test uses only mocks or call-count assertions → ask for the observable user-facing consequence. A test is described as flaky → preserve the failing seed, timing, or interleaving before attempting a stabilization fix. Output Format Report each investigation with: (1) target and cause, labeled Proven, Inferred, or Unknown; (2) the red command and actual failure before the fix; (3) green and revert-red results with actual output; and (4) final suite status and remaining uncertainty. Most "regression tests" written after a fix never had the chance to fail. They are decoration. This skill is the discipline that separates a real test from a decorative one. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills alirezarezvani/red-green-proof