A guide for designing predictable, resource-oriented APIs that are easy to maintain and use.

Install

mkdir -p .claude/skills/api-design-yisuescopeta && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/9776" && unzip -o skill.zip -d .claude/skills/api-design-yisuescopeta && rm skill.zip

Installs to .claude/skills/api-design-yisuescopeta

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Design robust, scalable, and intuitive APIs (REST, GraphQL, etc.). Enforces best practices for resource naming, HTTP methods, error handling, versioning, and security. Use this when designing or refactoring backend endpoints.
225 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Resource-oriented design
  • HTTP method enforcement
  • Status code standardization
  • GraphQL schema design

How it works

It enforces RESTful principles and industry standards for naming, methods, and responses.

Inputs & outputs

You give it
API requirements
You get back
API contract and design plan

When to use api-design

  • Designing new backend endpoints
  • Refactoring legacy API design
  • Defining API contracts

About this skill

API Design Principles

Overview

Great APIs are consistent, predictable, and easy to use. This skill enforces industry standards for API design.

Core Principles

1. Resource-Oriented Design (REST)

  • Nouns, not Verbs: Use resources (nouns) in methods.
    • Good: GET /users, POST /users
    • Bad: GET /getUsers, POST /createUser
  • Plural Nouns: Use plural nouns for collections (/users not /user).
  • Nesting: Use nesting to show relationships, but limit depth to 2-3 levels.
    • GET /users/{id}/posts (Okay)
    • GET /users/{id}/posts/{pid}/comments (Borderline)

2. HTTP Methods

  • GET: Retrieve data. Safe and idempotent.
  • POST: Create new resources. Not idempotent.
  • PUT: Update/Replace a resource completely. Idempotent.
  • PATCH: Partial update. Idempotent.
  • DELETE: Remove a resource. Idempotent.

3. Responses & Status Codes

  • 200 OK: Success (GET, PUT, PATCH).
  • 201 Created: Success (POST) - Return the created resource.
  • 204 No Content: Success (DELETE) - No body returned.
  • 400 Bad Request: Client error (validation).
  • 401 Unauthorized: Missing/invalid authentication.
  • 403 Forbidden: Authenticated but not allowed.
  • 404 Not Found: Resource does not exist.
  • 500 Internal Server Error: Server bug.

4. Naming Conventions

  • Case: Use camelCase for JSON fields and params (e.g., firstName). Use kebab-case for URLs (e.g., /user-profiles).
  • Consistency: If you use userId in one place, don't use user_id or id elsewhere for the same concept.

5. Filtering, Sorting, Pagination

  • Pagination: Always paginate collections. Use limit and offset or cursor-based pagination.
  • Filtering: Use query parameters: GET /users?role=admin.
  • Sorting: Use sort or order: GET /users?sort=-createdAt (descending).

6. GraphQL Specifics

  • Schema First: Design the schema before implementation.
  • N+1 Problem: Ensure resolvers use DataLoaders to batch database requests.
  • Naming: Use verb-noun for mutations (createUser, updatePost).

Security

  • HTTPS: Always use HTTPS.
  • Authentication: Use Bearer Tokens (JWT) in headers.
  • Rate Limiting: Protect endpoints from abuse.

When not to use it

  • Frontend UI design

Limitations

  • Design requires implementation effort
  • GraphQL N+1 problem needs manual handling

How it compares

It provides a standardized framework for consistency rather than ad-hoc endpoint creation.

Compared to similar skills

api-design side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
api-design (this skill)04moNo flagsIntermediate
fastapi-templates5202moNo flagsIntermediate
fastapi-pro794moNo flagsAdvanced
nodejs-backend-patterns122moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

5201,086

fastapi-pro

sickn33

Build high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2. Master microservices, WebSockets, and modern Python async patterns. Use PROACTIVELY for FastAPI development, async optimization, or API architecture.

79181

nodejs-backend-patterns

wshobson

Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices. Use when creating Node.js servers, REST APIs, GraphQL backends, or microservices architectures.

1246

springboot-patterns

affaan-m

Spring Boot 架构模式、REST API 设计、分层服务、数据访问、缓存、异步处理和日志记录。适用于 Java Spring Boot 后端工作。

1147

backend-development

skillcreatorai

Backend API design, database architecture, microservices patterns, and test-driven development. Use for designing APIs, database schemas, or backend system architecture.

1731

graphql

davila7

GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.

624

Search skills

Search the agent skills registry