본문으로 건너뛰기
Skillpedia
테스트29k · #9503

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/skills/red-green-proof/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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:

  1. A defect just identified but not yet fixed.
  2. A fix applied without a failing test to back it — the most valuable target, because the test still has to be proven load-bearing.
  3. A test written but never verified red.
  4. 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

repo: alirezarezvani/claude-skills

인기도

GitHub 스타
29k
순위
#9503
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