A static type checker that catches bugs before runtime by analyzing Python type hints. You'd use this when adding type safety to existing code, building FastAPI or Django apps where types matter, or enforcing stricter guarantees in CI/CD pipelines. The skill covers gradual typing (so you can add hints incrementally), Protocol support for structural typing, and the strict mode flag for maximum safety. The examples span basics like annotating functions and collections through advanced patterns like generics and TypeVar. Honest take: mypy has a learning curve with complex types, but it pays off by turning entire classes of runtime errors into build-time failures. Works well with modern Python frameworks that already lean on type hints.

skills.sh installs
478
GitHub stars
79
last updated
Aug 21, 2026

Install

$ npx -y skills add bobmatnyc/claude-mpm-skills --skill mypy --agent claude-code

Installs into .claude/skills of the current project.

Files

mypy - Static Type Checking for Python

Overview

mypy is the standard static type checker for Python, enabling gradual typing with type hints (PEP 484) and comprehensive type safety. It catches type errors before runtime, improves code documentation, and enhances IDE support while maintaining Python's dynamic nature through incremental adoption.

Key Features:

  • Gradual typing: Add types incrementally to existing code
  • Strict mode: Maximum type safety with --strict flag
  • Type inference: Automatically infer types from context
  • Protocol support: Structural typing (duck typing with types)
  • Generic types: TypeVar, Generic, and advanced type patterns
  • Framework integration: FastAPI, Django, Pydantic compatibility
  • Plugin system: Extend type checking for libraries
  • Incremental checking: Fast type checking on large codebases

Installation:

# Basic mypy
pip install mypy

# With common type stubs
pip install mypy types-requests types-PyYAML types-redis

# For FastAPI projects
pip install mypy pydantic

# For Django projects
pip install mypy django-stubs

# Development setup
pip install mypy pre-commit

Type Annotation Basics

1. Variable Type Hints

Sponsors

Details

Repository
github.com/bobmatnyc/claude-mpm-skills
Category
Python
First seen
Jun 3, 2026

More from bobmatnyc/claude-mpm-skills

All 158

Recommended

More Python
1laurigates avatarpython-testinglaurigates/claude-pluginsPython testing with pytest, coverage, fixtures, and mocking. Use when the user mentions pytest, unit tests, coverage, fixtures, mocking, or writing Python tests463skills.sh installs
2bobmatnyc avatarflaskbobmatnyc/claude-mpm-skillsFlask - Lightweight Python web framework for microservices, REST APIs, and flexible web applications with extensive extension ecosystem449skills.sh installs
3personamanagmentlayer avatarfastapi-expertpersonamanagmentlayer/pclExpert-level FastAPI development for high-performance Python APIs with async support216skills.sh installs
4bobmatnyc avatardjango-frameworkbobmatnyc/claude-mpm-skillsDjango full-featured Python web framework with batteries included (ORM, admin, auth)159skills.sh installs
5dj-bolt avatardjango-boltdj-bolt/django-boltBuild high-performance APIs with Django-Bolt, including BoltAPI routes, typed request validation, msgspec serialization, auth guards, middleware, OpenAPI docs, 135skills.sh installs
6manutej avatarFastAPI Customer Support Tech Enablementmanutej/luxor-claude-marketplaceComprehensive FastAPI skill for building modern Python web APIs with focus on customer support systems, ticket management, real-time chat, and backend operation0skills.sh installs