api-contract-review
Skill0 starsChanged 25 days agoMITView on GitHub
Use when designing or reviewing an HTTP, GraphQL, or gRPC API contract before implementation or release. Covers resource naming, methods and status codes, error shapes, pagination, idempotency, concurrency control, versioning, backward compatibility, auth boundaries, and contract tests. Does not implement the service.
12 other projects use a version of this.
Adopted by
Most recently taken up by
- decebals/claude-code-javatheir own version, first seen Nov 1, 2026
- TencentCloudBase/CloudBase-AI-Toolkittheir own version, first seen Oct 30, 2026
- OpenSelfHosting/skillstheir own version, first seen Oct 25, 2026
- juanitourquiza/shipframetheir own version, first seen Oct 23, 2026
- dss-time/repo-doctor-skillstheir own version, first seen Oct 15, 2026
- mvonline/claude-skillstheir own version, first seen Oct 11, 2026
Used with
Projects with it also use cloud-api-recipe-authoring, codebuddy-ide-mcp-upgrade and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
TencentCloudBaseSkillcloud-api-recipe-authoring
Author or revise a cloud-api-operations recipe (config/source/skills/cloud-api-operations/references/recipes/). Encodes why the long tail of control-plane capabilities is deliberately NOT wrapped as MCP/CLI tools, the API-first admission test for whether a capability deserves a recipe, the negative and positive lists, the fixed recipe structure, the writing rules distilled from writing-for-agents, the user-facing copy red lines, and the product regeneration/verification pipeline. Also routes contributors (and their agents) to the contribution flow and the pre-PR self-test protocol in references/contributing.md. Use when adding a recipe, judging whether a scenario belongs in the recipe set, updating the recipes index, re-checking existing recipes against the admission test, or onboarding someone who wants to submit one.
Also in 3 projects that use this
TencentCloudBaseSkillcodebuddy-ide-mcp-upgrade
升级 CodeBuddy IDE(genie 扩展)内置的 CloudBase MCP,以及 MCP 发版时同步 IDE 侧白名单。当用户提到「更新 IDE 里的 MCP」「内置 MCP 版本太老」「IDE 集成的 CloudBase 功能不足」「改工具白名单 toolWhiteList」「把新 bundle 打进 CodeBuddy」「白名单漂移」「MCP 发版要同步什么」时使用。覆盖:解包定位内置 bundle 与内嵌配置、重新构建 mcp bundle、生成新的工具白名单与系统提示词、安全注入 IDE 并备份、用 MCP 协议验证工具清单、人工端到端验收、一键回滚。
Also in 3 projects that use this
zaxbysauceSkillpr-review-fix
Codex adapter for addressing pull request review feedback in opencode-swarm. Use when the user asks to fix PR review comments, requested changes, reviewer findings, CI-review notes, or a pasted review summary with low false-positive tolerance.
Also in 3 projects that use this
albertdobmeyerSkillgit-workflows
Advanced git operations beyond add/commit/push. Use when rebasing, bisecting bugs, using worktrees for parallel development, recovering with reflog, managing subtrees/submodules, resolving merge conflicts, cherry-picking across branches, or working with monorepos.
Also in 3 projects that use this
ReinaMacCredySkillcodebase-audit
Deep codebase audit that first reads project docs (AGENTS.md, README.md) and investigates the architecture, then systematically finds hardcoded constants that should be dynamic and unfinished code (TODOs, "will"/"would" in comments). Use this skill when the user wants a thorough code review for hygiene issues, asks to find hardcoded values, wants to audit for TODOs or incomplete code, says things like "audit this codebase", "find hardcoded stuff", "what's unfinished", "find tech debt", "code hygiene check", or asks you to look across the whole project for issues. Also use when the user asks to understand a project before making changes, or wants a comprehensive health check of their codebase.
Also in 3 projects that use this
Microsoft AzureSkillskill-authoring
Write Agent Skills that comply with the agentskills.io specification. WHEN: "create a skill", "new skill", "write a skill", "skill template", "skill structure", "review skill", "skill PR", "skill compliance", "SKILL.md format", "skill frontmatter", "skill best practices". DO NOT USE FOR: general documentation. INVOKES: vally CLI.
Also in 5 projects that use this
- +6 more from TencentCloudBase
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- TencentCloudBase/CloudBase-AI-ToolKit★ 1.2ksame name
- TencentCloudBase/CloudBase-MCP★ 1.2ksame name
- TencentCloudBase/CloudBase-AI-Toolkit★ 1.2ksame name
- decebals/claude-code-java★ 763same name
- Mozurok/fhorja.dev★ 10same name
- DIL8654/claude-code-dotnet-template★ 8same name
- juanitourquiza/shipframe★ 4same name
- ldilov/harness-forge★ 4same name
- OpenSelfHosting/skills★ 2same name
- dennisrongo/claude-skills★ 1same name
2 more not listed
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 repository18 other files it gives its agents.
- docs/agents.mdAGENTS.md
- agent-skill-authorSkill
- codex-cli-workflowsSkill
- codex-plugin-authorSkill
- context-budgetSkill
- dependency-auditSkill
- docs-writerSkill
- git-recoverySkill
- incident-postmortemSkill
- mcp-server-builderSkill
- performance-profileSkill
- pr-reviewerSkill
- release-engineerSkill
- repo-onboardingSkill
- skill-security-reviewSkill
- sql-migration-reviewSkill
- terminal-debuggerSkill
- test-first-fixSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. 0 are common, 17 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 12 edited versions we read keep these.
17
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Use this skill when:
- Distinctive: line 40
If the document and the implementation disagree, test the implementation and fix the document in the same change.
- Distinctive: line 55
No verbs in the body that duplicate the method.
- Distinctive: line 90
No stack traces, SQL, secrets, or internal hostnames.
- Distinctive: line 95
Default page size and maximum.
- Distinctive: line 124
Document the conflict response and how the client resolves it.
- Distinctive: line 128
Every object access checks ownership or tenant, not only authentication.
- Very specific: line 167
Check protobuf compatibility (for example, buf breaking).
- Distinctive: line 168
Run contract tests against the implementation.
- Distinctive: line 169
Verify error responses, not only success.
- Distinctive: line 170
Test pagination boundaries and idempotent retries.
- Distinctive: line 204
Do not expose internal identifiers or sequential ids when enumeration is a risk.
- Distinctive: line 205
Do not return unbounded lists.
- Very specific: line 206
Do not use 200 for errors.
- Distinctive: line 207
Do not put secrets or tokens in URLs.
- Distinctive: line 208
Do not change validation rules without a version or a migration plan.
- Distinctive: line 209
Do not add a required field to an existing request.
- Distinctive: line 210
Do not reuse a removed protobuf field number or a GraphQL field name with new semantics.
- Distinctive: line 211
Do not publish an API without rate limits and a documented error shape.
“Common” is measured: kept by at least 6 in 10 of the 12 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
API Contract Review
An API contract is a promise about inputs, outputs, errors, and evolution. The expensive mistakes are rarely syntax. They are ambiguous semantics, unbounded results, missing idempotency, and a breaking change shipped as a patch.
Review the contract before code, then test it against the contract.
When to use
Use this skill when:
- Designing a new endpoint, mutation, or RPC.
- Reviewing an OpenAPI, GraphQL, or protobuf change.
- Adding a field, status code, or parameter to an existing API.
- Planning a version bump or deprecation.
- An agent or client needs to integrate with the API.
Workflow
1. Identify the contract source of truth
- OpenAPI document for REST.
- GraphQL schema and persisted operations.
.protofiles and the generated stubs.- JSON Schema for event payloads.
- A human document, which is the weakest source.
If the document and the implementation disagree, test the implementation and fix the document in the same change.
2. Check resource and method semantics
| Operation | Method | Success | Safe | Idempotent |
| List | GET | 200 | yes | yes |
| Read | GET | 200 | yes | yes |
| Create | POST | 201 + Location | no | no unless keyed |
| Full replace | PUT | 200/204 | no | yes |
| Partial update | PATCH | 200/204 | no | not guaranteed |
| Delete | DELETE | 204/202 | no | yes |
- Nouns in paths, verbs in methods:
/orders/{id}, not/getOrder. - Plural collections, stable identifiers.
- No verbs in the body that duplicate the method.
POSTfor actions that do not fit CRUD:/orders/{id}/cancel.HEADandOPTIONSbehave consistently withGET.
3. Check status and error semantics
200with a body,204without.201withLocationfor creation.400for malformed syntax,422for semantically invalid input when the stack distinguishes them.401unauthenticated,403authenticated but not allowed.404for missing or intentionally hidden resources.409for state conflicts.412for failed preconditions,428when a precondition is required.429with retry guidance.5xxonly for server faults.
Error body, preferably RFC 9457 Problem Details:
{
"type": "https://example.com/problems/insufficient-funds",
"title": "Insufficient funds",
"status": 409,
"detail": "The account balance is 1200 cents; the transfer requires 5000.",
"instance": "/transfers/01J8Z3",
"code": "insufficient_funds",
"traceId": "4f1c..."
}Rules:
- One error shape across the API.
- Machine-readable
codestable across versions. - Human-readable
detailsafe to show. - No stack traces, SQL, secrets, or internal hostnames.
- Validation errors identify the field and the rule.
4. Bound every collection
- Default page size and maximum.
- Cursor pagination for large or changing sets.
- Stable sort order with a tiebreaker.
- Total counts only when cheap, or marked approximate.
- Filters and sort fields documented and allowlisted.
{
"data": [],
"nextCursor": "eyJpZCI6MTIzfQ",
"hasMore": true
}Offset pagination is acceptable for small, stable datasets. It skips and duplicates rows when the underlying data changes.
5. Design for retries
POSTcreation accepts anIdempotency-Key.- The server stores the key with the result for a documented window.
- A repeated key returns the original result, not a duplicate.
- Retries are safe for
GET,PUT,DELETE, and keyedPOST. - Timeouts and retry guidance are in the error body or headers.
6. Handle concurrent updates
ETagon reads,If-Matchon writes.412when the precondition fails.- Or a version field in the body with a compare-and-set.
- Document the conflict response and how the client resolves it.
7. Check authorization boundaries
- Every object access checks ownership or tenant, not only authentication.
- List endpoints filter by tenant at the query level.
- Admin-only fields are not serialized for normal users.
- Bulk endpoints check every id, not only the first.
- Errors do not reveal whether another tenant's object exists.
8. Plan evolution
Non-breaking:
- Adding an optional request field with a safe default.
- Adding a response field clients must ignore.
- Adding a new endpoint.
- Adding an enum value only if clients tolerate unknown values. Document that requirement.
- Adding an optional header.
Breaking:
- Removing or renaming a field.
- Changing a type or format.
- Making an optional field required.
- Changing a status code or error shape.
- Changing default behavior.
- Tightening validation.
- Changing pagination or sort semantics.
- Removing an enum value clients may send.
Versioning options:
- URI version
/v2for broad, visible breaks. - Media type versioning for content negotiation.
- Additive evolution with a compatibility policy.
- GraphQL: deprecate fields, never reuse a removed name with different semantics.
- Protobuf: reserve removed field numbers and names; never reuse them.
9. Test the contract
- Validate the document (for example, Spectral for OpenAPI).
- Diff against the previous version (for example,
openapi-diff). - Check protobuf compatibility (for example,
buf breaking). - Run contract tests against the implementation.
- Verify error responses, not only success.
- Test pagination boundaries and idempotent retries.
Examples
Weak:
POST /api/doOrder
{ "user": 12, "items": "..." }Problems: verb in the path, ambiguous creation semantics, no idempotency, no error contract.
Stronger:
POST /orders
Idempotency-Key: 8f14e45f-ea3b-4c1a-9d1f-2b7c9a1e5d3f
Content-Type: application/json
{ "items": [{ "sku": "SKU-1", "quantity": 2 }] }201 Created
Location: /orders/01J8Z3{ "id": "01J8Z3", "status": "pending", "totalCents": 5000 }Guardrails
- Do not expose internal identifiers or sequential ids when enumeration is a risk.
- Do not return unbounded lists.
- Do not use
200for errors. - Do not put secrets or tokens in URLs.
- Do not change validation rules without a version or a migration plan.
- Do not add a required field to an existing request.
- Do not reuse a removed protobuf field number or a GraphQL field name with new semantics.
- Do not publish an API without rate limits and a documented error shape.
Verification checklist
- Source of truth identified and current.
- Paths and methods follow the resource model.
- Success and error status codes documented.
- One error shape with machine-readable codes.
- Collections bounded with documented pagination.
- Retries safe and idempotency documented.
- Concurrency control defined.
- Authorization checked per object.
- Breaking-change diff reviewed.
- Contract tests cover errors, pagination, and retries.
- Deprecation policy stated.
References
references/api-checklist.mdcontains an endpoint review sheet and a breaking-change matrix.
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.

