What problem does it solve? TypeScript codebases often accumulate unsafe patterns like any types, unchecked as casts, and loose object shapes that let invalid states compile and crash at runtime. This Skill gives the AI a concrete rulebook so every .ts or .tsx edit enforces sound typing instead of papering over type errors. ## Core Features & Use Cases - Type-safety rulebook: Sixteen opinionated rules covering discriminated unions, branded types, unknown over any, narrowing hierarchy, exhaustiveness checks, and satisfies over as. - Boundary validation guidance: Enforces parsing external data (RPC payloads, JSON.parse, IPC, environment variables) into named domain types using schema libraries like Zod with z.infer. - Code examples reference: A references/patterns.md file with before/after code for each rule, including constructive modeling with NonEmpty<T> tuples and schema-derived types via Pick/Omit/Parameters. - Use Case: While refactoring a Redux-style state object, the Skill replaces a { loading: boolean; data?: T; error?: string } bag with a discriminated union so impossible states cannot be represented. ## Quick Start Review this TypeScript file and refactor it to follow the typescript-best-practices rules, replacing any as casts and optional-field bags with validated discriminated unions.