runtime-type-reconstruction
Installation
SKILL.md
Know How to Reconstruct Types at Runtime
Overview
TypeScript types are erased at runtime, but sometimes you need to validate that runtime data matches your types. Use libraries like io-ts, zod, or runtypes to define schemas that provide both runtime validation and static types. This ensures your types match reality.
When to Use This Skill
- Validating data at runtime
- Parsing JSON with type safety
- Types need runtime checks
- Using io-ts, zod, or runtypes
- Building validation schemas
The Iron Rule
Use validation libraries like zod or io-ts to get both runtime validation and TypeScript types from a single source of truth.