Skip to main content
skill CX Codex

qe-contract-testing — Claude Code skill: API contract verification

qe-contract-testing — a skill for verifying REST, GraphQL, and event-driven API contracts with schema validation. Detects incompatible changes and ensures APIs won't break downstream clients.

MIT 115 installs ★ 533 updated 2026-10-25

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add proffesor-for-testing/agentic-qe --skill qe-contract-testing -a claude-code
Open on GitHub

What qe-contract-testing does

qe-contract-testing automates contract testing between API consumers and providers. It handles consumer-driven contracts (Pact), OpenAPI and GraphQL schema validation, backward compatibility checks, and breaking change analysis. The skill generates contracts from specifications, verifies providers against consumer contracts, identifies removed endpoints and parameter changes.

Includes Pact Broker integration for cross-team coordination, event schema validation, deprecation tracking, and reports with impact assessment. Requires Node.js and access to API endpoints or their specifications.

The goal is to catch breaking changes during development and document the contracts clients rely on. Provides examples for REST, GraphQL, event-driven systems, and CI/CD pipelines.

What it helps with

  • verify whether a new API version remains compatible with existing clients
  • document contracts between microservices
  • catch breaking changes before release
  • validate GraphQL query and response schemas
  • coordinate contract testing across multiple teams

Example prompts for the agent

  • Generate consumer contracts from openapi.yaml and save to contracts/
  • Check if API v2 remains compatible with v1 contracts, identify breaking changes
  • Validate GraphQL schema from schema.graphql against live requests

How to install qe-contract-testing

1Skills CLI (Vercel)

npx skills add proffesor-for-testing/agentic-qe --skill qe-contract-testing -a claude-code

2Manually: put the files in place

~/.claude/skills/qe-contract-testing/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/qe-contract-testing/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about qe-contract-testing

How do I install qe-contract-testing in Claude Code?

Run npx skills add proffesor-for-testing/agentic-qe --skill qe-contract-testing -a claude-code, then open ~/.claude/skills/qe-contract-testing/SKILL.md to verify.

What does qe-contract-testing do?

Tests contracts between API clients and providers. Generates contracts from specifications, checks backward compatibility, identifies breaking changes, and validates REST, GraphQL, and event-driven system schemas.

Which API formats does this skill support?

REST (OpenAPI), GraphQL, and event-driven systems. Works with Pact contracts, JSON schemas, and YAML specifications.

Source text

SKILL.md · MIT
---
inclusion: auto
name: qe-contract-testing
description: "Consumer-driven contract testing for APIs including REST, GraphQL, and event-driven systems with schema validation."
---

# QE Contract Testing

## Purpose

Guide the use of v3's contract testing capabilities including consumer-driven contracts, schema validation, backward compatibility checking, and API versioning verification.

## Activation

- When testing API contracts
- When validating schema changes
- When checking backward compatibility
- When testing GraphQL APIs
- When verifying event schemas

## Quick Start

```bash
# Generate contract from API
aqe contract generate --api openapi.yaml --output contracts/

# Verify provider against contracts
aqe contract verify --provider http://localhost:3000 --contracts contracts/

# Check breaking changes
aqe contract breaking --old api-v1.yaml --new api-v2.yaml

# Test GraphQL schema
aqe contract graphql --schema schema.graphql --operations queries/
```

## Agent Workflow

```typescript
// Contract generation
Task("Generate API contracts", `
  Analyze the REST API and generate consumer contracts:
  - Parse OpenAPI specification
  - Identify critical endpoints
  - Generate Pact contracts
  - Include example requests/responses
  Output to contracts/ directory.
`, "qe-api-contract")

// Breaking change detection
Task("Check API compatibility", `
  Compare API v2.0 against v1.0:
  - Detect removed endpoints
  - Check parameter changes
  - Verify response schema changes
  - Identify deprecations
  Report breaking vs non-breaking changes.
`, "qe-api-compatibility")
```

## Contract Testing Types

### 1. Consumer-Driven Contracts (Pact)

```typescript
await contractTester.consumerDriven({
  consumer: 'web-app',
  provider: 'user-service',
  contracts: 'contracts/web-app-user-service.json',
  verification: {
    providerBaseUrl: 'http://localhost:3000',
    providerStates: providerStateHandlers,
    publishResults: true
  }
});
```

### 2. Schema Validation

