Back to Skills

validating-api-contracts

majiayu000
Updated Today
1 views
58
9
58
View on GitHub
Metaaitestingapi

About

This skill validates API contracts through Pact-based consumer-driven testing and OpenAPI specification compliance checks. It helps developers generate contract tests, validate API responses, and detect breaking changes for backward compatibility. Use it when working with contract testing, Pact, or OpenAPI validation to ensure API providers meet consumer expectations.

Quick Install

Claude Code

Recommended
Plugin CommandRecommended
/plugin add https://github.com/majiayu000/claude-skill-registry
Git CloneAlternative
git clone https://github.com/majiayu000/claude-skill-registry.git ~/.claude/skills/validating-api-contracts

Copy and paste this command in Claude Code to install this skill

Documentation

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.

GitHub Repository

majiayu000/claude-skill-registry
Path: skills/contract-test-validator

Related Skills

content-collections

Meta

This skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.

View skill

creating-opencode-plugins

Meta

This skill provides the structure and API specifications for creating OpenCode plugins that hook into 25+ event types like commands, files, and LSP operations. It offers implementation patterns for JavaScript/TypeScript modules that intercept and extend the AI assistant's lifecycle. Use it when you need to build event-driven plugins for monitoring, custom handling, or extending OpenCode's capabilities.

View skill

sglang

Meta

SGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.

View skill

evaluating-llms-harness

Testing

This Claude Skill runs the lm-evaluation-harness to benchmark LLMs across 60+ standardized academic tasks like MMLU and GSM8K. It's designed for developers to compare model quality, track training progress, or report academic results. The tool supports various backends including HuggingFace and vLLM models.

View skill