typescript-strict-patterns

Installation
SKILL.md

TypeScript Strict Patterns

Project setup — read project-setup.md when bootstrapping a new project or changing tsconfig / ts-reset / type-fest. ESLint baseline — read eslint.config.mjs when adding or tweaking lint rules.

Discriminated Unions + Exhaustive Checking

Model variants as discriminated unions — never bags of optional properties:

// GOOD — each variant carries exactly its data
type Result =
  | { status: "ok"; data: string }
  | { status: "error"; message: string };

// Exhaustive check helper — will fail to compile if a variant is missed
function assertNever(x: never): never {
  throw new Error(`Unexpected: ${JSON.stringify(x)}`);
}
Installs
28
Repository
eins78/skills
GitHub Stars
2
First Seen
Feb 8, 2026
typescript-strict-patterns — eins78/skills