What problem does it solve? TypeScript codebases accumulate unsafe patterns like any types, unchecked as casts, and optional-field bags that let invalid states compile and crash at runtime. This Skill enforces a consistent set of type-system rules so code models only valid states and validates external data at boundaries. ## Core Features & Use Cases - Type modeling rules: Enforces discriminated unions, branded types, constructive modeling, and exhaustiveness checks so impossible states cannot be represented. - Boundary validation guidance: Directs parsing of external data as unknown with schema libraries like zod, deriving types via z.infer instead of hand-written guards. - Narrowing hierarchy: Ranks narrowing techniques from discriminant switches down to as casts as a last resort, with code examples in references/patterns.md. - Use Case: While editing a React component that handles an API response, the Skill guides you to parse the payload with a zod schema, model loading/ready/error states as a discriminated union, and add an exhaustiveness check in the render switch. ## Quick Start Ask the assistant to review or edit a TypeScript file and apply the typescript-best-practices rules to replace unsafe casts and any types with validated, strongly typed models.