contract-testing

Validate API contracts between services using Pact.js.

64|12|Updated Mar 23, 2026
One-click install
npx skills add https://github.com/petrkindlmann/qa-skills --skill contract-testing-petrkindlmann
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: contract-testing
Source: https://github.com/petrkindlmann/qa-skills/tree/main/skills/contract-testing
Command: npx skills add https://github.com/petrkindlmann/qa-skills --skill contract-testing-petrkindlmann

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Contract-based testing helps teams verify that services expose stable, well-defined interfaces, catching integration issues before they reach production.

Core Features & Use Cases

  • Consumer-driven contract tests with Pact.js to define expectations between client and provider.
  • Provider verification against published contracts, ensuring compliance without spinning up full integration environments.
  • Pact Broker setup and deployment-gate integration (can-i-deploy) to enforce safe deployments.
  • Webhook-driven verification and contract lifecycle management across CI/CD pipelines.

Quick Start

Create a consumer contract test for a service and run it to generate a pact, then trigger a provider verification in CI.

Frequently Asked Questions about contract-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is consumer-driven contract testing and how does it validate API contracts?

Consumer-driven contract testing validates API contracts by having clients define their expectations of a provider, generating a pact that providers verify against, catching integration issues before production without full integration environments.

How do I set up provider verification for Pact contracts in CI/CD pipelines?

Provider verification in CI/CD pipelines works by fetching published pacts from the Pact Broker and replaying them against the running provider, using provider states to set up required data for reliable contract validation.

Can I enforce deployment gates in CI/CD using the Pact Broker can-i-deploy check?

Yes, the Pact Broker can-i-deploy check enforces deployment gates by verifying that the consumer and provider versions have successfully verified contracts, preventing unsafe deployments in CI/CD pipelines.

Does Pact.js support webhook-driven verification and contract lifecycle management?

Pact.js supports webhook-driven verification through the Pact Broker, enabling automated contract lifecycle management across CI/CD pipelines by triggering provider verification when new pacts are published.

Why do I need provider states when verifying API contracts with Pact?

Provider states are essential for reliable verification because they configure the provider's internal data to match the specific scenario the consumer expects, ensuring the API contract is validated under the correct conditions.

What's the best way to start with consumer-driven contract tests using Pact.js?

Start by creating a consumer contract test defining expectations for a provider service, run it to generate a pact file, then trigger provider verification in CI against the published contract to ensure compliance.