type-design-analyzer

type-design-analyzer is an agent for Claude Code from rjmurillo/ai-agents. It costs 69 tokens per session (1,141 once invoked), scanned A, original, MIT.

An expert review agent for the design of types in a codebase. Types describe what data can look like and can also express rules that keep that data valid.

In plain words
What is it for?
Use it when adding a type, reviewing types from a pull request, or refactoring existing types. It examines consistency rules, valid state changes, field relationships, and how clearly the type communicates them.
Why use it?
It helps find weakly protected rules, unclear interfaces, and implementation details exposed to callers. The review combines written feedback with ratings for areas such as encapsulation and invariant expression.

Agent for Claude Code

Part of the project-toolkit plugin — 95 skills, 26 commands, 33 agents, 4 hooks shipped together

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.

agentmods
npx agentmods add agents/rjmurillo/ai-agents/type-design-analyzer
Clone the repo
git clone --depth 1 https://github.com/rjmurillo/ai-agents

Made for: Claude Code.

Or install project-toolkit, the plugin that ships this one along with the rest of its 95 skills, 26 commands, 33 agents, 4 hooks.

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/rjmurillo/ai-agents/type-design-analyzer.svg)](https://agentmods.dev/agents/rjmurillo/ai-agents/type-design-analyzer)
Your own site
<a href="https://agentmods.dev/agents/rjmurillo/ai-agents/type-design-analyzer"><img src="https://agentmods.dev/badge/agents/rjmurillo/ai-agents/type-design-analyzer.svg" alt="Measured on agentmods" height="20"></a>
Per session 69 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,141 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00069 $0.01141
Opus 5 $0.00034 $0.00571
Sonnet 5 $0.00014 $0.00228
Haiku 4.5 $0.00007 $0.00114

Measured 4d ago against content hash c7df006d7ae0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 · 130 lines

How it starts

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

Type Design Analyzer Agent

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?

Scoring Anchors (apply to all four dimensions):

Each dimension above lists four sub-criteria. Count how many are satisfied for the type under review, then map the count to one exact score. Use this rule for every dimension so the same type yields the same score:

Sub-criteria satisfied Score Meaning
4 of 4 10 Every sub-criterion fully met
3 of 4 7 Most met; one clear gap
2 of 4 5 Half met; material gaps remain
1 of 4 3 One met; broad gaps remain
0 of 4 1 None met

A sub-criterion counts as satisfied only when it is fully true, not partially; a partial satisfaction does not raise the count. State the count (e.g. "3/4") in each justification so the score is auditable.

Output Format:

Provide your analysis in this structure:

## Type: [TypeName]

### Invariants Identified
- [List each invariant with a brief description]

### Ratings
- **Encapsulation**: X/10  (sub-criteria met: N/4)
  [Brief justification]

- **Invariant Expression**: X/10  (sub-criteria met: N/4)
  [Brief justification]

- **Invariant Usefulness**: X/10  (sub-criteria met: N/4)
  [Brief justification]

- **Invariant Enforcement**: X/10  (sub-criteria met: N/4)
  [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

Read the full file on GitHub · 130 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 · 130 lines · 69 tokens per session scan A c7df006d7ae0

Subscribe to this mod's changes

type-design-analyzer is an agent published in the GitHub repository rjmurillo/ai-agents (45 stars, last pushed today), licensed MIT. It adds 69 tokens to every session and 1,141 once invoked, about $0.0003 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-08-30.

Related

Other agents, from other repositories

context-librarian

PROACTIVELY use when main Claude needs context before proceeding. Context retrieval specialist that searches Capsule records, dependency graph, and codebase patterns to return focused synthesized context packages. Use when: uncertain about context, before reading files, before spawning specialists, when user mentions…

arpitnath/claude-capsule-kit · 72 tokens

git-workflow-manager

Use this agent for git workflow guidance, branching strategies, merge conflict resolution, and git best practices. Helps with complex git operations and maintaining clean git history.

arpitnath/claude-capsule-kit · 39 tokens

github-issue-tracker

Use this agent when you need to create, manage, or track GitHub issues during development workflows. Creates properly formatted issues with context, labels, and assignees. Read-only agent for production safety.

arpitnath/claude-capsule-kit · 47 tokens

code-reviewer

Use this agent for code review before commits or PRs. Checks for bugs, security issues, performance problems, and code quality. Provides actionable feedback with specific line references.

arpitnath/claude-capsule-kit · 40 tokens

database-navigator

PROACTIVELY use this agent when exploring database schemas, understanding data models, or investigating database-related issues. Expert in SQL, migrations, and data relationships. Read-only agent for production safety.

arpitnath/claude-capsule-kit · 43 tokens

architecture-explorer

PROACTIVELY use this agent when exploring codebase architecture, understanding service boundaries, data flows, or integration points. Specializes in explaining "how does X integrate with Y?" questions. Read-only agent for production safety.

arpitnath/claude-capsule-kit · 50 tokens