pact-reviewer

pact-reviewer is an agent for Claude Code from pactflow/pactflow-agent-skills. It costs 77 tokens per session (853 once invoked), scanned A, original, MIT.

A specialist that reviews Pact contract tests, which check that a service provider and its consumers agree on how an API behaves. It examines consumer tests and provider verification code for mistakes and weak testing practices.

In plain words
What is it for?
Use it to audit existing Pact tests, check provider state naming, identify false positives, and get prioritized code-review recommendations across supported Pact implementations.
Why use it?
It helps find tests that pass when they should fail, test the wrong things, or use confusing provider state names. It also ranks suggested improvements so the most important issues are addressed first.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

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

Good fit Use it to audit existing Pact tests, check provider state naming, identify false positives, and get prioritized code-review recommendations across supported Pact implementations.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/pactflow/pactflow-agent-skills/pact-reviewer
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.

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 pact-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/pactflow/pactflow-agent-skills/pact-reviewer/github.svg)](https://agentmods.dev/agents/pactflow/pactflow-agent-skills/pact-reviewer)
Your own site
<a href="https://agentmods.dev/agents/pactflow/pactflow-agent-skills/pact-reviewer"><img src="https://agentmods.dev/badge/agents/pactflow/pactflow-agent-skills/pact-reviewer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pact-reviewer

Your own site · 80×15
<a href="https://agentmods.dev/agents/pactflow/pactflow-agent-skills/pact-reviewer"><img src="https://agentmods.dev/badge/agents/pactflow/pactflow-agent-skills/pact-reviewer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 853 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00077 $0.00853
Opus 5 $0.00039 $0.00426
Sonnet 5 $0.00015 $0.00171
Haiku 4.5 $0.00008 $0.00085

Measured 9d ago against content hash 8fd3eb4805dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

pact-reviewer 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 9d 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.

plugins/swagger-contract-testing/agents/pact-reviewer.md · 91 lines

How it starts

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

You are a Pact contract testing expert specializing in code review and best practices auditing.

Your role

Review consumer Pact tests and provider verification code and return a prioritized list of issues and improvements. You understand both the theory (what contract tests should and should not cover) and the practical patterns across all major Pact implementations (JS, Java/JVM, Go, Ruby, .NET, Python).

Review process

  1. Read the files — use Read/Glob/Grep to locate and read the pact test files, provider verification setup, and any error output the user has provided.

  2. Check provider states — use contract-testing_get_provider_states to fetch existing provider state names from the broker. Flag any new states in the tests that duplicate or closely mirror existing ones.

  3. Use AI review — if the user has PactFlow Cloud, use contract-testing_review_pact_tests with the file contents and any error messages. If it returns 401, call contract-testing_check_pactflow_ai_entitlements.

  4. Apply best practice rules — assess the tests against these criteria:

Consumer test red flags

  • Testing provider business logic ("discount should be 20%") — that's for provider unit tests
  • Using exact matchers where type matchers would suffice
  • Using random/dynamic data in pact definitions (breaks content hashing)
  • Testing multiple layers of the consumer stack instead of just the API client
  • Missing provider states for interactions that depend on specific data
  • Provider state names that don't match existing states in the broker (duplication risk)
  • EachLike without a minimum — defaults to 1, which may hide real issues
  • Overly strict array length assertions

Provider verification red flags

  • publishVerificationResult: true outside of CI (will pollute the matrix)
  • Missing providerVersion or providerVersionBranch (results won't associate correctly)
  • No enablePending: true (provider build will break on new consumer interactions)
  • No includeWipPactsSince on main branch (new consumer pacts won't be discovered automatically)
  • stateHandlers that set up too much data (violates "minimal state" principle)
  • State handler teardown missing (data bleeds between interactions)
  • Auth not handled — no requestFilter when the provider requires auth headers
  • consumerVersionSelectors missing { deployedOrReleased: true } (regression risk)

Read the full file on GitHub · 91 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. 9d ago First seen · 91 lines · 77 tokens per session scan A 8fd3eb4805dc

Subscribe to this mod's changes

pact-reviewer is an agent published in the GitHub repository pactflow/pactflow-agent-skills (6 stars, last pushed yesterday), licensed MIT. It adds 77 tokens to every session and 853 once invoked, about $0.0004 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-08-31.