What problem does it solve?
This Skill targets unsafe TypeScript patterns that lead to runtime errors, brittle interfaces, and maintenance headaches by enforcing strict type practices across codebases.
Core Features & Use Cases
- Const Types Pattern: Create a single source of truth with const objects and derived types for reliable runtime values.
- Flat Interfaces: Favor flat, single-level interfaces to improve readability and maintainability.
- Never Use any: Replace any with unknown and utilize generics for flexible, controlled typing.
- Utility Types & Type Guards: Leverage Pick, Omit, Partial, Required, Readonly, and custom guards to enforce safe shapes.
- Type Import Patterns: Use type-only imports to avoid runtime overhead and confusion.
- Use Case: When refactoring legacy TypeScript to modern patterns, or when introducing strict typing in a new project.
Quick Start
Run the TypeScript strict patterns checker on a project file, then apply the recommended const pattern, flat interfaces, and no-any policy to begin improving type safety.