/python-clean-architecture:review-architecture pathfrom python-clean-architecture
Reviews Python code against Clean Architecture principles — checks layer separation, design rules, Pythonic patterns, and refactoring opportunities. Supports standard and in-depth review depths.
Ships in python-clean-architecture. Installing the plugin adds it to Claude Code.
Before starting the review, use AskUserQuestion to ask: "Which review depth?" with these options:
Then review the code at $ARGUMENTS (or the current working directory if no path given) against Python Clean Architecture principles.
Read the code — Find and read ALL Python files in the target path recursively. Read every .py file — do not skip any. Understand the project structure, imports, and relationships between files.
Check architecture layers — Verify the three-layer separation:
DataInterface Protocol, not concrete DB classesCheck the 7 design principles — For each file/class/function, evaluate:
Check code quality — Apply the 22 design rules:
Check Pythonic patterns — Are patterns implemented the Pythonic way?
Check code cleanup opportunities — Look for concrete refactoring targets:
Report findings — Structure the output in this order:
Classify every Python file into a layer, then show the dependency flows. Use a simple vertical list format — never multi-column ASCII art. Example:
Layers
──────
API: routers/booking.py, routers/customer.py
Logic: operations/booking.py, operations/customer.py
Database: db/db_interface.py, db/models.py, db/database.py
Unclear: utils/helpers.py (mixed concerns)
Dependency Flows
────────────────
routers/booking.py → operations/booking.py → db/db_interface.py ✓
routers/customer.py → operations/customer.py → db/db_interface.py ✓
routers/admin.py → db/models.py ⚠ layer skip
Layer Violations
────────────────
⚠ routers/admin.py imports db/models.py directly — should go through operations
Adapt to the actual project. If it does not follow the three-layer model, show the dependency flow as-is and note what a target architecture would look like. Keep it compact — group similar flows rather than listing every file individually if there are many.
Call out specific things the code does right. Reference files and patterns. Examples:
This section builds trust and avoids a purely negative tone. Be specific — cite actual files and lines, not generic praise.
Present issues organized by severity:
For each finding, include all of the following:
Prioritize actionable cleanup suggestions over architectural observations.
If the user chose in-depth, load the following reference files for deeper analysis with detailed refactoring recipes and pattern guidance:
${CLAUDE_PLUGIN_ROOT}/skills/clean-architecture/references/design-principles.md${CLAUDE_PLUGIN_ROOT}/skills/clean-architecture/references/code-quality.md${CLAUDE_PLUGIN_ROOT}/skills/clean-architecture/references/error-handling.md${CLAUDE_PLUGIN_ROOT}/skills/clean-architecture/references/pythonic-patterns.mdFor detailed pattern guidance (when explaining HOW to fix), consult the relevant files in ${CLAUDE_PLUGIN_ROOT}/skills/clean-architecture/references/patterns/.
If the user chose standard, use only the checklists above — do not load reference files.
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub mktoronto/python-clean-architecture --plugin python-clean-architecture13 commands in this plugin
/add-endpointScaffold a new endpoint across all three architecture layers/check-qualityQuick code quality check against the 22 design rules/decoupleFind tight coupling and suggest dependency injection improvements/diagnose-smellsDetect code smells and anti-patterns with fix suggestions/extract-god-classFind and split god classes into focused collaborators/learn-architectureLearn an architecture or design topic — theory, the Pythonic way, and how it applies in your codeOther plugins' commands for the same job