api-contract-testing

api-contract-testing is a skill for Claude Code, Codex from bestdeejay-design/agent-skills. It costs 169 tokens per session (2,604 once invoked), scanned A, original, MIT.

A checker for API contracts, where an API contract is the written agreement describing an API's endpoints, inputs, and responses. It reads an OpenAPI 3.x file, checks its consistency, compares it with an expected-endpoint list, and can optionally check a live API.

In plain words
What is it for?
Use it to validate JSON or YAML OpenAPI files, find missing responses or broken references, check endpoint coverage, or compare live HTTP status codes with expectations.
Why use it?
It catches differences between what an API specification promises, what the endpoint list expects, and what the running service actually returns.

Skill for Claude CodeCodex

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 skills/bestdeejay-design/agent-skills/api-contract-testing
Any agent
npx skills add bestdeejay-design/agent-skills --skill api-contract-testing
Clone the repo
git clone --depth 1 https://github.com/bestdeejay-design/agent-skills

Made for: Claude Code, Codex.

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-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/bestdeejay-design/agent-skills/api-contract-testing.svg)](https://agentmods.dev/skills/bestdeejay-design/agent-skills/api-contract-testing)
Your own site
<a href="https://agentmods.dev/skills/bestdeejay-design/agent-skills/api-contract-testing"><img src="https://agentmods.dev/badge/skills/bestdeejay-design/agent-skills/api-contract-testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 169 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,604 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.00169 $0.02604
Opus 5 $0.00084 $0.01302
Sonnet 5 $0.00034 $0.00521
Haiku 4.5 $0.00017 $0.00260

Measured 4d ago against content hash 171e5fd7f1a1, 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-testing 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.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/api_contract.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

description: "Validate an API contract against an OpenAPI 3.x specification (JSON or YAML) and an optional manifest of expected endpoints. Script api_contract.py enumerates operations (paths + webhooks), checks spec inte
skills/api-contract-testing/SKILL.md · 208 lines

How it starts

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

API Contract Testing — validate an OpenAPI spec against expected endpoints

Load this skill when you need to check that a running API (or a spec on disk) actually matches the contract it promises. It is the verification counterpart of api-doc-generator (which writes the spec) and test-generator (which writes the tests): this skill checks the spec against a manifest of expected endpoints and, optionally, against the live API.

The tool is pure Python 3 stdlib — no PyYAML, no requests, no pip install. It reads an OpenAPI 3.x document from a file (.json or .yaml) or a URL, enumerates every declared operation (under paths and webhooks), checks the spec's internal consistency, and compares it against an optional manifest file. In --offline mode it never touches the network; in live mode it probes each manifest endpoint over HTTP and compares the actual status code with the expected one.

Triggers

Load this skill when the request matches any of these (EN / RU):

  • "api contract testing", "contract test", "check the API against the spec"
  • "validate openapi spec", "spec vs manifest", "endpoint coverage"
  • "проверь контракт API", "тест контракта", "сверь спецификацию с API"
  • "валидация openapi", "проверка эндпоинтов", "контрактное тестирование"
  • "does the API match the spec", "missing endpoints", "expected status codes"

DO NOT USE FOR: generating the OpenAPI spec (use api-doc-generator); writing the tests (use test-generator). This skill only checks contracts, it does not author them.


The api_contract.py script

scripts/api_contract.py — pure Python 3 stdlib (no dependencies).

Mode Command
Offline, JSON report python3 api_contract.py --spec openapi.json --offline --json
Offline + manifest python3 api_contract.py --spec openapi.yaml --manifest endpoints.txt --offline
Live checks python3 api_contract.py --spec openapi.json --manifest endpoints.txt --base-url https://api.example.com
Spec from URL python3 api_contract.py --spec-url https://example.com/openapi.json --manifest endpoints.txt

Read the full file on GitHub · 208 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 208 lines · 169 tokens per session scan A 171e5fd7f1a1

Subscribe to this mod's changes

api-contract-testing is a skill published in the GitHub repository bestdeejay-design/agent-skills (5 stars, last pushed 2d ago), licensed MIT. It adds 169 tokens to every session and 2,604 once invoked, about $0.0008 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.