Contract Test Generator

Contract Test Generator is a skill for Claude Code, Codex from PramodDutta/qaskills. It costs 24 tokens per session (7,728 once invoked), scanned A, original, MIT.

A guide for writing consumer-driven contract tests with Pact, a tool that checks whether an API service meets the expectations of the software using it.

In plain words
What is it for?
Use it to create consumer tests, verify provider behavior, and check API compatibility in a delivery pipeline.
Why use it?
It catches breaking changes between API providers and consumers without requiring every service to run together.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for aider. Also seen: positional $N argument; mentions Codex; built for aider.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { UserApiClient } from '../../src/api-client';.

Good fit Use it to create consumer tests, verify provider behavior, and check API…

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/PramodDutta/qaskills
agentmods
npx agentmods add skills/pramoddutta/qaskills/contract-test-generator

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Contract Test Generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/pramoddutta/qaskills/contract-test-generator.svg)](https://agentmods.dev/skills/pramoddutta/qaskills/contract-test-generator)
Your own site
<a href="https://agentmods.dev/skills/pramoddutta/qaskills/contract-test-generator"><img src="https://agentmods.dev/badge/skills/pramoddutta/qaskills/contract-test-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,728 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00024 $0.07728
Opus 5 $0.00012 $0.03864
Sonnet 5 $0.00005 $0.01546
Haiku 4.5 $0.00002 $0.00773

Measured 3d ago against content hash b5753d339812, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

Contract Test Generator scanned grade A with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

await axios.post(

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

import { execSync } from 'child_process';
seed-skills/contract-test-generator/SKILL.md · 922 lines

How it starts

The opening of the file, as written. The whole thing — 922 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Contract Test Generator

Contract testing bridges the gap between unit tests and full integration tests by verifying that services can communicate correctly without requiring all services to be running simultaneously. Consumer-driven contract testing, pioneered by the Pact framework, inverts the traditional approach: consumers define what they expect from providers, and providers verify they can satisfy those expectations. This skill guides AI coding agents through generating robust contract tests that catch integration breaking changes before they reach production.

Core Principles

  1. Consumer-Driven Design: Consumers define the contract based on what they actually use, not what the provider offers. This ensures contracts are minimal, focused, and reflect real usage patterns rather than hypothetical API surfaces.

  2. Provider Verification Independence: Provider tests verify contracts independently without needing the consumer running. This decouples deployment schedules and enables teams to work autonomously while maintaining integration guarantees.

  3. Contract as Shared Artifact: The contract (pact file) serves as a living specification between consumer and provider. It is versioned, stored centrally, and referenced by both sides during their respective CI pipelines.

  4. Minimal Assertion Surface: Contracts should assert only what the consumer needs, not the full provider response. Testing for specific fields rather than entire response bodies prevents brittle contracts that break on harmless provider changes.

  5. Versioning Alignment with Deployability: Every contract must be associated with a specific consumer version and verified against a specific provider version. The combination of these versions determines whether a deployment is safe.

  6. Fail-Fast in CI: Contract verification failures must block deployments. The can-i-deploy tool provides a definitive answer about deployment safety based on the latest verification matrix.

  7. Incremental Adoption: Contract tests can be introduced for the most critical interactions first, then expanded. There is no requirement to cover every endpoint immediately; focus on high-risk integration points.

Read the full file on GitHub · 922 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 922 lines · 24 tokens per session scan A b5753d339812

Subscribe to this mod's changes

Contract Test Generator is a skill published in the GitHub repository PramodDutta/qaskills (217 stars, last pushed 7d ago), licensed MIT. It adds 24 tokens to every session and 7,728 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.