What problem does it solve? Codebases in statically-typed languages often model state as bags of optional fields, rely on unsafe casts, and duplicate schema shapes by hand, letting the compiler accept programs that fail at runtime. This Skill provides a set of type design principles that push those failure modes from runtime into compile time. ## Core Features & Use Cases - Illegal State Elimination: Model variants as sum types (discriminated unions, enums with payloads, sealed classes) so contradictory field combinations cannot compile. - Boundary Parsing and Branding: Parse untyped external data (JSON, RPC payloads, env vars) at boundaries and brand semantic primitives like UserId versus OrderId to prevent mix-ups. - Exhaustiveness and Schema Derivation: Enforce exhaustive matching so new variants break compilation, and derive types from authoritative schemas (protobuf, OpenAPI, GraphQL) instead of hand-rolled duplicates. - Use Case: When reviewing a TypeScript function signature like { completed: boolean; completedAt?: Date }, apply the Skill to remodel it as { kind: 'open' } | { kind: 'done'; at: Date }, removing the meaningless state where completed is true but completedAt is undefined. ## Quick Start Ask the AI to review your type definitions and function signatures using the type system discipline principles to find states the compiler should reject.