red-green-proof
What it does
This skill makes the agent confirm a bug fix with evidence instead of assuming it works. It is for developers who want a regression test that truly catches the bug, not one that passes either way.
When to use it
- βWhen you are fixing a bug and want proof that the fix works.
- βWhen a pull request adds a regression test but no failing run was recorded.
- βWhen a test seems to pass even though the bug may still exist.
Skill link
https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/skills/red-green-proof/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βProve that this login bug is really fixed by writing a test that fails first and passes after the fix.β
5 new skills a week. 1 minute to read.
How it works
The agent confirms the cause of the bug, writes a test that fails on the current code and applies the smallest fix. It then removes the fix and checks that the test fails again, which shows the test depends on the fix.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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.
Picking the target
With an argument, that is the target: /red-green-proof the status endpoint reports finished runs as running.
With no argument, take the target from the conversation. The usual case is that you have just spent a long stretch investigating something β the bug is already on screen. Do not ask what to work on. Scan back through the session and pick, in this order:
- A defect just identified but not yet fixed.
- A fix applied without a failing test to back it β the most valuable target, because the test still has to be proven load-bearing.
- A test written but never verified red.
- Something described as "still open", "not fixed yet", or "characterization only".
State your pick in one line and start:
Target: the buffer discards events when the flush write fails (
checkpointBuffer.ts:271). Verifying before writing the test.
Only ask the user if two or more candidates are genuinely equal in priority β then list them as a short numbered choice and stop. If several related defects came up, handle them one at a time through the full loop rather than batching; each needs its own red.
If nothing in the conversation qualifies, say so and ask for a target rather than inventing one.
The loop
Run these in order. Do not skip 1, and never skip 4.
1. Verify the cause. Do not infer it.
Before you write a line of test code, establish what actually happened using evidence you can point at: the real record from the database or API, the real log line, the actual source of the function you are blaming.
Say which of these you have:
- Proven β I read the value / ran the code / pulled the record.
- Inferred β consistent with the evidence, but I have not confirmed it.
- Unknown β I cannot determine this from what is available.
State the label out loud. If the honest answer is Unknown, say so and name the one artifact that would settle it. A confident wrong cause costs more than an admitted gap, because it sends the fix to the wrong place.
Two traps worth naming:
- A plausible mechanism is not the mechanism. Rank candidates, then go rule them out one at a time by reading code, not by reasoning about it.
- Check whether the "bug" was deliberate.
git log -S '<the exact line>'and read the commit. If a test already asserts the current behaviour, someone may have wanted it. Understand why before you invert it.
2. Write the test. Watch it fail.
The test must fail **against
FAQ
Why remove the fix at the end?
A test that passes both with and without the fix proves nothing, so the revert step confirms that it really depends on the fix.
Does a passing test count as proof?
Not by itself. The skill requires recording the actual failure and success output for each step.
Does it need a clear bug description?
If it is used right after a debugging chat, it takes the target from that conversation.
Details
Original description by the author
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
Popularity
- GitHub stars
- 29k
- Ranking position
- #9503
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
agent-launcher-orchestrator
29kHelps your agent plan, build, test and schedule a Claude managed agent in your own account, step by step, starting from one clear goal.
grade-iterate
29kLets your agent grade a managed AI agent's work against a rubric and improve it in a fixed number of rounds, so it never loops forever.
interview
29kLets your agent interview you about an AI agent idea and turn your answers into a simple build plan before anything is launched.
run-without-you
29kHelps your agent set up a managed AI agent to run on a schedule or when an event happens, with the cron timing checked before launch.
Similar skills
test-driven-development
311kTeaches your agent to write a failing test first, watch it fail, then write the smallest code that passes, before building any feature or fix.
verification-before-completion
311kTeaches your agent to run real checks and read their output before claiming that a task, fix, or build is complete or passing.
migrate-to-shoehorn
310kReplaces risky type casts in your test files with the shoehorn library, so tests can use partial data and still pass type checks.