Pact verification
Skill Amey-Thakur/AI-SKILLS/skills/testing/pact-verification
Plug-and-play skills and prompts for every AI coding agent
npx -y skills add Amey-Thakur/AI-SKILLS --skill pact-verificationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 21 days oldThe repository was created 21 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Verify a provider against its consumers' recorded pacts in CI so a breaking API change fails before it ships. Use when independently deployed services share an HTTP contract and you want to catch breaks without end-to-end staging.
SKILL.md
3.0 KB, 613 tokens by cl100k_base, as published. Nobody here has run it
Pact verification
Consumer-driven contract testing records what each consumer actually needs from a provider as a pact: a set of request and response expectations. The value lands only when the provider replays those expectations against its real code in CI. Skip that step and the pact is a stale document; run it on every provider build and a removed field fails the pipeline instead of a customer.
Method
- Publish consumer pacts to a broker, tagged by branch. Have each consumer generate its pact in its own suite and push it to a Pact Broker or PactFlow with the consumer version and branch tag. The provider pulls pacts from the broker rather than a file copied between repos that goes stale.
- Run provider verification as a real CI job. Add a step that replays every
pact against a booted provider:
pact_verifier, the JVMPactVerificationTest, or@pact.verifier. It sends each recorded request to your actual handlers and checks the response matches the contract. - Wire provider states to real setup hooks. A pact request like "given user 42 exists" maps to a provider-state handler that seeds that row before the request runs. Implement each state to put the provider in exactly the precondition the consumer assumed, or verification passes against fiction.
- Publish verification results back to the broker. Report pass or fail per
pact with the provider version so the broker knows which consumer versions
this provider satisfies. Those results are what
can-i-deployreads. - Gate deploys with can-i-deploy. Before releasing either side, run
pact-broker can-i-deploy --to-environment production. It refuses the deploy unless a verified compatible pact exists between the versions heading to that environment, so a provider never ships ahead of a consumer it would break. - Use pending pacts for new consumers. Mark a brand-new consumer's pact pending so its unverified expectations do not redden the provider build while still surfacing what is coming. Promote it once the provider verifies it green.
Checks
- Does deleting a response field the consumer reads turn the provider's verification job red, not just a downstream test hours later?
- Is every provider state in the pacts backed by a real setup hook, with no silent no-ops?
- Does can-i-deploy actually block a mismatched pair in CI, not just print a warning?
Boundaries
Pacts cover the shape and semantics of a request and response contract, not performance, authentication policy, or business correctness behind the endpoint, which still need their own tests. This assumes HTTP or message pacts between services you both control; a third-party API you cannot run verification against needs a different check.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.