contract-test
Skill0 starsChanged 3 months agoMITView on GitHub
Detect breaking API changes before merge. Covers response shape validation, backward compatibility checks, deprecation workflows, and consumer-driven contract testing patterns.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- AsiaOstrich/EngramGraphtheir own version, first seen Nov 8, 2026
- AsiaOstrich/universal-dev-standardstheir own version, first seen Nov 1, 2026
- flurdy/agent-skillstheir own version, first seen Aug 9, 2026
- squall-chua/skillstheir own version, first seen Aug 9, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- AsiaOstrich/universal-dev-standards★ 84same name
- flurdy/agent-skills★ 9same name
- AsiaOstrich/EngramGraph★ 4same name
- squall-chua/skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository44 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- a11y-auditSkill
- ai-engineerSkill
- api-clientSkill
- changelog-enforcerSkill
- code-cleanup-guardianSkill
- code-reviewerSkill
- db-migrateSkill
- dep-auditSkill
- devops-automatorSkill
- env-configSkill
- error-observabilitySkill
- frontend-designSkill
- git-commit-helperSkill
- github-issues-managerSkill
- git-issue-syncSkill
- git-protocolSkill
- handoffSkill
- incident-responseSkill
- init-projectSkill
- karpathy-guidelinesSkill
- market-researcherSkill
- parallel-agent-git-isolationSkill
- product-strategistSkill
- pr-workflowSkill
- rapid-builderSkill
- release-managerSkill
- resumeSkill
- scrutinizeSkill
- shadcn-uiSkill
- skill-builderSkill
- sprint-plannerSkill
- state-machine-diagramsSkill
- state-managementSkill
- surveySkill
- system-architectSkill
- tech-docsSkill
- unstuckSkill
- ux-design-systemSkill
- ux-researchSkill
- webapp-testingSkill
- web-dev-fundamentalsSkill
- workflow-optimizerSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Before merging any API change:
- Distinctive: line 120
Every breaking change must bump the API version
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Contract Testing & API Compatibility
Breaking Change Detection
What Constitutes a Breaking Change
| Change | Breaking? | Safe Alternative |
| Remove a field from response | Yes | Deprecate first, remove after grace period |
| Rename a field | Yes | Add new field, keep old one, deprecate old |
| Change field type (string → number) | Yes | Add new field with new type |
| Change field from optional to required | Yes | Keep optional, validate in business logic |
| Add a new optional field | No | Safe to add anytime |
| Add a new required field to request | Yes | Make it optional with a default |
| Change error response format | Yes | Version the error format |
| Remove an endpoint | Yes | Return 410 Gone with migration guide |
| Change URL path | Yes | Keep old path as redirect/alias |
Pre-Merge Compatibility Check
Before merging any API change:
- Diff response types — Compare before/after TypeScript types or JSON schemas
- Check all consumers — grep for endpoint usage across services and client apps
- Run contract tests — verify existing consumers still work with new response shape
- Check generated clients — if using OpenAPI codegen, regenerate and check for compile errors
Response Shape Validation
// Define the contract as a schema
const UserResponseSchema = z.object({
id: z.string().uuid(),
email: z.string().email(),
name: z.string(),
createdAt: z.string().datetime(),
// Optional fields can be added without breaking
avatar: z.string().url().optional(),
});
// Validate in integration tests
test('GET /users/:id returns valid response shape', async () => {
const response = await api.get('/users/test-id');
const result = UserResponseSchema.safeParse(response.data);
expect(result.success).toBe(true);
});Deprecation Workflow
Timeline
Week 0: Add deprecation header + docs
Deprecation: @{DEPRECATION_UNIX_SECONDS}
Sunset: {SUNSET_HTTP_DATE}
Week 1-4: Monitor usage of deprecated endpoint/field
Log warnings when deprecated features are accessed
Week 4: Contact remaining consumers directly
Week 8: Remove deprecated feature (or extend if consumers remain)Deprecation Header Pattern
// Add to deprecated endpoints
// RFC 9745: Deprecation is a structured-field Date (@ + Unix seconds).
// RFC 8594: Sunset is an HTTP-date and must not be earlier than Deprecation.
res.setHeader('Deprecation', '@{DEPRECATION_UNIX_SECONDS}');
res.setHeader('Sunset', '{SUNSET_HTTP_DATE}'); // e.g. 'Wed, 30 Jun 2027 23:59:59 GMT'
res.setHeader('Link', '</api/v2/users>; rel="successor-version"');Consumer-Driven Contract Testing
Provider Side (API)
// Contract test: verify the API still satisfies consumer expectations
describe('User API Contract', () => {
it('returns fields that Consumer A depends on', async () => {
const response = await request(app).get('/api/users/1');
// Consumer A uses: id, email, name
expect(response.body).toHaveProperty('id');
expect(response.body).toHaveProperty('email');
expect(response.body).toHaveProperty('name');
expect(typeof response.body.id).toBe('string');
expect(typeof response.body.email).toBe('string');
});
});Consumer Side (Client)
// Contract test: verify the client handles the expected response shape
describe('User API Client Contract', () => {
it('correctly parses user response', () => {
const mockResponse = { id: '123', email: 'test@example.com', name: 'Test' };
const user = parseUserResponse(mockResponse);
expect(user.id).toBe('123');
});
});API Versioning Strategy
| Strategy | Pros | Cons | When to Use |
URL path (/v1/, /v2/) | Clear, easy to route | URL pollution | Public APIs with long-lived consumers |
| No versioning (evolve in place) | Simplest | Must never break | Internal + careful evolution |
Rules
- New fields: always optional (additive changes are safe)
- Removed fields: deprecate with sunset date, never remove without warning
- Type changes: add new field, never change existing field type
- Every breaking change must bump the API version
- Contract tests run in CI — failures block merge
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

