context-type-inference
Installation
SKILL.md
Understand How Context Is Used in Type Inference
Overview
Separating a value from its context can cause type errors.
TypeScript infers types based on both the value AND where it's used. When you extract a value to a variable, you lose context, which can cause surprising type errors.
When to Use This Skill
- Extracting a value to a constant causes type errors
- Callback parameters have wrong types
- Tuple types becoming array types
- String literals becoming general strings