# TypeScript Discriminated Unions (agent skill)

> TypeScript Discriminated Unions is an agent skill (a SKILL.md file) from mkosir/typescript-style-guide. Apply, review, and explain discriminated unions in TypeScript. It works with Claude Code and has 783 GitHub stars across a repository of 2 listed skills. Install it by copying the skill folder into your agent's skills directory.

Apply, review, and explain discriminated unions in TypeScript. Use automatically for tasks involving mutually exclusive variants, invalid state prevention, exhaustiveness checking, variant-specific object properties, application state, function arguments, or React props. Apply the TypeScript Style Guide's discriminated-union conventions in the context of the current task.

## Key facts

| Fact | Value |
|---|---|
| Repository | https://github.com/mkosir/typescript-style-guide |
| Skill path | skills/typescript-discriminated-unions/SKILL.md |
| Skill name | typescript-discriminated-unions |
| GitHub stars | 783 |
| Installs on skills.sh | 3 |
| License | MIT |
| Skills in repo | 2 |
| Plugin marketplace | no |
| Official | no |
| Works with | Claude Code |
| Category | Coding |
| Last commit | Sep 3, 2026 |

## When it triggers

- Use automatically for tasks involving mutually exclusive variants, invalid state prevention, exhaustiveness checking, variant-specific object properties, application state, function arguments, or React props.

## Add this skill

### Claude Code

```sh
git clone --depth 1 https://github.com/mkosir/typescript-style-guide.git
cp -r typescript-style-guide/skills/typescript-discriminated-unions ~/.claude/skills/typescript-discriminated-unions   # personal, or .claude/skills in a project
```

In the Claude apps, zip the skill folder and upload it under Customize > Skills > + > Upload a skill (code execution must be on).

### ChatGPT / Codex

```sh
git clone --depth 1 https://github.com/mkosir/typescript-style-guide.git
cp -r typescript-style-guide/skills/typescript-discriminated-unions .agents/skills/typescript-discriminated-unions   # repo; ~/.agents/skills for all projects
```

### Cursor

```sh
git clone --depth 1 https://github.com/mkosir/typescript-style-guide.git
cp -r typescript-style-guide/skills/typescript-discriminated-unions .cursor/skills/typescript-discriminated-unions   # project; ~/.cursor/skills for all projects
```

Sources (checked 2026-10-07): https://code.claude.com/docs/en/skills, https://support.claude.com/en/articles/12512180-using-skills-in-claude, https://learn.chatgpt.com/docs/build-skills, https://cursor.com/docs/context/skills

skills.sh listing: https://www.skills.sh/mkosir/typescript-style-guide/typescript-discriminated-unions

---

Canonical page: https://appsgit.com/skills/mkosir-typescript-discriminated-unions
Source: appsgit (https://appsgit.com), the app store for github. Data from the GitHub API, refreshed daily.
Machine access: JSON API https://appsgit.com/api/v1/apps (OpenAPI: https://appsgit.com/openapi.json), MCP server https://mcp.appsgit.com/mcp, full index https://appsgit.com/llms-full.txt.
