contract-testing-specialist

Validate API request and response contracts using Zod, Pact, and OpenAPI validators.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Whaleylaw/llm-lawyer --skill contract-testing-specialist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: contract-testing-specialist
Source: https://github.com/Whaleylaw/llm-lawyer/tree/main/.claude/skills/contract-testing-specialist
Command: npx skills add https://github.com/Whaleylaw/llm-lawyer --skill contract-testing-specialist

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents integration regressions and API mismatches by validating request and response contracts so frontend, backend, and third-party services remain compatible and predictable.

Core Features & Use Cases

  • Runtime schema validation: Validate incoming requests and outgoing responses at API boundaries using Zod or OpenAPI validators to surface clear validation errors.
  • Consumer-driven contract testing: Author Pact consumer tests and verify provider implementations to ensure agreed expectations between clients and services.
  • OpenAPI and GraphQL validation: Generate types from OpenAPI, validate responses against the spec, and test GraphQL schema contracts to avoid spec drift.
  • Schema evolution & compatibility: Test backward compatibility, enforce versioning for breaking changes, and add optional fields safely to prevent deploy-time failures.
  • Use Case: Ensure a frontend POST /api/users integration remains stable by sharing Zod types, running consumer Pact tests, and verifying the provider against generated pacts before deployment.

Quick Start

Validate the POST /api/users contract by asserting request and response schemas with shared Zod types and running a Pact consumer test against the backend provider.

Frequently Asked Questions about contract-testing-specialist

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent API contract mismatches between frontend and backend services?

Prevent API contract mismatches by validating request and response schemas at API boundaries using shared Zod types and consumer-driven Pact tests, ensuring frontend and backend integrations remain stable and predictable before deployment.

What is consumer-driven contract testing and when do I need it?

Consumer-driven contract testing is a technique where clients author Pact tests to define expected API interactions, and providers verify against those generated pacts. You need it to prevent integration regressions across microservices and third-party API integrations.

How do I validate OpenAPI spec compliance and prevent schema drift?

Validate OpenAPI spec compliance by generating types from the specification and validating runtime responses against the spec using OpenAPI validators. This prevents schema drift and ensures backward compatibility during schema evolution.

Can I use Zod for runtime schema validation of API responses?

Yes, you can use Zod for runtime schema validation of API responses to surface clear validation errors at API boundaries. It ensures incoming requests and outgoing responses match expected schemas, preventing contract mismatches between services.

Does contract testing work with GraphQL schema validation?

Contract testing works with GraphQL schema validation by testing GraphQL schema contracts to avoid spec drift. It validates that GraphQL schemas remain compatible and predictable across service integrations and schema evolution.

What's the best way to test backward compatibility for API schema evolution?

Test backward compatibility for API schema evolution by enforcing versioning for breaking changes and adding optional fields safely. Use OpenAPI validators and Pact verification to prevent deploy-time failures when evolving API contracts.