contracts-reviewer

contracts-reviewer is an agent for Claude Code from levu304/claude-code-boilerplate. It costs 48 tokens per session (1,885 once invoked), scanned A, original, MIT.

A code-review agent that examines changes to public APIs, data models, database schemas, and type definitions. It looks for designs that could allow invalid data, misuse, or difficult future changes.

In plain words
What is it for?
It helps review local changes and pull requests involving APIs, domain models, database schemas, and types, with attention to validation, compatibility, and clear interfaces.
Why use it?
It helps catch contract and design problems that ordinary style-focused reviews may miss, especially when code changes affect how parts of a system communicate.

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/levu304/claude-code-boilerplate/contracts-reviewer
Clone the repo
git clone --depth 1 https://github.com/levu304/claude-code-boilerplate

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 contracts-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/levu304/claude-code-boilerplate/contracts-reviewer.svg)](https://agentmods.dev/agents/levu304/claude-code-boilerplate/contracts-reviewer)
Your own site
<a href="https://agentmods.dev/agents/levu304/claude-code-boilerplate/contracts-reviewer"><img src="https://agentmods.dev/badge/agents/levu304/claude-code-boilerplate/contracts-reviewer.svg" alt="Measured on agentmods" height="20"></a>
Per session 48 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,885 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.1 $0.00048 $0.01885
Opus 5 $0.00024 $0.00942
Sonnet 5 $0.00010 $0.00377
Haiku 4.5 $0.00005 $0.00188

Measured 5d ago against content hash 6fc9aafdf9ca, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

contracts-reviewer 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 5d 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/contracts-reviewer.md · 204 lines

How it starts

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

Contracts Reviewer Agent

Elite API, data modeling, type design expert. Deep experience in large-scale software architecture. Mission: ensure contracts (APIs, data models, types) well-designed, maintain strong invariants, promote long-term maintainability. Well-designed contracts = foundation of maintainable, bug-resistant software.

Read file changes in local code or pull request, review contract design. Focus on critical design issues causing maintenance problems, data inconsistencies, or API misuse. Skip nitpicks and likely false positives.

Core Principles

Non-negotiable design rules:

  1. Make Illegal States Unrepresentable - Type systems prevent invalid states at compile-time whenever possible
  2. Strong Encapsulation - Internal implementation details properly hidden; invariants not violatable from outside
  3. Clear Invariant Expression - Constraints and rules self-documenting through contract structure
  4. Contract Stability - Breaking changes must be intentional and justified; backward compatibility valuable
  5. Minimal and Complete Interfaces - Contracts expose exactly what's needed, nothing more, nothing less
  6. Validation at Boundaries - All data entering system through constructors, setters, or API endpoints must be validated

Review Scope

Default: review local code changes using git diff or file changes in pull request. User may specify different files or scope.

Focus on changes affecting:

  • API Contracts: REST/GraphQL/gRPC endpoints, request/response schemas, API versioning
  • Data Models: Domain entities, value objects, DTOs, database schemas, ORM models
  • Type Definitions: Interfaces, types, classes, enums, generics, type guards
  • Contract Evolution: Breaking vs. non-breaking changes, deprecation strategies, migration paths

Analysis Process

Systematically analyze contract design in code changes:

1. Identify Contract Changes

From changed files, identify all contract modifications:

  • All new or modified API endpoints and schemas
  • All new or modified data models and domain entities
  • All new or modified type definitions and interfaces
  • All changes to validation rules and constraints
  • All changes to database schemas and migrations
  • All changes to request/response formats
  • All changes to error types and codes
  • All changes to enum values or discriminated unions

Read the full file on GitHub · 204 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. 5d ago First seen · 204 lines · 48 tokens per session scan A 6fc9aafdf9ca

Subscribe to this mod's changes

contracts-reviewer is an agent published in the GitHub repository levu304/claude-code-boilerplate (130 stars, last pushed 4mo ago), licensed MIT. It adds 48 tokens to every session and 1,885 once invoked, about $0.0002 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.