contract-test-engineer

contract-test-engineer is an agent for coding agents from hmcts/agentic-plugins-marketplace. It costs 197 tokens per session (1,315 once invoked), scanned A, original, MIT.

A coding-agent role that writes failing tests from approved API user stories before application code is written. It targets OpenAPI descriptions and Spring Boot services, including unit, integration, and service-to-service contract tests.

In plain words
What is it for?
Use it to create JUnit and Mockito unit-test scaffolding, Spring Boot integration tests with temporary databases, and Pact contract-test scaffolding for API boundaries.
Why use it?
It turns agreed behavior into executable checks before implementation, so missing or incorrect behavior is found early. An API contract describes how software services communicate; these tests check that both sides follow it.

Agent

Part of the hmcts-apim-sdlc-orchestrator plugin — 8 skills, 11 agents, 3 hooks 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/hmcts/agentic-plugins-marketplace/contract-test-engineer
Clone the repo
git clone --depth 1 https://github.com/hmcts/agentic-plugins-marketplace

Or install hmcts-apim-sdlc-orchestrator, the plugin that ships this one along with the rest of its 8 skills, 11 agents, 3 hooks.

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-engineer

README.md
[![agentmods](https://agentmods.dev/badge/agents/hmcts/agentic-plugins-marketplace/contract-test-engineer.svg)](https://agentmods.dev/agents/hmcts/agentic-plugins-marketplace/contract-test-engineer)
Your own site
<a href="https://agentmods.dev/agents/hmcts/agentic-plugins-marketplace/contract-test-engineer"><img src="https://agentmods.dev/badge/agents/hmcts/agentic-plugins-marketplace/contract-test-engineer.svg" alt="Measured on agentmods" height="20"></a>
Per session 197 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,315 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 $0.00197 $0.01315
Opus 5 $0.00098 $0.00658
Sonnet 5 $0.00039 $0.00263
Haiku 4.5 $0.00020 $0.00131

Measured 4d ago against content hash 4b7858d4c99b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

contract-test-engineer 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 4d 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/agents/hmcts-apim-sdlc-orchestrator/agents/contract-test-engineer.md · 104 lines

How it starts

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

Agent: Contract Test Engineer

Role

Translate approved user stories into a complete test suite before any implementation code is written. Tests define the contract; code fulfils it. Scope is the API Marketplace delivery model only — OpenAPI-first api-cp-* and Spring Boot service-cp-*.

Inputs

  • Approved story files from docs/pipeline/user-stories/.
  • context/service-shared.md — layer model, mapper-creates-objects rule, test naming, Docker/dockerTest.
  • context/api-spec-shared.md — generated interfaces, codegen, spec location.
  • The published api-cp-* OpenAPI contract the service implements.

Output

Per story:

  • docs/pipeline/test-specs/<PROJ-NNN>.feature — Gherkin (optional; skill: bdd-workflow).
  • Failing test scaffolding committed to the feature branch:
    • Unit test stubs
    • Spring Boot integration test stubs
    • Consumer-driven contract (Pact) stubs where a service boundary is crossed

Target frameworks (Modern by Default only — see context/service-shared.md)

Layer Framework
Unit JUnit 5 + Mockito + AssertJ
Integration @SpringBootTest + TestContainers (Postgres where DB-backed)
API contract Pact (consumer-driven); provider verification against the generated interfaces; REST Assured where a running endpoint is asserted
External HTTP mocks WireMock
API tests (Docker) ./gradlew dockerTest (docker-compose: WireMock + app, or Service Bus emulator + DB + app)
Repository @DataJpaTest proving Flyway schema matches JPA entities (DB-backed only)

Out of scope (do not scaffold): Serenity/Cucumber UI suites, Protractor/Selenium E2E, axe accessibility specs, embedded Artemis, RAML/REST-Assured-against-RAML, viewstore / projection / event-store tests. There is no UI and no CQRS in this pipeline.


Instructions

Step 1 — Parse ACs into scenarios

For each AC, write a Given/When/Then scenario (skill: bdd-workflow). One scenario per AC minimum; add negative/edge cases for conditional logic. Business language only — no selectors. Place feature files under src/test/resources/features/.

Read the full file on GitHub · 104 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. 4d ago First seen · 104 lines · 197 tokens per session scan A 4b7858d4c99b

Subscribe to this mod's changes

contract-test-engineer is an agent published in the GitHub repository hmcts/agentic-plugins-marketplace (3 stars, last pushed 8d ago), licensed MIT. It adds 197 tokens to every session and 1,315 once invoked, about $0.0010 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.