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.
npx agentmods add agents/rjmurillo/ai-agents/type-design-analyzergit clone --depth 1 https://github.com/rjmurillo/ai-agentsWrote 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.
[](https://agentmods.dev/agents/rjmurillo/ai-agents/type-design-analyzer)<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>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.
| Model | Per session | Once 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 |
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.
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:
-
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
-
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?
-
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?
-
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?
-
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
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.
- 4d ago First seen · 130 lines · 69 tokens per session scan A c7df006d7ae0
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.
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…
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.
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.
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.
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.
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.