red-green-proof
하는 일
이 스킬은 에이전트가 버그 수정을 가정하지 않고 증거로 확인하게 합니다. 어느 쪽에서나 통과하는 테스트가 아니라 실제로 버그를 잡는 회귀 테스트를 원하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓버그를 고치면서 수정이 작동한다는 증거가 필요할 때.
- ✓풀 리퀘스트가 회귀 테스트를 추가했지만 실패한 실행 기록이 없을 때.
- ✓테스트가 통과하는데도 버그가 아직 남아 있을 수 있다고 의심될 때.
스킬 링크
https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/skills/red-green-proof/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 로그인 버그가 정말 고쳐졌는지 증명해 주세요. 수정 전에는 실패하고 수정 후에는 통과하는 테스트를 작성해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 버그의 원인을 확인하고, 현재 코드에서 실패하는 테스트를 쓰고, 가장 작은 수정을 적용합니다. 그다음 수정을 빼고 테스트가 다시 실패하는지 확인합니다. 이로써 테스트가 수정에 실제로 의존한다는 것을 보여 줍니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
마지막에 수정을 왜 되돌리나요?
수정이 있든 없든 통과하는 테스트는 아무것도 증명하지 못합니다. 되돌리기 단계로 테스트가 실제로 수정에 의존하는지 확인합니다.
통과하는 테스트면 증거가 되나요?
그것만으로는 아닙니다. 이 스킬은 각 단계의 실제 실패와 성공 출력을 기록하도록 요구합니다.
버그 설명이 꼭 명확해야 하나요?
디버깅 대화 직후에 쓰면, 그 대화에서 대상을 가져옵니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 29k
- 순위
- #9503
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
agent-launcher-orchestrator
29k하나의 명확한 목표에서 시작해 내 계정의 Claude 관리형 에이전트를 계획하고, 만들고, 테스트하고, 예약하도록 돕습니다.
grade-iterate
29k에이전트가 채점 기준표에 따라 관리형 AI 에이전트의 결과물을 평가하고, 정해진 횟수 안에서 개선하도록 돕습니다. 끝없이 반복하지 않습니다.
interview
29kAI 에이전트 아이디어에 대해 질문하고, 답변을 간단한 빌드 계획으로 바꿔 어떤 것도 출시하기 전에 정리하도록 돕습니다.
run-without-you
29k에이전트가 관리형 AI 에이전트를 예약 또는 이벤트에 따라 실행되도록 설정하고, 출시 전에 cron 시간을 확인하도록 돕습니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.