amey-thakur/ai-skills/contract-testing

Claude Code and agent skill by amey-thakur/ai-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Verify a service boundary with a consumer-driven contract that records the payload the caller actually reads and that both sides check in CI. Use when two services deploy independently and an unannounced response change would silently break the consumer.

Install

npx vskill@latest install amey-thakur/ai-skills/contract-testing

SKILL.md

The same SKILL.md was published earlier as amey-thakur/ai-skills/contract-testing.

Contract testing

Two services on separate release trains share an agreement that lives only in each team's memory: the shape of the request and response between them. The provider renames a field, ships green, and the consumer breaks in production because no test in either repo covered the seam. A consumer-driven contract writes that agreement down from the caller's side and forces the provider to prove it still holds before merging.

Method

  1. Generate the contract from the consumer's own expectations. In a Pact

consumer test, declare each interaction the code depends on, run the real client against the Pact mock, and let it emit a pact JSON file naming only the fields the consumer reads.

  1. Match on type and structure, not literal values. Wrap fields in

like(), eachLike(), and regex() so the contract pins shape while a changing timestamp or generated ID does not turn every payload into a false failure.

  1. Publish the pact to a broker keyed by version. Run pact-broker publish

tagged with the consumer's git SHA and branch, so the provider can fetch exactly the contracts its live consumers rely on.

  1. Verify on the provider in CI. The provider replays each recorded request

against its real endpoints and fails the build if any response no longer matches, seeding data through a state handler per interaction.

  1. Gate deploys with can-i-deploy. Before releasing either side, run

pact-broker can-i-deploy --pacticipant X --version <sha> so you ship only when every dependent contract is verified against that exact version.

  1. Evolve additively. Add response fields freely, since an unread field

leaves contracts green; a rename or removal waits until no consumer contract references the old name, which the broker lets you confirm.

Signals

  • Does the contract name only fields the consumer actually reads?
  • Would renaming an unconsumed field leave the provider's verification green?
  • Does can-i-deploy block a release when a consumer's pact is unverified?

Boundaries

Contracts pin message shape and semantics at one hop, not correctness across a chain of services: use integration-testing or e2e-testing for full flows. They pay off only when both sides run verification in CI, since an unverified contract is just documentation. For the detailed provider-side replay setup, defer to pact-verification. A public API with unknown consumers is better served by schema and version discipline than by consumer pacts.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
10
Repository forks
2
7-day trend score
17

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/amey-thakur/ai-skills/contract-testing/badge)](https://verified-skill.com/skills/amey-thakur/ai-skills/contract-testing)

Something wrong with this skill or its page? Tell us.