architecture-python
Python architecture: PEP-8, type hints, clean layering, dependency injection, and testing strategy
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Python architecture: PEP-8, type hints, clean layering, dependency injection, and testing strategy
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Architecture decisions: layering, design patterns, microservices trade-offs, and domain-driven design
General code review process: priority ordering, what to block on, how to give actionable feedback
Python data science: notebook structure, data validation, reproducibility, and model documentation
Git workflow: branch naming, conventional commits, PR conventions, and merge strategies
TypeScript refactoring: SOLID principles, DRY, type safety improvements, and eliminating code smells
Security checklist: OWASP top 10, secret scanning, input validation, and auth patterns
| name | architecture-python |
| description | Python architecture: PEP-8, type hints, clean layering, dependency injection, and testing strategy |
In addition to general architecture principles, apply these Python-specific patterns:
ruff for linting and formatting.mypy --strict in CI.dataclasses or pydantic for structured data over plain dicts.src/
myapp/
domain/ # pure business logic, no I/O
models.py
services.py
application/ # use cases, orchestrates domain
use_cases.py
infrastructure/ # DB, HTTP, filesystem
repositories.py
http_client.py
presentation/ # FastAPI routes, CLI, etc.
routes.py
tests/
unit/
integration/
class UserRepository(Protocol):
def find_by_id(self, user_id: UUID) -> User | None: ...
def save(self, user: User) -> None: ...
@classmethod factory methods for complex initialization.@dataclass(frozen=True) for immutable domain objects.domain/exceptions.py.except: — always specify the exception type.asyncio + async/await for I/O-bound work (HTTP, DB with asyncpg/SQLAlchemy async).asyncio.run_in_executor for blocking calls.asyncio.gather for concurrent independent I/O operations.