skills/api-architect/SKILL.md
Expert API designer for REST, GraphQL, gRPC architectures. Activate on: API design, REST API, GraphQL schema, gRPC service, OpenAPI, Swagger, API versioning, endpoint design, rate limiting, OAuth flow. NOT for: database schema (use data-pipeline-engineer), frontend consumption (use web-design-expert), deployment (use devops-automator).
npx skillsauth add curiositech/windags-skills api-architectInstall 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.
Expert API designer specializing in REST, GraphQL, gRPC, and WebSocket architectures.
Activate on: "API design", "REST API", "GraphQL schema", "gRPC service", "OpenAPI", "Swagger", "API versioning", "endpoint design", "rate limiting", "OAuth flow", "API gateway"
NOT for: Database schema → data-pipeline-engineer | Frontend consumption → web-design-expert | Deployment → devops-automator
| Domain | Technologies | |--------|-------------| | REST | OpenAPI 3.1, HATEOAS, Pagination | | GraphQL | SDL, Relay, DataLoader, Federation | | gRPC | Protocol Buffers, Streaming patterns | | Security | OAuth 2.0, JWT, API Keys, RBAC | | DX | Swagger UI, SDK generation, Sandboxes |
Design Contract → Generate Stubs → Implement → Test Against Spec
success: { data: <resource>, meta: { page, total } }
error: { error: { code, message, details: [{ field, issue }] } }
/v1/users (most explicit)Accept: application/vnd.api+json;version=1/users?version=1Full working examples in ./references/:
| File | Description | Lines |
|------|-------------|-------|
| openapi-spec.yaml | Complete OpenAPI 3.1 spec | 162 |
| graphql-schema.graphql | GraphQL with Relay connections | 111 |
| grpc-service.proto | Protocol Buffer, all streaming | 95 |
| rate-limiting.yaml | Tier-based rate limit config | 85 |
| api-security.yaml | Auth, CORS, security headers | 130 |
Symptom: /getUsers, /createOrder, /deleteProduct
Fix: Use nouns (/users, /orders), let HTTP methods convey action
Symptom: {data: [...]} sometimes, raw arrays other times
Fix: Always use consistent envelope structure
Symptom: Removing fields, changing types without warning Fix: Semantic versioning, deprecation headers, sunset periods
Symptom: Resolver queries database per item in list
Fix: DataLoader pattern for batching, @defer for large payloads
Symptom: /users returns 50 fields when clients need 3
Fix: Sparse fieldsets (?fields=id,name,email) or GraphQL
Symptom: List endpoints return all records
Fix: Default limits, cursor-based pagination, hasMore indicator
Symptom: Duplicate POST requests create duplicate resources
Fix: Accept Idempotency-Key header, return cached response
Symptom: Stack traces, SQL errors exposed in 500 responses Fix: Generic error messages in production, request IDs for debugging
Symptom: Browser clients blocked with CORS errors Fix: Configure allowed origins, methods, headers explicitly
Symptom: API vulnerable to abuse, no usage visibility
Fix: Implement limits per tier, return X-RateLimit-* headers
Run ./scripts/validate-api-spec.sh to check:
[ ] All endpoints use nouns, not verbs
[ ] Consistent response envelope structure
[ ] Error responses include codes and actionable messages
[ ] Pagination on all list endpoints
[ ] Authentication/authorization documented
[ ] Rate limit headers defined
[ ] Versioning strategy documented
[ ] CORS configured for known origins
[ ] Idempotency keys for mutating operations
[ ] OpenAPI spec validates without errors
[ ] SDK generation tested
[ ] Examples for all request/response types
Read, Write, Edit - File operations for specsBash(npm:*, npx:*) - OpenAPI linting, code generationBash(openapi-generator:*) - SDK generationtools
Building resilient distributed systems with circuit breakers, retries with full-jitter exponential backoff, retry budgets (per-request 3-attempt + per-client 10% ratio per Google SRE), deadline propagation, and the cascading-failure math (4 layers × 3 retries = 64x amplification). Grounded in Resilience4j, Microsoft Cloud Patterns, AWS Architecture Blog (Marc Brooker), and Google SRE Book.
testing
Designing HTTP cache headers that work correctly across browsers, CDNs, and shared proxies — `Cache-Control` directives per RFC 9111, `stale-while-revalidate` and `stale-if-error` per RFC 5861, the Vary header for varying responses, and surrogate keys for tag-based purging. Grounded in IETF RFCs and Cloudflare/Fastly docs.
development
Use when designing or fixing a Content Security Policy on a real site, choosing between nonce-based and hash-based CSP, adding strict-dynamic, debugging "Refused to execute inline script" errors, deploying CSP in report-only mode first, configuring report-to / report-uri, or auditing an existing policy for unsafe-inline / unsafe-eval / wildcards. Triggers: "CSP blocks legitimate inline script", strict-dynamic, nonce-{RANDOM}, sha256-{HASH}, object-src none, base-uri none, frame-ancestors, Trusted Types, X-Content-Security-Policy obsolete, report-only vs enforced. NOT for general HTTP security headers (HSTS, COOP/COEP), Trusted Types deep dive, CORS configuration, or building a WAF.
tools
Choosing and operating an HTTP API versioning strategy that doesn't break clients — Stripe's date-based pinned versions, the Deprecation/Sunset header pair (RFC 9745 + RFC 8594), URI vs header vs media-type approaches, and the version-transformer pattern. Grounded in Stripe's published architecture and IETF RFCs.