contract-testing
What it does
This skill explains how to write tests that describe what the frontend expects from the backend, then checks that the backend meets them. It is for teams whose frontend and backend are deployed separately.
When to use it
- ✓When frontend and backend changes often break each other.
- ✓When end-to-end tests are slow and fragile because both services must run together.
- ✓When you want to know whether two services can be deployed independently.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/contract-testing/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Set up contract tests between my frontend app and its API so breaking backend changes are caught in CI.”
5 new skills a week. 1 minute to read.
How it works
The agent adds Pact consumer tests for the API client, publishes the expected contracts to a broker, and adds provider verification to the backend pipeline.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Implement consumer-driven contract testing for API boundaries
Integration tests that require both services running at the same time are slow, brittle, and hard to maintain. Consumer-driven contract testing decouples the consumer and provider test suites — each team can run their tests independently, yet the broker guarantees that the published contract is always verified against the live provider. This catches API mismatches days earlier than end-to-end tests, with far less infrastructure overhead.
Quick Reference
- The consumer writes tests that describe what it expects from the API (the "contract")
- The contract is published to a Pact Broker and verified against the real provider
- Provider changes that break the contract fail CI before they are deployed
- This replaces fragile end-to-end tests that require both services to be running simultaneously
Check
Check whether the frontend has consumer-driven contract tests that define and verify the API contract with the backend.
Fix
Add Pact consumer tests for the frontend API client, publish the contracts to a broker, and add provider verification to the backend CI pipeline.
Explain
Explain how consumer-driven contract testing works, what the Pact workflow looks like end-to-end, and how it compares to mocking and end-to-end testing.
Code Review
Review the Pact consumer tests. Flag interactions that are too permissive (any-type matchers on fields the consumer actually uses), missing status code assertions, and interactions for endpoints the consumer no longer calls.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/testing/contract-testing
FAQ
What is a contract test?
A test that records what the frontend expects from an API and checks the real API against those expectations.
Which tool does the skill use?
Pact, with a Pact Broker to share the contracts.
How is this different from end-to-end tests?
The skill says contract tests do not need both services running at the same time, and they catch mismatches earlier.
Details
Original description by the author
Use when setting up integration testing for a frontend-backend API boundary, evaluating whether two services are safe to deploy independently, or replacing slow end-to-end tests with contract tests.
Popularity
- GitHub stars
- 75k
- Ranking position
- #2787
- License
- MIT
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
test-driven-development
311kTeaches your agent to write a failing test first, watch it fail, then write the smallest code that passes, before building any feature or fix.
verification-before-completion
311kTeaches your agent to run real checks and read their output before claiming that a task, fix, or build is complete or passing.
migrate-to-shoehorn
310kReplaces risky type casts in your test files with the shoehorn library, so tests can use partial data and still pass type checks.