TypeScript Skill References
Detailed guides for utility types, generics, type guards, configuration, and error handling
Overview
This directory contains detailed guides for advanced TypeScript features. Main SKILL.md provides critical patterns. These references offer deep-dives into utility types, advanced generics, and type-safe patterns.
Quick Navigation
| Reference | Purpose | Read When |
|---|---|---|
| utility-types.md | 30+ built-in utility types (Partial, Pick, etc.) | Transforming types, avoiding manual definitions |
| generics-advanced.md | Constraints, conditional types, mapped types | Building reusable type-safe components |
| type-guards.md | Type narrowing, discriminated unions | Runtime type checking and validation |
| config-patterns.md | tsconfig.json deep dive, strict mode | Setting up TypeScript projects |
| error-handling.md | Type-safe error patterns, Result types | Handling errors without exceptions |
| ts5-patterns.md | NoInfer, branded types, exhaustive switch, using, const type parameters | Using TypeScript 5.x features |
Reading Strategy
For Type Transformations
- Read main SKILL.md
- MUST read: utility-types.md for Partial, Pick, Omit, Record, etc.
For Generic Functions/Components
- Read main SKILL.md
- MUST read: generics-advanced.md for constraints and conditional types
For Runtime Validation
- Read main SKILL.md
- MUST read: type-guards.md for type narrowing patterns
For Project Setup
- Read main SKILL.md
- MUST read: config-patterns.md for strict mode and compiler options
File Descriptions
utility-types.md
Complete guide to 30+ built-in utility types
- Partial, Required, Readonly
- Pick, Omit, Exclude, Extract
- Record, NonNullable, ReturnType
- Parameters, ConstructorParameters
- And 20+ more with examples
generics-advanced.md
Advanced generic patterns
- Generic constraints
- Conditional types
- Mapped types
- Template literal types
- Infer keyword
type-guards.md
Type narrowing and validation
- typeof, instanceof guards
- User-defined type guards
- Discriminated unions
- Assertion functions
config-patterns.md
tsconfig.json configuration
- Strict mode options
- Module resolution
- Path mapping
- Project references
error-handling.md
Type-safe error patterns
- Result types
- never type
- Error unions
- Exception handling
ts5-patterns.md
TypeScript 5.x language features
NoInfer<T>— prevent unintended type inference (TS 5.4)- Branded/nominal types — type-safe IDs and domain values
- Exhaustive switch with
neverandassertNeverhelper using/await using— explicit resource management (TS 5.2)- Const type parameters — preserve literal types in generics (TS 5.0)
Cross-Reference Map
- config-patterns.md → Project setup; foundational before all other patterns
- generics-advanced.md → Type reuse; builds on type-guards.md and utility-types.md
- type-guards.md → Runtime type narrowing; pairs with error-handling.md for safe code
- utility-types.md → Built-in transformations; reduces need for custom types
- error-handling.md → Type-safe errors; pairs with type-guards.md for safe handling
- ts5-patterns.md → TypeScript 5.x features; builds on generics-advanced.md and type-guards.md
- Related skills: react, nodejs