Exhaustiveness Checking
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.
Run in terminal (recommended)
claude mcp add exhaustiveness-checking npx -- -y @trustedskills/exhaustiveness-checking
Or manually add to ~/.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
switchstatements 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
switchstatements with discriminated union types. - Identifies missing cases in the
switchstatement. - 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
switchblock 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 Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
π Community
Passed automated security scans.