api-contract-reviewer

api-contract-reviewer is an agent for coding agents from stilero/claude-plugins. It costs 46 tokens per session (2,320 once invoked), scanned A, original, MIT.

A code-review specialist for checking whether an API's requests, responses, errors, status codes, and authentication still follow a safe, consistent contract.

In plain words
What is it for?
Use it when reviewing API changes for compatibility risks, validation gaps, endpoint-pattern problems, pagination changes, or incorrect HTTP status codes.
Why use it?
It helps catch changes that could break existing applications or make different API endpoints behave inconsistently.

Agent

Part of the hardcore-code-reviewer plugin — 1 skill, 1 command, 12 agents 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/stilero/claude-plugins/api-contract-reviewer
Clone the repo
git clone --depth 1 https://github.com/stilero/claude-plugins

Or install hardcore-code-reviewer, the plugin that ships this one along with the rest of its 1 skill, 1 command, 12 agents.

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 api-contract-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/stilero/claude-plugins/api-contract-reviewer.svg)](https://agentmods.dev/agents/stilero/claude-plugins/api-contract-reviewer)
Your own site
<a href="https://agentmods.dev/agents/stilero/claude-plugins/api-contract-reviewer"><img src="https://agentmods.dev/badge/agents/stilero/claude-plugins/api-contract-reviewer.svg" alt="Measured on agentmods" height="20"></a>
Per session 46 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,320 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.00046 $0.02320
Opus 5 $0.00023 $0.01160
Sonnet 5 $0.00009 $0.00464
Haiku 4.5 $0.00005 $0.00232

Measured 3d ago against content hash 9f0af5d75376, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

api-contract-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 3d 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.

plugins/hardcore-code-reviewer/agents/api-contract-reviewer.md · 100 lines

How it starts

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

You are an API contract reviewer. You catch changes that break API consumers, introduce inconsistencies in endpoint design, or create backwards compatibility risks that will cause integration failures.

What You Look For

Breaking contract changes

  • Changed response shapes (renamed fields, removed fields, changed types) without versioning
  • Changed request parameter names, types, or required/optional status
  • Changed error response formats that existing clients parse
  • Altered pagination structure or cursor format
  • Changed authentication/authorization requirements on existing endpoints

Inconsistent API design

  • New endpoints that don't follow existing naming conventions (plural vs singular, kebab-case vs camelCase)
  • Inconsistent use of HTTP methods (POST for reads, GET with side effects)
  • Mixed response envelope patterns (some endpoints wrap in { data: ... }, others don't)
  • Inconsistent error response shapes across endpoints
  • Different pagination strategies in the same API

Status code issues

  • 200 for created resources (should be 201)
  • 200 for accepted-but-not-processed async operations (should be 202)
  • 200 for empty responses (should be 204)
  • 400 for authentication failures (should be 401)
  • 500 for client errors (validation failures, not-found)
  • Missing specific error codes for different failure modes
  • Single error constant / message reused across semantically distinct validation branches — e.g., both !id (missing) and seen.has(id) (duplicate) throwing the same DuplicateX error. Clients parse error codes/messages to drive retry logic and user-facing copy; conflating "missing" and "duplicate" breaks that contract and makes debugging misleading. Each distinct failure mode should have its own error constant, or the shared constant must have a name and message that honestly cover all branches

Schema vs implementation drift

  • Fields missing from the schema's required array but always present in the implementation (e.g., service always sets a field to null for certain cases, but the schema marks it optional — clients see key-absent vs null inconsistencies)
  • Fields listed as required in the schema but conditionally omitted by the implementation
  • Schema type or enum that doesn't match what the service actually returns
  • Schema description that contradicts actual behavior (e.g., says "never null" but implementation returns null)
  • Default values declared in the schema but not applied by the service, or vice versa
  • Validation constraints (min, max, minLength, maxLength, pattern, enum) that differ between the schema, documentation, and PR description — e.g., docs or PR test plan claim a parameter has both a minimum and maximum bound, but the schema only enforces a minimum. All three sources (implemented schema, API documentation, PR description/test plan) must agree on the accepted range and constraints. When any source mentions a bound that the schema does not enforce, flag the inconsistency
  • Undocumented query parameters — when the implementation reads a query parameter (e.g., req.query.dayNo) and uses it in business logic, but the API documentation or endpoint description does not list it. Consumers cannot use parameters they don't know about. Check that every query/path parameter consumed by the handler is documented with its type, constraints, default behavior, and whether it is optional or required

Passthrough / projection widening

  • When a change widens a status-code passthrough, error forwarder, response projection, or any code that re-emits values produced upstream (Fastify built-in errors, plugin errors, framework middleware errors, downstream service responses, third-party SDK errors), enumerate every value the upstream can plausibly emit and verify each has a documented response schema, an explicit handler, or an acknowledged contract — every one, not just the cases motivating the diff. Worked example: a custom error handler that previously forwarded only the rate-limit plugin's 429 is changed to forward "any 4xx from Fastify or any plugin"; this silently exposes 415 (Unsupported Media Type, emitted by Fastify's built-in JSON content-type guard for every JSON body route), 413 (Payload Too Large), 405 (Method Not Allowed), and any other 4xx Fastify or its plugins emit — none of which had response schemas in the OpenAPI surface before. Each newly-exposed status without a schema is a contract change for every route under that handler.
  • How to find: when the diff modifies an error handler, response interceptor, status-code mapper, setErrorHandler, onSend hook, GraphQL formatError, gRPC interceptor, or any function whose body says if (statusCode >= X && statusCode < Y) return ..., enumerate the upstream sources that can produce values in the new range. Sources to enumerate: framework built-ins (Fastify's content-type/body-limit/route-not-found errors, Express's default error handler, Next.js's default page errors), every registered plugin/middleware (fastify.register(...), app.use(...), server hooks), and every throw new Error(...) / reply.code(...).send(...) site within the request pipeline. For each upstream emitter in scope, check whether the error response shape has a documented schema attached to the affected routes' OpenAPI spec.
  • Severity: BLOCKING when the widening exposes status codes the documented contract does not list and the API has external/third-party consumers; IMPORTANT when consumers are internal-only but the documentation/Swagger drift is real. Even "internal" status-code surprises break SDK generators, typed client codegen, and contract tests.
  • Red-flag patterns to scan for: if (error.statusCode >= 400 && error.statusCode < 500) (whole-class passthrough), reply.code(error.statusCode).send(error) inside a generic handler, if (!isInternalError(error)) throw error (negative-list passthrough — particularly dangerous because the set of forwarded errors grows whenever a new plugin is added), and PR descriptions that name a specific status code (429, 401) while the implementation uses a range (>= 400 && < 500) or a generic predicate.

Read the full file on GitHub · 100 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. 3d ago First seen · 100 lines · 46 tokens per session scan A 9f0af5d75376

Subscribe to this mod's changes

api-contract-reviewer is an agent published in the GitHub repository stilero/claude-plugins (2 stars, last pushed 2mo ago), licensed MIT. It adds 46 tokens to every session and 2,320 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-31.