Skip to main content
skill Claude Code CX Codex Cursor

api-design-principles · wshobson — Claude Code skill for API design

Use this skill to plan or review REST and GraphQL APIs. It helps when writing a specification or setting API conventions for a team.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add wshobson/agents
/plugin install backend-development@claude-code-workflows
Open on GitHub

What api-design-principles does

The skill covers REST resources and HTTP methods, GraphQL schemas, API versioning, and common design pitfalls. Its guidance includes pagination, status codes, rate limits, and documentation. For GraphQL, it also addresses N+1 queries and structured mutation errors.

More patterns and worked examples are in references/details.md; the skill points there when its core guidance is not enough. It suits developers making API design decisions or reviewing specifications. If you need generated implementation code or automated code checks, this skill alone is not the right tool.

What it helps with

  • design REST resources and choose HTTP methods
  • compare API versioning approaches
  • review a GraphQL schema and its operations
  • spot pagination and error-format issues
  • set API design conventions for a team

Example prompts for the agent

  • Design a REST API for users and orders with pagination and versioning.
  • Review this GraphQL schema for N+1 risks and propose structured mutation errors.
  • Draft API conventions for resource names and HTTP methods in this project.

How to install api-design-principles

1Plugin marketplace

/plugin marketplace add wshobson/agents
/plugin install backend-development@claude-code-workflows

This installs the whole backend-development plugin with all its skills

2Skills CLI (Vercel)

npx skills add wshobson/agents --skill api-design-principles -a claude-code

3Manually: put the files in place

~/.claude/skills/api-design-principles/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/api-design-principles/

From the same set213

The whole set →
typescript-advanced-types Seth Hobson Guides an agent through advanced TypeScript types, from generics to conditional and mapped types. Use it for typed libraries, API clients, or strict configuration objects. Claude Code CX Codex Cursor 92,169installs tailwind-design-system Seth Hobson Helps build design systems with Tailwind CSS v4, from theme tokens to component variants. Use it when a project needs shared UI patterns. Claude Code CX Codex Cursor 70,180installs brand-landingpage Travis D. Elliott This skill interviews you about the product and its visual direction, then builds a landing page through Stitch. Use it when there’s no established design yet. Claude Code CX Codex Cursor 39,476installs python-testing-patterns Seth Hobson This skill guides Python testing with pytest, fixtures and mocks. Use it when building a test suite or tracking down failing checks. Claude Code CX Codex Cursor 36,943installs python-performance-optimization Seth Hobson This skill profiles Python code to locate CPU and memory bottlenecks. Use it when an application responds slowly or consumes too many resources. Claude Code CX Codex Cursor 35,675installs nextjs-app-router-patterns Seth Hobson This skill covers Next.js App Router patterns for rendering, routing, and data fetching. Use it when starting an App Router project or moving from Pages Router. Claude Code CX Codex Cursor 32,529installs code-review-excellence Seth Hobson This skill guides pull request reviews, catches logic and security issues, and helps teams give specific feedback. Use it for review standards or developer mentoring. Claude Code CX Codex Cursor 30,193installs postgresql-table-design Seth Hobson Helps design and review PostgreSQL schemas with guidance on data types, keys, constraints, indexes, and table partitioning. Claude Code CX Codex Cursor 27,780installs

Other versions of api-design-principles

Similar

architecture official anthropics Writes an Architecture Decision Record or reviews a system design: options, trade-offs, consequences. Useful when you have to pick between technologies. Claude Code CX Codex Cursor +1 6,700installs sandbox-stable cloudflare This skill helps build and maintain Cloudflare Sandbox apps on the stable @cloudflare/sandbox package. Use it when Workers need isolated Linux environments. Claude Code CX Codex Cursor +1 67,600installs dotnet-design-pattern-review official github Reviews selected C#/.NET code for design patterns and suggests improvements without editing files. Use it when you need an architecture-focused code review. GitHub Copilot 11,609installs sandbox-migrate-to-next cloudflare Skill guides migration of Cloudflare Sandbox applications from the stable @cloudflare/sandbox package to the prerelease @cloudflare/sandbox@next (SDK 1.0). Use it when preparing code for the future stable release. Claude Code CX Codex Cursor +1 66,900installs gemini-agents-api official google Manages Agent resources in Gemini Enterprise Agent Platform through its API. Use it when you need to configure an agent before starting conversations. Claude Code Gemini CLI CX Codex 9,466installs upgrade-stripe stripe Guides an agent through Stripe API, webhook, and SDK version upgrades. Use it when moving an integration to a target API version. Claude Code CX Codex Cursor +1 72,800installs mcp-builder official anthropics This skill walks through building an MCP server in TypeScript or Python, from reading the protocol spec to writing tests and evaluation questions. Claude Code Claude.ai 130,949installs google-agents-cli-adk-code official Google A reference skill for building ADK agents with tools, callbacks, state, and workflows. Use it when an agent project needs concrete API patterns or code examples. Claude Code CX Codex Cursor +1 511,400installs

