contract-testing

contract-testing is a skill for Claude Code, Codex from orlando-japan/claude-code-setting. It costs 28 tokens per session (658 once invoked), scanned A, original, MIT.

A testing approach for checking that two services agree on an API's expected requests and responses. An API is an interface that lets software services communicate, and a contract records that interface's expected shape.

In plain words
What is it for?
Use it for independently deployed services to test consumer expectations and verify that the provider still satisfies them.
Why use it?
It catches incompatible provider changes before deployment without requiring slow, fragile tests that run both services together.

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/orlando-japan/claude-code-setting/contract-testing
Any agent
npx skills add orlando-japan/claude-code-setting --skill contract-testing
Clone the repo
git clone --depth 1 https://github.com/orlando-japan/claude-code-setting

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/orlando-japan/claude-code-setting/contract-testing.svg)](https://agentmods.dev/skills/orlando-japan/claude-code-setting/contract-testing)
Your own site
<a href="https://agentmods.dev/skills/orlando-japan/claude-code-setting/contract-testing"><img src="https://agentmods.dev/badge/skills/orlando-japan/claude-code-setting/contract-testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 658 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.00028 $0.00658
Opus 5 $0.00014 $0.00329
Sonnet 5 $0.00006 $0.00132
Haiku 4.5 $0.00003 $0.00066

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

Security

Grade A, and why

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

templates/extra/skills/contract-testing/SKILL.md · 55 lines

How it starts

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

Contract testing

Integration tests between services are slow, flaky, and hard to run. Contract tests are the alternative: each side asserts the shape of the interface independently, and a CI check fails when they disagree.

The pattern

  1. Consumer writes a contract: "when I call GET /users/:id, I expect a JSON object with id: string, email: string, and created_at: ISO8601."
  2. Consumer tests run against a mock that enforces the contract. No real network.
  3. Provider pulls the contract and runs a verification test: "can my real GET /users/:id satisfy that contract?"
  4. If either side changes in an incompatible way, the verification fails before the change merges.

Tools: Pact is the dominant framework; Spring Cloud Contract, Postman contract tests, and OpenAPI + schema validation are alternatives.

When contract tests help

  • Multiple services under independent teams with independent deploys.
  • APIs that are stable contracts, not constantly evolving shapes.
  • Cross-team coordination is expensive.

When they don't

  • Monolith with shared types (the type system is your contract).
  • Prototype / exploratory service where the API is in flux.
  • Single consumer and single provider owned by the same team.

Rules

  • Consumer drives the contract. The consumer says what it needs; the provider proves it can supply. Not the other way around.
  • Only test your consumer's usage. If your consumer only uses 3 fields of a 20-field response, the contract has 3 fields. Don't over-spec.
  • Contracts are not docs. Don't try to make the contract describe the whole API. That's OpenAPI's job.
  • Version contracts with consumers. When consumer v2 needs a new field, the contract changes. The old consumer v1 contract still exists until v1 is retired.
  • Provider verification runs on provider's CI. Consumer contract tests run on consumer's CI. Contracts are a shared artifact in the middle.

Failure modes

  • Flaky because real service involved. Contract tests should not hit a real service. Consumer uses mocks, provider runs in isolation.
  • Contracts drift from reality. The consumer updated the contract but never pushed it to the shared store. Automate.
  • Over-spec. Contract tests assert things the consumer doesn't actually care about. Every extra assertion is a false positive waiting to happen.

Read the full file on GitHub · 55 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 · 55 lines · 28 tokens per session scan A f8256bdc075c

Subscribe to this mod's changes

contract-testing is a skill published in the GitHub repository orlando-japan/claude-code-setting (2 stars, last pushed 3mo ago), licensed MIT. It adds 28 tokens to every session and 658 once invoked, about $0.0001 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.