Agent skill · writing content · aiskillstore

python-typing-patterns

Python type hints and type safety patterns. Triggers on: type hints, typing, TypeVar, Generic, Protocol, mypy, pyright, type annotation, overload, TypedDict.

Why this skill is useful

Provides specific patterns and examples for type safety in Python that the AI wouldn't reliably generate on its own.

What it needs

About 3k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

Python Typing Patterns Modern type hints for safe, documented Python code. Basic Annotations Collections Optional and Union TypedDict Callable Generics Protocol (Structural Typing) Type Guards Literal and Final Quick Reference Type Use Case ------ ---------- X \ None Optional value list[T] Homogeneous list dict[K, V] Dictionary Callable[[Args], Ret] Function type TypeVar("T") Generic parameter Protocol Structural typing TypedDict Dict with fixed keys Literal["a", "b"] Specific values only Final Cannot be reassigned Type Checker Commands Additional Resources ./references/generics-advanced.md - TypeVar, ParamSpec, TypeVarTuple ./references/protocols-patterns.md - Structural typing, runtime protocols ./references/type-narrowing.md - Guards, isinstance, assert ./references/mypy-config.md - mypy/pyright configuration ./references/runtime-validation.md - Pydantic v2, typeguard, beartype ./references/overloads.md - @overload decorator patterns Scripts ./scripts/check-types.sh - Run type checkers with common options Assets ./assets/pyproject-typing.toml - Recommended mypy/pyright config --- See Also This is a foundation skill with no prerequisites. Related Skills: python-pytest-patterns - Type-safe fixtures and mocking Build on this skill: python-async-patterns - Async type annotations python-fastapi-patterns - Pydantic models and validation python-database-patterns - SQLAlchemy type annotations

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/python-typing-patterns

View the source on GitHub

Browse the @skills marketplace