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.