type-design-analyzer
Analyze TypeScript type design quality. Use when reviewing types, checking invariants, or strengthening type safety.
Why use this skill?
Analyze your TypeScript type design quality with OpenClaw. Evaluate encapsulation, invariant strength, and safety to make illegal states unrepresentable.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/anton-abyzov/sw-type-design-analyzerWhat This Skill Does
The Type Design Analyzer is a specialized skill for OpenClaw that functions as an expert-level TypeScript consultant. It parses your source code and documentation to evaluate your type system through the lens of four critical dimensions: Encapsulation, Invariant Expression, Invariant Usefulness, and Invariant Enforcement. Rather than simply linting for syntax, this skill critiques the architectural philosophy of your data models. It detects 'anemic' domain objects that lack behavior, identifies leaky abstractions where internal state can be mutated from external scopes, and flags instances where business constraints are merely stored in comments rather than encoded into the type system itself.
Installation
To integrate this skill into your development environment, run the following command in your terminal:
clawhub install openclaw/skills/skills/anton-abyzov/sw-type-design-analyzer
Ensure you have the OpenClaw CLI configured and authenticated to access the repository.
Use Cases
This skill is ideal for:
- Refactoring Legacy Code: Identify modules where loose type definitions are leading to runtime exceptions.
- Architecture Reviews: Verify that your domain models successfully implement the 'make illegal states unrepresentable' philosophy before shipping to production.
- Mentorship & Onboarding: Provide junior developers with actionable feedback on their code, explaining exactly why a certain interface definition might be considered brittle or unsafe.
- Critical System Development: Analyze core business entities (like User, Transaction, or Order objects) to ensure invariants are strictly enforced via encapsulation.
Example Prompts
- "Analyze the UserAccount class in auth.ts. It feels like an anemic model, but I'm not sure how to wrap it in a better factory pattern. Can you give me a score on the four dimensions and suggest a refactor?"
- "Look at this TypeScript snippet. I'm relying on documentation comments to enforce that the 'Price' is positive. How can I use branded types or nominal typing to make this impossible to represent incorrectly?"
- "Review this Order processing module. The array of items is public and mutable. What are the specific security and stability risks here, and how do I enforce encapsulation while keeping the API usable?"
Tips & Limitations
To get the most out of the Type Design Analyzer, provide the agent with the context of the business problem your code is solving. The skill performs best when it understands the 'Why' behind your constraints. Keep in mind that this is an analytical agent; it provides feedback and structural suggestions, but it does not automatically refactor your codebase. It is designed to act as a reviewer rather than an automated code generator, helping you learn how to build more robust systems over time.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-anton-abyzov-sw-type-design-analyzer": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-read
Related Skills
network-engineer
Cloud network architect for VPC design, service mesh, zero-trust networking, load balancers, and CDN optimization. Use for network troubleshooting or connectivity issues.
jira-multi-project-mapper
Expert in mapping SpecWeave specs to multiple JIRA projects with intelligent project detection and cross-project coordination. Use when syncing to multiple JIRA projects (project-per-team, component-based), or managing bidirectional sync across team boundaries.
helm-chart-scaffolding
Design, organize, and manage Helm charts for templating and packaging Kubernetes applications with reusable configurations. Use when creating Helm charts, packaging Kubernetes applications, or implementing templated deployments.
performance-optimization
React Native performance with Hermes V1, FlashList, expo-image v2, concurrent rendering. Use for slow app, memory leaks, or FPS issues.
release-strategy-advisor
Release strategy advisor - detects brownfield patterns (tags, CI/CD, changelogs), recommends versioning strategy based on architecture. Creates release-strategy.md.