/vibe-types:scalafrom vibe-types
Provides Scala 3 compile-time safety patterns — opaque types, ADTs, givens, match types, inline, and capture checking. Useful for type-driven design, compiler errors, and porting type patterns from other languages to Scala 3.
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/scala3
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/T58-witness-evidence.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.mdUnion & intersection types — express alternatives without common supertype (A | B); combine capabilities (A & B) → catalog/T02-union-intersection.md
Type lambdas — abstract over type constructors inline; partially apply binary constructors for type-class shapes → catalog/T40-type-lambdas.md
Match types — compute types from types via pattern matching; type-level conditional logic → catalog/T41-match-types.md
Givens & using clauses — principled type-class dispatch; compiler supplies evidence automatically → catalog/T05-type-classes.md
Context functions & context bounds — abstract over contextual dependencies as types; lightweight capability annotation → catalog/T42-context-functions.md
Extension methods — attach operations to types you don't own; conditional syntax via type-class evidence → catalog/T19-extension-methods.md
Type-class derivation — auto-generate instances for any ADT from compile-time structure → catalog/T06-derivation.md
Multiversal equality — restrict == so only semantically meaningful comparisons compile → catalog/T20-equality-safety.md
Conversions, by-name params, deferred givens — explicit opt-in conversions; break circular given dependencies → catalog/T18-conversions-coercions.md
Enums, ADTs, GADTs — closed variant sets with exhaustive matching; per-branch type refinement → catalog/T01-algebraic-data-types.md
Opaque types — distinct types sharing the same representation; prevent value mix-ups, no boxing in monomorphic use (boxes when used as a type argument, like any type, with no overhead beyond the underlying type) → catalog/T03-newtypes-opaque.md
open, export, transparent — control extensibility; delegate via composition; suppress traits from inferred types → catalog/T21-encapsulation.md
Matchable & TypeTest — prevent pattern matching from breaking type abstractions; sound runtime type tests → catalog/T14-type-narrowing.md
Structural & refined types, named tuples — statically-checked duck typing; lightweight records without case classes → catalog/T07-structural-typing.md
Kind polymorphism — type parameters ranging over any kind; universal type tags → catalog/T35-universes-kinds.md
Inline & compile-time ops — constant folding, dead-branch elimination, compile-time specialization → catalog/T16-compile-time-ops.md
Macros (quotes & splices) — type-safe compile-time code generation and AST transformation → catalog/T17-macros-metaprogramming.md
Explicit nulls — reference types never hold null unless explicitly T | Null → catalog/T13-null-safety.md
Erased definitions — compile-time-only parameters; zero-cost type-level evidence → catalog/T27-erased-phantom.md
Capture checking & CanThrow — track captured capabilities; effect tracking and purity enforcement at type level → catalog/T12-effect-tracking.md
Experimental: named type args, into, modularity — selective type parameter binding; fine-grained conversion control → catalog/T43-experimental-preview.md
Changed & dropped features — more predictable inference and resolution; removed unsound Scala 2 features → catalog/T44-changed-dropped.md
Refinement types — value-level predicates enforced at compile time via Iron or refined libraries → catalog/T26-refinement-types.md
Generics & bounded polymorphism — upper/lower bounds, context bounds, F-bounded polymorphism → catalog/T04-generics-bounds.md
Variance & subtyping — covariant +A, contravariant -A, invariant; Liskov at the type level → catalog/T08-variance-subtyping.md
Callable types & overloading — function types, SAM types, eta-expansion, method overloading → catalog/T22-callable-typing.md
Type aliases — transparent aliases, parameterized aliases, type members, path-dependent types → catalog/T23-type-aliases.md
Record types & data modeling — case classes, named tuples, product types with auto-derived methods → catalog/T31-record-types.md
Self types — self-type annotations (self: T =>), capability requirements without inheritance → catalog/T33-self-type.md
Nothing & bottom type — universal subtype, throw, ???, empty collections, covariant widening → catalog/T34-never-bottom.md
Singleton types & compile-time value parameters — literal types, constValue, compiletime.ops; encode sizes/dimensions in types → catalog/T15-const-generics.md
Literal types — every literal has a singleton type; foundation for type-level computation and value discrimination → catalog/T52-literal-types.md
Path-dependent types — type members, instance-dependent types (x.Inner), abstract type members → catalog/T53-path-dependent-types.md
Immutability markers — val, final, sealed, immutable collections; immutability is the default → catalog/T32-immutability-markers.md
Trait-based dynamic dispatch — traits + abstract classes for runtime polymorphism; JVM vtable → catalog/T36-trait-objects.md
Given/implicit resolution — Scala's trait solver: search scopes, priority, divergence detection → catalog/T37-trait-solver.md
Associated types — abstract type members in traits; alternative to type parameters → catalog/T49-associated-types.md
Annotations & compiler directives — @inline, @tailrec, @targetName, @deprecated → catalog/T39-notation-attributes.md
Dependent types (via path-dependent + match types) — approximate value-indexed patterns → catalog/T09-dependent-types.md
Coherence & instance scoping (via given import rules) — no orphan rule; import-based visibility → catalog/T25-coherence-orphan.md
Functor / Applicative / Monad — map, flatMap, pure; compositional effect chaining via cats → catalog/T54-functor-applicative-monad.md
Monad transformers — EitherT, StateT, ReaderT; compose effects in a stack → catalog/T55-monad-transformers.md
Tagless final — decouple program description from interpretation; swap runtimes → catalog/T56-tagless-final.md
Typestate pattern — phantom types track state; invalid transitions don't compile → catalog/T57-typestate.md
Witness & evidence types — =:=, <:<, given evidence; compiler proves preconditions → catalog/T58-witness-evidence.md
Existential types — abstract type members, wildcard types; hide concrete types → catalog/T59-existential-types.md
Recursive types — sealed enum/trait hierarchies defined in terms of themselves → catalog/T61-recursive-types.md
usecases/UC01-invalid-states.mdusecases/UC02-domain-modeling.mdusecases/UC10-encapsulation.mdusecases/UC11-effect-tracking.mdusecases/UC12-compile-time.mdusecases/UC13-state-machines.mdusecases/UC14-extensibility.mdusecases/UC15-equality.mdusecases/UC16-nullability.mdusecases/UC17-variance.mdusecases/UC18-type-arithmetic.mdusecases/UC19-serialization.mdusecases/UC09-builder-config.mdusecases/UC08-error-handling.mdWhen this skill is loaded, say "Scala skill loaded 🎯"
README.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/T09-dependent-types.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/T15-const-generics.md (opens in a new tab)catalog/T16-compile-time-ops.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/T19-extension-methods.md (opens in a new tab)catalog/T20-equality-safety.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
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./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