Agent skill

Designing APIs

by ancoleman in ancoleman/ai-design-components

Design APIs that are secure, scalable, and maintainable using RESTful, GraphQL, and event-driven patterns.

MITAuto-check passedBackend & APIs

Install Designing APIs

skills CLI
$ npx skills add ancoleman/ai-design-components --skill designing-apis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ancoleman/ai-design-components designing-apis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ancoleman/ai-design-components.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/designing-apis .claude/skills/designing-apis && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
designing-apis
GitHub stars
526
Token cost
~2.6k tokens
SKILL.md length
813 words
Files
13 (incl. scripts, references)
Skills in repo
75
Repo updated
First seen
Licence
MIT

At a glance

Design APIs that are secure, scalable, and maintainable using RESTful, GraphQL, and event-driven patterns.

  • Works in 4 steps: Month 0: Announce deprecation → Months 1-3: Migration period → Months 4-6: Deprecation warnings → …
  • Designing new APIs
  • SKILL.md covers When to Use This Skill, Core Design Principles, API Style Selection and API Versioning, plus 6 more sections
  • Runs Shell scripts from its folder

What it does

Designing APIs is an agent skill from ancoleman/ai-design-components. Design APIs that are secure, scalable, and maintainable using RESTful, GraphQL, and event-driven patterns. Use when designing new APIs, evolving existing APIs, or establishing API standards for teams.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 17 other files, including scripts and reference files (for example `examples/asyncapi/order-events.yaml`, `outputs.yaml` and `references/authentication.md`).

It sits in Backend & APIs, covering Event-driven systems, GraphQL and REST APIs. It works with GraphQL. The repository describes itself as: Comprehensive UI/UX and Backend component design skills for AI-assisted development with Claude. The licence is MIT.

When your agent uses it

  • Designing new APIs
  • Evolving existing APIs
  • Establishing API standards for teams

Example prompts

  • “/designing-apis”

Requirements

  • A Bash shell

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Month 0: Announce deprecation
  2. Months 1-3: Migration period
  3. Months 4-6: Deprecation warnings
  4. Month 6: Sunset (return 410 Gone)

What it can do on your machine

Read from SKILL.md and the folder at commit 76551b7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Designing APIs loads about 2.6k tokens when it runs, and up to ~21k if it reads all its reference files. Until then it costs about 54 tokens; SKILL.md has 813 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~54
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~21k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from ancoleman/ai-design-components at commit 76551b7, republished under its MIT licence (© ancoleman). 813 words, ~2,585 tokens.

