Logo vun Api Design

Api Design

Communautéit
d-padmanabhan
api-design

Designs and reviews production APIs across REST/HTTP, OpenAPI, GraphQL, gRPC, webhooks, asynchronous operations, batch endpoints, SSE, and WebSockets. Use when defining resources, routes, methods, status codes, problem details, pagination, idempotency, conditional writes, API schemas, compatibility, deprecation, authentication, authorization, rate limits, or protocol contracts.

Iwwersiicht

Editeurd-padmanabhan
Repositoryagent-engineering-handbook
Skill-Nummapi-design
Stären
20
Forks
3
Matgeliwwert Fichieren
5
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 5 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum d-padmanabhan op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Api Design an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/d-padmanabhan/agent-engineering-handbook/tree/main/skills/api-design
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/d-padmanabhan/agent-engineering-handbook.git /tmp/agent-engineering-handbook
mkdir -p .claude/skills
cp -r /tmp/agent-engineering-handbook/skills/api-design .claude/skills/api-design
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Api Design an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Api Design automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Api Design net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

API Design

Mandatory API gates are owned by the API rule (${HANDBOOK_ROOT}/rules/320-api-design.mdc). This skill owns design workflow, trade-offs, examples, and protocol-specific guidance.

Non-Negotiables

  • Design from consumers, business invariants, trust boundaries, and failure behavior before choosing endpoint shapes.
  • Let resource identifiers name nouns and protocol operations express behavior. Model a business action as a subordinate resource when that produces a clear lifecycle.
  • Follow HTTP safety, idempotency, cache, conditional-request, and status-code semantics. Idempotence means the intended server effect is stable, not that every response is byte-identical.
  • Authenticate the principal and authorize every protected object, tenant, relationship, field, and action on the server.
  • Validate and bound every path, query, header, cookie, message, and body input. Serialize responses from allowlisted schemas rather than persistence objects.
  • Use RFC 9457 Problem Details for new public HTTP error contracts unless an existing compatibility commitment requires another documented shape.
  • Make retryable mutations safe with a stable operation identity, atomic state, and reconciliation. Never imply that transport delivery proves exactly-once business processing.
  • Protect mutable resources from lost updates when concurrency matters.
  • Treat the API description as a versioned contract. Detect breaking changes, provide migration evidence, and deprecate deliberately.
  • Bound payloads, pagination, batches, queries, streams, execution time, concurrency, retries, queues, and per-principal cost.
  • Keep secrets, credentials, raw payloads, and unnecessary personal data out of errors and telemetry.

Design Workflow

1. Define Consumers and Guarantees

Document:

  • consumers, trust levels, environments, and ownership;
  • critical operations and business invariants;
  • latency, availability, durability, freshness, and consistency needs;
  • authentication mechanism and authorization policy inputs;
  • expected load, object size, request size, page size, concurrency, and growth;
  • retry, duplicate, ordering, and partial-failure behavior;
  • compatibility window, support policy, and deprecation owner.

Do not start by listing endpoints.

2. Select the Interface Style

Choose the smallest interface that fits:

  • REST/HTTP for resource-oriented public or broadly interoperable APIs;
  • GraphQL for consumer-selected graphs when demand control and field authorization are enforceable;
  • gRPC for typed service-to-service contracts, streaming, and generated clients where HTTP/2 and Protobuf are operationally supported;
  • webhook delivery for provider-initiated notifications;
  • SSE for server-to-client event streams over HTTP;
  • WebSockets for bounded bidirectional sessions;
  • asynchronous operation resources for long-running work;
  • batch endpoints only when network savings justify their authorization, isolation, and partial-result complexity.

Use the networking transport skill (${HANDBOOK_ROOT}/skills/networking-transport/SKILL.md) for transport and wire format selection.

3. Model Resources and Operations

For REST/HTTP:

  • use stable, lowercase collection nouns and one multiword convention;
  • use opaque identifiers and avoid exposing storage topology;
  • nest only for true containment or scope;
  • use query parameters for filtering, sorting, pagination, field selection, and other optional refinement;
  • never place state-changing behavior behind GET, HEAD, or a query action such as ?action=delete;
  • use an explicit command endpoint only when no honest resource lifecycle fits, then document its authorization, idempotency, result, and failure semantics.

Examples of resource-modeled actions include an order cancellation resource, an export job, or a password-reset request.

