contract-testing
Implement consumer-driven contract testing with Pact.js.
Skill by kindlmann
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/jaiminvadadoriya-contract-testing
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, backend, testing, devops
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/contract-testing
What's inside
- Skill name
contract-testing- Description
- Implement consumer-driven contract testing with Pact.js. Covers consumer test writing, provider verification, Pact Broker setup, can-i-deploy as deployment gate, webhook-triggered verification, and schema-first vs consumer-first approaches. Use when: "contract test," "Pact," "consumer-driven," "API contract," "provider verification," "can-i-deploy." Related: api-testing, ci-cd-integration, test-environments, service-virtualization.
- License
- MIT
- Metadata
- author: kindlmann · version: 1.0 · category: infrastructure
- Instructions
- 508 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- body: 508 lines (spec recommends under 500)
Files (1)
- SKILL.md
SKILL.md (first lines)
<objective>
Verify that services can communicate correctly without deploying them together.
</objective>
---
## Discovery Questions
1. **Architecture:** Microservices, monolith with separate consumers (mobile/SPA), or BFF pattern? Contract testing matters most when teams deploy independently.
2. **Who owns the contract?** Consumer-driven (consumers define what they need) or provider-driven (provider publishes a spec)? Most teams benefit from consumer-driven.
3. **API versioning strategy:** URL-based (`/v1/`, `/v2/`), header-based, or none? Contracts must account for version negotiations.
4. **How many consumer-provider pairs?** Start with the highest-traffic or most-fragile integration. Do not try to contract-test everything at once.
5. **Existing API specs:** Is there an OpenAPI/Swagger spec? If yes, consider schema-first contracts as a starting point.
6. **Check `.agents/qa-project-context.md` first.** Respect existing API conventions and testing infrastructure.
---
## Core Principles
**1. Consumers define what they need, providers verify they can deliver.** The consumer writes a test declaring "I will call `GET /users/123` and expect `{ id, name, email }`." The provider runs this test against its real implementation. If the provider cannot satisfy the contract, the build breaks before deployment.
**2. Contracts are the shared source of truth.** Not documentation, not Slack threads, not "just deploy and see." Contracts are executable tests that live in CI and block deployments on violation.
**3. Contract tests replace integration environments, not integration tests.** You still need integration tests for complex multi-step workflows. Contract tests eliminate the need to deploy consumer and provider together just to verify the interface.
**4. Break the build on contract violation.** A contract test that logs a warning but allows deployment provides zero value. Contracts must be deployment gates.
**5. Test the contract, not the business logic.** Consumer tests verify response shape and status codes. Provider verification ensures the contract is satisfiable. Business rules belong in unit and integration tests.
---
## Pact.js Setup
### Install
```bash
# Consumer side
npm i -D @pact-foundation/pact
# Provider side
npm i -D @pact-foundation/pact
```
### Consumer Test
The consumer defines what it needs from the provider. This generates a pact file (JSON contract).
> **Pact-JS v16 (Oct 2025) renamed `PactV4` → `Pact` and `MatchersV3` → `Matchers`.** The old names were removed in v16. If you copy from older blog posts/examples, update the imports. The API behavior is unchanged.
```typescript
// consumer/tests/contract/userApi.pact.spec.ts
// Requires @pact-foundation/pact >= 16
import { Pact, Matchers } from "@pact-foundation/pact";
import path from "path";
import { UserApiClient } from "../../src/userApiClient";
const { like, eachLike, integer, string, regex } = Matchers;
const provider = new Pact({
consumer: "frontend-app",
provider: "user-service",
dir: path.resolve(__dirname, "../../../pacts"),
logLevel: "warn",
});
describe("User API Contract", () => {
it("should return a user by ID", async () => {
await provider
.addInteraction()
.given("user 123 exists")
.uponReceiving("a request for user 123")
.withRequest("GET", "/api/users/123", (builder) => {
builder.headers({ Accept: "application/json" });
})
.willRespondWith(200, (builder) => {
builder
.headers({ "Content-Type": "application/json" })
.jsonBody({
id: integer(123),
name: string("Alice Johnson"),
email: regex("alice@example.com", "^[\\w.+-]+@[\\w-]+\\.[\\w.]+$"),
role: string("member"),
createdAt: regex("2024-01-15T00:00:00Z", "^\\d{4}-\\d{2}-\\d{2}T.*Z$"),
});
})
.executeTest(async (mockServer) => {
const client = new UserApiClient(mockServer.url);
const user = await client.getUser(123);
expect(user.id).toBe(123);
expect(user.name).toBeDefined();
expect(user.email).toContain("@");
});
});
it("should return 404 for non-existent user", async () => {
await provider
.addInteraction()
.given("user 999 does not exist")
.uponReceiving("a request for non-existent user")
.withRequest("GET", "/api/users/999")
.willRespondWith(404, (builder) => {
builder.jsonBody({
error: string("Not Found"),
message: string("User 999 not found"),
});
})
.executeTest(async (mockServer) => {
const client = new UserApiClient(mockServer.url);
await expect(client.getUser(999)).rejects.toThrow("User 999 not found");
});
});
it("should return a paginated list of users", async () => {
await provider
.addInteraction()
.given("users exist")
.uponReceiving("a request for the user list")
.withRequest("GET", "/api/users", (builder) => {From JaiminVadadoriya/Distributed-Cloud-Storage---Sync-Platform, MIT.
More from JaiminVadadoriya/Distributed-Cloud-Storage---Sync-Platform
- 0.502score
ai-test-generation
kindlmann
Staged pipeline for AI-assisted test generation: requirements extraction → risk analysis → coverage matrix → scenario generation → oracle design → test code →…
SkillCFreshness: C★ 1Claude Code +9 - 0.502score
ci-cd-integration
kindlmann
Design CI/CD pipelines for test execution.
SkillCFreshness: C★ 1Claude Code +9 - 0.502score
ai-bug-triage
kindlmann
Hybrid fingerprint + LLM pipeline for bug classification, deduplication, and ticket generation.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
accessibility-testing
kindlmann
Test for WCAG 2.2 compliance using axe-core with Playwright, keyboard navigation audits, screen reader testing, ARIA pattern validation, and legal compliance…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
ai-system-testing
kindlmann
Test AI-powered features including LLM prompts, tool calls, nondeterministic outputs, evaluation frameworks, and hallucination risk assessment.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
api-testing
kindlmann
Test REST and GraphQL APIs with Playwright APIRequestContext, Supertest, or standalone HTTP clients.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
ai-qa-review
kindlmann
QA-focused code review for test quality.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
chaos-engineering
kindlmann
Validate system resilience through controlled fault injection.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
cypress-automation
kindlmann
Build Cypress test suites with component testing, E2E testing, custom commands, cy.intercept for network control, Cypress Cloud integration, and TypeScript…
SkillCFreshness: C★ 1Claude Code +9 - 0.488score
coverage-analysis
kindlmann
Measure and improve test coverage meaningfully.
SkillCFreshness: C★ 1Claude Code +9 - 0.488score
compliance-testing
kindlmann
Test for regulatory compliance including GDPR/CMP consent verification, Better Ads Standards, cookie compliance auditing, and privacy policy validation.
SkillCFreshness: C★ 1Claude Code +9 - 0.488score
database-testing
kindlmann
Validate database integrity, test migrations forward and backward, verify schema constraints, manage seed data, and identify query performance issues.
SkillCFreshness: C★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- May 30, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from kindlmann
- 0.570score
coverage-analysis
kindlmann
Measure and improve test coverage meaningfully.
SkillAFreshness: AClaude Code +9 - 0.570score
ai-qa-review
kindlmann
Review EXISTING test code for quality, smells, and testability issues.
SkillAFreshness: AClaude Code +9 - 0.570score
release-readiness
kindlmann
Validate release readiness with evidence-based go/no-go decisions.
SkillAFreshness: AClaude Code +9 - 0.570score
risk-based-testing
kindlmann
Produce a risk matrix or heatmap that quantifies what could break by business impact × probability, runs failure mode analysis on the top items, and maps test…
SkillAFreshness: AClaude Code +9 - 0.570score
qa-project-context
kindlmann
Create and fill .agents/qa-project-context.md with the project's tech stack, test frameworks, CI/CD pipeline, environments, quality goals, risk areas, team…
SkillAFreshness: AClaude Code +9 - 0.502score
ai-test-generation
kindlmann
Staged pipeline for AI-assisted test generation: requirements extraction → risk analysis → coverage matrix → scenario generation → oracle design → test code →…
SkillCFreshness: C★ 1Claude Code +9
Cite this page
contract-testing skill. Agent Mart. https://agentmart.dev/skills/jaiminvadadoriya-contract-testing (last updated 2026-10-24)