Skill python-code-review
Meninjau kode Python untuk kepatuhan PEP8, type safety, pola asynchronous, error handling, dan kesalahan coding umum.
- Bintang GitHub
- 87
- File
- 6
- Commit terakhir
- 15 Sep 2026
- Lisensi
- Apache-2.0
- Tool yang diizinkan
- —
Apa fungsi skill python-code-review?
python-code-review adalah agent skill. Meninjau kode Python untuk kepatuhan PEP8, type safety, pola asynchronous, error handling, dan kesalahan coding umum.
Ringkasan dibuat dari SKILL.md skill ini.
Tentang skill python-code-review
Skill ini memungkinkan Anda untuk menganalisis file Python guna memastikan ketepatan struktur dan gaya penulisannya. Developer dapat menggunakannya untuk mengaudit file .py terhadap kepatuhan PEP8, type safety, dan pola asynchronous yang benar. Saat agent memuat skill ini, ia akan memeriksa kode berdasarkan file referensi spesifik seperti pep8-style.md, type-safety.md, dan async-patterns.md untuk memastikan implementasi berkualitas tinggi.
Tool ini mengidentifikasi masalah seperti blocking calls dalam fungsi async, type hints yang hilang, atau penanganan exception yang tidak tepat. Tool ini mampu membedakan antara error yang sebenarnya dengan pola yang valid, seperti penggunaan Any untuk library tanpa tipe atau penggunaan komentar noqa. Prosesnya mengikuti workflow pelaporan yang ketat yang mengharuskan verifikasi temuan terhadap aturan berbasis konteks serta protokol verifikasi wajib sebelum menyajikan hasil.
Dengan memeriksa mutable default arguments, pengelompokan import yang benar, dan konvensi penamaan yang tepat, skill ini membantu menjaga codebase tetap profesional. Tool ini menghasilkan laporan mendetail yang mencakup path file spesifik dan nomor baris untuk setiap masalah yang ditemukan.
Apa yang bisa dilakukan agent dengannya
- 1Audit kepatuhan PEP8Memeriksa apakah file Python mengikuti standar indentasi, panjang baris, dan konvensi penamaan.
- 2Verifikasi type safetyMemastikan semua parameter fungsi dan tipe return memiliki type hints yang sesuai.
- 3Deteksi bottleneck asyncMengidentifikasi blocking calls seperti time.sleep atau requests di dalam fungsi asynchronous.
Ditulis dari SKILL.md milik skill tersebut. Setiap use case diverifikasi dengan kutipan darinya.
Cara install skill python-code-review
Setiap perintah menyalin folder skill ke direktori skills client. Restart client atau mulai sesi baru untuk memuatnya.Install skill python-code-review di Plugin
/plugin marketplace add existential-birds/beagle /plugin install beagle-python@existential-birds
Install skill python-code-review di Claude Code
~/.claude/skills/python-code-review/SKILL.md
$ npx degit existential-birds/beagle/plugins/beagle-python/skills/python-code-review ~/.claude/skills/python-code-reviewInstall skill python-code-review di Claude Code (project)
.claude/skills/python-code-review/SKILL.md
$ npx degit existential-birds/beagle/plugins/beagle-python/skills/python-code-review .claude/skills/python-code-reviewInstall skill python-code-review di Codex
~/.agents/skills/python-code-review/SKILL.md
$ npx degit existential-birds/beagle/plugins/beagle-python/skills/python-code-review ~/.agents/skills/python-code-reviewInstall skill python-code-review di Gemini CLI
~/.gemini/skills/python-code-review/SKILL.md
$ npx degit existential-birds/beagle/plugins/beagle-python/skills/python-code-review ~/.gemini/skills/python-code-reviewInstall skill python-code-review di Claude.ai
npx degit existential-birds/beagle/plugins/beagle-python/skills/python-code-review python-code-review && zip -r python-code-review.zip python-code-review # claude.ai → Customize → Skills → + → Create skill → Upload a skill → python-code-review.zip
SKILL.md
Lihat di GitHubPython Code Review
Quick Reference
| Issue Type | Reference |
|---|---|
| Indentation, line length, whitespace, naming | references/pep8-style.md |
| Missing/wrong type hints, Any usage | references/type-safety.md |
| Blocking calls in async, missing await | references/async-patterns.md |
| Bare except, missing context, logging | references/error-handling.md |
| Mutable defaults, print statements | references/common-mistakes.md |
Review Checklist
PEP8 Style
- 4-space indentation (no tabs)
- Line length ≤79 characters (≤72 for docstrings/comments)
- Two blank lines around top-level definitions, one within classes
- Imports grouped: stdlib → third-party → local (blank line between groups)
- No whitespace inside brackets or before colons/commas
- Naming:
snake_casefor functions/variables,CamelCasefor classes,UPPER_CASEfor constants - Inline comments separated by at least two spaces
Type Safety
- Type hints on all function parameters and return types
- No
Anyunless necessary (with comment explaining why) - Proper
T | Nonesyntax (Python 3.10+)
Async Patterns
- No blocking calls (
time.sleep,requests) in async functions - Proper
awaiton all coroutines
Error Handling
- No bare
except:clauses - Specific exception types with context
-
raise ... fromto preserve stack traces
Common Mistakes
- No mutable default arguments
- Using
loggernotprint()for output - f-strings preferred over
.format()or%
Valid Patterns (Do NOT Flag)
These patterns are intentional and correct - do not report as issues:
- Type annotation vs type assertion - Annotations declare types but are not runtime assertions; don't confuse with missing validation
- Using
Anywhen interacting with untyped libraries - Required when external libraries lack type stubs - Empty
__init__.pyfiles - Valid for package structure, no code required noqacomments - Valid when linter rule doesn't apply to specific case- Using
cast()after runtime type check - Correct pattern to inform type checker of narrowed type
Context-Sensitive Rules
Only flag these issues when the specific conditions apply:
| Issue | Flag ONLY IF |
|---|---|
| Generic exception handling | Specific exception types are available and meaningful |
| Unused variables | Variable lacks _ prefix AND isn't used in f-strings, logging, or debugging |
Gates (reporting workflow)
Complete in order. Do not advance until each pass condition is met.
- Scope — Pass: You list every
.pypath (or explicit glob) you inspected this run. - False-positive screen — Pass: For each issue you plan to report, you checked Valid Patterns and Context-Sensitive Rules above; you drop or narrow the finding if those sections say not to flag it.
- Evidence — Pass: Each remaining finding includes
[FILE:LINE](or a bounded line range). Symbols or short verbatim snippets may supplement the location anchor but do not replace it. - Verification protocol — Pass: You load review-verification-protocol and complete its mandatory steps for each reported issue before the user-facing write-up.
- Ship — Pass: The user-visible output matches whatever structure that protocol requires (no issues-only dump that skips its checks).
When to Load References
- Reviewing code formatting/style → pep8-style.md
- Reviewing function signatures → type-safety.md
- Reviewing
async deffunctions → async-patterns.md - Reviewing try/except blocks → error-handling.md
- General Python review → common-mistakes.md
Review Questions
- Does the code follow PEP8 formatting (indentation, line length, whitespace)?
- Are imports properly grouped (stdlib → third-party → local)?
- Do names follow conventions (snake_case, CamelCase, UPPER_CASE)?
- Are all function signatures fully typed?
- Are async functions truly non-blocking?
- Do exceptions include meaningful context?
- Are there any mutable default arguments?
Before reporting: complete Gates (reporting workflow) above (especially gate 4).
Berkas dalam skill ini
6Pertanyaan seputar skill python-code-review
Bagaimana cara install skill python-code-review di Claude Code?
Jalankan npx degit existential-birds/beagle/plugins/beagle-python/skills/python-code-review ~/.claude/skills/python-code-review. Claude Code memuat skill dari ~/.claude/skills (semua proyek) atau .claude/skills (satu proyek) dan menggunakan skill saat deskripsinya cocok dengan tugas.
Client mana saja yang bisa menggunakan skill python-code-review?
Client apa pun yang membaca format Agent Skills: Claude Code, Codex, Gemini CLI, dan claude.ai (unggah sebagai ZIP). Script dalam skill hanya berjalan di client yang mengizinkan eksekusi kode.
Panduan gaya Python spesifik apa yang diikuti oleh skill ini?
Skill ini mengikuti standar PEP8 untuk indentasi, panjang baris, whitespace, dan konvensi penamaan.
Kapan penggunaan type hint 'Any' diperbolehkan?
Penggunaan 'Any' diperbolehkan saat berinteraksi dengan library tanpa tipe (untyped) yang tidak memiliki type stubs, namun sebaiknya disertai dengan komentar yang menjelaskan alasannya.