contract-testing

Verify microservice API contracts with Pact consumer-driven testing.

14|3|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/rnavarych/alpha-engineer --skill contract-testing-rnavarych
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: contract-testing
Source: https://github.com/rnavarych/alpha-engineer/tree/main/plugins/billy-milligan/skills/quality/contract-testing
Command: npx skills add https://github.com/rnavarych/alpha-engineer --skill contract-testing-rnavarych

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenge of ensuring microservices integrate correctly without relying on slow and brittle end-to-end tests, by implementing consumer-driven contract testing.

Core Features & Use Cases

  • Consumer-Driven Contracts: Define API expectations from the consumer's perspective using Pact.
  • Provider Verification: Verify that the provider fulfills the contracts defined by consumers.
  • API Change Detection: Detect breaking API changes before they impact consumers.
  • Runtime Validation: Use OpenAPI or schema validation middleware to enforce contracts at the API boundary.
  • Use Case: In a microservices architecture, the frontend service (consumer) defines its expected API interactions with the backend (provider). Contract tests ensure the backend adheres to these expectations, preventing deployment-related integration failures.

Quick Start

Use the contract-testing skill to set up provider verification for your API against consumer contracts.

Frequently Asked Questions about contract-testing

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

FAQPage Schema
How do I test microservice integrations without slow end-to-end tests?

Contract testing replaces slow end-to-end tests by having consumers define API expectations and providers verify them independently. This approach isolates integration failures early without deploying the entire microservices stack.

How does Pact provider verification work with state handlers?

Pact provider verification works by replaying consumer contract interactions against the provider API. State handlers configure the necessary provider state before each interaction is verified, ensuring the API meets the defined contract expectations.

Can I use OpenAPI schema validation middleware for runtime API validation?

Yes, OpenAPI or Zod middleware enforces API contracts at runtime by validating requests and responses against the defined schema. This detects breaking API changes proactively at the API boundary.

What is consumer-driven contract testing and when do I need it?

Consumer-driven contract testing is a method where API consumers define their expected interactions, and providers verify they meet those expectations. You need it in microservices architectures to prevent deployment-related integration failures.

Does contract testing detect breaking API changes before deployment?

Yes, contract testing detects breaking API changes by verifying consumer contracts against the provider. If a provider modifies an endpoint in a way that violates a consumer contract, the verification fails before deployment impacts consumers.

Do I need end-to-end tests if I use contract testing for microservices?

Contract testing provides integration assurance without requiring full end-to-end tests. While it ensures microservices integrate correctly by verifying contracts, you may still use end-to-end tests sparingly for critical user journeys across the entire stack.