ai-debt-detector
Fungsinya
Detektor 'utang' AI ini memeriksa kode yang dibuat AI untuk mencari masalah umum yang biasanya dihindari oleh manusia. Detektor ini mencari kegagalan, resource yang tidak dibersihkan, dependensi yang tidak ada, dan penyimpangan dari standar proyek.
Kapan dipakai
- ✓Setelah AI menghasilkan kode.
- ✓Sebelum menerima saran AI atau menggabungkan kode dari AI.
- ✓Saat kode sudah berjalan tetapi terasa tidak stabil atau belum lengkap.
Link skill
https://github.com/wshobson/agents/blob/main/plugins/skill-forge-essentials/skills/ai-debt-detector/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
“Pindai kode hasil AI ini untuk mencari kegagalan, orphaned resource, dan dependensi yang tidak ada.”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Detektor ini menganalisis kode untuk mencari pola tertentu yang sering keliru dibuat AI, seperti tidak adanya penanganan error, resource yang tidak dilepas, dan package yang tidak ada. Tujuannya adalah memastikan kode kuat dan aman.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
AI Debt Detector
Overview
AI agents generate code that passes the happy path but hides debt: missing error handling, orphaned resources, ignored failure modes, hallucinated packages, silent architectural drift. This skill forces a targeted audit for the exact patterns AI agents get wrong.
When to Use
- After any AI code generation session (20+ lines produced)
- Before merging AI-generated PRs
- When code works but something feels off
- After vibe-coding sprints where debt accumulates fastest
- When the agent claims done without showing verification
Process
After code generation, scan for these AI-specific debt patterns:
FAILURE MODES - What happens when this fails?
- Network timeout? Disk full? Permission denied? Null input?
- Is there a try/catch? Does it catch SPECIFIC errors or swallow everything?
- Are resources cleaned up on failure? (streams closed, connections returned, temp files deleted)
ORPHANS - What gets created but never cleaned up?
- Temp files, event listeners, intervals, subscriptions, connections
- Are there corresponding cleanup/dispose/close calls for every open/create?
- In React: does every addEventListener have a removeEventListener in cleanup?
EDGE CASES - What inputs break this?
- Empty array/string? null/undefined? Multi-MB input? Unicode? Concurrent calls?
- Does the code assume the happy path? (AI almost always does)
HALLUCINATED DEPS - Do all imports actually exist?
- Is every package in package.json/requirements.txt?
- Are API methods real? (AI invents plausible-sounding methods that don't exist)
- Does this library's latest version still export this function?
ARCHITECTURAL DRIFT - Does this match the project's patterns?
- Same error handling style as existing code?
- Uses the project's established utilities (not reinventing)?
- Follows the file structure convention?
Red Flags (stop and fix immediately)
catch (e) {}orcatch (e) { console.log(e) }- swallowed error- No
finallyblock when resources were opened // TODO: handle error- AI's way of punting- Import from a path that doesn't exist in the project
- Timeout set but no abort/cleanup on timeout
- Database connection opened but never released back to pool
Common Mistakes
- Trusting that compilation means correctness (compilation checks syntax, not logic)
- Reviewing only the diff without checking what the AI did NOT generate (missing error paths)
- Assuming the AI used the right library version (it often uses deprecated APIs)
- Skipping the orphan check because garbage collection handles it (it doesn't for connections, listeners, timers)
Why This Exists
AI agents systematically optimize for "looks correct" and "passes the happy path." They miss failure modes, orphan resources, and hallucinate dependencies at rates significantly higher than manual code. This skill forces an audit for those specific blind spots.
Pertanyaan umum
Mengapa saya perlu memeriksa kode AI?
AI bagus dalam membuat kode yang berjalan dalam kondisi ideal, tetapi bisa lupa menangani error, melepas resource, atau menggunakan package yang benar. Hal ini menciptakan 'utang' yang bisa menimbulkan masalah di kemudian hari.
Apa itu 'orphaned resource'?
Itu adalah sesuatu yang dibuat oleh kode (seperti koneksi jaringan atau file sementara) tetapi tidak ditutup atau dihapus setelah digunakan, sehingga bisa terus memakai resource sistem.
Apa itu 'failure mode'?
Itu adalah situasi ketika kode bisa gagal (misalnya error jaringan atau input yang tidak valid) dan bagaimana kode merespons kegagalan tersebut. Kode yang baik sudah memiliki rencana untuk menangani situasi seperti ini.
Detail
Deskripsi asli dari pembuat
Use after generating code, after accepting AI suggestions, or when reviewing AI-written modules. Also use when code works but feels brittle, when error handling seems thin, when orphaned resources or missing cleanup are suspected, or when the agent claims done but hidden debt may exist. Catches the specific failure patterns AI agents produce that humans would not.
repo: wshobson/agents
Popularitas
- Bintang GitHub
- 41k
- Peringkat
- #6788
- Lisensi
- MIT
- Diperbarui
- 15/10/2026
Komentar
- …
Skill lain dari repositori ini
screen-reader-testing
41kMeminta agent Anda menguji website menggunakan screen reader untuk memastikan website dapat diakses.
wcag-audit-patterns
41kMembantu agent Anda mengaudit aksesibilitas website dan memperbaiki masalah sesuai panduan WCAG.
multi-reviewer-patterns
41kMemungkinkan agent Anda mengoordinasikan code review paralel, menghapus temuan ganda, dan menggabungkan laporan.
parallel-debugging
41kMemungkinkan agent Anda men-debug masalah rumit dengan investigasi paralel dan analisis akar masalah.
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.