/vibe-types:pythonfrom vibe-types
Provides techniques for Python type-checking constraints including annotations, Union, Literal, TypedDict, Protocol, generics, TypeGuard, Final, dataclasses. Useful when writing type hints or debugging type checker errors.
Ships in vibe-types. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Base path:
${CLAUDE_PLUGIN_ROOT}/skills/python
Let the type checker carry as much of correctness as it can. The idea is to move guarantees out of runtime checks, tests, and discipline and into the types, so that holding a value is itself evidence that its invariants hold. Wherever you can, make a bad state impossible to express instead of checking for it later. Treat these as defaults to apply with judgment, not as absolute rules.
usecases/UC01-invalid-states.mdcatalog/T26-refinement-types.mdusecases/UC11-effect-tracking.mdcatalog/T14-type-narrowing.mdBool has two and a three-case enum has three) match the values that are legal for the job, holding every value that should occur and as few as possible that should not. A practical rule: among the types that can represent every legal value, choose the one with the fewest inhabitants, since the extra inhabitants are exactly the values that should never occur and that you would otherwise have to check for. For a yes or no choice, Bool is more precise than Int; a closed enum is more precise than a String; NonEmptyList is more precise than List. A newtype covers a second case: UserId and OrderId may have the same number of inhabitants as the integer underneath, but as distinct types they can no longer be passed in place of one another. The limiting case, a type with no illegal inhabitants at all, is just make illegal states unrepresentable. → catalog/T03-newtypes-opaque.mdOption or Result so that "no answer" becomes a case the caller has to handle. Or narrow the input, for example taking a NonEmptyList so that head always has an answer. When you match, cover every constructor and avoid a catch-all case unless the set of cases is genuinely open, so that adding a variant later becomes a compile error instead of a silent fall-through. For a branch that genuinely cannot occur, close it with a value of an empty type (the uninhabited type, written Nothing, Never, !, or Empty depending on the language), which has no inhabitants and so proves the branch unreachable, rather than throwing a "can't happen" error that a later change can turn into a real crash. Finally, prefer a definition that provably terminates over one you only expect to terminate. → usecases/UC03-exhaustiveness.md, catalog/T34-never-bottom.mdcatalog/T32-immutability-markers.mdusecases/UC13-state-machines.mdClock, an HttpClient, a PaymentGateway, and so on) instead of calling a global or a singleton. A function whose type does not name a given authority then cannot use it, the caller decides what to pass down, and the code becomes easy to test by passing a different value. → catalog/T12-effect-tracking.mdBasic annotations, Optional, None — variables/params/returns match declared types; None must be handled explicitly → catalog/T13-null-safety.md
Union and Literal types — value must be one of declared types or literal values → catalog/T02-union-intersection.md
TypedDict — dict keys, value types, and required/optional presence enforced statically → catalog/T31-record-types.md
NewType — distinct type prevents interchanging semantically different values → catalog/T03-newtypes-opaque.md
Enums with static typing — values restricted to closed named set; exhaustiveness on match/case → catalog/T01-algebraic-data-types.md
Dataclasses and typed data modeling — field types enforced; @dataclass_transform extends to third-party decorators → catalog/T06-derivation.md
Generics, TypeVar, bounded types — generic code preserves type relationships; bounds restrict acceptable types → catalog/T04-generics-bounds.md
ParamSpec and TypeVarTuple — preserve callable signatures through decorators; variadic generics → catalog/T45-paramspec-variadic.md
Protocol (structural subtyping) — class satisfies Protocol if it has required methods/attrs — no inheritance needed → catalog/T07-structural-typing.md
Abstract base classes — subclasses must implement all abstract methods; cannot instantiate ABC directly → catalog/T05-type-classes.md
Callable types and @overload — constrain function signatures as arguments; different return types per arg pattern → catalog/T22-callable-typing.md
Final and ClassVar — prevent reassignment/override; distinguish class-level from instance-level attrs → catalog/T32-immutability-markers.md
TypeGuard, TypeIs, and type narrowing — user-defined narrowing functions the checker trusts; exhaustive branch analysis → catalog/T14-type-narrowing.md
Never and NoReturn — mark functions that never return; bottom type for exhaustiveness proofs → catalog/T34-never-bottom.md
Annotated and type metadata — attach metadata for runtime validators (Pydantic, beartype) while keeping base type visible → catalog/T26-refinement-types.md
Self type — methods return same type as the class they're called on; fluent/builder APIs → catalog/T33-self-type.md
TypeAlias and the type statement — explicit alias declarations; lazy evaluation and forward references → catalog/T23-type-aliases.md
Generic classes and variance — user-defined generics preserve type-parameter relationships; variance prevents unsound substitutions → catalog/T08-variance-subtyping.md
**Unpack and kwargs typing — constrain individual keyword argument types via TypedDict → catalog/T46-kwargs-typing.md
Type inference, gradual typing, Any — checker infers types; Any disables checks; --strict controls enforcement → catalog/T47-gradual-typing.md
Literal types — restrict parameters to specific values (Literal["a", "b"]); discriminate without enums → catalog/T52-literal-types.md
Effect tracking (via Result patterns) — T | Error unions, context managers, exception groups → catalog/T12-effect-tracking.md
Metaprogramming (via decorators) — decorators, metaclasses, __init_subclass__, dataclass_transform → catalog/T17-macros-metaprogramming.md
Type conversions (via dunder methods) — __int__, __float__, __str__; no implicit conversions → catalog/T18-conversions-coercions.md
Equality safety (via eq) — opt-in equality, @dataclass(eq=True), Protocol for comparison → catalog/T20-equality-safety.md
Encapsulation (convention-based) — _private, __mangling, __all__, @property → catalog/T21-encapsulation.md
Phantom types (via TYPE_CHECKING) — if TYPE_CHECKING: guards, NewType for type-level tracking → catalog/T27-erased-phantom.md
Runtime polymorphism (via ABC/Protocol) — ABC and Protocol as trait-object analogs → catalog/T36-trait-objects.md
Associated types (via Protocol members) — Protocol type annotations, ClassVar, Generic output types → catalog/T49-associated-types.md
Typestate pattern (via Literal + overload) — Generic state parameter, checker-enforced → catalog/T57-typestate.md
Existential types (via Protocol) — interface without knowing concrete type → catalog/T59-existential-types.md
Recursive types (via forward references) — recursive type aliases, annotations → catalog/T61-recursive-types.md
usecases/UC01-invalid-states.mdusecases/UC02-domain-modeling.mdusecases/UC03-exhaustiveness.mdusecases/UC04-generic-constraints.mdusecases/UC05-structural-contracts.mdusecases/UC06-immutability.mdusecases/UC07-callable-contracts.mdusecases/UC08-error-handling.mdusecases/UC09-builder-config.mdREADME.md (opens in a new tab)catalog/00-overview.md (opens in a new tab)catalog/T01-algebraic-data-types.md (opens in a new tab)catalog/T02-union-intersection.md (opens in a new tab)catalog/T03-newtypes-opaque.md (opens in a new tab)catalog/T04-generics-bounds.md (opens in a new tab)catalog/T05-type-classes.md (opens in a new tab)catalog/T06-derivation.md (opens in a new tab)catalog/T07-structural-typing.md (opens in a new tab)catalog/T08-variance-subtyping.md (opens in a new tab)catalog/T12-effect-tracking.md (opens in a new tab)catalog/T13-null-safety.md (opens in a new tab)catalog/T14-type-narrowing.md (opens in a new tab)catalog/T17-macros-metaprogramming.md (opens in a new tab)catalog/T18-conversions-coercions.md (opens in a new tab)catalog/T20-equality-safety.md (opens in a new tab)catalog/T21-encapsulation.md (opens in a new tab)catalog/T22-callable-typing.md (opens in a new tab)catalog/T23-type-aliases.md (opens in a new tab)catalog/T26-refinement-types.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
python-type-checking, type-annotations, mypy, pyright, type-safety
npx claudepluginhub jpablo/vibe-types --plugin vibe-types7 skills in this plugin
/leanvibe-types:leanLean 4 compile-time safety techniques — dependent types, inductive types, type classes, termination checking, propositions as types, proof automation. Use this skill whenever the user writes Lean 4 code, mentions dependent types, asks about theorem proving, discusses inductive types, type classes, tactics (simp, omega, decide), subtypes, termination proofs, or any Lean type system feature. Also use when formalizing invariants, writing proof-carrying code, or porting type patterns from Scala, Rust, or Haskell to Lean./rustvibe-types:rustRust compile-time safety techniques — ownership, borrowing, lifetimes, traits, generics, Send/Sync, const generics. Use this skill whenever the user writes Rust code, mentions ownership or borrowing, asks about lifetime errors, discusses trait bounds, Send/Sync, derive macros, PhantomData, newtype patterns, or any Rust type system feature. Also use when debugging borrow checker errors or porting type patterns from Scala, Python, or Haskell to Rust./scalavibe-types:scalaScala 3 compile-time safety techniques — opaque types, enums/ADTs/GADTs, givens, match types, inline, capture checking. Use this skill whenever the user writes Scala 3 code, mentions type safety, asks about compiler errors, discusses ADTs, opaque types, given instances, context functions, match types, extension methods, or any Scala type system feature. Also use when porting type patterns from Rust, Python, or Haskell to Scala 3./typescriptvibe-types:typescriptTypeScript compile-time safety techniques — discriminated unions/exhaustive narrowing, structural typing, conditional types (keyof, infer, extends), mapped and utility types (Partial/Required/Readonly/Pick/Omit, DeepPartial), template literal types, branded/nominal types, satisfies/const assertions, strictNullChecks/noUncheckedIndexedAccess, generics. Use this skill whenever the user writes TypeScript/TS code; wants to derive static types from validation schemas (Zod z.infer, io-ts, Valibot, TypeBox) to keep schema and types in sync; mentions mapped/utility types (“make every field readonly and optional”), keyof/infer/generic constraints, template literal types, discriminated unions/narrowing or exhaustiveness checks, or asks about tsc/tsserver errors like TS2322/TS2345/TS2559/TS2367; also when porting type-level patterns from Scala, Rust, Python, or Haskell to TypeScript. Do not use for JavaScript runtime code, framework behavior (Node/React), build tooling, performance, or schema parsing/validation runtime concerns./verify-markdown-snippetsVerify every code snippet embedded in a markdown file for syntactic and type correctness, using the language-specific project under `projects/`. Use this skill proactively whenever the user asks to check, verify, validate, lint, or type-check code examples inside markdown — docs, tutorials, PR reviews of documentation changes, skill catalogs, blog posts, README files, anything with fenced code blocks. Also use it when the user is reviewing a pull request that touches markdown files containing code examples, or when they mention wanting to make sure their documentation code is "runnable" or "doesn't lie". The skill produces a per-snippet report (both markdown and JSON) listing exact syntax errors, type errors, and any snippets that lack a language tag./cleanvibe-types:cleanApply vibe-types catalog and use-case knowledge to refactor source files in place. Use when the user invokes /vibe-clean (or asks you to "vibe-clean" a file, directory, or branch) to systematically improve code using the techniques in the loaded vibe-types skill. Does NOT change observable behavior, public APIs, or test assertions.
Other plugins' skills for the same job