- Home
- Skills
- Williamzujkowski
- Cognitive Toolworks
- Api Contract Testing
api-contract-testing_skill
- Python
5
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill williamzujkowski/cognitive-toolworks --skill api-contract-testing- SKILL.md13.0 KB
Overview
This skill generates and validates API contract tests using Pact, Spring Cloud Contract, or OpenAPI. It automates consumer-driven contract creation, provider verification, CI integration, and schema-drift detection. The output includes runnable test code, contract artifacts, and reports suitable for CI gating. It supports single-endpoint proofs up to full governance plans for evolving APIs.
How this skill works
Given an OpenAPI or contract DSL and a role (consumer or provider), the skill parses endpoints, request/response schemas, and interactions. It selects framework-specific templates (Pact DSL, Spring Contract DSL, or OpenAPI validators) and emits minimal or full test suites, contract spec files, and optional CI pipeline configs. When available, it diffs against historical contracts to detect breaking changes and produces a compatibility/validation report.
When to use it
- Microservices communicating via REST or GraphQL that need formal contract guarantees
- Front-end (mobile/web) teams that require safe API version evolution
- API providers who must verify backward compatibility before deployment
- CI/CD pipelines that require automated contract verification gates
- Teams moving from manual integration tests to consumer-driven contracts
- Detecting schema drift during API evolution and releases
Best practices
- Choose Pact for consumer-driven, polyglot environments and Pact Broker integration
- Use Spring Cloud Contract inside Spring Boot ecosystems for provider-driven workflows
- Prefer OpenAPI validation for spec-first projects and simple request/response checks
- Publish contracts to a broker and enforce verification as a blocking CI gate
- Treat removed endpoints and deleted required fields as deployment blockers
Example use cases
- Generate a Pact consumer test (JavaScript) for GET /users/:id as a quick proof-of-concept
- Produce a multi-endpoint test suite plus GitHub Actions workflow that publishes and verifies pacts
- Run schema evolution analysis over historical contracts and flag breaking changes with severity
- Create Spring Cloud Contract DSL files for provider verification in a Spring Boot service
- Add OpenAPI request/response validators to an Express app for runtime contract enforcement
FAQ
A valid OpenAPI 3.x JSON/YAML or contract DSL, a role set to 'consumer' or 'provider', and a framework choice of 'pact', 'spring-contract', or 'openapi'.
How are breaking changes handled?
The skill diffs new specs against previous contracts, classifies changes as critical/warning/safe, logs affected consumers, and can generate CI gates to block deployments for critical changes.