本文へ移動
cccskills
無料GitHub で公開

api-design

API design: REST conventions, OpenAPI, versioning, pagination, error format, GraphQL, webhooks.

日本語の概要は準備中です。原文の説明を表示しています。

SebastianLuser/claude-code-arcaneスター 3(GitHub 3 + cccskills 0)

実行スコア 未検証

インストール方法を見る

含まれるファイル(3)

  • SKILL.md3.7 KB
  • references/anti-patterns.md1.1 KB
  • references/versioning-deprecation.md983 B

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

api-design — REST, GraphQL, Versioning & Docs

MANDATORY WORKFLOW

Antes de recomendar o generar cualquier diseño, completar estos pasos en orden.

Step 0: Gather Requirements

Clarificar (o inferir del contexto si ya fue especificado):

  1. ¿API nueva o extensión? (si es extensión, leer la existente primero)
  2. Tipos de clientes: SPA / mobile / third-party / server-to-server
  3. ¿Over-fetch o deeply nested relations? → influye en REST vs GraphQL
  4. Auth: JWT / API Key / OAuth / ninguna
  5. ¿Versioning desde día 1? ¿Hay clientes externos que no podemos romper?

Si el usuario ya especificó estos valores, saltar directamente al Step 1.

Step 1: Recomendar approach

Usar la tabla API Style Decision más abajo para elegir REST / GraphQL / gRPC. Explicar la elección en 1 oración.

Step 2: Diseñar + Verificar

Implementar el diseño. Al terminar, validar contra el Checklist al final de este documento.


API Style Decision

StyleUse when
RESTDefault. CRUD-dominant, cacheable, broad client support
GraphQLMultiple clients with very different shapes, deep nested relations, significant over-fetch
gRPCInternal service-to-service, streaming, strict contracts, performance-critical

REST Conventions

  • URLs: plural nouns, kebab-case, nesting max 2 levels, no verbs. Pattern: /api/v1/resources/{id}/sub-resources
  • Verbs: GET (read), POST (create, use Idempotency-Key if critical), PUT (full replace), PATCH (partial), DELETE
  • Pagination: cursor keyset over offset (offset drifts with concurrent writes, re-scans rows)
  • Response wrapper: { "data": [...], "pagination": { "cursor": "...", "hasMore": true } }
  • Filtering/sorting: ?filter[status]=active&sort=-createdAt&fields=id,name
  • Dates: ISO 8601 UTC. IDs: opaque (never auto-increment — reveals volume)
  • Rate limiting headers: X-RateLimit-Limit, X-RateLimit-Remaining, Retry-After

Error Format — RFC 9457 Problem Details

Fields: type (URI), title, status, detail, traceId (log correlation). Never invent a custom format. Never expose stack traces in production.

Schema-first Approach

  1. Recommended: OpenAPI spec first, generate types + client code
  2. Alternative (Fastify): Code-first with Zod, auto-generate OpenAPI via @fastify/swagger
  3. Monorepo: Share schemas in packages/api-types between backend and frontend
  4. Tooling: Lint (Spectral), mock (Prism), docs (Redocly/Scalar)

Versioning

  • Default: URL path (/v1/) — simple, cacheable, grep-friendly
  • Non-breaking (no bump): add optional field, new endpoint, new enum value
  • Breaking (requires bump): remove/rename field, change type, change status codes

→ Read references/versioning-deprecation.md for deprecation flow, support windows, and webhook outbound details

Anti-patterns

→ Read references/anti-patterns.md for 10 common API design anti-patterns with corrections

Checklist

  • URLs plural, no verbs, nesting max 2
  • Correct status codes, RFC 9457 errors with traceId
  • Cursor pagination with { data, pagination } wrapper
  • OpenAPI spec up-to-date and linted, generated types in client
  • Breaking changes trigger version bump
  • Deprecation headers + usage monitoring on old endpoints
  • Rate limit headers, auth documented per endpoint
  • Webhooks signed with HMAC

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

Plan, design, and implement A/B tests and experiments with statistical rigor. Covers hypothesis frameworks, sample sizing, metrics, and result analysis.

日本語の概要は準備中です。原文の説明を表示しています。

SebastianLuser/claude-code-arcane32026年10月27日 更新

Web/mobile accessibility decision guide: WCAG 2.2 AA, ARIA, keyboard nav, focus management, contrast, testing. Use for: a11y, accessibility, wcag, aria, screen reader, keyboard, contrast.

日本語の概要は準備中です。原文の説明を表示しています。

SebastianLuser/claude-code-arcane32026年10月27日 更新

Generate, iterate, and scale ad creative for paid advertising across Google, Meta, LinkedIn, and X. Covers platform specs, creative frameworks, and quality validation.

日本語の概要は準備中です。原文の説明を表示しています。

SebastianLuser/claude-code-arcane32026年10月27日 更新

Musica interactiva para juegos: layering vertical, re-secuenciacion horizontal, stingers, reglas de transicion con sync points, y mapeo de estados de gameplay a musica. Usar para: musica adaptativa, sistema de musica dinamica, transiciones musicales, combat music.

日本語の概要は準備中です。原文の説明を表示しています。

SebastianLuser/claude-code-arcane32026年10月27日 更新

Design multi-agent systems, create agent architectures, define communication patterns, and build autonomous agent workflows with structured evaluation frameworks.

日本語の概要は準備中です。原文の説明を表示しています。

SebastianLuser/claude-code-arcane32026年10月27日 更新

Inter-agent communication protocol for C-suite agent teams. Defines invocation syntax, loop prevention, isolation rules, response formats, and quality loops.

日本語の概要は準備中です。原文の説明を表示しています。

SebastianLuser/claude-code-arcane32026年10月27日 更新

SebastianLuser のスキルをすべて見る

このスキルの問題を報告する