discriminated-unions

Installation
SKILL.md

Discriminated Unions

Apply the TypeScript Style Guide's discriminated-union conventions in the context of the current task.

Workflow

  1. Inspect the consuming repository's conventions and configuration.
  2. Let explicit repository conventions take precedence over this opinionated guidance.
  3. Apply, review, or explain only the guidance relevant to the task.
  4. State important tradeoffs when the appropriate model depends on context or judgment.

Boundaries

  • Use discriminated unions for mutually exclusive variants that require different data.
  • Do not force a discriminated union when properties may independently be absent or when only a value changes.
  • Keep TypeScript and ESLint responsible for checks they can enforce automatically.
  • Do not introduce unrelated TypeScript Style Guide conventions merely because this skill is active.
Installs
2
GitHub Stars
782
First Seen
Aug 23, 2026
discriminated-unions — mkosir/typescript-style-guide