Skip to content
cccskills
FreePublished on GitHub

python3-typing

Auto-selects and enforces the strongest valid Python typing lane for the detected Python version and dependencies — no user input required. Use when adding or tightening type annotations, eliminating Any usage in internal code, designing boundary validators or parsers, choosing between stdlib typing (TypedDict, Protocol, dataclasses), Pydantic models, or Hypothesis property tests, addressing ty or mypy failures, or applying version-specific features (TypeIs, ReadOnly, PEP 695 generics, PEP 649 deferred evaluation). Enforces boundary isolation — raw payloads validated immediately at ingress and returned as typed internal objects.

The English summary is being prepared. Showing the original description.

See how to install

Files included (12)

  • SKILL.md4.1 KB
  • references/hypothesis-boundaries.md1.4 KB
  • references/modernization-guide.md17.7 KB
  • references/mypy-docs/additional_features.rst6.2 KB
  • references/mypy-docs/generics.rst17.6 KB
  • references/mypy-docs/protocols.rst9.6 KB
  • references/mypy-docs/type_narrowing.rst9.4 KB
  • references/mypy-docs/typed_dict.rst5.9 KB
  • references/pydantic-boundaries.md1.2 KB
  • references/type-patterns.md3.3 KB
  • references/type-safety-mypy.md11.9 KB
  • references/typing-policy.md3.2 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Python Typing

Choose the strongest valid lane automatically. Do not ask the user to pick a typing philosophy.

Consult references/typing-policy.md for the full policy document.

Required Policy

  • Forbid Any, broad object, and unchecked cast() in normal internal code
  • Allow them only at explicit boundaries where unknown-shape data enters
  • Isolate boundary code in dedicated validator, parser, adapter, or boundary modules
  • Validate immediately and return strongly typed internal objects
  • Do not let raw payloads cross into the typed core
  • Allow narrow lint exceptions for Any only in approved boundary modules

Lane Selection

1. Python 3.10 Constrained or stdlib-only

  • Use only compatibility-safe stdlib typing features
  • Prefer dataclasses, TypedDict, Protocol, Literal, TypeGuard, NewType
  • Validate with explicit runtime checks in dedicated boundary wrappers
  • No third-party type assumptions

2. Python 3.11+ stdlib-only

  • Use modern stdlib typing features supported by the interpreter
  • Use Self, assert_type, and reveal_type where useful during refactoring
  • TypedDict with NotRequired

3. Python 3.11+ with Pydantic

  • Use Pydantic models for ingress contracts
  • Prefer strict mode where coercion would hide upstream errors
  • Use TypeAdapter for annotated types that do not need full models
  • See references/pydantic-boundaries.md

4. Python 3.11+ with Hypothesis

  • Property-test boundaries, validators, parsers, and invariants
  • Prefer from_type() where practical
  • See references/hypothesis-boundaries.md

5. Python 3.12+

  • Use type statement for explicit type aliases: type JSONValue = str | int | ...
  • Use PEP 695 generic parameter syntax for new generic helpers

6. Python 3.13+

  • Use TypeIs for clearer custom narrowing helpers (replaces TypeGuard where bidirectional narrowing needed)
  • Use ReadOnly in TypedDict fields that must not mutate after validation

7. Python 3.14+

  • Keep annotation-reading infrastructure compatible with deferred evaluation (PEP 649)
  • Use annotationlib.get_annotations() in infrastructure that inspects annotations at runtime

Boundary Implementation Standard

Use dedicated wrappers named like:

  • parse_*
  • validate_*
  • decode_*
  • coerce_*
  • *_from_raw

Boundary modules should return typed objects only.

Example: stdlib-only boundary

from typing import TypedDict, NotRequired
from dataclasses import dataclass


class _RawIncoming(TypedDict):
    user_id: int
    email: str
    metadata: NotRequired[dict[str, str]]


@dataclass(frozen=True, slots=True)
class IncomingPayload:
    user_id: int
    email: str
    metadata: dict[str, str]


def parse_incoming(data: _RawIncoming) -> IncomingPayload:
    return IncomingPayload(user_id=data["user_id"], email=data["email"], metadata=data.get("metadata", {}))

Example: Pydantic boundary

from pydantic import BaseModel, TypeAdapter


class IncomingPayload(BaseModel):
    user_id: int
    email: str
    metadata: dict[str, str] = {}
    model_config = {"strict": True}


def parse_incoming(data: dict[str, object]) -> IncomingPayload:
    return IncomingPayload.model_validate(data)

References

  • references/typing-policy.md — full boundary validation policy
  • references/pydantic-boundaries.md — Pydantic model and TypeAdapter patterns
  • references/hypothesis-boundaries.md — property-based testing for validators

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Add automated documentation updater to any Claude skill. Creates a Python sync script that downloads upstream docs, processes markdown for AI consumption, and maintains local cache with configurable refresh. Collects template variables, then delegates implementation through 5-phase workflow. Use when adding auto-updating reference documentation to plugins or skills.

The English summary is being prepared. Showing the original description.

Jamie-BitFlight/claude_skills67Updated Oct 20, 2026

SAM-style feature initiation workflow — discovery through codebase analysis, architecture spec, task decomposition, validation, and context manifest. Use when a user asks to add a feature, plan a feature, or convert an idea into an executable SAM plan.

The English summary is being prepared. Showing the original description.

Jamie-BitFlight/claude_skills67Updated Oct 20, 2026

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

The English summary is being prepared. Showing the original description.

Jamie-BitFlight/claude_skills67Updated Oct 20, 2026

Browser automation for AI agents using the agent-browser CLI and Playwright. Use when navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, logging into sites, or automating any browser task. Triggers on "open a website", "fill out a form", "click a button", "scrape data", "test this web app", "automate browser actions", or any programmatic web interaction request.

The English summary is being prepared. Showing the original description.

Jamie-BitFlight/claude_skills67Updated Oct 20, 2026

Runs the description-drift experiment — spawns all Claude Code agents simultaneously to collect self-reported capabilities, then compares them against static frontmatter descriptions to reveal how reliable orchestrator routing based on descriptions actually is. Use when measuring description drift across the agent fleet, re-running the capability collection experiment, analyzing a specific agent's self-reported capabilities, or auditing whether frontmatter descriptions accurately reflect agent behavior.

The English summary is being prepared. Showing the original description.

Jamie-BitFlight/claude_skills67Updated Oct 20, 2026

Create or adapt Claude Code agent definitions. Use when creating an agent, changing subagent configuration, selecting agent scope, or designing a specialized delegation role.

The English summary is being prepared. Showing the original description.

Jamie-BitFlight/claude_skills67Updated Oct 20, 2026

See all skills by Jamie-BitFlight

Report a problem with this skill