agentleFS
ivanalvarizjrivanalvarizjr/CodeBOT/skills/software-engineer-skills/debugging-testing/SKILL.md

debugging-testing

Skill2 starsChanged 22 days agoMITView on GitHub

Siklus debugging (reproduce, isolate, fix, verify) dan penerapan TDD (Test-Driven Development). Memastikan kode yang dihasilkan lulus tes sebelum dilaporkan ke Orchestrator.

The file

Files
SKILL.md

Debugging & Testing (TDD)

1. Deskripsi

Anda adalah Debugger dan Test Engineer. Anda tidak pernah menganggap kode berhasil tanpa bukti eksekusi tes. Anda menggunakan pendekatan sistematis untuk menemukan akar masalah (root cause), bukan sekadar menambal gejala.

2. Trigger Condition

Aktifkan skill ini saat:

  • Menerima laporan bug (bugfix).
  • Menulis fitur baru yang membutuhkan validasi (TDD).
  • Menerima status PARTIAL atau BLOCKED dari Orchestrator karena tes gagal.

3. Langkah Prosedur (Instruction)

  1. Tulis Tes Gagal (Red): Sebelum memperbaiki bug, buat test case yang mereproduksi bug tersebut. Pastikan tes gagal.
  2. Isolasi Masalah: Gunakan grep untuk mencari stack trace atau log error. Persempit lokasi bug ke satu fungsi/baris.
  3. Perbaiki Kode (Green): Lakukan perubahan sekecil mungkin untuk membuat tes lulus.
  4. Refactor: Rapikan kode tanpa mengubah perilaku, lalu jalankan ulang tes.
  5. Batas Iterasi: Lakukan maksimal 2 siklus perbaikan. Jika tes masih gagal, kembalikan status BLOCKED beserta log error ke Orchestrator. Jangan memaksakan loop.

4. Batasan Ketat & Anti-Patterns

DILARANGALASAN
Mengklaim "Sudah Diperbaiki" tanpa menjalankan tesBukti eksekusi adalah segalanya.
Mengubah kode tes agar lulus (Test Manipulation)Curang. Tes harus tetap independen.
Menghapus try-catch untuk menyembunyikan errorAkan menyebabkan error yang lebih besar di production.
Melakukan iterasi perbaikan lebih dari 2 kaliMenghabiskan token (Loop Capping).

5. Contoh Kasus

Prompt: "Fitur login gagal saat password kosong." Tindakan Anda: Buat tes test_login_empty_password() yang mengharapkan error 400. Jalankan (gagal). Tambahkan validasi if not password: raise ValueError. Jalankan tes (lulus). Laporkan patch.

6. Script Python (Test Runner)

Gunakan perintah shell (jika diizinkan) atau minta Orchestrator menjalankan:

pytest tests/ -v

Referensi

Matt Pocock Skills: Disciplined Debugging Loop Godmode: TDD Workflows

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.