What problem does it solve?
This Skill helps prevent fragile or inconsistent TypeScript code by enforcing strict, readable patterns for types, interfaces, generics, and imports.
Core Features & Use Cases
- Const-first union types: Defines string literal unions from runtime-safe const objects to improve autocomplete and refactoring.
- Flat interfaces: Encourages shallow interface nesting for clarity, replacing inline nested object types with dedicated interfaces.
- No
any policy: Requires unknown for unknown inputs and uses generics for flexible, type-safe functions.
- Utility types & type guards: Provides reusable patterns for transforming types and validating unknown values at runtime.
- Type-only imports: Promotes
import type and type-prefixed imports to keep dependencies and intent clear.
Quick Start
Use the typescript skill rules to refactor your current TypeScript models by replacing inline nested object types with flat interfaces, removing any in favor of unknown plus type guards, and defining union types from as const objects.