python-code-review Skill
Überprüft Python-Code auf PEP8-Konformität, Typsicherheit, asynchrone Patterns, Error Handling und gängige Programmierfehler.
- GitHub Stars
- 87
- Dateien
- 6
- Letzter Commit
- 15. Sept. 2026
- Lizenz
- Apache-2.0
- Erlaubte Tools
- —
Was macht der python-code-review Skill?
python-code-review ist ein Agent Skill. Überprüft Python-Code auf PEP8-Konformität, Typsicherheit, asynchrone Patterns, Error Handling und gängige Programmierfehler.
Zusammenfassung erzeugt aus der SKILL.md des Skills.
Über den python-code-review skill
Dieser Skill ermöglicht die Analyse von Python-Dateien auf strukturelle und stilistische Korrektheit. Entwickler nutzen ihn, um .py-Dateien auf PEP8-Konformität, Typsicherheit und korrekte asynchrone Patterns zu prüfen. Wenn ein Agent diesen Skill lädt, gleicht er den Code mit spezifischen Referenzdateien wie pep8-style.md, type-safety.md und async-patterns.md ab, um eine hochwertige Implementierung sicherzustellen.
Das Tool identifiziert Probleme wie blockierende Aufrufe in async-Funktionen, fehlende Type Hints oder unpassendes Exception Handling. Es unterscheidet zwischen echten Fehlern und validen Patterns, wie etwa der Verwendung von Any für untypisierte Libraries oder dem Einsatz von noqa-Kommentaren. Der Prozess folgt einem strikten Reporting-Workflow, der eine Überprüfung der Ergebnisse gegen kontextsensitive Regeln und ein obligatorisches Verifizierungsprotokoll erfordert, bevor die Resultate präsentiert werden.
Durch das Prüfen von veränderlichen Default-Argumenten (mutable default arguments), korrekter Import-Gruppierung und richtiger Namenskonventionen hilft es dabei, eine professionelle Codebase aufrechtzuerhalten. Es erstellt detaillierte Reports, die für jedes identifizierte Problem die spezifischen Dateipfade und Zeilennummern enthalten.
Was ein agent damit machen kann
- 1PEP8-Konformität prüfenÜberprüfen, ob eine Python-Datei die Standard-Einrückung, Zeilenlänge und Namenskonventionen einhält.
- 2Typsicherheit verifizierenSicherstellen, dass alle Funktionsparameter und Rückgabetypen über angemessene Type Hints verfügen.
- 3Async-Bottlenecks erkennenBlockierende Aufrufe wie time.sleep oder requests innerhalb von asynchronen Funktionen identifizieren.
Geschrieben basierend auf dem SKILL.md des skills. Jeder use case wurde gegen ein zitat daraus geprüft.
So installierst du den python-code-review Skill
Jeder Befehl kopiert den Skill-Ordner in das Skills-Verzeichnis des Clients. Starte den Client neu oder beginne eine neue Session, um ihn zu laden.Den python-code-review Skill in Plugin installieren
/plugin marketplace add existential-birds/beagle /plugin install beagle-python@existential-birds
Den python-code-review Skill in Claude Code installieren
~/.claude/skills/python-code-review/SKILL.md
$ npx degit existential-birds/beagle/plugins/beagle-python/skills/python-code-review ~/.claude/skills/python-code-reviewDen python-code-review Skill in Claude Code (project) installieren
.claude/skills/python-code-review/SKILL.md
$ npx degit existential-birds/beagle/plugins/beagle-python/skills/python-code-review .claude/skills/python-code-reviewDen python-code-review Skill in Codex installieren
~/.agents/skills/python-code-review/SKILL.md
$ npx degit existential-birds/beagle/plugins/beagle-python/skills/python-code-review ~/.agents/skills/python-code-reviewDen python-code-review Skill in Gemini CLI installieren
~/.gemini/skills/python-code-review/SKILL.md
$ npx degit existential-birds/beagle/plugins/beagle-python/skills/python-code-review ~/.gemini/skills/python-code-reviewDen python-code-review Skill in Claude.ai installieren
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
Auf GitHub ansehenPython 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).
Dateien in diesem Skill
6python-code-review Skill-Fragen
Wie installiere ich den python-code-review Skill in Claude Code?
Führe npx degit existential-birds/beagle/plugins/beagle-python/skills/python-code-review ~/.claude/skills/python-code-review aus. Claude Code lädt Skills aus ~/.claude/skills (alle Projekte) oder .claude/skills (ein Projekt) und nutzt einen Skill, wenn seine Beschreibung zur Aufgabe passt.
Welche Clients können den python-code-review Skill nutzen?
Jeder Client, der das Agent Skills-Format liest: Claude Code, Codex, Gemini CLI und claude.ai (als ZIP hochladen). Skripte im Skill laufen nur dort, wo der Client Codeausführung erlaubt.
Welchem spezifischen Python-Styleguide folgt dieser Skill?
Der Skill folgt den PEP8-Standards für Einrückung, Zeilenlänge, Whitespace und Namenskonventionen.
Wann ist es akzeptabel, den 'Any' Type Hint zu verwenden?
Die Verwendung von 'Any' ist akzeptabel, wenn man mit untypisierten Libraries interagiert, für die keine Type Stubs vorhanden sind; dies sollte jedoch durch einen Kommentar ergänzt werden, der den Grund erklärt.