plugins/systems-design/skills/api-design/SKILL.md
Designs REST, GraphQL, or gRPC APIs from requirements — picks the right protocol for the use case, models resources and operations, defines schemas (Zod for internal, OpenAPI/GraphQL SDL/proto for specs), and writes the spec to .context/architecture/api/. Use when the user asks to design an API, sketch out endpoints, model a schema, plan a service's interface, or says things like "what should the API look like for X", "design endpoints for Y", or "how should clients talk to this service".
npx skillsauth add lucasilverentand/skills api-designInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Turns "we need an API for X" into a concrete spec — protocol, resources, schemas, and the cross-cutting concerns that actually bite in production.
ls .context/architecture/api/ 2>/dev/null || echo "(none yet)"Before picking a protocol or drawing endpoints, ask (use AskUserQuestion for the non-obvious ones):
Write the protocol choice with a one-paragraph justification. A weak reader should understand why without knowing the trade-offs in advance. Example:
REST over HTTPS with JSON payloads. Chosen because the primary clients are the storefront web app (browser) and a third-party partner dashboard, both of which work best with standard HTTP tooling and caching. GraphQL was considered but would add a server-side schema layer for no current benefit.
List resources and operations. Keep it simple:
|Resource|Operations|Notes|
|---|---|---|
|orders|POST, GET /:id, GET ?customer_id=..., POST /:id/refund|POST /:id/refund is a sub-action, not PUT|
|customers|GET /:id, GET /:id/orders|Read-only from this service|
Conventions to pick once and stick to:
/orders, not /order)ord_abc123) as strings, never integerssnake_case for public APIs, camelCase for internal/customers/:id/orders — flatten beyond that)See references/http-conventions.md for the full set of HTTP conventions with explanations.
GraphQL: define types, queries, mutations, subscriptions in SDL. Every type, field, and argument gets a description string — the schema is the documentation.
gRPC: write the .proto file. Group related RPCs into services. Document each RPC with what it does and what errors it returns.
See references/examples.md for full examples in all three protocols.
For each endpoint/operation:
Use Zod for internal services, OpenAPI for external REST, GraphQL SDL for GraphQL, proto for gRPC.
For each of these, apply conventions from the reference files and document any deviation in the spec:
{
"type": "https://api.example.com/errors/order.read.not_found",
"title": "Order not found",
"status": 404,
"detail": "No order with that ID exists.",
"instance": "/v1/orders/ord_abc123",
"request_id": "req_f00b4r"
}
{ data, meta: { next_cursor, has_more } }. Max 100, default 25.Idempotency-Key header on all write endpoints.429 with Retry-After./v1/. Deprecation headers.null = "explicitly no value".* with credentials.For details and rationale on each, see the reference files below.
Output to .context/architecture/api/<service>.md. Structure:
code -> meaning -> when it fires.context/architecture/documentation:write-adr) for non-obvious choices when availabledocumentation:c4-diagrams) when availableWrite specs for juniors and weaker LLM models. A spec that only a senior can read is a spec that will be misimplemented:
|When|Use|
|---|---|
|Need the system architecture first|architecture|
|Need the data model|data-modeling|
|The API is part of a larger design|documentation:write-design-doc for the parent doc if installed|
|A choice deserves a permanent record|documentation:write-adr if installed|
|A diagram would make the flow clearer|documentation:c4-diagrams if installed|
|Review an existing API design|design-review|
|File|Covers|
|---|---|
|references/http-conventions.md|URLs, HTTP verbs, status codes, request/response shapes, CORS|
|references/error-handling.md|RFC 7807 Problem Details, error code taxonomy, validation errors, result types, Zod validation|
|references/auth.md|Auth schemes by caller type, API key format, ABAC authorization, Hono middleware order|
|references/pagination.md|Cursor-based (recommended) and offset-based pagination with trade-offs|
|references/api-patterns.md|Idempotency, rate limiting, versioning, webhooks, file uploads, API documentation|
|references/example-rest.md|REST example: Orders API with Zod schemas, endpoints, error codes|
|references/example-graphql.md|GraphQL example: Orders SDL with types, queries, mutations|
|references/example-grpc.md|gRPC example: Orders proto with services, messages, streaming|
development
Cross-platform Apple Human Interface Guidelines: color, typography, layout, materials, motion, accessibility, SF Symbols, branding, plus shared UI elements (activity views, rating indicators, web views, …) and meta sections (components, patterns, technologies). Use when the design topic is platform-agnostic. User says: "iOS color tokens", "SF Symbols", "Apple typography", "dark mode guidance".
development
Guides a full system design from idea to spec — sequences requirements gathering, architecture decomposition, data modeling, API design, and document writing into a coherent workflow with clear handoffs. Use when the user asks to "design a system", "build X from scratch", "architect something end-to-end", "plan a new service", or has a broad design ask that spans multiple concerns. Also use when the user says things like "I need to build X" without specifying which aspect to start with. This is the entry point for any design task that isn't clearly scoped to a single skill (data model only, API only, etc.).
development
Synthesizes build-ready design systems and DESIGN.md files from chat briefs, screenshots, moodboards, videos, URLs, live pages, or local image folders while preserving the target product identity. Use when the user asks to "make a design system from these screenshots", "turn this moodboard into DESIGN.md", "extract the design language from this video", "define the UX vibe and rules from these references", or create cohesive UI rules from visual inspiration.
development
Reviews and critiques an existing or proposed system design — flags single points of failure, missing non-functional requirements, scaling bottlenecks, security gaps, operational blind spots, unjustified tech choices, and places where the design will fall over under load or failure. Produces a structured review with severity-tagged findings, not just vibes. Use when the user asks for a second opinion on an architecture, requests a design review, wants feedback on a proposed system, pastes a design doc, or says things like "review this design", "what's wrong with X", "poke holes in this", or "is this a good architecture".