본문으로 건너뛰기
cccskills
무료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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(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(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Jamie-BitFlight/claude_skills672026년 10월 20일 업데이트

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Jamie-BitFlight/claude_skills672026년 10월 20일 업데이트

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Jamie-BitFlight/claude_skills672026년 10월 20일 업데이트

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Jamie-BitFlight/claude_skills672026년 10월 20일 업데이트

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Jamie-BitFlight/claude_skills672026년 10월 20일 업데이트

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Jamie-BitFlight/claude_skills672026년 10월 20일 업데이트

Jamie-BitFlight의 스킬 모두 보기

이 스킬의 문제 신고