Download SKILL.mdSave it as .claude/skills/designing-apis/SKILL.md (or your agent's skills folder). This skill also uses 12 other files; get the full folder from GitHub.
name
designing-apis
description
Design APIs that are secure, scalable, and maintainable using RESTful, GraphQL, and event-driven patterns. Use when designing new APIs, evolving existing APIs, or establishing API standards for teams.

Designing APIs

Design well-structured, scalable APIs using REST, GraphQL, or event-driven patterns. Focus on resource design, versioning, error handling, pagination, rate limiting, and security.

When to Use This Skill

Use when:

  • Designing a new REST, GraphQL, or event-driven API
  • Establishing API design standards for a team or organization
  • Choosing between REST, GraphQL, WebSockets, or message queues
  • Planning API versioning and breaking change management
  • Defining error response formats and HTTP status code usage
  • Implementing pagination, filtering, and rate limiting patterns
  • Designing OAuth2 flows or API key authentication
  • Creating OpenAPI or AsyncAPI specifications

Do NOT use for:

  • Implementation code (use api-patterns skill for Express, FastAPI code)
  • Authentication implementation (use auth-security skill for JWT, sessions)
  • API testing strategies (use testing-strategies skill)
  • API deployment and infrastructure (use deploying-applications skill)

Core Design Principles

Resource-Oriented Design (REST)

Use nouns for resources, not verbs in URLs:

✓ GET    /users              List users
✓ GET    /users/123          Get user 123
✓ POST   /users              Create user
✓ PATCH  /users/123          Update user 123
✓ DELETE /users/123          Delete user 123

✗ GET    /getUsers
✗ POST   /createUser

Nest resources for relationships (limit depth to 2-3 levels):

✓ GET /users/123/posts
✓ GET /users/123/posts/456/comments
✗ GET /users/123/posts/456/comments/789/replies  (too deep)

For complete REST patterns, see references/rest-design.md

HTTP Method Semantics
MethodIdempotentSafeUse ForSuccess Status
GETYesYesRead resource200 OK
POSTNoNoCreate resource201 Created
PUTYesNoReplace entire resource200 OK, 204 No Content
PATCHNoNoUpdate specific fields200 OK, 204 No Content
DELETEYesNoRemove resource204 No Content, 200 OK

Idempotent means multiple identical requests have the same effect as one request.

HTTP Status Codes

Success (2xx):

  • 200 OK, 201 Created, 204 No Content

Client Errors (4xx):

  • 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found
  • 409 Conflict, 422 Unprocessable Entity, 429 Too Many Requests

Server Errors (5xx):

  • 500 Internal Server Error, 503 Service Unavailable

For complete status code guide, see references/rest-design.md

API Style Selection

Decision Matrix
FactorRESTGraphQLWebSocketMessage Queue
Public API⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Complex Data⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Caching⭐⭐⭐⭐⭐⭐⭐⭐⭐
Real-time⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Simplicity⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Quick Selection
  • Public API, CRUD operations → REST
  • Complex data, flexible queries → GraphQL
  • Real-time, bidirectional → WebSockets
  • Event-driven, microservices → Message Queue

For detailed protocol selection, see references/protocol-selection.md

API Versioning

https://api.example.com/v1/users
https://api.example.com/v2/users

Pros: Explicit, easy to implement and test Cons: Maintenance overhead

Alternative Strategies
  • Header-Based: Accept-Version: v1
  • Media Type: Accept: application/vnd.example.v1+json
  • Query Parameter: ?version=1 (not recommended)
Breaking Change Management

Timeline:

  1. Month 0: Announce deprecation
  2. Months 1-3: Migration period
  3. Months 4-6: Deprecation warnings
  4. Month 6: Sunset (return 410 Gone)

Include deprecation headers:

http
Deprecation: true
Sunset: Sat, 31 Dec 2025 23:59:59 GMT
Link: </api/v2/users>; rel="successor-version"

For complete versioning guide, see references/versioning-strategies.md

Error Response Standards

json
{
  "type": "https://api.example.com/errors/validation",
  "title": "Validation Error",
  "status": 400,
  "detail": "One or more fields failed validation",
  "errors": [
    {
      "field": "email",
      "message": "Must be a valid email address",
      "code": "INVALID_EMAIL"
    }
  ]
}

Content-Type: application/problem+json

For complete error patterns, see references/error-handling.md

Pagination Patterns

Strategy Selection
ScenarioStrategyWhy
Small datasets (<1000)Offset-basedSimple, page numbers
Large datasets (>10K)Cursor-basedEfficient, handles writes
Sorted dataKeysetConsistent results
Real-time feedsCursor-basedHandles new items
Offset-Based (Simple)
http
GET /users?limit=20&offset=40

Response includes: limit, offset, total, currentPage

Cursor-Based (Scalable)
http
GET /users?limit=20&cursor=eyJpZCI6MTIzfQ==

Cursor is base64-encoded JSON with position information. Response includes: nextCursor, hasNext

For implementation details, see references/pagination-patterns.md

Rate Limiting

Token Bucket Algorithm
  • Each user has bucket with tokens
  • Each request consumes 1 token
  • Tokens refill at constant rate
  • Empty bucket rejects request
Rate Limit Headers
http
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 73
X-RateLimit-Reset: 1672531200

When exceeded (429):

http
Retry-After: 3600
Show full SKILL.md (327 more words)Show less
Strategies
  • Per User: 100 requests/hour
  • Per API Key: 1000 requests/hour
  • Per IP: 50 requests/hour (unauthenticated)
  • Tiered: Free (100/hr), Pro (1000/hr), Enterprise (10000/hr)

For implementation patterns, see references/rate-limiting.md

API Security Design

OAuth 2.0 Flows

Authorization Code Flow (Web Apps):

  1. Redirect user to authorization server
  2. User grants permission
  3. Exchange code for access token
  4. Use token for API requests

Client Credentials Flow (Service-to-Service):

  1. Authenticate with client ID and secret
  2. Receive access token
  3. Use token for API requests
Scope-Based Authorization

Define granular permissions:

read:users    - Read user data
write:users   - Create/update users
delete:users  - Delete users
admin:*       - Full admin access
API Key Management

Use header-based keys:

http
X-API-Key: sk_live_abc123xyz456

Best practices:

  • Prefix with environment: sk_live_*, sk_test_*
  • Store hashed keys only
  • Support key rotation
  • Track last-used timestamp

For complete security patterns, see references/authentication.md

OpenAPI Specification

Basic Structure
yaml
openapi: 3.1.0
info:
  title: User Management API
  version: 2.0.0

paths:
  /users:
    get:
      summary: List users
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserList'

OpenAPI enables:

  • Code generation (server stubs, client SDKs)
  • Validation (request/response checking)
  • Mock servers (testing against spec)
  • Documentation (interactive docs)

For complete OpenAPI examples, see examples/openapi/

AsyncAPI Specification

Event-Driven APIs

AsyncAPI defines message-based APIs (WebSockets, Kafka, MQTT):

yaml
asyncapi: 3.0.0
info:
  title: Order Events API

channels:
  orders/created:
    address: orders.created
    messages:
      orderCreated:
        payload:
          type: object
          properties:
            orderId:
              type: string

For AsyncAPI examples, see examples/asyncapi/

GraphQL Design

Schema Structure
graphql
type User {
  id: ID!
  username: String!
  posts(limit: Int): [Post!]!
}

type Query {
  user(id: ID!): User
  users(limit: Int): [User!]!
}

type Mutation {
  createUser(input: CreateUserInput!): User!
}
N+1 Problem Solution

Use DataLoader to batch requests:

javascript
const userLoader = new DataLoader(async (userIds) => {
  // Single query for all users
  const users = await db.users.findByIds(userIds);
  return userIds.map(id => users.find(u => u.id === id));
});

For GraphQL patterns, see references/graphql-design.md

Quick Reference Tables

Pagination Strategy Selection
ScenarioStrategy
Small datasetsOffset-based
Large datasetsCursor-based
Sorted dataKeyset
Real-time feedsCursor-based
Versioning Strategy Selection
FactorURL PathHeaderMedia Type
Visibility⭐⭐⭐⭐⭐⭐⭐⭐⭐
Simplicity⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Best ForMost APIsInternal APIsContent negotiation

Integration with Other Skills

  • api-patterns: Implement API designs in Express, FastAPI, Go
  • auth-security: Implement OAuth2, JWT, session management
  • database-design: Design database schemas for API resources
  • testing-strategies: API testing (integration, contract, load)
  • deploying-applications: Deploy and scale APIs
  • observability: Monitor API performance and errors

Additional Resources

Detailed guidance:

  • references/rest-design.md - RESTful patterns and best practices
  • references/graphql-design.md - GraphQL schema and resolver patterns
  • references/versioning-strategies.md - Comprehensive versioning guide
  • references/error-handling.md - RFC 7807 implementation details
  • references/pagination-patterns.md - Pagination implementation patterns
  • references/rate-limiting.md - Rate limiting algorithms and strategies
  • references/authentication.md - OAuth2, API keys, scopes
  • references/protocol-selection.md - Choosing the right API style

Working examples:

  • examples/openapi/ - Complete OpenAPI 3.1 specifications
  • examples/asyncapi/ - Event-driven API specifications
  • examples/graphql/ - GraphQL schemas and patterns

Validation and tooling:

  • scripts/validate-openapi.sh - Validate OpenAPI specifications

© ancoleman, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 12 other files (scripts, references) in skills/designing-apis of ancoleman/ai-design-components.

  • SKILL.md
  • examples/asyncapi/order-events.yaml
  • examples/graphql/schema.graphql
  • outputs.yaml
  • references/authentication.md
  • references/error-handling.md
  • references/graphql-design.md
  • references/pagination-patterns.md
  • references/protocol-selection.md
  • references/rate-limiting.md
  • references/rest-design.md
  • references/versioning-strategies.md
  • scripts/validate-openapi.sh

Open the folder on GitHubat commit 76551b7

Compare with similar skills

Designing APIs next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Designing APIs compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Designing APIs this skillancoleman/ai-design-components526—~2.6kAutomated safety check: PassMIT
API Auditbriiirussell/cybersecurity-skills413—~2.8kAutomated safety check: NotesMIT
Domain Webfjrevoredo/mini-diarium3081 repos~1kAutomated safety check: PassMIT
Discover APIrand/cc-polymath181—~1.5kAutomated safety check: PassMIT
API Architectcuriositech/some_claude_skills243—~1.4kAutomated safety check: PassMIT
Nodejs Backend Patternsever-works/ever-works16218 repos~4kAutomated safety check: PassAGPL-3.0

Similar skills

  • API Audit

    briiirussell/cybersecurity-skills

    Audit REST, GraphQL, and RPC APIs against the OWASP API Security Top 10 (2023).

    413 GitHub stars~2.8k tokensUpdated 4 mo ago
    Backend & APIsAuto-check: notes
  • Domain Web

    fjrevoredo/mini-diarium

    A skill your agent uses when building web services. An agent skill from fjrevoredo/mini-diarium.

    308 GitHub starsUsed in 1 repo~1k tokens
    Backend & APIsAuto-check passed
  • Discover API

    rand/cc-polymath

    Automatically discover API design skills when working with REST APIs, GraphQL schemas, API authentication, OAuth, JWT, rate limiting, API versioning, error handling, or endpoint design.

    181 GitHub stars~1.5k tokensUpdated 7 mo ago
    Backend & APIsAuto-check passed
  • API Architect

    curiositech/some_claude_skills

    Expert API designer for REST, GraphQL, gRPC architectures. An agent skill from curiositech/some_claude_skills.

    243 GitHub stars~1.4k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Nodejs Backend Patterns

    ever-works/ever-works

    Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices.

    162 GitHub starsUsed in 18 repos~4k tokens
    Backend & APIsAuto-check passed
  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 1 repo~2k tokens
    Backend & APIsAuto-check passed

More from ancoleman/ai-design-components

All 75 skills in this repo
  • Building AI Chat

    ancoleman/ai-design-components

    Builds AI chat interfaces and conversational UI with streaming responses, context management, and multi-modal support.

    526 GitHub stars~3.4k tokensUpdated 10 mo ago
    Auto-check passed
  • Building Forms

    ancoleman/ai-design-components

    Builds form components and data collection interfaces including contact forms, registration flows, checkout processes, surveys, and settings pages.

    526 GitHub stars~3.7k tokensUpdated 10 mo ago
    Auto-check passed
  • Building Tables

    ancoleman/ai-design-components

    Builds tables and data grids for displaying tabular information, from simple HTML tables to complex enterprise data grids.

    526 GitHub stars~1.8k tokensUpdated 10 mo ago
    Auto-check passed
  • Creating Dashboards

    ancoleman/ai-design-components

    Creates comprehensive dashboard and analytics interfaces that combine data visualization, KPI cards, real-time updates, and interactive layouts.

    526 GitHub stars~3.5k tokensUpdated 10 mo ago
    Auto-check passed
  • Designing Layouts

    ancoleman/ai-design-components

    Designs layout systems and responsive interfaces including grid systems, flexbox patterns, sidebar layouts, and responsive breakpoints.

    526 GitHub stars~1.7k tokensUpdated 10 mo ago
    Auto-check passed
  • Displaying Timelines

    ancoleman/ai-design-components

    Displays chronological events and activity through timelines, activity feeds, Gantt charts, and calendar interfaces.

    526 GitHub stars~2.7k tokensUpdated 10 mo ago
    Auto-check passed

Works with

Categories

Questions about Designing APIs

What does Designing APIs do?

Design APIs that are secure, scalable, and maintainable using RESTful, GraphQL, and event-driven patterns. Designing APIs is an agent skill from ancoleman/ai-design-components. Design APIs that are secure, scalable, and maintainable using RESTful, GraphQL, and event-driven patterns.

When should I use Designing APIs?

Designing APIs fits situations like: designing new APIs; evolving existing APIs; establishing API standards for teams.

How do I install Designing APIs in Claude Code?

Run `npx skills add ancoleman/ai-design-components --skill designing-apis -a claude-code`. Or copy the skill folder (skills/designing-apis in ancoleman/ai-design-components) into .claude/skills/designing-apis in your project. Claude Code loads it when a task matches its description.

How do I install Designing APIs in Codex?

Run `npx skills add ancoleman/ai-design-components --skill designing-apis -a codex`. Or copy the skill folder (skills/designing-apis in ancoleman/ai-design-components) into .agents/skills/designing-apis in your project. Codex loads it when a task matches its description.

Can I use Designing APIs in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ancoleman/ai-design-components --skill designing-apis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/designing-apis, .gemini/skills/designing-apis, .github/skills/designing-apis and .opencode/skills/designing-apis in your project.

What does Designing APIs need to run?

Going by SKILL.md and its folder, Designing APIs needs a shell for the scripts in its folder. Our summary lists: A Bash shell.

Does Designing APIs access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Designing APIs safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Designing APIs use?

Designing APIs is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Designing APIs use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 18k tokens, read only when the agent opens those files.

What are the alternatives to Designing APIs?

Skills that share tags, products or a category with Designing APIs: API Audit (briiirussell/cybersecurity-skills, 413 stars), Domain Web (fjrevoredo/mini-diarium, 308 stars), Discover API (rand/cc-polymath, 181 stars) and API Architect (curiositech/some_claude_skills, 243 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Designing APIs?

ancoleman (a GitHub user) maintains it in ancoleman/ai-design-components, which has 526 GitHub stars. The repository holds 75 skills in this directory. The repository was last updated on December 11, 2025.

Source: ancoleman/ai-design-components on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.