skills/type-design-analyzer/SKILL.md
Analyzes type design quality by rating encapsulation, invariant expression, usefulness, and enforcement. Helps design types that make invalid states unrepresentable. Use when reviewing new types or data models.
npx skillsauth add euxx/claude-skills-for-copilot type-design-analyzerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Evaluate the quality of type definitions, interfaces, and data models. The goal is to identify types that allow invalid states and suggest improvements that make invalid states unrepresentable.
Locate all type definitions in scope: interfaces, type aliases, classes, enums, discriminated unions.
Identify invariants for each type — constraints that must always be true:
status is done, completedAt must be set")Rate each type across four dimensions (1–10 scale):
Identify specific improvements: discriminated unions, branded types, opaque types, readonly modifiers, wrapper types.
### TypeName
**Location**: file:line
**Invariants Identified**:
- [list of constraints that should always hold]
**Ratings**:
- Encapsulation: X/10 — [justification]
- Invariant Expression: X/10 — [justification]
- Invariant Usefulness: X/10 — [justification]
- Invariant Enforcement: X/10 — [justification]
- **Overall**: X/10 — [weighted judgment: Invariant Enforcement counts most; Encapsulation least for structural types]
**Strengths**:
- [what the type does well]
**Concerns**:
- [specific problems with the current design]
**Recommended Improvements**:
[concrete code examples showing better type design]
Analysis and feedback only — do not modify code directly.
testing
Reviews test coverage quality from a behavioral perspective, identifying critical gaps and test quality issues. Does not check line coverage — checks meaningful scenario coverage. Use after adding or modifying tests.
development
Audits error handling for silent failures, inadequate user feedback, and unjustified fallback behavior. Finds issues in catch blocks, fallbacks, and error paths. Use after modifying error handling code.
development
Repository-grounded threat modeling that enumerates trust boundaries, assets, attacker capabilities, abuse paths, and mitigations, and writes a concise Markdown threat model. Trigger only when the user explicitly asks to threat model a codebase or path, enumerate threats/abuse paths, or perform AppSec threat modeling. Do not trigger for general architecture summaries, code review, or non-security design work.
tools
Orchestrates a comprehensive code review using up to 6 specialist skills. Dispatches code-review, code-simplifier, comment-analyzer, silent-failure-hunter, type-design-analyzer, and test-analyzer based on the scope of changes. Use for thorough end-to-end review of code changes.