# Contract Test

> Test the boundary between two systems by the contract, not the implementation. Use for APIs, integrations, and shared interfaces.

- Skill: `archive228/contract-test` (Agent Skill)
- Install (CLI): `npx skillmds@latest add archive228/contract-test`
- Raw SKILL.md: https://api.skillmd.com/api/skills/archive228/contract-test/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: archive228 (https://skillmd.com/u/archive228)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/archive228/contract-test

---

# Contract Test
Test what the two sides AGREED on, so either can change internals without breaking the other.
- Assert the **shape**: required fields, types, status codes, error format — not internal logic.
- Cover the contract's edges: missing optional fields, the documented error responses, pagination bounds, versioning.
- For consumers: test against the real contract (recorded/real responses), not a mock you wrote to match your assumptions — that mock drifts and lies.
- One source of truth for the schema; both sides validate against it.
A green unit test with a wrong mock is worse than no test. Pin the contract.

