quality-contract-testing
Use when the user asks about consumer driven contract tests with Pact, Pact Broker or PactFlow, can-i-deploy, provider verification, message pacts or Spring…
от j4flmao★ 47 звёзд на GitHub
Установить quality-contract-testing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Quality Contract Testing
Purpose
Implement consumer-driven contract testing with Pact to verify API compatibility between services without brittle integration tests.
Agent Protocol
Trigger
Exact user phrases: "contract testing", "Pact", "Spring Cloud Contract", "consumer-driven contract", "provider contract", "API compatibility", "integration testing", "contract verification", "Pact broker", "CDC", "breaking change".
Input Context
Before activating, verify:
- Service architecture (monolith, microservices, event-driven)
- Consumer and provider service names
- Communication protocol (HTTP REST, gRPC, async messaging)
- Existing test frameworks and CI setup
Output Artifact
Contract testing setup with Pact consumer tests, provider verification, and CI pipeline configuration.
Response Format
# Contract architecture: consumers, providers, interactions
# Pact Broker configuration
// Consumer test example
// Provider verification setup
No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.
Completion Criteria
- Consumer tests written for each API interaction
- Pact contracts generated and published to broker
- Provider verification tests configured
- Pact Broker deployed or SaaS configured
- CI pipeline with contract verification step
- Breaking change detection workflow established
- Canary release or version compatibility strategy in place
Max Response Length
200 lines of configuration and test code.
Consumer-Driven Contracts
Pact Overview
Pact is a consumer-driven contract testing framework. The consumer defines the expected interaction (request + response) in a test. Pact generates a contract file from the consumer test. The contract is published to a Pact Broker. The provider fetches the contract and verifies it against the actual API. If verification fails, the provider cannot deploy.
Consumer Test Setup (TypeScript)
Consumer tests define the expected request and response for each API interaction. Tests run against a mock provider started by Pact. Each interaction specifies: a description of what the consumer expects to receive, the provider state that must be set up before verification, the request details (method, path, headers, body), and the expected response (status, headers, body).
Provider Verification Setup
Provider tests fetch the latest consumer contracts from the Pact Broker and verify each interaction against the provider's actual API. The provider starts a test server, runs the contract verifier, and checks that each consumer interaction's response matches the actual response. Provider states are set up via API calls to the provider's test endpoints or database seeding.
Pact Broker Deployment
The Pact Broker stores contracts, verification results, and matrices of compatible versions. It can be self-hosted via Docker Compose or used as a SaaS product (PactFlow). The Broker exposes a web UI showing the network diagram of all service dependencies. Webhooks can be configured to notify consumers when a provider publishes a new verification result or when a contract changes.
Versioning and Compatibility
Contracts are versioned by the consumer's application version (Git commit SHA) and branch. Deployments are recorded per environment with pact-broker record-deployment (or record-release); tags are the legacy mechanism. The can-i-deploy tool checks the Pact Broker for compatibility before any deployment. The Broker maintains a matrix of compatible consumer and provider versions.
Breaking Change Detection
When a provider change breaks a consumer contract, the Broker shows exactly which consumer is affected, which interaction failed, and the exact response diff. The developer fixes the issue by making the change backward compatible (add new endpoint instead of modifying existing, add optional fields) or coordinating a multi-service deployment.
CI Pipeline Integration
Consumer CI: test → publish pact with branch + version. Provider CI: fetch pending contracts → verify → report results. Deployment check: can-i-deploy verifies all consumer contracts pass before provider deploys. The pipeline blocks deployment if can-i-deploy fails.
Spring Cloud Contract Alternative
Spring Cloud Contract provides Groovy-based contract definitions for JVM projects. Contracts are defined as Groovy DSL files alongside the provider code. The provider generates a test stub from the contract. Consumer-side tests use the WireMock stub generated from the contract. Contracts are stored in a Git repository or Artifactory instead of a Pact Broker.
Message (Async) Contract Testing
For messaging contracts (Kafka, SQS, RabbitMQ, IBM MQ), Pact supports message pacts. A message pact defines the expected message payload (key-value pairs or serialized objects) that the consumer expects from a message queue. The provider
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/cdc-workflow.md
- references/contract-testing-advanced-2.md
- references/contract-testing-advanced.md
- references/contract-testing-ci.md
- references/contract-testing-fundamentals-2.md
- references/contract-testing-fundamentals.md
- references/contract-testing-strategies.md
- references/contract-testing-tools.md
- references/contract-testing-workflow.md
- references/merged-backend-contract-testing.md
- references/pact-broker-deep-dive.md
- references/pact-patterns.md
- references/pact-setup-2.md
- references/pact-setup.md
- references/provider-verification-deep.md
- references/provider-verification.md
FAQ
Что делает скилл quality-contract-testing?
Use when the user asks about consumer driven contract tests with Pact, Pact Broker or PactFlow, can-i-deploy, provider verification, message pacts or Spring Cloud Contract. Produces consumer tests, provider verification and CI gating. Not for service tests with real dependencies (use quality-integration-testing) or e2e journeys (use quality-e2e-testing).
Как установить скилл quality-contract-testing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл quality-contract-testing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
AnthropicThe scan that the plugin's GitHub Action runs.
azure-static-web-apps
GitHubHelps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
ai-ready
GitHubMake any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
aws-cdk-python-setup
GitHubSetup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…