aj-geddes avatar

Api Contract Testing

Helps you set up contract testing between services so you don't break APIs when deploying changes. Instead of running full integration tests, you validate that your service honors the contract consumers expect. Covers Pact for consumer-driven contracts, OpenAPI schema validation, and integration with Pact Broker for sharing contracts across teams. Most valuable in microservices architectures where you need to catch breaking changes before they hit production. The Pact implementation is solid and the reference guides cover both TypeScript and Java. Worth noting that contract tests complement integration tests rather than replace them, since they focus on API shape and format rather than business logic.

skills.sh installs
926
GitHub stars
379
last updated
Aug 21, 2026

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill api-contract-testing --agent claude-code

Installs into .claude/skills of the current project.

Files

API Contract Testing

Table of Contents

Overview

Contract testing verifies that APIs honor their contracts between consumers and providers. It ensures that service changes don't break dependent consumers without requiring full integration tests. Contract tests validate request/response formats, data types, and API behavior independently.

When to Use

  • Testing microservices communication
  • Preventing breaking API changes
  • Validating API versioning
  • Testing consumer-provider contracts
  • Ensuring backward compatibility
  • Validating OpenAPI/Swagger specifications
  • Testing third-party API integrations
  • Catching contract violations in CI

Quick Start

Minimal working example:

// tests/pact/user-service.pact.test.ts
import { PactV3, MatchersV3 } from "@pact-foundation/pact";
import { UserService } from "../../src/services/UserService";

const { like, eachLike, iso8601DateTimeWithMillis } = MatchersV3;

Sponsors

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
Backend & APIs, Testing & QA, AI & Agent Building
First seen
May 16, 2026

More from aj-geddes/useful-ai-prompts

All 258
1letz-ai avatarletzai-apiletz-ai/letzai-skillletzai api914skills.sh installs
2ruvnet avatarapi-docsruvnet/rufloGenerate API documentation from source code with JSDoc and OpenAPI support893skills.sh installs
3mindrally avataropenai-api-developmentmindrally/skillsExpert guidance for OpenAI API development including GPT models, Assistants API, function calling, embeddings, and best practices for production applications.888skills.sh installs
4alirezarezvani avatardatabase-designeralirezarezvani/claude-skillsUse when the user asks to design database schemas, plan data migrations, optimize queries, choose between SQL and NoSQL, or model data relationships.858skills.sh installs
5mindrally avatargo-backend-microservicesmindrally/skillsGo backend development best practices for microservices with clean architecture, observability, and production-ready patterns855skills.sh installs
6vercel avatardce-edgevercel/next.jsdce edge842skills.sh installs