# Contract Test

> Contract Test is an Agent Skill for testing & quality published in the Archive228/loopkit repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

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

- Skill name: `contract-test`
- Category: [Testing & Quality](https://www.openparable.com/skill/testing-quality/1)
- Source: https://github.com/Archive228/loopkit/blob/HEAD/skills/contract-test/SKILL.md
- Repository: Archive228/loopkit (638 GitHub stars when collected)

## SKILL.md

# 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.

---

Source: https://www.openparable.com/skill/testing-quality/contract-test (OpenParable). Cite the canonical URL above.
