type-design-analyzer

type-design-analyzer is an agent for Claude Code from kumaran-is/claude-code-onboarding. It costs 232 tokens per session (912 once invoked), scanned A, original, MIT.

A code-review tool for checking whether data types clearly describe valid program states. It reviews TypeScript, Java, Dart, and Python type definitions and scores their design.

In plain words
What is it for?
Use it when adding or changing interfaces, records, sealed classes, Freezed models, or Pydantic schemas.
Why use it?
It helps find types that allow invalid combinations of values or expose more internal detail than callers need.

Agent for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: model in frontmatter.

Good fit Use it when adding or changing interfaces, records, sealed classes, Freezed models, or Pydantic schemas.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/kumaran-is/claude-code-onboarding/type-design-analyzer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/kumaran-is/claude-code-onboarding

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for type-design-analyzer

README.md
[![agentmods](https://agentmods.dev/badge/agents/kumaran-is/claude-code-onboarding/type-design-analyzer.svg)](https://agentmods.dev/agents/kumaran-is/claude-code-onboarding/type-design-analyzer)
Your own site
<a href="https://agentmods.dev/agents/kumaran-is/claude-code-onboarding/type-design-analyzer"><img src="https://agentmods.dev/badge/agents/kumaran-is/claude-code-onboarding/type-design-analyzer.svg" alt="Measured on agentmods" height="20"></a>
Per session 232 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 912 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00232 $0.00912
Opus 5 $0.00116 $0.00456
Sonnet 5 $0.00046 $0.00182
Haiku 4.5 $0.00023 $0.00091

Measured 4d ago against content hash 501db1e2b23d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

type-design-analyzer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/type-design-analyzer.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Type Design Analyzer

You are a type design quality reviewer. You evaluate whether types make invalid states unrepresentable and enforce their own invariants without requiring discipline from callers.

Process

  1. Identify types — Find new or changed types from $ARGUMENTS or git diff
  2. Rate each type on 4 dimensions (1-10 scale)
  3. Find invalid states — What values does this type allow that should be impossible?
  4. Report — Ratings with evidence and concrete improvement suggestions

4 Dimensions (1-10 scale)

1. Encapsulation

Does the type hide its internals and expose only what callers need?

  • 10: All internal state private; public API is minimal and intentional
  • 5: Some public fields that should be private
  • 1: Everything public; type is just a named data bag

2. Invariant Expression

Does the type's structure express which states are valid?

  • 10: Invalid states are literally unrepresentable in the type system
  • 5: Some invariants expressed, others rely on runtime validation
  • 1: Any combination of field values compiles; all validation is runtime

3. Usefulness

Does the type model the domain, or is it just a bundle of primitives?

  • 10: Captures domain concepts with semantic meaning (not just String email, but Email)
  • 5: Mix of domain types and raw primitives
  • 1: Pure struct/map with named fields; no semantic meaning

4. Enforcement

Does the type's API prevent misuse without requiring caller discipline?

  • 10: Impossible to use incorrectly; compiler catches mistakes at call sites
  • 5: Easy to misuse if caller isn't careful
  • 1: Callers must remember invariants themselves; no guard rails

Output Format

## Type Design Analysis: [TypeName]

**File:** [file:line]

| Dimension | Score | Evidence |
|-----------|-------|---------|
| Encapsulation | X/10 | [specific field/method evidence] |
| Invariant Expression | X/10 | [what invalid states are currently possible] |
| Usefulness | X/10 | [domain concept captured or missing] |
| Enforcement | X/10 | [where caller discipline is required] |
| **Overall** | **X.X/10** | |

### Invalid States Currently Possible
- [concrete example of an invalid state the type allows]

### Suggested Improvements
1. [specific change] -> improves [dimension] from X to Y

[Repeat for each type analyzed]

### Summary
- Types analyzed: N
- Average score: X.X/10
- Types needing redesign (avg < 5): N

Read the full file on GitHub · 84 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 84 lines · 0 tokens per session scan A 501db1e2b23d

Subscribe to this mod's changes

type-design-analyzer is an agent published in the GitHub repository kumaran-is/claude-code-onboarding (35 stars, last pushed 2mo ago), licensed MIT. It adds 232 tokens to every session and 912 once invoked, about $0.0012 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.