What problem does it solve? Codebases often rely on conventions, comments, and runtime checks to enforce rules like "this string must be a valid email" or "a connection must be open before sending". These rules silently break as code evolves. This Skill moves those invariants into the type system so the compiler rejects illegal states on every build, eliminating whole classes of bugs and the tests that compensate for them. ## Core Features & Use Cases - Four type-level moves: Selects between newtypes/branded types (identity), smart constructors (construction), discriminated unions (state machines), and phantom types (operation ordering) based on the invariant being protected. - Code audits for type smells: Detects primitive obsession, boolean blindness, stringly-typed data, partial functions, validation-instead-of-parsing, and missing exhaustiveness checks, with the smallest fix for each. - Types vs tests decisions: Applies a four-criterion test to decide whether a check belongs in the type system or in a test suite. - Use Case: Given a RequestState object with optional data, error, and loading fields, refactor it into a discriminated union with an exhaustiveness-checked switch, then delete the now-redundant tests. ## Quick Start Ask the assistant to audit a module for primitive obsession and refactor its stringly-typed status fields into discriminated unions with exhaustiveness checks.