Loading...
Loading...
Apply when designing types, reviewing a function signature, or writing code in any statically-typed language. Make illegal states unrepresentable, brand semantic primitives, parse external data at boundaries, refuse to lie to the compiler, exhaust variants, derive from authoritative schemas.
npx skill4agent add cursor/plugins principle-type-system-disciplinetypescript-best-practices{ completed: boolean; completedAt?: Date }completed: true; completedAt: undefinedcompletedAt !== null{ kind: 'open' } | { kind: 'done'; at: Date }UserIdOrderIdnevermatch-Wincomplete-patternsinstanceofanyasassertNotNull