typescript-patterns
Installation
SKILL.md
TypeScript Design Patterns
Overview
TypeScript design patterns apply established software design principles within the TypeScript type system to create maintainable, reusable, and type-safe code. This skill should be invoked when writing TypeScript code requiring best practices, building reusable libraries, or creating well-typed application architectures.
Core Principles
- Type Safety: Leverage TypeScript's static typing to catch errors at compile time
- Generics: Write reusable code that works with any type
- Structural Typing: Use interface composition over inheritance
- Utility Types: Leverage built-in utility types (Partial, Pick, Omit, etc.)
Preparation Checklist
- Enable strict mode in tsconfig.json
- Plan type hierarchy for your domain
- Identify opportunities for generics
- Define error handling strategy