typescript
Installation
SKILL.md
TypeScript
Route to Sub-skills
→ Type system (unknown/any, narrowing, discriminated unions, mapped types…) → type-system/ sub-skill
→ Zod (schema validation, transforms, coercion, branded types…) → zod/ sub-skill
→ Design patterns (Strategy, Factory, Builder, Decorator, Mixin…) → oop-principles skill
→ SOLID principles (SRP, OCP, LSP, ISP, DIP) → oop-principles skill
Error Handling
| Strategy | Caller forced to handle? | Composability |
|---|---|---|
Return T | null |
Yes (null check) | Low |
| Throw exception | No — easy to miss | High |
Return exception T | ErrorA | ErrorB |
Yes — union exhaustion | Medium |
| Option/Either type | Via .flatMap chain |
High (needs library) |
Related skills