Back to Skills

contract-test-design

verified

Design consumer-driven contract testing strategies using Pact, verify provider contracts, and manage API evolution with contract-first approaches.

View on GitHub

Marketplace

melodic-software

melodic-software/claude-code-plugins

Plugin

test-strategy

Repository
Verified Org

melodic-software/claude-code-plugins
13stars

plugins/test-strategy/skills/contract-test-design/SKILL.md

Last Verified

January 21, 2026

Install Skill

Select agents to install to:

Scope:
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-design

Installation paths:

Claude
.claude/skills/contract-test-design/
Powered by add-skill CLI

Instructions

# 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)   │
                       

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
4429 chars