Design consumer-driven contract testing strategies using Pact, verify provider contracts, and manage API evolution with contract-first approaches.
View on GitHubmelodic-software/claude-code-plugins
test-strategy
plugins/test-strategy/skills/contract-test-design/SKILL.md
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/melodic-software/claude-code-plugins/blob/main/plugins/test-strategy/skills/contract-test-design/SKILL.md -a claude-code --skill contract-test-designInstallation paths:
.claude/skills/contract-test-design/# Contract Test Design
## When to Use This Skill
Use this skill when:
- **Contract Test Design tasks** - Working on consumer-driven contract testing strategies using Pact
- **Planning or design** - Need guidance on contract testing approaches
- **Best practices** - Want to follow established patterns and standards
## Overview
Contract testing verifies that services communicate correctly by testing the contract (API agreement) between a consumer and provider. Consumer-driven contracts (CDC) ensure providers don't break their consumers.
---
## Contract Testing vs Other Test Types
| Aspect | E2E Tests | Integration Tests | Contract Tests |
|--------|-----------|-------------------|----------------|
| Scope | Full system | Component + deps | Consumer-provider |
| Speed | Slow (minutes) | Medium (seconds) | Fast (ms) |
| Reliability | Often flaky | Moderate | Very stable |
| Deployment coupling | High | Medium | Low (async) |
| Failure localization | Poor | Moderate | Excellent |
| Maintenance | High | Medium | Low |
---
## Consumer-Driven Contract Flow
```text
┌─────────────────────────────────────────────────────────────┐
│ CONSUMER SIDE │
│ │
│ 1. Consumer writes test 2. Test generates contract │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Consumer │ │ Contract │ │
│ │ Test │ ─────► │ (JSON) │ │
│ └──────────────┘ └──────────────┘ │
│ │ │
└──────────────────────────────────────┼──────────────────────┘
│
▼ Publish to Broker
┌──────────────────┐
│ Contract Broker │
│ (Pact Broker) │