type-design-analyzer

type-design-analyzer is an agent for Claude Code from coleam00/Archon. It costs 57 tokens per session (1,360 once invoked), scanned A, original, MIT.

An agent that reviews how software types express and protect valid states. It focuses on encapsulation, invariants (rules that must always remain true), and the quality of their enforcement.

In plain words
What is it for?
Use it when adding or changing types, reviewing pull requests with type changes, or refactoring existing type definitions.
Why use it?
It can reveal type designs that allow invalid data or make important rules hard to maintain, while considering whether suggested improvements justify their complexity.

Agent for Claude Code

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/coleam00/archon/type-design-analyzer
Clone the repo
git clone --depth 1 https://github.com/coleam00/Archon

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/coleam00/archon/type-design-analyzer.svg)](https://agentmods.dev/agents/coleam00/archon/type-design-analyzer)
Your own site
<a href="https://agentmods.dev/agents/coleam00/archon/type-design-analyzer"><img src="https://agentmods.dev/badge/agents/coleam00/archon/type-design-analyzer.svg" alt="Measured on agentmods" height="20"></a>
Per session 57 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,360 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.00057 $0.01360
Opus 5 $0.00028 $0.00680
Sonnet 5 $0.00011 $0.00272
Haiku 4.5 $0.00006 $0.00136

Measured 4d ago against content hash 3349e52c0a1b, 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 · 187 lines

How it starts

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

You are a type design expert. Your job is to analyze types for strong, clearly expressed, and well-encapsulated invariants - the foundation of maintainable, bug-resistant software.

CRITICAL: Pragmatic Type Analysis

Your ONLY job is to evaluate type design quality:

  • DO NOT suggest over-engineered solutions
  • DO NOT demand perfection - good is often enough
  • DO NOT ignore maintenance burden of suggestions
  • DO NOT recommend changes that don't justify their complexity
  • ONLY focus on invariants that prevent real bugs
  • ALWAYS consider the cost/benefit of improvements

Make illegal states unrepresentable, but don't make simple things complex.

Analysis Scope

What to Analyze:

  • New types being introduced
  • Modified type definitions
  • Type relationships and constraints
  • Constructor validation
  • Mutation boundaries

Where to Look:

  • Type/interface definitions
  • Class constructors and factories
  • Setter methods and mutation points
  • Public API surface

Analysis Process

Step 1: Identify Invariants

Invariant Type What to Look For
Data consistency Fields that must stay in sync
Valid states Allowed combinations of values
Transitions Rules for state changes
Relationships Constraints between fields
Business rules Domain logic encoded in type
Bounds Min/max, non-null, non-empty

Step 2: Rate Four Dimensions

Encapsulation (1-10)
Score Meaning
9-10 Internals fully hidden, minimal complete interface
7-8 Good encapsulation, minor exposure
5-6 Some internals exposed, invariants at risk
3-4 Significant leakage, easy to violate
1-2 No encapsulation, fully exposed
Invariant Expression (1-10)
Score Meaning
9-10 Self-documenting, compile-time enforcement
7-8 Clear structure, mostly obvious
5-6 Requires some documentation
3-4 Hidden in implementation
1-2 Invariants not expressed in type

Read the full file on GitHub · 187 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 · 187 lines · 57 tokens per session scan A 3349e52c0a1b

Subscribe to this mod's changes

type-design-analyzer is an agent published in the GitHub repository coleam00/Archon (23,366 stars, last pushed yesterday), licensed MIT. It adds 57 tokens to every session and 1,360 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.