Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
pixel-process-ug avatar

Api Design

  • 70 installs
  • 1 repo stars
  • Updated March 16, 2026
  • pixel-process-ug/superkit-agents

Helps with backend & apis tasks.

About

api-design is a Claude Code skill for backend & apis. It helps solo builders move faster with AI-assisted development.

  • api-design
  • Backend & APIs
  • AI-coding skill

Api Design by the numbers

  • 70 all-time installs (skills.sh)
  • +2 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #3,084 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/pixel-process-ug/superkit-agents --skill api-design

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs70
repo stars1
Last updatedMarch 16, 2026
Repositorypixel-process-ug/superkit-agents

What it does

Helps with backend & apis tasks.

Files

SKILL.mdMarkdownGitHub ↗

API Design

Overview

Structured API endpoint design through guided discovery. Produces consistent, well-documented API designs with OpenAPI/Swagger specifications. Covers resource modeling, authentication, pagination, error handling, and versioning — ensuring consumer-centric design before any implementation begins.

Announce at start: "I'm using the api-design skill to design the API."

Phase 1: Discovery

Ask these questions ONE AT A TIME:

Resource Questions

#QuestionWhat It Determines
1What entities/resources does this API manage?Resource naming
2What are the relationships between them?Nested routes, includes
3What operations are needed for each? (CRUD, search, batch)HTTP methods, endpoints

Consumer Questions

#QuestionWhat It Determines
4Who will consume this API? (frontend, mobile, third-party, internal)Response shape, auth model
5What authentication/authorization is needed?Security scheme
6What rate limits or quotas apply?Rate limiting headers

Constraint Questions

#QuestionWhat It Determines
7REST, GraphQL, or tRPC?API paradigm
8Versioning strategy? (URL path, header, query param)URL structure
9Pagination approach? (cursor, offset, keyset)List response shape
10Existing API conventions in the codebase?Consistency constraints

API Paradigm Decision Table

FactorChoose RESTChoose GraphQLChoose tRPC
ConsumersMultiple, diverseFrontend-heavy, flexible queriesTypeScript monorepo
Caching needsStrong (HTTP caching)Moderate (client-side)Low (internal only)
Data shapePredictable, resource-orientedNested, variable-shapeType-safe RPC
Team familiarityUniversalRequires schema knowledgeRequires TypeScript
Real-time needsWebSocket addonSubscriptions built-inSubscription support

STOP after discovery — present a summary of resources, operations, and constraints. Get confirmation before designing endpoints.

Phase 2: Design Endpoints

For each endpoint, define:

### [METHOD] /api/v1/[resource]

**Purpose:** [what this endpoint does]

**Request:**
- Headers: `Authorization: Bearer <token>`
- Query params: `?page=1&limit=20&sort=created_at:desc`
- Body:

{ "field": "type — description" }


**Response (200):**

{ "data": [...], "meta": { "total": 100, "page": 1, "limit": 20 } }


**Error Responses:**
| Status | Code | Description |
|--------|------|-------------|
| 400 | VALIDATION_ERROR | Invalid request body |
| 401 | UNAUTHORIZED | Missing or invalid token |
| 404 | NOT_FOUND | Resource doesn't exist |
| 409 | CONFLICT | Resource already exists |

**Authorization:** [who can access this]

HTTP Method Decision Table

OperationMethodStatus (success)Idempotent
List resourcesGET200Yes
Get single resourceGET200Yes
Create resourcePOST201No
Full replacePUT200Yes
Partial updatePATCH200No
Delete resourceDELETE204Yes
Bulk createPOST201No
Search (complex)POST200Yes (safe)

Pagination Decision Table

ApproachWhen to UseProsCons
CursorReal-time feeds, large datasetsConsistent, no skippingCannot jump to page N
OffsetSmall datasets, admin panelsSimple, jumpableSkips/duplicates on insert
KeysetTime-series, logsEfficient on large tablesRequires sortable key

Error Response Format

All endpoints must use a consistent error shape:

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Human-readable description",
    "details": [
      { "field": "email", "message": "Invalid email format" }
    ]
  }
}

Status Code Reference

