python-type-safety

Installation
Summary

Static type checking with annotations, generics, protocols, and strict mode enforcement.

  • Covers type annotations, generics with TypeVars, structural protocols, and type narrowing patterns for catching errors at analysis time
  • Includes modern syntax (Python 3.10+ union types), bounded type variables, and generic repository patterns for type-safe APIs
  • Provides configuration guidance for mypy strict mode and incremental adoption strategies for existing codebases
  • Demonstrates 10 fundamental patterns from basic function signatures to advanced generic containers, protocols, and callable types
SKILL.md

Python Type Safety

Leverage Python's type system to catch errors at static analysis time. Type annotations serve as enforced documentation that tooling validates automatically.

When to Use This Skill

  • Adding type hints to existing code
  • Creating generic, reusable classes
  • Defining structural interfaces with protocols
  • Configuring mypy or pyright for strict checking
  • Understanding type narrowing and guards
  • Building type-safe APIs and libraries

Core Concepts

1. Type Annotations

Declare expected types for function parameters, return values, and variables.

Related skills

More from wshobson/agents

Installs
6.5K
Repository
wshobson/agents
GitHub Stars
35.2K
First Seen
Jan 30, 2026