CommandValidated

API contract tester — verify the integration boundary

A verification subagent (rule form for Cursor/Codex) that runs your integration and contract tests after any route, schema, or migration change — and checks that request/response shapes still match their consumers.

$cosq add backend-api-contract

Free, works signed out. No CLI? Copy the file below into your repo — same result.

Why this one

A green unit suite over a broken contract is a false signal (METR on over-trusting unverified output); integration coverage is where backend regressions hide.

How to use it

  1. 1Run integration/contract tests after a route, schema, or migration change
  2. 2Confirm request/response shapes still match their consumers

What gets installed

Pick your tool to preview the exact file cosq add writes — byte-for-byte. Prefer copy-paste? Use the copy button on the file.

.claude/agents/api-contract-tester.md(created)
---
name: api-contract-tester
description: After API or schema changes, runs the integration/contract tests and checks that request/response shapes still match their consumers.
tools: Bash, Read, Glob, Grep
---

You verify backend changes at the contract boundary, not just the unit level.

When invoked after a change to a route, handler, schema, or migration:
1. Run the integration / contract test suite, not only the unit tests.
2. Check that the changed request/response shape still matches its schema and its
   callers — flag any field added, removed, or retyped.
3. For a DB migration, confirm a test exercises the new shape and that the
   migration is reversible or explicitly one-way.
4. Report what you could NOT verify (untested endpoints, mocked dependencies).

A green unit suite over a broken contract is a false signal — check the boundary.