sawrus/agent-guides/api-design

Claude Code and agent skill by sawrus/agent-guides

Trust tier 2
  • community
LLM review pending
Source check pending

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-design

SKILL.md

API contract: add or change

1. Find the contract

  1. Look for the spec: openapi.yaml, api/*.yaml, docs/api/, *.proto under proto/ or api/.
  2. If the code generates the spec (FastAPI, springdoc, swaggo), find the command that exports it and use the

exported file in step 4.

  1. If no spec exists, write down the current request and response of the endpoint from the code and its tests.
  2. Find the consumers: other services, frontends, published SDKs. Ask the user if they are not known.

2. Edit the contract first

  1. Change the spec before the code. Keep the change to the endpoint or message the task names.
  2. 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).

  1. List endpoints take limit and a cursor (page_token / next_page_token) and return a bounded page.
  2. A create endpoint that clients may retry accepts an Idempotency-Key header.
  3. gRPC: add fields with new field numbers. Never reuse or renumber a field; reserved removed 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

bash
git show origin/main:openapi.yaml > /tmp/base.yaml
oasdiff breaking /tmp/base.yaml openapi.yaml --fail-on ERR
buf breaking --against '.git#branch=main'

If the tool reports a breaking change, do one of these:

  1. Make it additive: keep the old field, add the new one, and map both in the code.
  2. Add a new version (/v2/... path or a new proto package v2) and keep the old version running.
  3. 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

  1. Mark the old field or endpoint deprecated: true (OpenAPI) or [deprecated = true] (proto).
  2. HTTP: return Deprecation and Sunset headers on deprecated endpoints.
  3. 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

  1. Generate server stubs or types from the spec if the project does so (buf generate, openapi-generator).
  2. Add tests for the success response, each documented error status, and validation of each new field.
  3. 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).

  1. 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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/sawrus/agent-guides/api-design/badge)](https://verified-skill.com/skills/sawrus/agent-guides/api-design)

Something wrong with this skill or its page? Tell us.