typescript-patterns
Installation
SKILL.md
TypeScript Patterns
Use this skill when changing TypeScript code and you need strong, practical defaults instead of a catalog of language features.
Goals
- Make invalid states hard to represent
- Keep inference helpful, not magical
- Validate runtime boundaries
- Avoid type gymnastics that reduce readability
Core Rules
1. Prefer inference until the contract matters
- Let TypeScript infer obvious locals.
- Add explicit types for public APIs, exported functions, complex return types, and shared constants.
- If inference produces a weak or widened type, annotate deliberately.