type-safety

Installation
SKILL.md

Type Safety

Playbook for moving invariants from runtime checks into the type system. Six techniques that work together to make illegal states unrepresentable and catch bugs at compile time instead of test time.

This is NOT a general TypeScript style guide. These techniques apply to:

  • Domain model design
  • SDK / library public APIs
  • Discriminated unions with mutually exclusive shapes
  • Entity ID modeling (task IDs, user IDs, etc.)
  • Boundary hardening (input validation, DB reads, external API responses)

They do NOT belong in:

  • Application glue code (route handlers, UI components)
  • Scripts, migrations, one-off tooling
  • Code where a runtime check is clearer and equally safe
  • Codebases without an existing type discipline to build on
Related skills

More from inkeep/team-skills

Installs
7
GitHub Stars
10
First Seen
Apr 8, 2026