remove-ai-slops
Fungsinya
Alat ini menghapus kode 'gemuk' atau tidak perlu yang dihasilkan oleh kecerdasan buatan dalam perubahan kode Anda. Alat ini melakukannya dengan aman, memastikan program tetap berfungsi seperti sebelumnya.
Kapan dipakai
- βSaat Anda meminta untuk 'membersihkan' atau 'menghapus kode yang tidak perlu' dari sebuah pembaruan.
- βSetelah menggunakan AI untuk membuat kode dan ingin meninjaunya.
- βUntuk memastikan kode buatan AI mengikuti praktik terbaik.
Link skill
https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/shared-skills/skills/remove-ai-slops/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
βBersihkan kode buatan AI di commit terbaru saya.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Alat ini pertama-tama membuat tes untuk memastikan kode berfungsi. Lalu, alat ini menganalisis dan menghapus pola kode yang dianggap 'gemuk' oleh AI. Terakhir, alat ini memeriksa ulang dengan tes untuk memastikan tidak ada yang rusak.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Remove AI Slops Skill
Inputs
- Default scope: branch diff vs
merge-base main(no arguments needed) - Optional scope: explicit file list passed by the caller (e.g., a Ralph workflow's changed-files set)
What this skill does
Cleans AI-generated slop from a bounded set of changed files while strictly preserving behavior. Locks behavior with regression tests first, then runs a categorized multi-pass cleanup, then verifies with quality gates and a critical review. Reverts and direct-edits when verification fails.
The core safety invariant: behavior is locked by green tests before a single line is removed. A checklist alone is not safety; a passing regression test is.
Categories (what counts as slop)
The agent looks for these nine categories. The first three are stylistic, the next three are structural, the next two are about hidden cost, and the last is about behavior coverage.
Stylistic
Obvious comments β comments restating code, trivial docstrings, section dividers, commented-out code, vague TODOs/Notes.
- KEEP: comments explaining WHY (business logic, edge cases, workarounds), ticket links, regex/algorithm explanations.
- KEEP: BDD markers (
# given,# when,# then,# when/then).
Over-defensive code β null checks for guaranteed values, try/except around code that cannot raise, isinstance checks for statically typed params, default values for required params, backward-compat shims, redundant validation duplicated at multiple layers, broad exception catching (
except Exception/except BaseExceptionin Python, emptycatch {}orcatch (e) { console.error(e) }without narrowing in TypeScript/JavaScript).- KEEP: validation at system boundaries (user input, external APIs), I/O error handling, nullable DB fields. Top-level boundary catch-all (CLI
main(), HTTP handler) with explicit logging + re-raise is acceptable. - REFACTOR:
except Exceptionβ catch the specific exception you expect. Emptycatch {}β addinstanceofnarrowing or re-throw.catch (e) { log(e) }β narrow withinstanceof, handle known cases, re-throw unknown. - PROOF REQUIRED: before deleting any validation or error handling at a trust boundary, Phase 2 must include an adversarial regression (malformed or hostile input) that fails if the guard is removed. No adversarial test β the guard stays. Redundant defense to remove is a duplicate of a check that already runs inside the boundary; a guard with no proof of redundancy is load-bearing.
- KEEP: validation at system boundaries (user input, external APIs), I/O error handling, nullable DB fields. Top-level boundary catch-all (CLI
Excessive complexity β deep nesting (>3 levels), nested ternaries, complex boolean expressions (combine 4+ predicates), long parameter lists (>5 args without a struct/dataclass/object), god functions (>50 lines doing many things), overly clever one-liners that sacrifice readability,
if/elif/elsechains for type/enum/literal discrimination (must bematch/case+assert_never),objectused as a type annotation (must beProtocol,TypeVar, or explicit union).- KEEP: established complexity patterns in this codebase, performance-critical hot paths that intentionally use a complex idiom.
if/elsefor boolean conditions and range checks (not variant discrimination). - REFACTOR: nested if-chains β guard clauses / early returns. Complex ternaries β explicit if/else. isinstance/enum if/elif chains β
match/casewithassert_neveron the wildcard.objectannotations βProtocol(structural),TypeVar(generic), or union (known variants).
- KEEP: established complexity patterns in this codebase, performance-critical hot paths that intentionally use a complex idiom.
Structural
Needless abstraction β pass-through wrappers, single-use helpers, speculative indirection ("we might need this later"), interfaces with one implementer where the interface adds no testability win, factory functions that just call a constructor.
- KEEP: abstractions that provide a real seam (testability, multiple implementers, framework-required boundaries).
Boundary violations β wrong-layer imports (UI importing DB driver), leaky responsibilities (handler doing business logic that belongs in a service), hidden coupling (module A reads module B's private state), side effects in pure-named functions.
- KEEP: pragmatic short-circuits already established as a pattern in this codebase. Flag for human judgment if unsure.
Dead code β unused imports, unused private functions/methods, unreachable branches, stale feature flags, debug leftovers (
console.log,print(...),dbg!), removed-but-still-referenced code.
β¦
Pertanyaan umum
Apa itu 'AI slop'?
Ini adalah pola kode yang kadang dihasilkan AI dan kurang ideal, seperti komentar yang terlalu jelas, kode yang berlebihan dalam antisipasi error, atau kerumitan yang tidak perlu.
Apakah alat ini bisa merusak kode saya?
Tidak, alat ini dirancang agar aman. Alat hanya menghapus kode setelah tes memastikan perilaku program tidak berubah.
Apakah alat ini menghapus komentar yang berguna?
Tidak. Alat tetap mempertahankan komentar yang menjelaskan 'mengapa' sesuatu dilakukan, tautan tiket, atau penjelasan algoritma yang kompleks. Hanya komentar yang sekadar mengulang kode yang akan dihapus.
Detail
Deskripsi asli dari pembuat
Removes AI-generated code smells from branch changes or an explicit file list behind regression tests. Use when the user asks to clean up, deslop, or remove AI-slop patterns from recent changes.
Popularitas
- Bintang GitHub
- 70k
- Peringkat
- #3138
- Lisensi
- NOASSERTION
- Diperbarui
- 15/10/2026
Komentar
- β¦
Skill lain dari repositori ini
comment-checker
70kMembantu agent Anda memahami dan menanggapi feedback dari pengecek komentar otomatis. Berguna untuk memproses hasil review kode atau konten otomatis.
lcx-contribute-bug-fix
70kMembantu agent Anda berkontribusi dalam perbaikan bug untuk proyek terkait LazyCodex. Agent membuat issue atau pull request untuk menjaga kualitas kode.
lcx-doctor
70kMemungkinkan agent Anda mengecek kesehatan instalasi LazyCodex dan Codex CLI. Berguna saat sistem berperilaku aneh setelah update atau perubahan.
lcx-report-bug
70kMembantu agent Anda melaporkan bug secara detail untuk proyek LazyCodex. Agent membuat issue berisi informasi yang berguna agar developer bisa memperbaiki masalahnya.
Skill serupa
diffs
394kMemungkinkan agent Anda menghasilkan diff perubahan yang nyata dan dapat dibagikan sebagai tautan viewer atau file gambar, bukan ringkasan yang ditulis manual.
coding-agent
394kMembantu agent Anda menyerahkan pekerjaan pemrograman besar ke Codex, Claude Code, atau OpenCode di latar belakang, lalu memeriksa kemajuannya.
gh-issues
394kMembantu agent Anda menemukan issue GitHub, memilih yang dikerjakan, dan membuka pull request perbaikan, termasuk tindak lanjut komentar tinjauan.