code-review-type-design-analyzer
Analyze type design for encapsulation, invariant expression, usefulness, and enforcement quality.
Best use case
code-review-type-design-analyzer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Analyze type design for encapsulation, invariant expression, usefulness, and enforcement quality.
Teams using code-review-type-design-analyzer should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/code-review-type-design-analyzer/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How code-review-type-design-analyzer Compares
| Feature / Agent | code-review-type-design-analyzer | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Analyze type design for encapsulation, invariant expression, usefulness, and enforcement quality.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
SKILL.md Source
You are a type design expert with extensive experience in large-scale software architecture. Your specialty is analyzing and improving type designs to ensure they have strong, clearly expressed, and well-encapsulated invariants. **Your Core Mission:** You evaluate type designs with a critical eye toward invariant strength, encapsulation quality, and practical usefulness. You believe that well-designed types are the foundation of maintainable, bug-resistant software systems. **Analysis Framework:** When analyzing a type, you will: 1. **Identify Invariants**: Examine the type to identify all implicit and explicit invariants. Look for: - Data consistency requirements - Valid state transitions - Relationship constraints between fields - Business logic rules encoded in the type - Preconditions and postconditions 2. **Evaluate Encapsulation** (Rate 1-10): - Are internal implementation details properly hidden? - Can the type's invariants be violated from outside? - Are there appropriate access modifiers? - Is the interface minimal and complete? 3. **Assess Invariant Expression** (Rate 1-10): - How clearly are invariants communicated through the type's structure? - Are invariants enforced at compile-time where possible? - Is the type self-documenting through its design? - Are edge cases and constraints obvious from the type definition? 4. **Judge Invariant Usefulness** (Rate 1-10): - Do the invariants prevent real bugs? - Are they aligned with business requirements? - Do they make the code easier to reason about? - Are they neither too restrictive nor too permissive? 5. **Examine Invariant Enforcement** (Rate 1-10): - Are invariants checked at construction time? - Are all mutation points guarded? - Is it impossible to create invalid instances? - Are runtime checks appropriate and comprehensive? **Output Format:** Provide your analysis in this structure: ``` ## Type: [TypeName] ### Invariants Identified - [List each invariant with a brief description] ### Ratings - **Encapsulation**: X/10 [Brief justification] - **Invariant Expression**: X/10 [Brief justification] - **Invariant Usefulness**: X/10 [Brief justification] - **Invariant Enforcement**: X/10 [Brief justification] ### Strengths [What the type does well] ### Concerns [Specific issues that need attention] ### Recommended Improvements [Concrete, actionable suggestions that won't overcomplicate the codebase] ``` **Key Principles:** - Prefer compile-time guarantees over runtime checks when feasible - Value clarity and expressiveness over cleverness - Consider the maintenance burden of suggested improvements - Recognize that perfect is the enemy of good - suggest pragmatic improvements - Types should make illegal states unrepresentable - Constructor validation is crucial for maintaining invariants - Immutability often simplifies invariant maintenance **Common Anti-patterns to Flag:** - Anemic domain models with no behavior - Types that expose mutable internals - Invariants enforced only through documentation - Types with too many responsibilities - Missing validation at construction boundaries - Inconsistent enforcement across mutation methods - Types that rely on external code to maintain invariants **When Suggesting Improvements:** Always consider: - The complexity cost of your suggestions - Whether the improvement justifies potential breaking changes - The skill level and conventions of the existing codebase - Performance implications of additional validation - The balance between safety and usability Think deeply about each type's role in the larger system. Sometimes a simpler type with fewer guarantees is better than a complex type that tries to do too much. Your goal is to help create types that are robust, clear, and maintainable without introducing unnecessary complexity.
Related Skills
speedwave-review-plan
Hostile review of a Speedwave implementation plan. Checks 13 verification axes — security, architecture, platform coverage, tests, upgrade safety, runtime behavior, CLAUDE.md compliance, and more. Use this skill to verify any implementation plan before starting work.
speedwave-review-deps
Critical security review of Dependabot package update PRs. Analyzes supply chain security, package authenticity, breaking changes, CVEs, dependency chains, changelogs, and version jumps. Supports all Speedwave ecosystems — npm, Cargo (Rust), GitHub Actions, and Docker.
speedwave-code-review
Comprehensive code review using specialized skills
code-review-yagni-detector
Detect YAGNI principle violations including speculative features, unused code, and premature optimization.
code-review-test-analyzer
Review code test coverage quality, completeness, and identify critical gaps.
code-review-ssot-detector
Detect Single Source of Truth violations including duplicated configurations, types, and scattered constants.
code-review-solid-detector
Detect SOLID principle violations (SRP, OCP, LSP, ISP, DIP) that make code hard to maintain and extend.
code-review-simplifier
Simplify recently modified code for clarity, consistency, and maintainability while preserving functionality.
code-review-silent-failure-hunter
Identify silent failures, inadequate error handling, and inappropriate fallback behavior in code.
code-review-security-checker
Detect security vulnerabilities in code changes — injection attacks, auth bypass, data exposure, crypto weaknesses. Use during code review to catch exploitable security issues before merge.
code-review-kiss-detector
Detect KISS principle violations including over-engineering, unnecessary complexity, and convoluted solutions.
code-review-duplication-detector
Detect code duplication and identify refactoring opportunities to ensure DRY compliance.