type-hints

Enforce consistent Python type hints using modern syntax conventions.

Updated Nov 11, 2025
One-click install
npx skills add https://github.com/libertininick/chain-reaction --skill type-hints
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: type-hints
Source: https://github.com/libertininick/chain-reaction/tree/main/.claude/skills/type-hints
Command: npx skills add https://github.com/libertininick/chain-reaction --skill type-hints

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Type annotations are REQUIRED on all functions and classes. This Skill provides a standardized, centralized guide for Python type hints to ensure consistency, readability, and better tooling support across the codebase.

Core Features & Use Cases

  • Unified conventions for Optional values, input/output containers, TypeVars, and Protocols.
  • Guidance on modern syntax (Union types with |, TypedDict, Literal, Self) to improve type safety and clarity.
  • Use cases include onboarding new contributors, code reviews, and maintaining large Python projects with consistent typing.

Quick Start

Annotate a sample function using the recommended union syntax and apply TypedDict for API-like data to see the conventions in action.

Frequently Asked Questions about type-hints

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce consistent Python type hints across a large codebase?

To enforce consistent Python type hints, apply standardized conventions for Optional values, unions, and TypeVars across your project. This Skill provides centralized rules for modern syntax choices like PEP 604 unions, TypedDict, and Protocols to ensure readability and better tooling support.

What is the best way to use modern Python typing syntax like PEP 604 unions and TypedDict?

The best way to use modern Python typing syntax is to standardize on PEP 604 union types using the pipe character, apply TypedDict for API-like data, and use Protocols for structural subtyping. This ensures type safety, clarity, and consistent code quality across the codebase.

When do I need TypedDict and Protocols for Python type annotations?

You need TypedDict and Protocols for Python type annotations when defining API-like data structures and structural subtyping. TypedDict specifies dictionary types with specific keys, while Protocols define interfaces for static analysis without requiring explicit inheritance.

Can I use this Python typing convention guide for code reviews and onboarding?

Yes, you can use this Python typing convention guide for code reviews and onboarding. It specifies naming conventions for TypeVars, recommended documentation patterns, and modern syntax choices to satisfy type-annotation standards for new contributors.

Why are type annotations required on all Python functions and classes?

Type annotations are required on all Python functions and classes to ensure consistency, readability, and better static analysis tooling support. This Skill provides a centralized guide to standardize these annotations and maintain code quality across large projects.

Does this Python type hints Skill work with static analysis and linting tools?

Yes, this Python type hints Skill works with static analysis and linting tools by specifying modern syntax choices and documentation patterns that satisfy type-annotation standards, improving type safety and enabling better tooling support across the codebase.