4. Define the Contract

Specify:

  • method or operation semantics;
  • request media type, schema, requiredness, defaults, unknown-field policy, and size limit;
  • success status, headers, body schema, and empty-body behavior;
  • RFC 9457 problem types, safe details, field pointers, and retryability;
  • JSON naming, timestamp, identifier, decimal, money, unit, enum, null, and absent-value conventions;
  • filtering operators, sort grammar, deterministic tie-break order, duplicate parameter behavior, and maximum page size;
  • cache scope, validators, conditional reads, and conditional writes;
  • asynchronous status, polling, cancellation, result, failure, expiry, and retention behavior.

Use the REST and HTTP contracts reference (${HANDBOOK_ROOT}/skills/api-design/references/rest-http-contracts.md).

5. Design Security and Failure Behavior

Define authentication separately from authorization. Apply bounded schemas before policy or business logic, and apply output filtering after authorization.

For mutations and remote dependencies, define:

  • idempotency key ownership, request fingerprint, atomic persistence, replayed response, conflict behavior, and retention;
  • optimistic concurrency and stale-write response;
  • one end-to-end deadline, attempt timeouts, retry owner, transient failure classes, backoff, jitter, and retry budget;
  • rate-limit principal, quota unit, window, response headers, and overload behavior;
  • outbound destination and redirect policy;
  • webhook signature, timestamp, replay, durable handoff, and redelivery policy;
  • redacted audit, logs, metrics, and traces.

Use the security and resilience reference (${HANDBOOK_ROOT}/skills/api-design/references/security-resilience.md), the service resilience skill (${HANDBOOK_ROOT}/skills/service-resilience/SKILL.md), and the distributed transactions skill (${HANDBOOK_ROOT}/skills/distributed-transactions/SKILL.md).

6. Define Evolution

Choose the newest OpenAPI version supported by the repository's validated toolchain. Do not copy a version number from a handbook example without checking generator, validator, gateway, and documentation compatibility.

Classify changes across request schemas, response schemas, requiredness, defaults, enums, error types, status codes, ordering, pagination, authorization, and observable behavior. Additive syntax can still be behaviorally breaking.

Use the evolution and OpenAPI reference (${HANDBOOK_ROOT}/skills/api-design/references/evolution-openapi.md).

7. Apply Protocol-Specific Controls

GraphQL, gRPC, webhooks, SSE, WebSockets, and batch APIs retain the same identity, authorization, validation, resource, compatibility, and observability requirements. Add protocol-specific demand, flow-control, deadline, schema, and connection-lifecycle controls.

Use the GraphQL, gRPC, and streaming reference (${HANDBOOK_ROOT}/skills/api-design/references/graphql-grpc-streaming.md).

8. Verify the Contract

Run applicable:

  • schema lint and validation;
  • request and response conformance tests;
  • authorization tests for object, tenant, relationship, action, and field boundaries;
  • negative tests for unknown, malformed, oversized, duplicate, stale, replayed, and out-of-order inputs;
  • OpenAPI or Protobuf breaking-change checks;
  • consumer contract and generated-client tests;
  • retry, timeout, idempotency, concurrency, and partial-failure tests;
  • load, abuse, rate-limit, streaming, and backpressure tests;
  • documentation examples against the production contract.

Review Output

For a design or review, report:

  1. consumers, invariants, and trust boundaries;
  2. interface style and resource or operation model;
  3. request, response, error, pagination, and async contracts;
  4. authentication, authorization, validation, and abuse controls;
  5. idempotency, concurrency, retry, and partial-failure behavior;
  6. compatibility, versioning, and deprecation plan;
  7. verification, observability, and unresolved risks.

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Api Design?

Designs and reviews production APIs across REST/HTTP, OpenAPI, GraphQL, gRPC, webhooks, asynchronous operations, batch endpoints, SSE, and WebSockets. Use when defining resources, routes, methods, status codes, problem details, pagination, idempotency, conditional writes, API schemas, compatibility, deprecation, authentication, authorization, rate limits, or protocol contracts.

Firwat Api Design op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Api Design besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Api Design an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/d-padmanabhan/agent-engineering-handbook/tree/main/skills/api-design an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Api Design benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Api Design benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Api Design domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Api Design gratis?

Jo. De Skill gëtt vum d-padmanabhan ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