red-green-proof
Fungsinya
Skill ini membuat agent mengonfirmasi perbaikan bug dengan bukti, bukan berasumsi bahwa perbaikannya berfungsi. Skill ini untuk pengembang yang menginginkan tes regresi yang benar-benar menangkap bug, bukan tes yang lulus dalam kedua kondisi.
Kapan dipakai
- βSaat Anda memperbaiki bug dan ingin bukti bahwa perbaikannya berfungsi.
- βSaat pull request menambahkan tes regresi tetapi tidak ada catatan run yang gagal.
- βSaat sebuah tes tampak lulus padahal bug mungkin masih ada.
Link skill
https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/skills/red-green-proof/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBuktikan bahwa bug login ini benar-benar sudah diperbaiki dengan menulis tes yang gagal dulu dan lulus setelah perbaikan.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent memastikan penyebab bug, menulis tes yang gagal pada kode saat ini, dan menerapkan perbaikan terkecil. Lalu agent menghapus perbaikan dan memastikan tes gagal lagi, yang menunjukkan bahwa tes bergantung pada perbaikan.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Mengapa perbaikan dihapus di akhir?
Tes yang lulus baik dengan maupun tanpa perbaikan tidak membuktikan apa pun, jadi langkah pengembalian ini memastikan tes benar-benar bergantung pada perbaikan.
Apakah tes yang lulus sudah cukup sebagai bukti?
Belum dengan sendirinya. Skill ini mewajibkan pencatatan output kegagalan dan keberhasilan yang sebenarnya untuk setiap langkah.
Apakah perlu deskripsi bug yang jelas?
Jika dipakai tepat setelah percakapan debugging, skill ini mengambil target dari percakapan itu.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 29k
- Peringkat
- #9503
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
agent-launcher-orchestrator
29kMembantu agent Anda merencanakan, membangun, menguji, dan menjadwalkan agent Claude terkelola di akun Anda sendiri, langkah demi langkah.
grade-iterate
29kMembantu agent Anda menilai hasil kerja agent AI terkelola berdasarkan rubrik dan memperbaikinya dalam jumlah putaran tetap, agar tidak berputar tanpa henti.
interview
29kMembantu agent Anda mewawancarai Anda tentang ide agent AI dan mengubah jawaban Anda menjadi rencana pembangunan sederhana sebelum apa pun diluncurkan.
run-without-you
29kMembantu agent Anda disiapkan agar berjalan tanpa Anda sesuai jadwal atau saat sebuah peristiwa terjadi, dengan waktu cron diperiksa sebelum peluncuran.
Skill serupa
test-driven-development
311kMengajari agent Anda menulis tes yang gagal dulu, melihatnya gagal, lalu menulis kode terkecil yang lulus, sebelum membangun fitur atau perbaikan apa pun.
verification-before-completion
311kMengajari agent Anda menjalankan pemeriksaan nyata dan membaca keluarannya sebelum menyatakan tugas, perbaikan, atau build sudah selesai atau lulus.
migrate-to-shoehorn
310kMengganti type cast berisiko di file tes Anda dengan pustaka shoehorn, sehingga tes bisa memakai data parsial dan tetap lulus pemeriksaan tipe.