/vibe-types:typescriptfrom vibe-types
Guides TypeScript compile-time safety: discriminated unions, conditional/mapped/template literal types, branded types, exhaustive narrowing, type-level patterns. Activates when writing TS code, inferring schema types, or diagnosing type 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/typescript
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.
Bool 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.Option 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.Clock, 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.switch; invalid states unrepresentable → catalog/T01-algebraic-data-types.mdA | B, A & B; express alternatives without class hierarchies → catalog/T02-union-intersection.mdtype UserId = string & { __brand: "UserId" }; prevent value mix-ups at zero runtime cost → catalog/T03-newtypes-opaque.md<T extends U>; generic code only compiles when constraints hold → catalog/T04-generics-bounds.mdzod.infer<>, reflect-metadata; auto-generate instances from shape → catalog/T06-derivation.mdcatalog/T07-structural-typing.mdcatalog/T08-variance-subtyping.mdPromise<T>, Result patterns, fp-ts IO; track side effects at type level → catalog/T12-effect-tracking.mdstrictNullChecks, T | null | undefined, optional chaining; reference types never null by default → catalog/T13-null-safety.mdin, instanceof, discriminant checks; narrow to specific branch → catalog/T14-type-narrowing.mdcatalog/T17-macros-metaprogramming.mdas, satisfies, is predicates; explicit opt-in conversions → catalog/T18-conversions-coercions.mdprivate, #field, readonly, module exports; control surface area → catalog/T21-encapsulation.mdReturnType<F> → catalog/T22-callable-typing.mdtype Foo = ...; recursive aliases, utility types → catalog/T23-type-aliases.mdcatalog/T26-refinement-types.mdcatalog/T27-erased-phantom.mdinterface, object literal types, Record<K, V>, index signatures → catalog/T31-record-types.mdreadonly, as const, Readonly<T>, ReadonlyArray<T>; prevent reassignment → catalog/T32-immutability-markers.mdthis — fluent builder chains; subclass-aware return types → catalog/T33-self-type.mdnever; exhaustiveness proofs; unreachable branches → catalog/T34-never-bottom.mdinstanceof dispatch; union narrowing → catalog/T36-trait-objects.mdT extends U ? X : Y; infer; type-level branching and computation → catalog/T41-match-types.md[...T]; infer in tuple position; spreading tuple types → catalog/T45-paramspec-variadic.mdany — any, unknown, --strict flags; escape hatches and enforcement levels → catalog/T47-gradual-typing.mdinfer R in conditional types; ReturnType, Parameters, Awaited → catalog/T49-associated-types.md"foo", 42, true; restrict types to specific values; string discriminants → catalog/T52-literal-types.mdmap, chain, pipe; compositional effect chaining via fp-ts Option/Either/Task → catalog/T54-functor-applicative-monad.mdcatalog/T57-typestate.md<T>() => T pattern; hide concrete type while preserving contracts → catalog/T59-existential-types.mdtype aliases; trees, JSON, expressions → catalog/T61-recursive-types.md{ [K in keyof T]: ... }; keyof, typeof; transform and query object shapes → catalog/T62-mapped-types.md`${A}${B}`; string-level type computation; route patterns, CSS → catalog/T63-template-literal-types.mdAsyncIterator, for await...of, async generators; type-safe async streams → catalog/T64-async-iteration.mdusecases/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.mdusecases/UC10-encapsulation.mdusecases/UC13-state-machines.mdusecases/UC14-extensibility.mdusecases/UC15-equality.mdusecases/UC16-nullability.mdusecases/UC17-variance.mdusecases/UC19-serialization.mdusecases/UC21-concurrency.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/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)catalog/T27-erased-phantom.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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./pythonvibe-types:pythonPython type-checking constraint techniques — annotations, Union, Literal, TypedDict, Protocol, generics, TypeGuard, Final, dataclasses. Use this skill whenever the user writes Python with type hints, mentions mypy or pyright, asks about typing module features, discusses Protocol, TypedDict, NewType, dataclasses, Literal, overload, ParamSpec, or any type annotation. Also use when adding types to untyped code or debugging type checker errors./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.Other plugins' skills for the same job