contract-guard
Skill0 starsChanged 4 months agoMITView on GitHub
Guard external contracts before changing them. Use BEFORE modifying anything consumed outside the current codebase or by clients you do not control: public/exported APIs, REST/GraphQL endpoints and their request/response shapes, published package entry points, database schemas read by other services, event/message payloads, webhooks, or generated client types. Also use when reviewing a diff that touches such surfaces. Prevents silently shipping breaking changes to external consumers.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- TzolkinB/skillstheir own version, first seen Oct 22, 2026
- zieang88888/zhskillstheir own version, first seen Oct 1, 2026
- skillsmith-dev/ai-skillstheir own version, first seen Jun 20, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- TzolkinB/skills★ 2same name
- zieang88888/zhskills★ 1same name
- skillsmith-dev/ai-skills★ 0same 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 repository40 other files it gives its agents.
- address-pr-feedbackSkill
- architectureSkill
- code-reviewSkill
- code-structureSkill
- competitive-briefSkill
- debugSkill
- deep-workSkill
- dependency-upgradeSkill
- deploy-checklistSkill
- diagnoseSkill
- documentationSkill
- explain-pr-step-by-stepSkill
- feedback-checkpointSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- improve-codebase-architectureSkill
- incident-responseSkill
- memory-managementSkill
- observabilitySkill
- plan-criticSkill
- plan-from-rfcSkill
- pr-babysitterSkill
- prototypeSkill
- queue-checkSkill
- rebase-onto-mainSkill
- releaseSkill
- security-reviewSkill
- setup-engineering-skillsSkill
- squash-and-pushSkill
- synthesize-researchSkill
- system-designSkill
- tddSkill
- tech-debtSkill
- testing-strategySkill
- to-issuesSkill
- to-prdSkill
- triageSkill
- verification-before-completionSkill
- zoom-outSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 9 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
If the change only touches code whose callers all live in this repo and are updated in the same change, this skill does not apply — …
- Distinctive: line 34
Before editing, establish who consumes the thing you're about to change:
- Distinctive: line 36
Search the repo for callers.
- Distinctive: line 37
Look for contract artifacts: OpenAPI/GraphQL schemas, protobuf files, generated client packages, versioned API docs, consumer contract …
- Distinctive: line 38
Ask: "can every consumer be updated in this same change?" If no (external clients, mobile apps with old versions, other teams, published …
- Very specific: line 44
Use references/breaking-change-taxonomy.md for the full table.
- Distinctive: line 52
Never apply a breaking change in place.
- Very specific: line 54
Expand–migrate–contract: add the new field/endpoint/column alongside the old, migrate consumers, remove the old one later (separately).
- Distinctive: line 57
Negotiate: if consumers are known and coordinated, an agreed synchronized change — recorded, not assumed.
- Distinctive: line 59
If none is possible in scope, do not make the change — report the conflict and the recommended strategy instead.
- Distinctive: line 65
Run existing contract tests (Pact, schema validation) — add one when the surface has none and you're touching it.
- Very specific: line 72
Every change touching a guarded surface ends with an explicit statement in the PR/commit/summary:
- Very specific: line 81
Do not resolve ambiguity in favor of convenience.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Contract Guard
External consumers cannot be refactored by you. Any interface they depend on is a contract: change it deliberately and compatibly, or version it — never silently.
When this applies
Trigger this skill before editing (or when reviewing edits to):
- Exported symbols of a published package or shared library
- HTTP/GraphQL/gRPC endpoints: paths, methods, params, request/response shapes, status codes, error formats
- Database schemas other services or reports read
- Event, queue, or webhook payloads
- OpenAPI/GraphQL/protobuf schema files and generated clients
- File formats or CLI output that downstream tooling parses
If the change only touches code whose callers all live in this repo and are updated in the same change, this skill does not apply — refactor freely.
Workflow
1. Inventory the contract surface
Before editing, establish who consumes the thing you're about to change:
- Search the repo for callers; check whether the symbol/endpoint is exported, published, or documented publicly.
- Look for contract artifacts: OpenAPI/GraphQL schemas, protobuf files, generated client packages, versioned API docs, consumer contract tests (e.g. Pact).
- Ask: "can every consumer be updated in this same change?" If no (external clients, mobile apps with old versions, other teams, published packages) → the surface is guarded.
State the finding explicitly: Contract surface: <what> — consumers: <who/unknown>.
2. Classify the intended change
Use references/breaking-change-taxonomy.md for the full table. Summary:
- Compatible (safe): adding optional fields, adding new endpoints/methods, widening accepted input, adding enum handling, new optional params with defaults.
- Breaking: removing/renaming anything; changing a field's type or nullability; adding a required input; narrowing accepted values; changing error shapes, status codes, sort order, pagination, or semantics callers rely on; changing serialization defaults.
- Ambiguous: behavior changes that were arguably bugs — treat as potentially breaking, flag for human decision.
3. Breaking → stop and choose a compatibility strategy
Never apply a breaking change in place. Options, in order of preference:
- Expand–migrate–contract: add the new field/endpoint/column alongside the old, migrate consumers, remove the old one later (separately).
- Version the surface:
/v2endpoint, new event version, semver major bump for packages. - Deprecate with a window: mark deprecated, keep serving, document the removal date.
- Negotiate: if consumers are known and coordinated, an agreed synchronized change — recorded, not assumed.
If none is possible in scope, do not make the change — report the conflict and the recommended strategy instead.
4. Verify with contract evidence
Claims of compatibility need proof, not inspection:
- Run existing contract tests (Pact, schema validation) — add one when the surface has none and you're touching it.
- Diff schema artifacts old-vs-new (e.g.
oasdifffor OpenAPI,buf breakingfor protobuf, migration dry-run for SQL) when tooling exists. - Compile/type-check in-repo consumers and any reachable generated clients.
- For serialized payloads: round-trip a captured real payload from before the change through the new code.
5. Sign off with a compatibility statement
Every change touching a guarded surface ends with an explicit statement in the PR/commit/summary:
Contract impact: [none | compatible additions | breaking — strategy: <versioning/expand-contract/deprecation>]. Evidence: <tests/diff command run>.
Constraints
- Absence of a schema file does not mean absence of a contract — consumers bind to observed behavior.
- "The tests pass" is insufficient when no test encodes the external contract; say so and add one.
- Renames are removals. A rename of anything externally visible is a breaking change, full stop.
- Do not resolve ambiguity in favor of convenience; flag
Potentially breaking — review requiredwith the evidence.
Verification
- Contract surface and consumers stated before the edit
- Change classified against the taxonomy
- Breaking changes have an explicit compatibility strategy (or were not made)
- Contract evidence produced (test, schema diff, consumer compile, or payload round-trip)
- Compatibility statement included in the final summary
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.