Questions about api-design-principles

How do I install api-design-principles in Claude Code?

Run npx skills add wshobson/agents --skill api-design-principles -a claude-code. You can also add the marketplace with /plugin marketplace add wshobson/agents and install /plugin install backend-development@claude-code-workflows.

What does api-design-principles do?

It guides REST and GraphQL API design, including versioning and specification reviews. It also covers pitfalls such as GraphQL N+1 queries and incorrect use of HTTP methods.

Where are the detailed examples for api-design-principles?

They are in references/details.md. The skill directs you there when its core guidance is not sufficient.

Source text

SKILL.md · MIT
---
name: api-design-principles
description: Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewing API specifications, or establishing API design standards.
---

# API Design Principles

Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers and stand the test of time.

## When to Use This Skill

- Designing new REST or GraphQL APIs
- Refactoring existing APIs for better usability
- Establishing API design standards for your team
- Reviewing API specifications before implementation
- Migrating between API paradigms (REST to GraphQL, etc.)
- Creating developer-friendly API documentation
- Optimizing APIs for specific use cases (mobile, third-party integrations)

## Core Concepts

### 1. RESTful Design Principles

**Resource-Oriented Architecture**

- Resources are nouns (users, orders, products), not verbs
- Use HTTP methods for actions (GET, POST, PUT, PATCH, DELETE)
- URLs represent resource hierarchies
- Consistent naming conventions

**HTTP Methods Semantics:**

- `GET`: Retrieve resources (idempotent, safe)
- `POST`: Create new resources
- `PUT`: Replace entire resource (idempotent)
- `PATCH`: Partial resource updates
- `DELETE`: Remove resources (idempotent)

### 2. GraphQL Design Principles

**Schema-First Development**

- Types define your domain model
- Queries for reading data
- Mutations for modifying data
- Subscriptions for real-time updates

**Query Structure:**

- Clients request exactly what they need
- Single endpoint, multiple operations
- Strongly typed schema
- Introspection built-in

### 3. API Versioning Strategies

**URL Versioning:**

```
/api/v1/users
/api/v2/users
```

**Header Versioning:**

```
Accept: application/vnd.api+json; version=1
```

**Query Parameter Versioning:**

```
/api/users?version=1
```

## Detailed patterns and worked examples

Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient.

## Best Practices

### REST APIs

1. **Consistent Naming**: Use plural nouns for collections (`/users`, not `/user`)
2. **Stateless**: Each request contains all necessary information
3. **Use HTTP Status Codes Correctly**: 2xx success, 4xx client errors, 5xx server errors
4. **Version Your API**: Plan for breaking changes from day one
5. **Pagination**: Always paginate large collections
6. **Rate Limiting**: Protect your API with rate limits
7. **Documentation**: Use OpenAPI/Swagger for interactive docs

### GraphQL APIs

1. **Schema First**: Design schema before writing resolvers
2. **Avoid N+1**: Use DataLoaders for efficient data fetching
3. **Input Validation**: Validate at schema and resolver levels
4. **Error Handling**: Return structured errors in mutation payloads
5. **Pagination**: Use cursor-based pagination (Relay spec)
6. **Deprecation**: Use `@deprecated` directive for gradual migration
7. **Monitoring**: Track query complexity and execution time

## Common Pitfalls

- **Over-fetching/Under-fetching (REST)**: Fixed in GraphQL but requires DataLoaders
- **Breaking Changes**: Version APIs or use deprecation strategies
- **Inconsistent Error Formats**: Standardize error responses
- **Missing Rate Limits**: APIs without limits are vulnerable to abuse
- **Poor Documentation**: Undocumented APIs frustrate developers
- **Ignoring HTTP Semantics**: POST for idempotent operations breaks expectations
- **Tight Coupling**: API structure shouldn't mirror database schema

© Seth Hobson · MIT · wshobson/agents

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor