---
name: contract-test-generator-e7521c8c71d3
description: Generate contract tests for API migrations with consumer-driven contracts and provider verification
allowed-tools: ["Bash", "Read", "Write", "Grep", "Glob", "Edit"]
graph:
  domains: [domain:software-engineering]
  specializations: [specialization:code-migration-modernization]
  skillAreas: [skill-area:contract-testing, skill-area:api-contract-testing]
  roles: [role:qa-engineer, role:backend-engineer]
  workflows: [workflow:technical-debt-reduction]
  topics: [topic:refactoring]
---

# Contract Test Generator Skill

Generates contract tests for API migrations, supporting consumer-driven contracts, provider verification, and breaking change detection.

## Purpose

Enable API contract testing for:
- Consumer contract generation
- Provider verification
- Schema validation
- Breaking change detection
- Mock server generation

## Capabilities

### 1. Consumer Contract Generation
- Generate from API usage
- Extract from tests
- Build from specs
- Support multiple formats

### 2. Provider Verification
- Verify against contracts
- Test all consumers
- Check compatibility
- Document failures

### 3. Schema Validation
- Validate request schemas
- Check response schemas
- Verify data types
- Enforce constraints

### 4. Breaking Change Detection
- Detect field removals
- Find type changes
- Identify required additions
- Flag compatibility issues

### 5. Mock Server Generation
- Generate from contracts
- Support stub responses
- Handle scenarios
- Enable development isolation

### 6. Contract Versioning
- Track contract versions
- Manage compatibility
- Support migrations
- Document changes

## Tool Integrations

| Tool | Purpose | Integration Method |
|------|---------|-------------------|
| Pact | Consumer-driven contracts | CLI |
| Spring Cloud Contract | Java contracts | CLI |
| Dredd | API validation | CLI |
| Prism | Mock server | CLI |
| WireMock | Mock server | CLI |

## Output Schema

```json
{
  "generationId": "string",
  "timestamp": "ISO8601",
  "contracts": [
    {
      "consumer": "string",
      "provider": "string",
      "interactions": [
        {
          "description": "string",
          "request": {},
          "response": {}
        }
      ]
    }
  ],
  "verification": {
    "passed": "boolean",
    "results": []
  },
  "artifacts": {
    "contractFiles": [],
    "mockServerConfig": "string"
  }
}
```

## Integration with Migration Processes

- **api-modernization**: Contract verification
- **monolith-to-microservices**: Service contracts

## Related Skills

- `openapi-generator`: Spec generation
- `api-compatibility-analyzer`: Breaking changes

## Related Agents

- `regression-detector`: Regression prevention
- `cross-team-integrator`: Contract coordination


---
Source attribution: a5c-ai
Original project: https://github.com/a5c-ai/babysitter
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 Gabriel Moreira

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: a5c-ai
Original project: https://github.com/a5c-ai/babysitter
Attribution basis: Upstream repository explicitly recorded in package mirror path

Fields of work: Development & Engineering, Product Management
Roles: Backend Developer, Data Engineer, DevOps / SRE, Product Manager, QA / Test Engineer
Specialties: API, Backend, Testing
Tools: Dredd, Pact, Prism, Wiremock, Spring Cloud Contract
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: ddd074028af3b2847b63ec3782167203bdb4e04dcba78b75d960d236765ef9d4
