sawrus/agent-guides/api-design
Claude Code and agent skill by sawrus/agent-guides
- community
Checking that the SKILL.md file is still in the repository.
Procedure to add or change an HTTP (OpenAPI) or gRPC (protobuf) API contract: edit the spec first, check breaking changes with oasdiff or buf, version and deprecate, and add contract tests. Use when you add or change an endpoint, request or response schema, or a proto service.
Install
npx vskill@latest install sawrus/agent-guides/api-designSKILL.md
API contract: add or change
1. Find the contract
- Look for the spec:
openapi.yaml,api/*.yaml,docs/api/,*.protounderproto/orapi/. - If the code generates the spec (FastAPI, springdoc, swaggo), find the command that exports it and use the
exported file in step 4.
- If no spec exists, write down the current request and response of the endpoint from the code and its tests.
- Find the consumers: other services, frontends, published SDKs. Ask the user if they are not known.
2. Edit the contract first
- Change the spec before the code. Keep the change to the endpoint or message the task names.
- HTTP: one resource per path, plural nouns (
/orders/{orderId}), standard methods and status codes, one
error schema for all endpoints (for example RFC 9457 application/problem+json).
- List endpoints take
limitand a cursor (page_token/next_page_token) and return a bounded page. - A create endpoint that clients may retry accepts an
Idempotency-Keyheader. - gRPC: add fields with new field numbers. Never reuse or renumber a field;
reservedremoved numbers and names.
3. Classify the change
Additive (safe):
- new endpoint, new optional request field, new response field, new enum value that clients ignore.
Breaking:
- removed or renamed field or endpoint, new required request field, changed type or format, changed status code,
stricter validation, changed field number or name in proto.
4. Check breaking changes with a tool
If the tool reports a breaking change, do one of these:
- Make it additive: keep the old field, add the new one, and map both in the code.
- Add a new version (
/v2/...path or a new proto packagev2) and keep the old version running. - If the user accepts the break, mark it as breaking in the changelog and the merge request, and name the
consumers that must change.
5. Deprecate
- Mark the old field or endpoint
deprecated: true(OpenAPI) or[deprecated = true](proto). - HTTP: return
DeprecationandSunsetheaders on deprecated endpoints. - Write the removal date in the API docs page. Remove only after consumers stop calling it (check access logs
or metrics).
6. Implement and test
- Generate server stubs or types from the spec if the project does so (
buf generate,openapi-generator). - Add tests for the success response, each documented error status, and validation of each new field.
- Add a contract test that checks responses against the spec (
schemathesis run openapi.yaml --url <local>,
Pact, or a schema assertion in the API tests).
- Update the API docs page and the changelog in the same change.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingareas/software/backend/skills/api-design/SKILL.md
Popularity
- Repository stars
- 10
- Repository forks
- 1
- 7-day trend score
- 12
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 3 Apr 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/sawrus/agent-guides/api-design)