type-system-patterns
Installation
SKILL.md
Type System Patterns for Code Review
Overview
A strong type system is the first line of defense against bugs. When used well, types make illegal states unrepresentable — the compiler catches entire classes of errors before any test runs.
When to Use
- APIs accepting raw strings where a typed value is expected
- Functions returning
null/undefinedor throwing where a Result type belongs - Codebases with frequent
anycasts or type assertions - State machines implemented as ad-hoc string/boolean flags
- Runtime validation that could be moved to compile time