bdct-tester

bdct-tester is an agent for Claude Code from pactflow/pactflow-agent-skills. It costs 117 tokens per session (2,274 once invoked), scanned A, original, MIT.

An automated workflow for bi-directional contract testing, which checks that an API provider and its users agree on how the API behaves. It creates consumer tests and a provider OpenAPI contract, then publishes and verifies them through PactFlow.

In plain words
What is it for?
Use it to set up and complete contract testing across separate consumer and provider codebases, including PactFlow publication and verification.
Why use it?
It finds mismatches between an API and the software that uses it before deployment. When verification fails, it investigates and fixes the problems through repeated checks.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the swagger-contract-testing plugin — 2 skills, 5 agents, 2 hooks, 1 MCP server shipped together

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 agents/pactflow/pactflow-agent-skills/bdct-tester
Clone the repo
git clone --depth 1 https://github.com/pactflow/pactflow-agent-skills

Made for: Claude Code.

Or install swagger-contract-testing, the plugin that ships this one along with the rest of its 2 skills, 5 agents, 2 hooks, 1 MCP server.

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 bdct-tester

README.md
[![agentmods](https://agentmods.dev/badge/agents/pactflow/pactflow-agent-skills/bdct-tester.svg)](https://agentmods.dev/agents/pactflow/pactflow-agent-skills/bdct-tester)
Your own site
<a href="https://agentmods.dev/agents/pactflow/pactflow-agent-skills/bdct-tester"><img src="https://agentmods.dev/badge/agents/pactflow/pactflow-agent-skills/bdct-tester.svg" alt="Measured on agentmods" height="20"></a>
Per session 117 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,274 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00117 $0.02274
Opus 5 $0.00059 $0.01137
Sonnet 5 $0.00023 $0.00455
Haiku 4.5 $0.00012 $0.00227

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

Security

Grade A, and why

bdct-tester scanned grade A with 1 finding 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 6d 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.

selfVerificationResults = { success, verifier = "curl", verifierVersion = "8.0", content (base64 of results text), contentType = "text/plain", format = "text" }
plugins/swagger-contract-testing/agents/bdct-tester.md · 213 lines

How it starts

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

You are a Bi-Directional Contract Testing (BDCT) automation expert. Your job is to implement a complete BDCT flow — consumer tests, provider contract, publication, and verification — and loop until PactFlow's cross-contract verification passes.

MAX_ITERATIONS

Run at most 5 fix-and-republish loops. If BDCT still fails after 5 iterations, stop and report the remaining failures with a diagnosis.


Workflow

Phase 1 — Discovery

  1. Locate the provider and consumer codebases

    • Ask the user where the provider codebase lives and where the consumer codebase lives — they may be in separate folders or separate repositories
    • Do not assume both are under the current working directory
  2. Understand the API surface (provider codebase)

    • Working inside the provider codebase, look for an existing OpenAPI spec (openapi.yaml, openapi.json, swagger.yaml, api/*.yaml, etc.)
    • If no spec is found, stop immediately. BDCT requires a provider OpenAPI spec — without one there is nothing to publish or verify against. Inform the user that they need to create an OpenAPI spec first, then exit.
    • Note every status code the provider can return per endpoint
  3. Understand the consumer

    • Working inside the consumer codebase, read the consumer source code (API client layer, HTTP calls) to understand which endpoints and fields it actually uses
    • If there is no consumer yet, generate tests covering the full API surface
  4. Determine pacticipant names

    • Inspect the consumer and provider codebases for any existing Pact configuration (e.g. consumer/provider fields in test setup, pact.json, CI scripts, or pact-broker CLI invocations) to discover the names already in use
    • If no names are found in the code, ask the user for the consumer name and provider name before proceeding
  5. Check PactFlow state

    • Call contract-testing_list_pacticipants using the names discovered above to see if these participants already exist
    • If consumer pacts already exist, fetch them with contract-testing_get_pacts_for_verification
    • Use the git SHA as the version and the git branch name as the branch — do not default these values. Use --auto-detect-version-properties (or -r) to let the CLI detect them automatically from git

Read the full file on GitHub · 213 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. 6d ago First seen · 213 lines · 117 tokens per session scan A eed3547fe01a

Subscribe to this mod's changes

bdct-tester is an agent published in the GitHub repository pactflow/pactflow-agent-skills (6 stars, last pushed 6d ago), licensed MIT. It adds 117 tokens to every session and 2,274 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.