Exhaustiveness Checking

🌐Community
by marius-townhouse Β· vlatest Β· Repository

This skill rigorously analyzes responses for completeness, ensuring all relevant aspects are covered – vital for thoroughness and accuracy.

Install on your platform

We auto-selected Claude Code based on this skill’s supported platforms.

1

Run in terminal (recommended)

terminal
claude mcp add exhaustiveness-checking npx -- -y @trustedskills/exhaustiveness-checking
2

Or manually add to ~/.claude/settings.json

~/.claude/settings.json
{
  "mcpServers": {
    "exhaustiveness-checking": {
      "command": "npx",
      "args": [
        "-y",
        "@trustedskills/exhaustiveness-checking"
      ]
    }
  }
}

Requires Claude Code (claude CLI). Run claude --version to verify your install.

About This Skill

What it does

This skill allows an AI agent to verify that a TypeScript switch statement or similar construct handles all possible cases of a discriminated union. It ensures no potential values are missed, preventing runtime errors and improving code reliability. The skill provides feedback on whether the exhaustive check passed or failed, highlighting any missing cases.

When to use it

  • Code Review: Automatically assess TypeScript code for exhaustiveness in switch statements when reviewing pull requests.
  • Refactoring: Identify potential issues during refactoring of existing TypeScript codebases that utilize discriminated unions.
  • Learning/Debugging: Help developers understand and debug type errors related to incomplete pattern matching.
  • Automated Testing: Integrate into CI/CD pipelines to ensure exhaustiveness checks are consistently enforced.

Key capabilities

  • Analyzes switch statements with discriminated union types.
  • Identifies missing cases in the switch statement.
  • Provides feedback on whether the exhaustive check passed or failed.

Example prompts

  • "Check if this TypeScript code is exhaustively handling all possible values of the 'Status' type." [followed by code]
  • β€œAnalyze this switch statement for completeness regarding the 'Shape' union.” [followed by code]
  • "Can you verify that this switch block covers all cases in my 'Fruit' discriminated union?" [followed by code]

Tips & gotchas

This skill requires valid TypeScript code as input. It is most effective when dealing with explicit discriminated unions; implicit or complex union types might yield less accurate results.

Tags

πŸ›‘οΈ

TrustedSkills Verification

Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates β€” what you install today is exactly what was reviewed and verified.

Security Audits

Gen Agent Trust HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
marius-townhouse
Installs
5

🌐 Community

Passed automated security scans.