clean-code-guard
Fungsinya
AI agent ini memeriksa kode program Anda untuk memastikan kode tersebut mengikuti praktik penulisan yang baik, seperti jelas, terorganisir, dan mudah dipahami. Tool ini membantu mencegah kesalahan umum yang bisa muncul saat kode dibuat secara otomatis.
Kapan dipakai
- βSetelah AI menghasilkan sepotong kode.
- βSebelum mengirim atau menyimpan kode yang Anda atau AI ubah.
- βSaat Anda ingin meninjau kualitas kode yang sudah ada.
Link skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/clean-code-guard/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
βTinjau kode ini untuk memastikan kode tersebut mengikuti praktik terbaik.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent ini membandingkan kode Anda dengan serangkaian aturan kualitas, seperti nama yang jelas dan fungsi yang kecil. Jika menemukan bagian yang tidak sesuai dengan aturan, agent akan memberikan saran atau melakukan perbaikan.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
clean-code-guard
You are reviewing generated or changed code before it ships. Apply the rules below as a guard pass after the first implementation pass β and once this skill is active, keep applying it to every later code change in the same session, re-running the self-check before delivery after each edit rather than reverting to unguarded output because the skill loaded earlier. If the user explicitly invokes this skill before writing code, use the same rules while writing and still run the self-check before delivery.
When to Use
Use this skill when reviewing generated or changed code before it ships. Activate it reactively after an agent writes, edits, or refactors production code β especially after a first implementation pass. Re-run the guard pass before delivery after each edit.
Compatibility
This is a portable instruction skill. It requires no MCP server, network access,
API key, shell command, local executable, or bundled script. It can be used in
any runtime that supports SKILL.md plus directly linked references/
files; agents/openai.yaml is lightweight display metadata.
This skill does not replace project linters, formatters, type checkers, or test runners. Use the project's own tools for mechanical verification; use this skill for the judgement layer around code quality and review.
How to use this skill
This skill has three modes β pick based on the user's request.
Guard-pass mode (recommended): after code has been generated, edited, refactored, or fixed, check the diff or target files against the Always-applied imperatives below. Fix violations before presenting, committing, or merging the work.
Live mode (explicit): when the user invokes this skill before a risky code edit, apply the same imperatives while writing, then run the Self-check before delivery checklist. If you violate any rule, fix it before showing the user.
Review mode (triggered when the user asks you to review, audit, critique, or rate code): walk references/review-checklist.md against the target file(s) and produce a structured findings report. Do not edit code in review mode unless asked.
Across all three modes, the rule bodies live in references/. Read the relevant reference file when:
- You hit a rule you don't fully remember the reasoning for.
- The user pushes back on a rule and you need the source citation.
- You're in review mode and need the full checklist.
- The code under review touches a specific principle (e.g., subclassing β references/solid.md; deduplication β references/dry-kiss-yagni.md).
The reference files are:
- references/naming-and-functions.md β names, function size, parameters, command/query separation.
- references/comments-and-formatting.md β when to comment, when to delete, matching neighbor style.
- references/solid.md β SRP, OCP, LSP, ISP, DIP with the modern phrasings and detection smells.
- references/dry-kiss-yagni.md β knowledge vs code duplication, Sandi Metz's re-inline rule, McCabe complexity, Fowler's YAGNI cost categories.
- references/ai-failure-modes.md β the 14 systematic ways LLMs produce bad code. Read this one first if you are an AI agent reading this skill. It is the highest-leverage file in the skill.
- references/review-checklist.md β structured walk-through for review mode.
- references/sources.md β central bibliography for source URLs. Read it only when you need to verify or cite an external source.
Examples
- A coding agent implements an endpoint: use guard-pass mode on the diff before the work is presented or committed.
- User asks "review this PR" or "should I merge this?": use review mode and report findings from references/review-checklist.md; do not edit unless asked.
- User asks "implement this endpoint using clean-code-guard": use live mode while writing, then run the self-check before delivery.
- User asks "refactor this function, same behavior": preserve observable behavior exactly and treat any bug fix as a separate change.
Success criteria
This skill is working when code-writing tasks avoid the listed failure modes,
β¦
Pertanyaan umum
Apa yang dimaksud dengan 'praktik terbaik' dalam kode?
Ini seperti aturan emas dalam menulis kode agar lebih mudah dibaca, dipahami, dan dirawat oleh programmer lain (atau oleh Anda sendiri di masa depan).
Mengapa saya membutuhkan ini jika AI sudah menulis kodenya?
Bahkan AI bisa membuat kesalahan atau menulis kode yang kurang ideal. Agent ini memastikan kode yang dihasilkan berkualitas tinggi dan menghindari masalah umum.
Apakah ini menggantikan tool pengecekan kode lainnya?
Tidak, tool ini melengkapi tool lain. Fokusnya pada kualitas dan kejelasan kode, sedangkan tool lain mungkin memeriksa kesalahan sintaksis atau masalah keamanan.
Detail
Deskripsi asli dari pembuat
Review generated or changed production code with Clean Code, SOLID, DRY, KISS, YAGNI, and LLM-specific failure-mode checks.
Popularitas
- Bintang GitHub
- 48k
- Peringkat
- #4150
- Lisensi
- MIT
- Diperbarui
- 15/10/2026
Komentar
- β¦
Skill lain dari repositori ini
00-andruia-consultant
48kMembantu agent Anda memulai atau meningkatkan proyek AI. Agent menganalisis kode, menyarankan tools, dan membuat rencana aksi dalam bahasa Spanyol.
007
48kMemungkinkan agent Anda melakukan audit keamanan dan threat modeling. Berguna untuk melindungi proyek dari serangan dan celah keamanan.
10-andruia-skill-smith
48kMembantu agent Anda membuat atau meningkatkan tools AI. Agent mendefinisikan cara kerja tools, menulis dokumentasi, dan memvalidasi strukturnya.
20-andruia-niche-intelligence
48kMemungkinkan agent Anda membuat ringkasan industri tertentu. Berguna untuk memahami konteks, aturan, pola penggunaan, dan risiko proyek dengan sumber terpercaya.
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.