Agent skill

Exhaustive Switch

by zkldi in zkldi/Tachi

Prefer staticAssertUnreachable in the default branch of switches that must cover every variant of a union, so exhaustiveness is checked at compile time.

No licenceAuto-check passed

Install Exhaustive Switch

skills CLI
$ npx skills add zkldi/Tachi --skill exhaustive-switch -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install zkldi/Tachi exhaustive-switch --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/zkldi/Tachi.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cursor/skills/exhaustive-switch .claude/skills/exhaustive-switch && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
exhaustive-switch
GitHub stars
238
Token cost
~625 tokens
SKILL.md length
265 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
None found

At a glance

Prefer staticAssertUnreachable in the default branch of switches that must cover every variant of a union, so exhaustiveness is checked at compile time.

  • Works in 3 steps: Import staticAssertUnreachable from… → Bind the switched value in a variable if… → In default, call…
  • Reviewing switch on discriminated unions
  • SKILL.md covers When to use, Pattern, Why and Avoid, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Exhaustive Switch is an agent skill from zkldi/Tachi. Prefer staticAssertUnreachable in the default branch of switches that must cover every variant of a union, so exhaustiveness is checked at compile time. Use when writing or reviewing switch on discriminated unions, string literal unions, enums, or any switch meant to be exhaustive in the Tachi TypeScript server.

Its SKILL.md is about 630 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with TypeScript. The repository describes itself as: A Cutting-Edge, Modular Score Tracker.

When your agent uses it

  • Reviewing switch on discriminated unions
  • String literal unions
  • Any switch meant to be exhaustive in the Tachi TypeScript server