CodeMeaningWhen to Use
200OKSuccessful GET, PUT, PATCH
201CreatedSuccessful POST that creates
204No ContentSuccessful DELETE
400Bad RequestValidation failure
401UnauthorizedMissing or invalid credentials
403ForbiddenValid credentials, insufficient permissions
404Not FoundResource does not exist
409ConflictDuplicate or state conflict
422Unprocessable EntityValid JSON but semantic error
429Too Many RequestsRate limit exceeded
500Internal Server ErrorUnexpected server failure

STOP after endpoint design — present each endpoint for review and approval.

Phase 3: Generate OpenAPI Spec

openapi: 3.1.0
info:
  title: [API Name]
  version: 1.0.0
  description: [API description]

servers:
  - url: http://localhost:3000/api/v1
    description: Development
  - url: https://api.example.com/v1
    description: Production

paths:
  /resource:
    get:
      summary: List resources
      parameters: [...]
      responses: [...]
    post:
      summary: Create resource
      requestBody: [...]
      responses: [...]

components:
  schemas: [...]
  securitySchemes: [...]

STOP after spec generation — validate the YAML and present for final approval.

Phase 4: Save and Transition

After explicit approval:

1. Save OpenAPI spec to docs/api/YYYY-MM-DD-<api-name>.yaml 2. Commit with message: docs(api): add OpenAPI spec for <api-name> 3. Determine next step based on user intent

Transition Decision Table

User IntentNext SkillRationale
"Let's implement this"planningCreate implementation plan from API spec
"Write specs for this"spec-writingBehavioral specs for each endpoint
"Generate client SDK"ManualUse OpenAPI codegen tools
"Just save the design"NoneAPI design is the deliverable
"Add tests"testing-strategyDefine API test approach

Design Principles

PrincipleRule
Consistent namingPlural nouns for collections (/users, not /user)
Proper HTTP methodsGET reads, POST creates, PUT replaces, PATCH updates, DELETE removes
Proper status codesUse the right code for the right situation (see table above)
Consistent error formatSame error shape across all endpoints
Pagination by defaultAll list endpoints paginated
Filtering and sortingQuery params for list endpoints
IdempotencyPUT and DELETE are always idempotent
HATEOASInclude links for discoverability (when appropriate)

Anti-Patterns / Common Mistakes

MistakeWhy It Is WrongWhat To Do Instead
Verb-based URLs (/getUsers)Not RESTful, breaks conventionsUse nouns: GET /users
Inconsistent plural/singularConfuses consumersAlways plural for collections
Returning 200 for errorsHides failures from clientsUse proper status codes
No pagination on list endpointsPerformance bomb on large datasetsAlways paginate
Different error formats per endpointClients can't build generic error handlingOne error shape for all
Exposing internal IDs in URLsSecurity and coupling riskUse UUIDs or slugs
No versioning strategyBreaking changes break clientsVersion from day one
Designing without knowing consumersAPI serves no one wellDiscovery phase first

Anti-Rationalization Guards

  • Do NOT skip the discovery phase — understand consumers and constraints first
  • Do NOT design endpoints without defining error responses
  • Do NOT skip pagination for any list endpoint
  • Do NOT use inconsistent naming across endpoints
  • Do NOT generate the OpenAPI spec without user approval of endpoint designs
  • Do NOT mix API paradigms (REST + GraphQL) without explicit justification

Integration Points

SkillRelationship
spec-writingDownstream: API design informs behavioral specifications
planningDownstream: API endpoints become implementation tasks
tech-docs-generatorDownstream: OpenAPI spec feeds API reference docs
testing-strategyDownstream: API design informs integration test strategy
security-reviewDownstream: auth/authz model reviewed for vulnerabilities
database-schema-designUpstream: data model informs resource design
prd-generationUpstream: PRD requirements drive API resource identification

Verification Gate

Before claiming the API design is complete:

1. VERIFY all endpoints have request/response schemas 2. VERIFY all error responses are documented with consistent format 3. VERIFY authentication is specified for each endpoint 4. VERIFY pagination is defined for all list endpoints 5. VERIFY the OpenAPI spec is valid YAML 6. VERIFY user has approved each endpoint individually

Skill Type

Flexible — Adapt API paradigm, pagination style, and auth model to project needs while preserving the discovery-first approach, consistent error handling, and consumer-centric design principles.

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.