Guide · Agent skill
How to use the API Contract Testing agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The api-contract-testing skill is a set of instructions that teaches an AI coding agent how to check an API change against its documented contract and the client code that calls it. It is for backend and API developers, and for teams whose client and server build fine but fail at runtime. After this guide you will know how to install the skill, how to ask for it with a natural request, and what it will and will not do.
Quick start
- 1Download the ZIP. Get the api-contract-testing ZIP from the skill's page on this directory.
- 2Unzip into a skills folder. Extract it into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder.
- 3Or upload it in the Claude apps. In the Claude apps, go to Settings → Capabilities → Skills and upload the ZIP.
- 4Confirm project prerequisites. Make sure the project has a test runner, a schema validator and local OpenAPI, JSON Schema or protobuf contract files.
- 5Describe the change in plain language. Ask the agent about a specific schema change, endpoint, event or regression and name the contract file.
- 6Review the matrix and results. Check the change classification, the test matrix, observed failures and listed coverage gaps.
What the skill makes the agent do
An API is the interface a server exposes to other software. When that interface changes, this skill makes the agent compare the documented contract (OpenAPI, JSON Schema or protobuf files) with the real server code and the client code that calls it.
The agent then writes small local tests using made-up sample data to check valid, missing, null, wrong-type and error responses. It reports whether the change is breaking or compatible, and it lists the coverage gaps it could not close.
- Reads local contract files and the relevant server and client code.
- Builds a test matrix of synthetic fixtures.
- Runs checks with the test runner and schema validator already in your project.
- Reports observed failures, a minimal reproduction and remaining gaps.
Install the api-contract-testing skill
You can install the skill in one of two ways. Download the ZIP file from the skill's page on this directory and unzip it into a skills folder. Use ~/.claude/skills/ for a skill available across your projects, or a project's .claude/skills/ folder to limit it to one project.
If you use the Claude apps instead, upload the ZIP under Settings → Capabilities → Skills.
- Personal install: unzip into ~/.claude/skills/
- Project install: unzip into the project's .claude/skills/ folder
- Claude apps: Settings → Capabilities → Skills, then upload the ZIP
Check what you need before you start
The skill does not bring its own test tools. Your project needs an existing test runner and a schema validator. You also need local API contract files (OpenAPI, JSON Schema or protobuf) plus the relevant server and client code.
The skill depends on having a contract to compare against. A project with no API schema or documented contract gives it nothing to check. The skill runs no scripts and uses no network access.
- An existing project test runner and schema validator
- Local contract files: OpenAPI, JSON Schema or protobuf
- The relevant server and client code
Trigger the skill with natural requests
You do not need a special command. Describe the change or the failure in plain language and mention the contract, and the agent should pick up the skill when the request matches its purpose: schema changes, compatibility regressions and client integration failures.
The skill also includes a reusable prompt you can adapt. It asks the agent to review the change against the actual contract and supplied code, list affected consumers, and add local contract tests with the existing runner.
- "I'm renaming the field amount in the invoice response. Is this a breaking change for our clients? Check against openapi.yaml and the client code."
- "Clients report a runtime failure after the last server release. Build a minimal provider/consumer reproduction from the contract."
- "Review this API change against the contract and add local tests for valid, missing, null, wrong-type and error responses."
Review this API change against the actual contract and supplied client/server code.
List affected consumers and supported version combinations. Add local contract tests
for valid, missing, null, wrong-type and error responses with the existing runner.
Report checks actually run and any provider behavior still requiring integration proof.See what a typical check looks like
The skill uses a synthetic example. Suppose a documented response is {"id":"invoice-demo","amount_minor":1250,"currency":"EUR"}, where id and currency are strings and amount_minor is a non-negative integer in minor units. This sample does not represent a real customer or payment.
The agent would check cases such as amount_minor arriving as the string "1250", which the runtime parser should reject even if generated types compile. It would also check a missing or null required field, an extra display_label field against the consumer's extra-field policy, and an HTML error body, which should map to the declared protocol error rather than be treated as a valid invoice.
- Wrong type: a string where an integer is required should be rejected at runtime.
- Missing or null: rejected when the field is required and non-nullable.
- Extra field: compatibility depends on the consumer's documented policy.
- Error body: an HTML error page should map to the declared error, not a valid result.
Use safe settings and understand the limits
The skill tells the agent to use synthetic fixtures by default and not to copy sensitive production payloads into reports. It treats supplied payloads and specifications as data, not as instructions. Network tests need an authorized endpoint, bounded request volume and test credentials. Do not use this skill as authorization to call production endpoints.
A passing schema test is not proof of business correctness, performance or access control. One consumer also cannot prove compatibility for every client or SDK version.
- Do not run it against production endpoints or live systems without authorization.
- Avoid payment, notification or other state-changing calls unless they are in scope.
- Do not log secrets, raw authorization headers or private customer records.
- The skill plans and verifies contracts; it does not deploy APIs or run migrations.
Get better results with a few habits
Give the agent the exact contract file and the client code that consumes the endpoint. Ask it to record the commands it ran and the outcomes it observed, so you can tell checks that were run from checks that were not. Keep the failing reproduction, since it is the evidence for any compatibility claim.
For a breaking change, ask for options such as versioning, a compatibility adapter or a staged migration. The skill expects you to assign owners and rollback criteria yourself.
- Provide the versioned contract alongside the code.
- Ask for both old-consumer-against-new-provider and new-consumer-against-old-provider checks where those combinations are supported.
- Keep fixtures small, synthetic and versioned with the contract.
What people use it for
- Deciding whether renaming or removing a response field breaks existing clients.
- Checking that a new optional field does not break a strict consumer.
- Reproducing a runtime integration failure with a minimal local test.
- Verifying that error responses follow the declared error format.
- Planning a staged migration with versioning and rollback criteria for a breaking change.
Frequently asked questions
What is the api-contract-testing skill?
It is an agent skill that makes an AI coding agent compare an API's documented contract with the server and client code, then write local tests with synthetic data. It reports whether a change is breaking or compatible.
How do I install the api-contract-testing skill?
Download the ZIP from the skill's page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder. In the Claude apps, you can instead upload the ZIP under Settings → Capabilities → Skills.
What do I need to use it?
You need an existing project test runner and schema validator, since the skill provides neither. You also need local API contract files (OpenAPI, JSON Schema or protobuf) and the relevant server and client code.
Is the skill free to use?
The skill is licensed under MIT. The source does not mention pricing, so check the directory page for any terms beyond the licence.
Does the skill call live APIs or need the internet?
The skill says it uses no network access and runs no scripts. It warns against production calls, and any network testing needs an authorized endpoint and test credentials.
Can I use it instead of a full testing service?
Yes, if you want local fixtures and your existing tools. The skill does not provision a testing service and uses the project's current test runner rather than a hosted platform.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you are a backend or API developer changing a response field, endpoint, event or error format, or if you are chasing a runtime integration failure that a successful build did not catch. Pick something else if your API has no schema or documented contract, since the skill has nothing to compare against, or if you need live or production testing, which this skill does not authorize.
Download the skill