api-contract-validator

api-contract-validator is an agent for coding agents from ShaheerKhawaja/ProductionOS. It costs 39 tokens per session (3,419 once invoked), scanned A, original, MIT.

An agent that checks whether a frontend and backend agree on their API. An API is the defined way software parts exchange requests and responses.

In plain words
What is it for?
It compares frontend API calls with backend endpoints, checks request and response types, reviews handled error codes, detects the API style and frameworks in use, and checks available API specifications.
Why use it?
It catches integration errors caused by mismatched URLs, parameters, data types, response formats, or error handling before they reach users.

Agent

Part of the productionos plugin — 4 skills, 41 commands, 11 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/shaheerkhawaja/productionos/api-contract-validator
Clone the repo
git clone --depth 1 https://github.com/ShaheerKhawaja/ProductionOS

Or install productionos, the plugin that ships this one along with the rest of its 4 skills, 41 commands, 11 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-validator

README.md
[![agentmods](https://agentmods.dev/badge/agents/shaheerkhawaja/productionos/api-contract-validator.svg)](https://agentmods.dev/agents/shaheerkhawaja/productionos/api-contract-validator)
Your own site
<a href="https://agentmods.dev/agents/shaheerkhawaja/productionos/api-contract-validator"><img src="https://agentmods.dev/badge/agents/shaheerkhawaja/productionos/api-contract-validator.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,419 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00039 $0.03419
Opus 5 $0.00019 $0.01709
Sonnet 5 $0.00008 $0.00684
Haiku 4.5 $0.00004 $0.00342

Measured 4d ago against content hash 21a48e18aafc, 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-validator scanned grade A with 1 finding 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const res = await fetch(url, options);
agents/api-contract-validator.md · 335 lines

How it starts

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

ProductionOS API Contract Validator

API contract mismatches are the #1 source of integration bugs. You catch them before they reach production.

You operate like a senior integration engineer who has debugged too many "works on my machine" issues caused by frontend/backend drift. Every finding must reference both sides of the contract — the frontend call AND the backend endpoint. You never report "this might not match" without reading both the caller and the handler.

Two-Pass Validation Protocol

Pre-Validation: Architecture Detection

# Detect backend framework
grep -rl "FastAPI\|flask\|Flask\|django\|Django" --include="*.py" -l 2>/dev/null | head -5
grep -rl "express\|Express\|@nestjs\|Hono\|Elysia" --include="*.ts" --include="*.js" -l 2>/dev/null | head -5
# Detect frontend API patterns
grep -rl "fetch\|axios\|useSWR\|useQuery\|trpc\|tRPC" --include="*.ts" --include="*.tsx" -l 2>/dev/null | head -10
# Detect API client generation (OpenAPI, tRPC, GraphQL codegen)
ls openapi.json openapi.yaml swagger.json 2>/dev/null
grep -rl "createTRPCRouter\|graphql-codegen\|orval\|openapi-typescript" 2>/dev/null | head -5

Identify: backend framework, API style (REST/tRPC/GraphQL), frontend fetching library, type generation strategy (manual vs codegen).

Pass 1 — CRITICAL (blocks the release)

1. Backend Endpoint Inventory

# FastAPI routes
grep -rn "@router\.\(get\|post\|put\|delete\|patch\)\|@app\.\(get\|post\|put\|delete\|patch\)" --include="*.py"
# Django URLs
grep -rn "path(\|re_path(\|url(" --include="urls.py"
# Express/Hono routes
grep -rn "router\.\(get\|post\|put\|delete\|patch\)\|app\.\(get\|post\|put\|delete\|patch\)" --include="*.ts" --include="*.js"
# Next.js API routes
find . -path "*/api/*" -name "route.ts" -o -name "route.js" 2>/dev/null

Read the full file on GitHub · 335 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 · 335 lines · 39 tokens per session scan A 21a48e18aafc

Subscribe to this mod's changes

api-contract-validator is an agent published in the GitHub repository ShaheerKhawaja/ProductionOS (8 stars, last pushed 4mo ago), licensed MIT. It adds 39 tokens to every session and 3,419 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

balrog

Adversarial validation agent. Spawned by quest between Implement and Review phases. Analyzes the quest diff for failure modes, writes targeted test cases, runs them, and delivers a severity-ranked findings report. Critical/High findings must be addressed before the Review gate opens.

justinjdev/fellowship · 58 tokens

palantir

Background monitor during fellowship execution. Watches quest progress via task metadata, detects stuck quests, scope drift, and file conflicts. Spawned by Gandalf alongside quest teammates. Reports issues to the lead via SendMessage.

justinjdev/fellowship · 46 tokens

_protocol

Canonical spec for how fellowship agents deliver reports and respond to lifecycle events via SendMessage.

justinjdev/fellowship · 0 tokens

quest-runner

Quest executor that uses the fellowship CLI for gate management. Runs the full quest lifecycle (Onboard through Research, Plan, Implement, Review, Complete) with structural gate enforcement via the fellowship binary.

justinjdev/fellowship · 43 tokens

scout

Research & analysis agent. Investigates questions and analyzes codebases without modifying source code. Can write research notes to docs/research/ or .fellowship/. No git operations, no commits, no PRs.

justinjdev/fellowship · 46 tokens

validator

Read-only adversarial validator. Spawned by scout to verify research findings against the actual code. Challenges assumptions, confirms or refutes claims, and reports CONFIRMED/CONTESTED/UNVERIFIED. Cannot modify files or run commands — enforced by tool restrictions.

justinjdev/fellowship · 56 tokens