```typescript
await contractTester.validateSchema({
  type: 'openapi',
  schema: 'api/openapi.yaml',
  requests: actualRequests,
  validation: {
    requestBody: true,
    responseBody: true,
    headers: true,
    statusCodes: true
  }
});
```

### 3. GraphQL Contract Testing

```typescript
await graphqlTester.testContracts({
  schema: 'schema.graphql',
  operations: 'queries/**/*.graphql',
  validation: {
    queryValidity: true,
    responseShapes: true,
    nullability: true,
    deprecations: true
  }
});
```

### 4. Event Contract Testing

```typescript
await contractTester.eventContracts({
  schema: 'events/schemas/',
  events: {
    'user.created': {
      schema: 'UserCreatedEvent.json',
      examples: ['examples/user-created.json']
    },
    'order.completed': {
      schema: 'OrderCompletedEvent.json',
      examples: ['examples/order-completed.json']
    }
  },
  compatibility: 'backward'
});
```

## Breaking Change Detection

```yaml
breaking_changes:
  always_breaking:
    - endpoint_removed
    - required_param_added
    - response_field_removed
    - type_changed

  potentially_breaking:
    - optional_param_removed
    - response_field_added
    - enum_value_removed

  non_breaking:
    - endpoint_added
    - optional_param_added
    - response_field_made_optional
    - documentation_changed
```

## Contract Report

```typescript
interface ContractReport {
  summary: {
    contracts: number;
    passed: number;
    failed: number;
    warnings: number;
  };
  consumers: {
    name: string;
    contracts: ContractResult[];
    compatibility: 'compatible' | 'breaking' | 'unknown';
  }[];
  breakingChanges: {
    type: string;
    location: string;
    description: string;
    impact: 'high' | 'medium' | 'low';
    migration: string;
  }[];
  deprecations: {
    item: string;
    deprecatedIn: string;
    removeIn: string;
    replacement: string;
  }[];
}
```

## CI/CD Integration

```yaml
contract_verification:
  consumer_side:
    - generate_contracts
    - publish_to_broker
    - can_i_deploy_check

  provider_side:
    - fetch_contracts_from_broker
    - verify_against_provider
    - publish_results

  pre_release:
    - check_breaking_changes
    - verify_all_consumers
    - update_compatibility_matrix
```

## Pact Broker Integration

```typescript
await contractTester.withBroker({
  brokerUrl: 'https://pact-broker.example.com',
  auth: { token: process.env.PACT_TOKEN },
  operations: {
    publish: true,
    canIDeploy: true,
    webhooks: true
  }
});
```

## Coordination

**Primary Agents**: qe-api-contract, qe-api-compatibility, qe-graphql-tester
**Coordinator**: qe-contract-coordinator
**Related Skills**: qe-test-generation, qe-security-compliance

© proffesor-for-testing · MIT · proffesor-for-testing/agentic-qe

Similar skills

All skills for Testing and QA →

From the same set73

The whole set →
shift-left-testing The shift-left-testing skill moves checks earlier in development: validate requirements, write tests before implementation, and run them in CI. Use it when introducing TDD or other early quality practices. CX Codex +1 117installs test-environment-management test-environment-management is a Claude Code skill for setting up test infrastructure and matching it to production. It covers environment setup, parity checks, and test infrastructure costs. CX Codex +1 117installs debug-loop debug-loop — a skill for step-by-step debugging of errors through real commands, not simulations. Forms hypotheses, validates them against live data, identifies root cause, and only then fixes the code. CX Codex +1 117installs shift-right-testing shift-right-testing guides agents through production testing using feature flags, canary rollouts, and chaos experiments. Useful when setting up progressive delivery or tracking SLOs. CX Codex +1 115installs security-visual-testing security-visual-testing validates URLs, masks sensitive data on screenshots, and runs multi-viewport visual regression tests with WCAG accessibility audits. CX Codex +1 115installs enterprise-integration-testing Enterprise integration testing skill for SAP, middleware, and WMS setups. It coordinates cross-system checks across RFC, IDoc, OData, and ESB flows. CX Codex +1 113installs holistic-testing-pact holistic-testing-pact builds testing strategies around PACTS principles and holistic quadrants. It structures quality planning for classical, AI-assisted, and autonomous agent setups. CX Codex +1 111installs observability-testing-patterns observability-testing-patterns is a Claude Code skill with patterns for checking dashboards, alert thresholds, log aggregation, and APM tracing during monitoring tests. CX Codex +1 109installs

Project sponsors

Companies that keep this analytics open