From python-engineering
Selects and applies strongest Python typing strategy per project version, enforcing boundaries with stdlib, Pydantic, or Hypothesis. Use for type checker failures, model design, data validation, reducing Any.
How this skill is triggered — by the user, by Claude, or both
Slash command
/python-engineering:python3-typingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Choose the strongest valid lane automatically. Do not ask the user to pick a typing philosophy.
references/hypothesis-boundaries.mdreferences/modernization-guide.mdreferences/mypy-docs/additional_features.rstreferences/mypy-docs/generics.rstreferences/mypy-docs/protocols.rstreferences/mypy-docs/type_narrowing.rstreferences/mypy-docs/typed_dict.rstreferences/pydantic-boundaries.mdreferences/type-patterns.mdreferences/type-safety-mypy.mdreferences/typing-policy.mdChoose the strongest valid lane automatically. Do not ask the user to pick a typing philosophy.
Consult references/typing-policy.md for the full policy document.
Any, broad object, and unchecked cast() in normal internal codeAny only in approved boundary modulesdataclasses, TypedDict, Protocol, Literal, TypeGuard, NewTypeSelf, assert_type, and reveal_type where useful during refactoringTypedDict with NotRequiredTypeAdapter for annotated types that do not need full modelsreferences/pydantic-boundaries.mdfrom_type() where practicalreferences/hypothesis-boundaries.mdtype statement for explicit type aliases: type JSONValue = str | int | ...TypeIs for clearer custom narrowing helpers (replaces TypeGuard where bidirectional narrowing needed)ReadOnly in TypedDict fields that must not mutate after validationannotationlib.get_annotations() in infrastructure that inspects annotations at runtimeUse dedicated wrappers named like:
parse_*validate_*decode_*coerce_**_from_rawBoundary modules should return typed objects only.
from typing import TypedDict, NotRequired
from dataclasses import dataclass
class _RawIncoming(TypedDict):
user_id: int
email: str
metadata: NotRequired[dict[str, str]]
@dataclass(frozen=True, slots=True)
class IncomingPayload:
user_id: int
email: str
metadata: dict[str, str]
def parse_incoming(data: _RawIncoming) -> IncomingPayload:
return IncomingPayload(
user_id=data["user_id"],
email=data["email"],
metadata=data.get("metadata", {}),
)
from pydantic import BaseModel, TypeAdapter
class IncomingPayload(BaseModel):
user_id: int
email: str
metadata: dict[str, str] = {}
model_config = {"strict": True}
def parse_incoming(data: dict[str, object]) -> IncomingPayload:
return IncomingPayload.model_validate(data)
references/typing-policy.md — full boundary validation policyreferences/pydantic-boundaries.md — Pydantic model and TypeAdapter patternsreferences/hypothesis-boundaries.md — property-based testing for validatorsnpx claudepluginhub jamie-bitflight/claude_skills --plugin python-engineeringProvides complete Python type hints: built-in generics, unions, TypedDict, Protocol, Literal, ParamSpec, and mypy/Pyright config for static type safety.
Enforces Python type safety with hints, generics, protocols, type narrowing, and mypy/pyright. Use for annotating code, generic classes, structural interfaces, or strict checking.
Guides usage of modern Python type hints: TypedDict, Protocol, Generics, TypeVar, Callable, and union syntax. Useful for type-safe Python codebases using mypy or pyright.