api-contract-testing
Helps your agent test API contracts. This ensures changes don't break other parts of the system. It's useful for preventing compatibility issues.
What it does
This tool helps check if changes to an API contract (the rules for system communication) cause problems. It ensures that the API provider and consumers continue to work together after changes.
When to use it
- ✓When a field or rule in the API response changes.
- ✓When code compiles but system communication fails at runtime.
- ✓When needing to know if a change breaks compatibility or is just a new feature.
Example of what to ask your AI
“Review this API change. List affected consumers and supported version combinations. Add local contract tests for valid, invalid, and error responses using the existing test runner. Report checks actually run and what still requires proof.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
It compares the official API definition with actual behavior, creating small tests with dummy data. This ensures that changes don't break communication between systems using the API.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add sickn33/agentic-awesome-skills --skill api-contract-testingOr download just the file:
curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/api-contract-testing/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
API Contract Testing
Overview
Turn an API change into explicit provider and consumer checks. Start from the actual contract and affected clients, then verify wire-level behavior rather than relying on generated types or a successful build. Default to local fixtures and existing test tools; this skill does not provision a testing service.
When to Use
- A response field, endpoint, event schema or error envelope changes.
- A client and server build successfully but disagree at runtime.
- A team needs to distinguish a breaking change from a compatible extension.
- A reported regression needs a minimal provider/consumer reproduction.
Do not use this as authorization to call production endpoints, bypass access controls or publish a new API version.
How It Works
1. Bind the contract and scope
Identify the provider, transport, contract source and version, known consumers and the requested behavior. Read the real OpenAPI/JSON Schema/protobuf definition or documented examples and the corresponding server/client code. Record missing consumers and stale specifications as coverage gaps; do not invent interfaces or claim complete coverage from one client.
Keep these distinct: documented schema, actual provider output, generated client types and runtime parsing. A type assertion alone is not validation. Preserve the existing protocol and test runner instead of introducing a new platform by default.
2. Classify the change
Review fields, requiredness, nullability, enum values, status codes, headers, content type, pagination and error behavior. Inspect whether clients tolerate extra fields and unknown enum values. Even an added optional field can break a strict consumer. Explicitly identify affected versions and assumptions before calling a change compatible.
For events, include duplicate delivery, ordering and version envelopes. For request changes, check serialization and server validation as well as responses.
3. Build a small test matrix
Use deterministic synthetic fixtures for:
- Valid success, including optional and empty values.
- Missing required fields, wrong types and explicit nulls.
- Extra fields and unknown enums according to the actual compatibility policy.
- Declared error envelopes, non-success statuses and malformed bodies.
- Old consumer against new provider and new consumer against retained old provider, where those combinations are supported.
Assert the behavior promised by the contract. Do not silently coerce malformed values or make the fixture match a defect just to get a passing test.
4. Verify each boundary
Run the existing schema validator against fixtures. Exercise the provider handler locally and pass its serialized result through the real consumer parser. Check failure cases reject or map errors as specified. Use an authorized isolated integration environment only when fixtures cannot establish the required property; report that boundary explicitly.
A mock verifies assumptions encoded in the mock. It does not establish that the real provider implements them. Record exact commands, fixture versions and observed outcomes separately from unrun checks.
5. Report and hand off
Deliver the change classification, affected consumers, test matrix, observed failures, minimal reproduction and remaining coverage gaps. For a breaking change, propose versioning, a compatibility adapter or a staged migration with owners and rollback criteria. Deployment and consumer migration require their own task authorization.
Example
Synthetic documented response:
{"id":"invoice-demo","amount_minor":1250,"currency":"EUR"}
Contract: id and currency are strings; amount_minor is a non-negative integer in minor units. This fixture does not represent an actual customer or payment.
| Fixture change | Expected check |
|---|---|
amount_minor becomes "1250" |
Runtime parser rejects the string; compile-time generated types alone cannot detect wire drift. |
amount_minor is missing or null |
Reject when the field is required and non-nullable. |
Extra display_label field |
Verify the consumer's documented extra-field policy before declaring compatibility. |
| HTTP error with an HTML body | Produce the declared transport/protocol error, rather than treating it as a valid invoice. |
Reusable prompt:
Review this API change against the actual contract and supplied client/server code.
…
FAQ
What is an 'API contract'?
It's a document defining how one system (provider) communicates with another (consumer), specifying data formats, endpoints, and expected rules.
Why not use real production data?
Using real data can expose sensitive information and doesn't guarantee all error scenarios are tested. Minimal, synthetic data is safer and more effective for testing.
Does this tool deploy or manage APIs?
No, this tool focuses on planning and verifying API contracts. It does not deploy APIs or manage testing services.
Details
Original description by the author
Design and review API contract tests across providers and consumers. Use for schema changes, compatibility regressions and client integration failures.
Popularity
- GitHub stars
- 48k
- Ranking position
- #2151
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
00-andruia-consultant
Helps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
sickn33/agentic-awesome-skills
007
Lets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
sickn33/agentic-awesome-skills
10-andruia-skill-smith
Helps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
sickn33/agentic-awesome-skills
20-andruia-niche-intelligence
Lets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
sickn33/agentic-awesome-skills
Similar skills
cpp-testing
Makes your agent write and improve tests for C++ code. It helps set up testing tools and fix errors.
affaan-m/ECC
csharp-testing
Helps your agent create tests for C# and .NET code. It uses best practices to ensure tests are efficient and reliable.
affaan-m/ECC
django-tdd
Enables your agent to apply testing strategies for Django with pytest-django and TDD. It's useful for writing robust tests and ensuring code quality, especially for DRF APIs.
affaan-m/ECC