Example prompts

  • “/exhaustive-switch”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Import staticAssertUnreachable from #utils/misc.js (server code).
  2. Bind the switched value in a variable if needed so the default branch receives a narrowed type.
  3. In default, call staticAssertUnreachable(discriminant) with the same value you are switching on (after all cases, TypeScript should infer…

What it can do on your machine

Read from SKILL.md and the folder at commit e6b34a1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Exhaustive Switch loads about 625 tokens when it runs. Until then it costs about 83 tokens; SKILL.md has 265 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~83
When it runs · the whole SKILL.md, loaded when a task matches
~625

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Without a licence we can't republish the file, so here is its outline and opening line. It has 265 words (~625 tokens).

“Use this pattern when the switch is meant to be exhaustive: every value of the discriminant type should have a case, and adding a new variant later should cause a TypeScript error until a new case is added.”

— opening of SKILL.md by zkldi
name
exhaustive-switch

Read the full SKILL.md on GitHub

Files

Just SKILL.md in .cursor/skills/exhaustive-switch of zkldi/Tachi.

Open the folder on GitHubat commit e6b34a1

Compare with similar skills

Exhaustive Switch next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Exhaustive Switch compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Exhaustive Switch this skillzkldi/Tachi238—~625Automated safety check: PassNone
MCP Server Builderanthropics/skills180k63 repos~2.3kAutomated safety check: PassApache-2.0
Web Artifacts Builderanthropics/skills180k40 repos~769Automated safety check: PassApache-2.0
Typescript Advanced Typesrolling-scopes/rsschool-app10k25 repos~4.2kAutomated safety check: PassMPL-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k4 repos~1.1kAutomated safety check: PassMIT
MCP Server BuildershareAI-lab/learn-claude-code78k4 repos~1.2kAutomated safety check: PassMIT

Similar skills

  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 63 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • Web Artifacts Builder

    anthropics/skills

    Official

    Builds multi-component claude.ai HTML artifacts as a small React, TypeScript and Tailwind project, then bundles it into one shareable HTML file.

    180k GitHub starsUsed in 40 repos~769 tokens
    Frontend & DesignAuto-check passed
  • Typescript Advanced Types

    rolling-scopes/rsschool-app

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.

    10k GitHub starsUsed in 25 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 4 repos~1.1k tokens
    DevelopmentAuto-check passed
  • MCP Server Builder

    shareAI-lab/learn-claude-code

    Walks through building MCP servers in Python or TypeScript that expose tools, resources and prompts to Claude, with templates, registration and testing.

    78k GitHub starsUsed in 4 repos~1.2k tokens
    Agent WorkflowsAuto-check passed
  • Nx Import

    nrwl/nx

    Import, merge, or combine repositories into an Nx workspace using nx import.

    29k GitHub starsUsed in 6 repos~3.5k tokens
    DevelopmentAuto-check passed

More from zkldi/Tachi

  • Patterns for writing actions (MakeAction/MakeAnonAction), using the Postgres DB (Kysely), and migrating Express routes from MongoDB to Postgres in the Tachi server.

    238 GitHub stars~2.3k tokensUpdated yesterday
    Auto-check passed
  • Coverage Tools

    zkldi/Tachi

    Aggregates Vitest v8/Istanbul coverage across Tachi workspaces via tachi-coverage-tools (manifest, CLI, optional programmatic API).

    238 GitHub stars~580 tokensUpdated yesterday
    Auto-check passed
  • DB Formats

    zkldi/Tachi

    Guidance on using db-formats/ column lists (SELECT) and document mappers (ToDocument) instead of selectAll() when writing Postgres-backed endpoints in the Tachi server.

    238 GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • Preserves existing code comments (line, block, JSDoc, region markers) when editing files; does not delete or collapse comments for brevity unless the user asked to remove or update them.

    238 GitHub stars~399 tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Exhaustive Switch

What does Exhaustive Switch do?

Prefer staticAssertUnreachable in the default branch of switches that must cover every variant of a union, so exhaustiveness is checked at compile time. Exhaustive Switch is an agent skill from zkldi/Tachi. Prefer staticAssertUnreachable in the default branch of switches that must cover every variant of a union, so exhaustiveness is checked at compile time.

When should I use Exhaustive Switch?

Exhaustive Switch fits situations like: reviewing switch on discriminated unions; string literal unions; any switch meant to be exhaustive in the Tachi TypeScript server.

How do I install Exhaustive Switch in Claude Code?

Run `npx skills add zkldi/Tachi --skill exhaustive-switch -a claude-code`. Or copy the skill folder (.cursor/skills/exhaustive-switch in zkldi/Tachi) into .claude/skills/exhaustive-switch in your project. Claude Code loads it when a task matches its description.

How do I install Exhaustive Switch in Codex?

Run `npx skills add zkldi/Tachi --skill exhaustive-switch -a codex`. Or copy the skill folder (.cursor/skills/exhaustive-switch in zkldi/Tachi) into .agents/skills/exhaustive-switch in your project. Codex loads it when a task matches its description.

Can I use Exhaustive Switch in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add zkldi/Tachi --skill exhaustive-switch -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/exhaustive-switch, .gemini/skills/exhaustive-switch, .github/skills/exhaustive-switch and .opencode/skills/exhaustive-switch in your project.

What does Exhaustive Switch need to run?

SKILL.md names no scripts, command-line tools or credentials: Exhaustive Switch is instructions for the agent only.

Does Exhaustive Switch access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Exhaustive Switch safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Exhaustive Switch use?

No licence was found for Exhaustive Switch or its repository. Without one, default copyright applies: ask the author before reusing or redistributing it.

How many tokens does Exhaustive Switch use?

About 625 tokens (SKILL.md is roughly 2.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Exhaustive Switch?

Skills that share tags, products or a category with Exhaustive Switch: MCP Server Builder (anthropics/skills, 180k stars), Web Artifacts Builder (anthropics/skills, 180k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Exhaustive Switch?

zkldi (a GitHub user) maintains it in zkldi/Tachi, which has 238 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 8, 2026.

Source: zkldi/Tachi on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.