contract-testing
Skill1 starsChanged 12 days agoMITView on GitHub
Prove that a consumer and a provider still agree, without deploying them together. Covers the consumer-driven flow — consumer expectations, broker publication, provider verification, and a can-i-deploy gate in the pipeline — plus provider-driven and bi-directional variants, message and event contracts for Kafka or queues, contract versioning with branches and environments, pending contracts, and what a contract test must never assert. Use when adding or changing an integration between two services, when a consumer breaks after a provider release, when wiring deployment gates, or when the user says 'contract test', 'Pact', 'consumer-driven', 'can-i-deploy', or 'provider verification'. This skill governs cross-service agreement — contract design belongs to api-contracts, in-service test levels to test-strategy.
13 other projects use a version of this.
Adopted by
Most recently taken up by
- jayavibhavnk/claude-skillstheir own version, first seen Nov 29, 2026
- JPeetz/agent-skillstheir own version, first seen Nov 15, 2026
- jason0971/skillstheir own version, first seen Nov 8, 2026
- petrkindlmann/qa-skillstheir own version, first seen Oct 25, 2026
- proffesor-for-testing/agentic-qetheir own version, first seen Oct 25, 2026
- vindreshsingh/engineering-skillstheir own version, first seen Oct 20, 2026
Used with
Projects with it also use api-design, release-notes and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillapi-design
Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.
Also in 4 projects that use this
Microsoft AzureSkillrelease-notes
Author and update release notes for Azure App Configuration libraries and providers. USE FOR: write release notes, add release note entry, update release notes, draft release notes, new version release notes, format release notes. DO NOT USE FOR: generating changelogs from git history, writing internal engineering notes.
Also in 3 projects that use this
SentrySkillsecurity-review
Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.
Also in 3 projects that use this
Other versions13 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 13
- proffesor-for-testing/agentic-qe★ 524same name
- petrkindlmann/qa-skills★ 274same name
- JPeetz/agent-skills★ 21same name
- Indium-AI-Labs/indium-agentkit★ 18same name
- Ionate-Technologies/indium-agentkit★ 17same name
- saitarrun/Devforge-ai★ 4same name
- sb-dev/narrative-production-skills★ 2same name
- jason0971/skills★ 1same name
- mejbaurbahar/fagun★ 1same name
- mejbaurbahar/software-tester-skills★ 1same name
3 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- api-contractsSkill
- api-protocolsSkill
- clean-architectureSkill
- collaborative-judgmentSkill
- config-and-dependenciesSkill
- cqrs-and-consistencySkill
- data-accessSkill
- design-firstSkill
- design-serviceSkill
- domain-modellingSkill
- idempotency-and-immutabilitySkill
- implement-serviceSkill
- infrastructure-adaptersSkill
- refactor-safelySkill
- resilience-patternsSkill
- review-serviceSkill
- secure-serviceSkill
- service-boundariesSkill
- stack-profileSkill
- test-strategySkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 12 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Read .msskills/config.yaml in the repo root.
- Very specific: line 25
No config file or no paths.contracts key → use defaults.
- Distinctive: line 32
Verify every check. Fix failures before presenting.
- Distinctive: line 59
All checks pass → state "Contract holds: <consumer> → <provider>, N interactions, verified."
- Distinctive: line 105
Where the deploy gate blocks: Before build, before deploy, or as a warning.
“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Contract Testing
Integration tests that start two services answer a question nobody asked: do these two versions work together, in this environment, right now? What teams actually need to know is whether the version they are about to deploy will break anything already running.
Contract testing answers that. The consumer records what it needs; the provider proves it can deliver it; the pipeline refuses a deploy that would break someone. No shared environment, no lockstep releases, and a failure that names the consumer it would have broken.
Config Resolution
- Read
.msskills/config.yamlin the repo root; look uppaths.contracts. - A custom document exists at that path → read its frontmatter
mode:override→ use it alone; ignore the defaults below.overlay(default, or nomodekey) → read defaults first, then apply the custom document's sections on top, matched by exact heading; new sections append.
- A path is configured but no file exists there → say which path is missing, then use the defaults.
- No config file or no
paths.contractskey → use defaults. .msskills/stack.mdexists → use its contract tooling and broker, and its language binding. If no tool is recorded, describe the flow and say the tool choice is open rather than assuming one.
Self-Validation Checklist
STOP after writing or reviewing a contract test, or changing an integration between two services. Verify every check. Fix failures before presenting.
- CONSUMER DRIVEN: Does the contract state what the consumer actually needs, derived from real consumer code, rather than mirroring the provider's full response? If it was written from the provider's schema → rewrite from the consumer's use.
- ONLY WHAT IS USED: Does the expectation include fields the consumer never reads? Every extra field is a promise the provider can no longer break → remove them.
- TYPES NOT VALUES: Are matchers used for anything not semantically fixed — IDs, timestamps, generated strings? Exact-value matching on incidental data produces false failures.
- PROVIDER STATE NAMED: Does each interaction declare the provider state it needs, in words the provider can set up ("an order 123 exists and is cancellable")?
- NO BUSINESS LOGIC: Does the test assert the provider's behaviour — a calculation, a rule, a workflow? That belongs in the provider's own tests → assert only the shape of the exchange.
- BOTH SIDES RUN: Is the consumer side generating the contract in CI and the provider side verifying it in CI? A contract nobody verifies is documentation.
- VERIFICATION IS REAL: Does provider verification run against the real handler stack rather than a stub? A verification that mocks the provider proves nothing.
- STATE HANDLERS COMPLETE: Does the provider implement every state the consumers name, and do those handlers create data through legitimate paths?
- DEPLOY GATED: Does the pipeline block a deploy when the version being deployed is not compatible with what is already running in that environment?
- MESSAGES COVERED: Are published events and consumed messages under contract, not just HTTP?
- VERSIONED BY COMMIT: Are contracts published with the commit SHA and the branch, and is the deployed version recorded on release, so compatibility can be computed at all?
- FAILURE PATHS INCLUDED: Are the error responses the consumer handles — 404, 409, 422 — part of the contract? Consumers depend on those shapes too.
All checks pass → state "Contract holds: <consumer> → <provider>, N interactions, verified."
Active Anti-Pattern Scan
Any box you can check is a defect. Fix it before presenting.
- Provider-Written Consumer Contract: the provider team authored the consumer's expectations → it now tests its own assumptions; let the consumer write them.
- Full-Response Contract: every field of the provider's response asserted → freezes the provider's entire schema; assert only what is consumed.
- Functional Test in Disguise: business rules, calculations, or workflow asserted through
the contract → move to the provider's component tests (see
test-strategy). - Exact Match on Generated Data: timestamps, UUIDs, or sequence numbers matched literally → type or regex matchers.
- Unverified Contract: published to the broker, never verified by any provider build → wire provider verification, or delete the contract.
- Stubbed Verification: the provider verifies against mocked internals → run the real stack with only external dependencies stubbed.
- Missing Deploy Gate: contracts verified but the pipeline deploys regardless → add the compatibility check before deploy.
- Contract as Schema Dump: generated from OpenAPI with no consumer involvement → that is schema validation, useful but different; consumer-driven means driven by a consumer.
- Untested Events: HTTP under contract, published events not → events are contracts too.
- Stale Contracts: contracts from consumer branches deleted long ago still blocking → record deployments and let the broker expire unused versions.
- Fake Provider States: state handlers that insert rows directly, bypassing invariants → set up through the service's own paths so the state is reachable in reality.
- Contract Tests Replacing All Integration Tests: no test ever exercises the real client against a real dependency → keep narrow integration tests for adapter and infrastructure behaviour.
Ambiguity Signals
Route these through collaborative-judgment. Each has two defensible answers.
- Consumer-driven or bi-directional. Consumer-driven is stronger and requires both teams to adopt the tooling. Bi-directional — comparing a consumer's recorded expectations against the provider's published spec — is far cheaper to introduce across an estate you do not control, and it verifies less.
- Contracts with an external provider. You cannot make a third party verify anything. A scheduled check of your expectations against their sandbox is the usual compromise, and it is weaker.
- How much of an event to put under contract. Consumers of a rich event each use a different subset; the union quickly approaches the whole schema.
- Pending contracts. They let a consumer publish a new expectation without breaking the provider's build, which keeps teams unblocked and can let an unimplemented expectation linger.
- Where the deploy gate blocks. Before build, before deploy, or as a warning. Stricter is safer and stops more releases, including some that would have been fine.
- Whether a pair needs contracts at all. Two services owned by one team, always released together, may be adequately covered by component tests.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

