contract-testing-builder

Implements API contract tests with Pact and OpenAPI to verify provider-consumer compatibility.

2|Updated Jun 5, 2026
One-click install
npx skills add https://github.com/sathishssj3/NexVR-Engine --skill contract-testing-builder-sathishssj3
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: contract-testing-builder
Source: https://github.com/sathishssj3/NexVR-Engine/tree/main/.agents/skills/contract-testing-builder
Command: npx skills add https://github.com/sathishssj3/NexVR-Engine --skill contract-testing-builder-sathishssj3

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? API changes can silently break downstream consumers, and traditional integration tests require slow, fragile shared environments. This Skill implements consumer-driven contract testing so breaking changes are caught early in CI without deploying both services together. ## Core Features & Use Cases - Pact Consumer & Provider Tests: Define expected interactions on the consumer side and verify them against the real provider with state handlers. - OpenAPI & JSON Schema Validation: Validate requests and responses against OpenAPI specs and JSON schemas using express-openapi-validator and Ajv. - Breaking Change Detection & CI Integration: Detect removed fields and type changes, publish pacts to a Pact Broker, and run verification in GitHub Actions. - Use Case: A team maintaining a User API consumed by a web app writes Pact consumer tests, publishes contracts to a broker, and the provider CI pipeline verifies every commit against those contracts before deployment. ## Quick Start Ask the AI to set up Pact contract tests between your consumer application and provider API, including provider state handlers and CI verification.

Frequently Asked Questions about contract-testing-builder

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

FAQPage Schema
How do I set up Pact contract testing in TypeScript?▼

Use PactV3 from @pact-foundation/pact to define consumer interactions with given states, requests, and expected responses, then execute tests against the mock server. On the provider side, use the Verifier class with stateHandlers to seed test data and verify published pacts.

What is consumer-driven contract testing?▼

Consumer-driven contract testing lets API consumers define the exact requests and responses they depend on, which providers must then satisfy. This catches breaking changes early, enables independent development, and avoids needing a shared integration environment.

Pact vs OpenAPI for API contract testing?▼

Pact captures actual consumer expectations as executable contracts verified against the provider, while OpenAPI validates requests and responses against a static specification using middleware like express-openapi-validator. Pact suits consumer-driven workflows; OpenAPI suits spec-first documentation and validation.

How do I verify Pact contracts on the provider side?▼

Run the Pact Verifier against your live provider with providerBaseUrl pointing to the running app, pactUrls or a broker for contracts, and stateHandlers that seed or clean database records for each provider state before verification.

What counts as a breaking API change in contract tests?▼

Breaking changes include removing required response fields, changing field types, and removing enum values. Adding optional fields is safe, and deprecations should follow a documented notice period such as six months.

How do I integrate contract tests into CI pipelines?▼

Run consumer pact tests on every push, publish generated pact files to a Pact Broker tagged with the commit SHA, then trigger provider verification jobs that fetch contracts from the broker using broker URL and token secrets.