ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified developer tools Safety 5/5

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.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/anton-abyzov/sw-type-design-analyzer
Or

What 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:

  1. Refactoring Legacy Code: Identify modules where loose type definitions are leading to runtime exceptions.
  2. Architecture Reviews: Verify that your domain models successfully implement the 'make illegal states unrepresentable' philosophy before shipping to production.
  3. Mentorship & Onboarding: Provide junior developers with actionable feedback on their code, explaining exactly why a certain interface definition might be considered brittle or unsafe.
  4. Critical System Development: Analyze core business entities (like User, Transaction, or Order objects) to ensure invariants are strictly enforced via encapsulation.

Example Prompts

  1. "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?"
  2. "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?"
  3. "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

Stars1054
Views0
Updated2026-02-16
View Author Profile
AI Skill Finder

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 skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-anton-abyzov-sw-type-design-analyzer": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#typescript#static-analysis#architecture#refactoring#domain-driven-design
Safety Score: 5/5

Flags: file-read