validating-api-contracts

Solid

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".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 91/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
92
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

## 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**: ...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

Testing & QA Featured

automating-api-testing

This skill automates API endpoint testing, including request generation, validation, and comprehensive test coverage for REST and GraphQL APIs. It is used when the user requests API testing, contract testing, or validation against OpenAPI specifications. The skill analyzes API endpoints and generates test suites covering CRUD operations, authentication flows, and security aspects. It also validates response status codes, headers, and body structure. Use this skill when the user mentions "API testing", "REST API tests", "GraphQL API tests", "contract tests", or "OpenAPI validation".

2,926 Updated yesterday
jeremylongshore
Testing & QA Listed

api-contract-testing

Tools and patterns for API contract testing using OpenAPI, JSON Schema, and contract-first development

7 Updated today
pfangueiro
AI & Automation Listed

api-contract-testing

Validate an API contract against an OpenAPI 3.x specification (JSON or YAML) and an optional manifest of expected endpoints. Script api_contract.py enumerates operations (paths + webhooks), checks spec internal consistency (unresolved $refs, duplicates, missing responses), compares the manifest against the spec offline, and in live mode probes each manifest endpoint over HTTP and compares the actual status with the expected one. Pure Python 3 stdlib (argparse, json, pathlib, sys, urllib.request) with a built-in minimal YAML subset parser — no PyYAML, no requests. Emits a machine-readable JSON report (endpoints_count, missing_from_spec, contract_violations, conformant, errors) and uses exit codes 0/1/2. Closes the loop for api-doc-generator and test-generator.

5 Updated 2 months ago
bestdeejay-design