---
name: validating-api-contracts-13da3d8c4b2e
description: |
  This skill validates API contracts using consumer-driven testing and OpenAPI validation. It leverages Pact for consumer-driven contract testing, ensuring that API providers adhere to the expectations of their consumers. It also validates APIs against OpenAPI specifications to guarantee compliance and identify breaking changes. Use this skill when the user asks to generate contract tests, validate API responses, check backward compatibility, or validate requests/responses using the terms "contract-test", "ct", "Pact", "OpenAPI validation", or "consumer-driven contract testing".
allowed-tools: Read, Write, Edit, Grep, Glob, Bash
version: 1.0.0
---

## Overview

This skill enables Claude to generate and validate API contracts, ensuring compatibility between API providers and consumers. It uses Pact for consumer-driven contract testing and OpenAPI validation for specification compliance.

## How It Works

1. **Generating Contract Tests**: Claude creates Pact consumer tests based on API usage, generating provider verification tests and building OpenAPI contract validators.
2. **Validating Contracts**: The skill verifies if API responses match the defined contracts.
3. **Checking Compatibility**: It checks for backward compatibility to identify breaking changes in the API.

## When to Use This Skill

This skill activates when you need to:
- Generate contract tests for an API.
- Validate API responses against existing contracts.
- Identify breaking changes in an API.

## Examples

### Example 1: Generating Pact Contracts

User request: "Generate contract tests for my API using Pact."

The skill will:
1. Analyze the API and generate Pact consumer contracts.
2. Create provider verification tests based on the contracts.

### Example 2: Validating an OpenAPI Specification

User request: "Validate my API against the OpenAPI specification."

The skill will:
1. Validate the API against the provided OpenAPI specification.
2. Report any discrepancies or violations of the specification.

## Best Practices

- **Clarity**: Be specific when requesting contract generation or validation, providing relevant API details.
- **Completeness**: Ensure that your OpenAPI specifications are up-to-date for accurate validation.
- **Context**: Provide context about the consumer and provider roles when using Pact.

## Integration

This skill can be integrated with other testing and deployment tools in the Claude Code ecosystem to automate contract verification as part of a CI/CD pipeline.

---
Source attribution: BbgnsurfTech
Original project: https://github.com/BbgnsurfTech/claude-skills-collection/blob/01d3fafeca1133f841956b8b90b939fee92d71e7/plugins/claude-code-plugins-plus/backups/skill-structure-cleanup-20251108-073936/plugins/testing/contract-test-validator/skills/contract-test-validator/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2025 Claude Code Plugin Hub

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: BbgnsurfTech
Original project: https://github.com/BbgnsurfTech/claude-skills-collection/blob/01d3fafeca1133f841956b8b90b939fee92d71e7/plugins/claude-code-plugins-plus/backups/skill-structure-cleanup-20251108-073936/plugins/testing/contract-test-validator/skills/contract-test-validator/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering, Product Management
Roles: Backend Developer, Data Engineer, DevOps / SRE, Product Manager, QA / Test Engineer
Specialties: API, Backend, Testing
Tools: Pact
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 1d1c5aedeffe24e149d4bdb1c796ba23310c9d8c48f94aa970999871a9ada05f
