Skip to content
Back to skills

Contract Testing

ASecurity

Consumer-driven contract testing, OpenAPI spec drift validation, and breaking API change detection for microservices.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 6, 2026
developmenttypescripttestingapici/cd

Works with

  • api

Security analysis

A100/100

Scanned September 6, 2026

npx -y skills add saitarrun/Devforge-ai --skill contract-testing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Contract Testing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Contract Testing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/saitarrun-contract-testing/badge)](https://www.skillsdirectory.com/skills/saitarrun-contract-testing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: contract-testing
description: Consumer-driven contract testing, OpenAPI spec drift validation, and breaking API change detection for microservices.
version: 1.0.0
---

# Contract Testing & OpenAPI Validation Skill

This skill ensures microservices communicate reliably via explicit, version-controlled contracts without breaking downstream consumers.

## Core Architectural Pillars

### 1. OpenAPI & Schema Drift Validation
- **Spec-First & Code-First Sync**: Enforce strict TypeScript/Zod/JSON Schema generation from OpenAPI 3.1 definitions.
- **Breaking Change Detection**: Run `oasdiff` or `openapi-diff` in CI/CD to block backward-incompatible changes (e.g. removed fields, altered types, tightened validation).

### 2. Consumer-Driven Contract Testing (Pact)
- **Consumer Contracts**: Downstream microservices define expected API requests and responses.
- **Provider Verification**: Upstream microservice verifies actual endpoint execution against consumer expectations before deployment.
- **Pact Broker Matrix**: Track deployment status across environments to prevent deploying incompatible service versions.

### 3. Mock Service Worker (MSW) & Integration Mocks
- **Deterministic API Fixtures**: Shared MSW handlers across unit, component, and E2E tests.
- **Network Level Interception**: Mock API traffic at network level to avoid fragile global fetch overrides.

## Checklist for Slices with `needs_contract_testing: true`
- [ ] OpenAPI 3.1 schema defined or updated
- [ ] Breaking change check passes against `main` branch schema
- [ ] Consumer Pact tests generated or MSW handlers synchronized
- [ ] Provider endpoint verification passes end-to-end

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.