python-types-contracts

Define explicit typing contracts for Python public interfaces and boundary rules.

5|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/ahgraber/skills --skill python-types-contracts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-types-contracts
Source: https://github.com/ahgraber/skills/tree/main/skills/python-types-contracts
Command: npx skills add https://github.com/ahgraber/skills --skill python-types-contracts

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Define explicit typing contracts for Python public interfaces to reduce ambiguity, drift, and unwarranted exposure of internal implementation details.

Core Features & Use Cases

  • Enforces clear contracts at module and package boundaries to define the public API surface.
  • Guides when to apply pydantic at trust boundaries versus internal use, and helps prevent overuse of Any or object across modules.
  • Provides migration-aware guidance for contract evolution and backward compatibility.

Quick Start

Define public API contracts and boundary rules for a Python project, then introduce a migration plan for changes.

Frequently Asked Questions about python-types-contracts

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

FAQPage Schema
How do I enforce explicit typing contracts for Python public interfaces?

To enforce explicit typing contracts for Python public interfaces, define clear module and package boundary rules. This reduces ambiguity and prevents unwarranted exposure of internal implementation details across your API surface.

When should I use pydantic for boundary validation in Python?

Use pydantic for boundary validation at trust boundaries where external data enters your system. For internal code, apply plain types to prevent pydantic models from proliferating beyond their necessary validation scope.

What is the best way to migrate Python API contracts without breaking compatibility?

Migrating Python API contracts requires migration-aware changes and clear boundary rules. Establish a concrete migration plan for changes to ensure backward compatibility while evolving your public API surface safely.

How do I stop pydantic models from proliferating beyond trust boundaries?

To stop pydantic models from proliferating beyond trust boundaries, enforce explicit boundary rules. Apply pydantic strictly at external trust perimeters and use plain types for internal code interactions.

Why does overusing Any or object across Python modules cause API drift?

Overusing Any or object across Python modules causes API drift by removing explicit typing constraints. Defining explicit public interface contracts replaces ambiguous types with clear boundary definitions to stabilize your API.

Do I need pydantic to define internal Python typing contracts?

You do not need pydantic for internal Python typing contracts. Use plain types internally to structure code, reserving pydantic specifically for external trust boundaries where strict data validation is required.