backend-contract-testing

backend-contract-testing is a skill for Claude Code, Codex from j4flmao/agent-skills. It costs 100 tokens per session (4,324 once invoked), scanned A, original, MIT.

A testing approach for checking that one service communicates with another as expected. It uses Pact, a tool that records a consumer service's expectations and checks that the provider service meets them.

In plain words
What is it for?
Use it to write consumer and provider contract tests, verify service interactions, publish contracts, and run checks in continuous integration.
Why use it?
It catches service communication changes without relying on slow, fragile tests that run the whole system.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/j4flmao/agent-skills/contract-testing
Any agent
npx skills add j4flmao/agent-skills --skill contract-testing
Clone the repo
git clone --depth 1 https://github.com/j4flmao/agent-skills

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 backend-contract-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/j4flmao/agent-skills/contract-testing.svg)](https://agentmods.dev/skills/j4flmao/agent-skills/contract-testing)
Your own site
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/contract-testing"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/contract-testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,324 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00100 $0.04324
Opus 5 $0.00050 $0.02162
Sonnet 5 $0.00020 $0.00865
Haiku 4.5 $0.00010 $0.00432

Measured 2d ago against content hash 271bf7bfb89d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

backend-contract-testing scanned grade A with 0 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 2d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/backend/universal/contract-testing/SKILL.md · 541 lines

How it starts

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

Backend Contract Testing

Purpose

Use consumer-driven contract (CDC) testing with Pact to verify that provider services satisfy consumer expectations, replacing brittle end-to-end integration tests with fast, deterministic contract tests.

Agent Protocol

Trigger

Exact user phrases: "contract testing", "Pact", "consumer-driven contracts", "CDC", "provider verification", "pact test", "pactflow", "contract test", "consumer test", "provider test".

Input Context

  • Service architecture: list of consumers and providers.
  • Existing test framework (Jest, JUnit, pytest, etc.).
  • Pact broker or PactFlow URL if available.

Output Artifact

Pact test code snippets or Pactfile. No file unless requested.

Response Format

Consumer: {service}
Provider: {service}
Interactions: {N}
State: {provider state}

Completion Criteria

  • Consumer test written for each consumer-provider interaction.
  • Provider verification test written for each provider.
  • Pact files published to Pact broker.
  • Provider verification runs in CI against the deployed provider.
  • No hardcoded URLs or real data in Pact tests.

Max Response Length

6 lines per interaction. 20 lines for full test.

Architecture Decision Tree

Should I Use Contract Testing?

Do consumer and provider belong to different teams?
  ├── Yes → Strongly consider contract testing
  └── No → Is the provider used by multiple consumers?
            ├── Yes → Contract testing recommended
            └── No → Would an E2E test be too slow/brittle?
                      ├── Yes → Contract testing may help
                      └── No → Simple unit/integration tests may suffice

Which Approach?

Can the consumer change the contract independently?
  ├── Yes → Consumer-Driven Contract (CDC) with Pact
  └── No → Is the provider owned by the same team as the consumer?
            ├── Yes → Bi-Directional Contracts (Spring Cloud Contract or Pact)
            └── No → Provider-Driven Contracts (OpenAPI + Specmatic)

Read the full file on GitHub · 541 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. 2d ago First seen · 541 lines · 100 tokens per session scan A 271bf7bfb89d

Subscribe to this mod's changes

backend-contract-testing is a skill published in the GitHub repository j4flmao/agent-skills (20 stars, last pushed today), licensed MIT. It adds 100 tokens to every session and 4,324 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

Contract Test Generator

Generate consumer-driven contract tests using Pact framework to verify API provider-consumer compatibility and prevent integration breaking changes.

PramodDutta/qaskills · 24 tokens

Contract Testing with Pact

Consumer-driven contract testing skill using Pact, covering consumer tests, provider verification, Pact Broker integration, and CI/CD workflows.

PramodDutta/qaskills · 29 tokens

api-testing-patterns

Comprehensive API testing patterns including contract testing, REST/GraphQL testing, and integration testing. Use when testing APIs or designing API test strategies.

summarybotng/summarybot-ng · 34 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens