Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generate and validate API contract tests using Pact, Spring Cloud Contract, or OpenAPI with consumer-driven contracts and schema drift detection.
.claude/skills/williamzujkowski-api-contract-testing-validator/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 92% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 30% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 19% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 47% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 42% | 0% |
Trigger conditions:
Use this skill when you need to establish or validate API contracts between consumers and providers, detect schema drift, prevent breaking changes, and integrate contract testing into CI/CD pipelines.
Before execution, verify:
NOW_ET = 2025-10-26T06:31:34-04:00 (NIST/time.gov semantics, America/New_York)api_spec is valid OpenAPI 3.x JSON/YAML, service description, or contract DSLrole is exactly "consumer" or "provider"framework is exactly "pact", "spring-contract", or "openapi"language (if provided) is supported by chosen frameworkNOW_ET; verify links resolveAbort conditions:
api_spec is invalid JSON/YAML or missing required fields (paths, operations)framework and language combination not supported (e.g., Pact with COBOL)Scope: Generate minimal consumer or provider contract test for single endpoint.
Steps:
api_spec: Extract endpoint path, method, request/response schemaExample output: Pact consumer test for GET /users/:id endpoint (JavaScript).
Scope: Generate comprehensive contract tests for 3-5 endpoints with CI pipeline integration.
Steps:
api_specapi_spec against existing contract (if available)Sources (accessed 2025-10-26T06:31:34-04:00):
Scope: Deep analysis of schema evolution, versioning strategies, and contract governance.
Steps:
Additional sources (accessed 2025-10-26T06:31:34-04:00):
Framework selection:
Test generation depth:
Breaking change severity:
Ambiguity thresholds:
api_spec has >20 endpoints, request focus on specific consumer-provider pairRequired fields (all tiers):
json{ "contract_tests": { "type": "code", "language": "javascript|java|python|go", "framework": "pact|spring-contract|openapi", "file_path": "path/to/test/file", "content": "// Full test code..." }, "contract_spec": { "type": "json|yaml", "format": "pact_v3|spring_contract_dsl|openapi_3.1", "content": "{ ... contract JSON ... }" } }
T2+ additional fields:
json{ "ci_integration": { "type": "yaml", "pipeline": "github_actions|gitlab_ci|jenkins", "content": "# Pipeline config..." }, "validation_report": { "type": "markdown", "breaking_changes": [ { "severity": "critical|warning|safe", "description": "Removed endpoint /users/:id", "affected_consumers": ["mobile-app", "web-ui"] } ], "compatibility_matrix": "table of consumer/provider version compatibility" } }
T3 additional fields:
json{ "versioning_plan": { "type": "markdown", "strategy": "url|header|content_negotiation", "migration_steps": ["step 1", "step 2"] }, "governance_workflow": { "type": "markdown", "approval_process": "description", "pact_broker_config": "webhook and notification setup" } }
Example 1: Pact Consumer Test (JavaScript, ≤30 lines)
javascriptconst { PactV3, MatchersV3 } = require('@pact-foundation/pact'); const { getUserById } = require('./api-client'); const provider = new PactV3({ consumer: 'mobile-app', provider: 'user-service' }); describe('User API Contract', () => { it('gets user by ID', () => { provider .given('user 123 exists') .uponReceiving('a request for user 123') .withRequest({ method: 'GET', path: '/users/123', headers: { Accept: 'application/json' }, }) .willRespondWith({ status: 200, headers: { 'Content-Type': 'application/json' }, body: { id: MatchersV3.like(123), name: MatchersV3.like('Alice'), email: MatchersV3.email('alice@example.com'), }, }); return provider.executeTest(async (mockServer) => { const user = await getUserById(mockServer.url, 123); expect(user.name).toBe('Alice'); }); }); });
See /skills/api-contract-testing/resources/ for Spring Cloud Contract and OpenAPI examples.
Token budgets (strict):
Safety requirements:
Auditability:
Determinism:
api_spec + role + framework must generate identical contract testsValidation:
Official Documentation (accessed 2025-10-26T06:31:34-04:00):
Tools and Libraries:
Best Practices:
Example Repositories:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-15 | pass→pass | 10,025 | 5,267 | -47% | 1 | 1 | 0% | 2,124 | 4,149 | +95% | 0 | 0 | — |
case-16 | fail→fail | 7,332 | 9,631 | +31% | 1 | 1 | 0% | 1,697 | 5,298 | +212% | 0 | 0 | — |
case-01 | fail→pass | 10,035 | 7,810 | -22% | 1 | 1 | 0% | 2,777 | 5,327 | +92% | 0 | 0 | — |
case-02 | fail→pass | 21,996 | 17,855 | -19% | 1 | 1 | 0% | 6,221 | 8,111 | +30% | 0 | 0 | — |
case-03 | fail→pass | 23,934 | 16,697 | -30% | 1 | 1 | 0% | 6,228 | 7,407 | +19% | 0 | 0 | — |
case-04 | fail→pass | 13,786 | 5,957 | -57% | 1 | 1 | 0% | 2,962 | 4,348 | +47% | 0 | 0 | — |
case-05 | pass→pass | 10,834 | 9,711 | -10% | 1 | 1 | 0% | 2,135 | 5,330 | +150% | 0 | 0 | — |
case-06 | fail→fail | 7,430 | 8,672 | +17% | 1 | 1 | 0% | 1,676 | 5,270 | +214% | 0 | 0 | — |
case-07 | fail→fail | 13,363 | 13,899 | +4% | 1 | 1 | 0% | 3,144 | 6,295 | +100% | 0 | 0 | — |
case-08 | pass→pass | 6,408 | 5,462 | -15% | 1 | 1 | 0% | 1,519 | 4,318 | +184% | 0 | 0 | — |
case-09 | fail→pass | 17,264 | 14,476 | -16% | 1 | 1 | 0% | 4,979 | 7,075 | +42% | 0 | 0 | — |
case-10 | fail→pass | 15,688 | 17,845 | +14% | 1 | 1 | 0% | 3,981 | 7,588 | +91% | 0 | 0 | — |
case-11 | fail→pass | 7,226 | 6,223 | -14% | 1 | 1 | 0% | 1,473 | 4,159 | +182% | 0 | 0 | — |
case-12 | pass→pass | 7,594 | 8,572 | +13% | 1 | 1 | 0% | 1,592 | 4,693 | +195% | 0 | 0 | — |
case-13 | fail→fail | 6,108 | 6,643 | +9% | 1 | 1 | 0% | 1,148 | 4,317 | +276% | 0 | 0 | — |
case-14 | fail→fail | 1,513 | 4,584 | +203% | 1 | 1 | 0% | 270 | 3,846 | +1324% | 0 | 0 | — |
case-17 | pass→pass | 11,004 | 5,980 | -46% | 1 | 1 | 0% | 2,044 | 4,100 | +101% | 0 | 0 | — |
case-18 | pass→pass | 10,515 | 9,922 | -6% | 1 | 1 | 0% | 2,061 | 5,040 | +145% | 0 | 0 | — |
case-19 | fail→fail | 16,574 | 15,869 | -4% | 1 | 1 | 0% | 3,624 | 6,492 | +79% | 0 | 0 | — |
case-20 | fail→fail | 15,017 | 14,143 | -6% | 1 | 1 | 0% | 3,476 | 6,533 | +88% | 0 | 0 | — |
case-21 | fail→fail | 13,928 | 14,983 | +8% | 1 | 1 | 0% | 3,217 | 6,652 | +107% | 0 | 0 | — |
case-22 | pass→pass | 14,863 | 9,163 | -38% | 1 | 1 | 0% | 2,620 | 4,950 | +89% | 0 | 0 | — |
case-23 | pass→pass | 12,831 | 8,937 | -30% | 1 | 1 | 0% | 2,177 | 4,790 | +120% | 0 | 0 | — |
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. 23 cases were attempted. The headline lift of +30 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.