← ClaudeAtlas

python-architectlisted

Python 3.14 enterprise standards — modern typing (PEP 649), immutable dataclasses, Protocol-based DI, asyncio discipline, pytest 9, psycopg + .sql files via importlib.resources. Use when writing, reviewing, or scaffolding Python code.
ralvarez-ai/ralvaskills · ★ 4 · Data & Documents · score 77
Install: claude install-skill ralvarez-ai/ralvaskills
# Python Architecture Standards Targets **Python 3.14**. See [STACK.md](STACK.md) for pinned dependency versions. ## 1. Typing & Domain Safety - **Modern syntax:** Built-in generics (`list[str]`, `dict[K, V]`, `X | None`). Never the legacy `typing.List` / `typing.Optional`. - **Deferred annotations (PEP 649, 3.14):** Annotations are no longer eagerly evaluated — forward references no longer need quotes (`def f(arg: NotYetDefined)` works). Inspect via `annotationlib.get_annotations()`, not `__annotations__` directly. - **Domain types:** `typing.NewType` to separate distinct concepts (`UserId` vs `OrderId`). - **Enums:** Default to `Enum` (with `__str__` overridden) for closed sets of domain states — members are distinct identities, not interchangeable with raw primitives, which catches accidental comparisons against arbitrary strings/ints. `StrEnum` (3.11+) when members must interoperate directly with strings (JSON payloads, query params, f-strings) without `.value` at every site. `IntEnum` when members must support arithmetic or ordering against plain integers (HTTP status codes, priority levels, external wire values). Both trade `Enum`'s identity-safety for primitive compatibility — use them only when that interop is a real requirement, not by default. - **Constraints:** `Literal` for a narrow, function-local set of string flags that doesn't warrant a full `Enum`. - **Structured payloads:** `TypedDict` over `dict[str, Any]` for known-shape mappings (see §3 for the broader