Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Pact consumer-driven contracts, provider verification, schema evolution
.claude/skills/contract-testing-patterns/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | — | — |
| case-15 | ✓→✓ | = Same ✓ | — | — |
| case-21 | ✗→✗ | = Same ✗ | — | — |
| case-22 | ✗→✗ | = Same ✗ | — | — |
| case-07 | ✗→✗ | = Same ✗ | — | — |
javascriptconst { PactV3, MatchersV3 } = require('@pact-foundation/pact'); const { like, eachLike, string, integer } = MatchersV3; const provider = new PactV3({ consumer: 'OrderService', provider: 'UserService', logLevel: 'warn', }); describe('User API Contract', () => { it('returns user by ID', async () => { await provider .given('user with ID 1 exists') .uponReceiving('a request for user 1') .withRequest({ method: 'GET', path: '/api/users/1', headers: { Accept: 'application/json' }, }) .willRespondWith({ status: 200, headers: { 'Content-Type': 'application/json' }, body: { id: integer(1), name: string('Jane Doe'), email: string('jane@example.com'), roles: eachLike('admin'), }, }) .executeTest(async (mockServer) => { const client = new UserClient(mockServer.url); const user = await client.getUser(1); expect(user.id).toBe(1); expect(user.name).toBeDefined(); }); }); });
javascriptconst { Verifier } = require('@pact-foundation/pact'); describe('User Provider Verification', () => { it('validates consumer contracts', async () => { const verifier = new Verifier({ providerBaseUrl: 'http://localhost:3000', pactBrokerUrl: process.env.PACT_BROKER_URL, pactBrokerToken: process.env.PACT_BROKER_TOKEN, provider: 'UserService', providerVersion: process.env.GIT_SHA, providerVersionBranch: process.env.GIT_BRANCH, publishVerificationResult: true, stateHandlers: { 'user with ID 1 exists': async () => { await db.users.create({ id: 1, name: 'Jane Doe', email: 'jane@example.com' }); }, 'no users exist': async () => { await db.users.deleteAll(); }, }, }); await verifier.verifyProvider(); }); });
yaml# Backward Compatible (SAFE): - Adding optional fields - Adding new endpoints - Widening accepted value ranges - Adding new enum values (if consumer ignores unknown) # Breaking Changes (UNSAFE): - Removing fields - Renaming fields - Changing field types - Making optional fields required - Narrowing accepted value ranges - Removing endpoints
bash# Before deploying consumer pact-broker can-i-deploy \ --pacticipant OrderService \ --version $GIT_SHA \ --to-environment production # Before deploying provider pact-broker can-i-deploy \ --pacticipant UserService \ --version $GIT_SHA \ --to-environment production
can-i-deploy gate in CI pipeline before deploycan-i-deploy failures| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-23 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-24 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-25 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted. The headline lift of +4 percentage points is the difference between those two pass rates over the 25 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.