coding-python-clean-architecturelisted
Install: claude install-skill bitranox/bitranox-skills
# Layered Architecture for Python
## Overview
Framework-agnostic, typed Python architecture optimized for **change**, **testability**, and **clear boundaries**. Inner layers never import from outer layers. Domain stays pure.
**Primary goal:** Keep the cost of change low over the lifetime of the system. Business logic should be easy to understand, test, and evolve independently of infrastructure choices.
**Target:** Python >=3.10 | Typed | Pure domain | Framework-agnostic core | No compatibility shims
## When to Use
- Starting a new Python project that needs long-term maintainability
- Reviewing existing code for architecture violations (imports crossing layers)
- Deciding where a new class/function belongs (domain vs application vs adapter)
- Structuring data flow between external inputs, domain logic, and outputs
- Setting up testing strategy with proper isolation
- Implementing reliability patterns (UoW, outbox, idempotency)
- Refactoring framework-centric code to layered architecture
**When NOT to use:**
- Projects already using a different established architecture
**Single-file scripts and throwaway prototypes stay in this skill** - they route to SCRIPT mode
(see `script-mode.md` and the mode-selection table below), one of this skill's four operating
modes. Do not drop the skill for them.
**Capability check (REVIEW / judgment).** Spotting architecture/layer violations and the
true-vs-accidental-duplication call is capability-sensitive - a weaker model misjudges i