
typescript-discriminated-unions
Apply, review, and explain discriminated unions in TypeScript
by mkosirFree
Description
typescript-discriminated-unions is an agent skill from the TypeScript Style Guide by mkosir. It applies, reviews and explains discriminated unions in TypeScript, and it loads automatically on tasks that involve mutually exclusive variants or preventing invalid states. The skill follows the discriminated-union conventions of the guide, but it asks the agent to check the consuming repository's own conventions and configuration first, and to let explicit repository rules win over the guide. It applies only the guidance that matters to the task, and it names the important tradeoffs when the right model depends on context or judgment. Its boundaries are clear. Discriminated unions are for mutually exclusive variants that carry different data. They are not for cases where properties may be absent independently, or where only a value changes, and the skill says not to force them there. It also leaves checks that TypeScript and ESLint can enforce to those tools, and it does not bring in unrelated conventions from the guide just because it is active. The skill is listed on skills.sh with 3.5K installs and 783 GitHub stars for its project, and all of its security audits show Pass.…
Highlights
- Applies discriminated-union conventions
- Defers to repository conventions first
- Explains tradeoffs when judgment is needed
- Says when not to use a discriminated union
Ratings & Reviews
No ratings yet
Be the first to rate typescript-discriminated-unions.
People also visit

principle-type-system-discipline
Apply when designing types, reviewing a function signature
typescript-discriminated-unions FAQ
What does typescript-discriminated-unions do?
It helps an AI agent apply, review and explain discriminated unions in TypeScript, using the TypeScript Style Guide's conventions.
How do I install it?
Run: npx skills add https://github.com/mkosir/typescript-style-guide --skill typescript-discriminated-unions
When should I use a discriminated union?
The skill says to use one for mutually exclusive variants that require different data. It warns against using one when properties may be absent independently or when only a value changes.
Does it override my project's conventions?
No. The skill says to inspect the repository's conventions first and let explicit repository rules take precedence over the guide.
Is it free?
The listing shows it as free.
What security audit results does it have?
Gen Agent Trust Hub: Pass. Socket: Pass. Snyk: Pass.
What are the best typescript-discriminated-unions alternatives?
Popular alternatives to typescript-discriminated-unions include typescript, principle-type-system-discipline and typescript-advanced-types. See all typescript-discriminated-unions alternatives

















