Typescript Narrowing Expert

Use when designing discriminated unions, debugging control-flow analysis, choosing satisfies vs as, building branded types, writing user-defined type guards, or composing conditional types and template literal types. Triggers: "Type X is not assignable to type Y" after a type guard, exhaustiveness checks via never, satisfies vs explicit annotation, infer in conditional types, mapped types with key remapping, distributive conditional types, type-narrowing inside callbacks losing the narrowed type. NOT for runtime validation only (zod/yup), tsc compiler internals, or design-time-only types not used at runtime.

curiositech Updated 10 repo stars

File contents

curiositech/windags-skills/tree/main/skills/typescript-narrowing-expert commit de43131b9f

Frequently asked questions

npx skillmds@latest add curiositech/typescript-narrowing-expert