a5c-ai/babysitter / library/specializations/code-migration-modernization/skills/contract-test-generator
contract-test-generator
VerifiedGenerate contract tests for API migrations with consumer-driven contracts and provider verification
README.md
View on GitHub# Contract Test Generator Skill
## Overview
The Contract Test Generator skill creates contract tests for API migrations. It supports consumer-driven contracts and provider verification to prevent breaking changes.
## Quick Start
### Prerequisites
- Contract testing framework
- API specifications
- Consumer/provider access
### Basic Usage
1. **Define contracts**
- Identify consumers
- Document interactions
- Set expectations
2. **Generate tests**
```bash
# Using Pact
pact-provider-verifier --provider-base-url=http://api
```
3. **Verify contracts**
- Run provider verification
- Check all consumers
- Fix failures
## Features
### Contract Types
| Type | Direction | Use Case |
|------|-----------|----------|
| Consumer-Driven | Consumer -> Provider | Microservices |
| Provider-Driven | Provider -> Consumer | Public APIs |
| Bi-Directional | Both | Partnerships |
### Testing Workflow
1. Consumer writes contract
2. Contract published to broker
3. Provider verifies contract
4. Both deploy independently
## Configuration
```json
{
"consumer": {
"name": "frontend-app"
},
"provider": {
"name": "user-service",
"baseUrl": "http://localhost:8080"
},
"pact": {
"broker": "https://pact.example.com",
"publishContracts": true
}
}
```
## Related Documentation
- [SKILL.md](./SKILL.md) - Full skill specification
- [Pact](https://docs.pact.io/)
- [Spring Cloud Contract](https://spring.io/projects/spring-cloud-contract)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |