Agent skill

API Design Patterns

by rohitg00 in rohitg00/awesome-claude-code-toolkit

REST API design with resource naming, pagination, versioning, and OpenAPI spec generation

Apache-2.0Auto-check passedBackend & APIs

Install API Design Patterns

skills CLI
$ npx skills add rohitg00/awesome-claude-code-toolkit --skill api-design-patterns -a claude-code

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

GitHub CLI
$ gh skill install rohitg00/awesome-claude-code-toolkit api-design-patterns --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/rohitg00/awesome-claude-code-toolkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/api-design-patterns .claude/skills/api-design-patterns && 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
api-design-patterns
GitHub stars
2.7k
Token cost
~1.2k tokens
SKILL.md length
299 words
Files
1
Skills in repo
37
Repo updated
First seen
Licence
Apache-2.0

At a glance

REST API design with resource naming, pagination, versioning, and OpenAPI spec generation

  • Tasks that involve API design
  • SKILL.md covers Resource Naming, HTTP Methods, Status Codes and Error Response Format, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve OpenAPI specifications

What it does

API Design Patterns is an agent skill from rohitg00/awesome-claude-code-toolkit. REST API design with resource naming, pagination, versioning, and OpenAPI spec generation

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering API design, OpenAPI specifications and REST APIs. It works with OpenAPI. The repository describes itself as: The most comprehensive toolkit for Claude Code -- 135 agents, 35 curated skills, 42 commands, 176+ plugins, 20 hooks, 15 rules, 7 templates, 14 MCP configs, 26 companion apps, 52… The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve API design
  • Tasks that involve OpenAPI specifications
  • Tasks that involve REST APIs

Example prompts

  • “/api-design-patterns”

What it can do on your machine

Read from SKILL.md and the folder at commit ebdf1d5. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json and yaml).

    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

API Design Patterns loads about 1.2k tokens when it runs. Until then it costs about 27 tokens; SKILL.md has 299 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~27
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from rohitg00/awesome-claude-code-toolkit at commit ebdf1d5, republished under its Apache-2.0 licence (© rohitg00). 299 words, ~1,201 tokens.

Download SKILL.mdSave it as .claude/skills/api-design-patterns/SKILL.md (or your agent's skills folder).
name
api-design-patterns
description
REST API design with resource naming, pagination, versioning, and OpenAPI spec generation

API Design Patterns

Resource Naming

  • Use plural nouns: /users, /orders, /products
  • Nest for relationships: /users/{id}/orders
  • Max nesting depth: 2 levels. Beyond that, use query params or top-level resources
  • Use kebab-case: /user-profiles, not /userProfiles
  • Never put verbs in URLs: /users/{id}/activate is wrong, use POST /users/{id}/activation

HTTP Methods

MethodPurposeIdempotentRequest BodySuccess Code
GETRead resource(s)YesNo200
POSTCreate resourceNoYes201
PUTFull replaceYesYes200
PATCHPartial updateNoYes200
DELETERemove resourceYesNo204

Return Location header on POST with the URL of the created resource.

Status Codes

200 OK              - Successful read/update
201 Created         - Successful creation
204 No Content      - Successful delete
400 Bad Request     - Validation error (include field-level errors)
401 Unauthorized    - Missing or invalid authentication
403 Forbidden       - Authenticated but not authorized
404 Not Found       - Resource does not exist
409 Conflict        - State conflict (duplicate, version mismatch)
422 Unprocessable   - Semantically invalid (valid JSON, bad values)
429 Too Many Reqs   - Rate limited (include Retry-After header)
500 Internal Error  - Unhandled server error (never expose stack traces)

Error Response Format

json
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Request validation failed",
    "details": [
      { "field": "email", "message": "Must be a valid email address" },
      { "field": "age", "message": "Must be at least 18" }
    ]
  }
}

Use consistent error codes across the API. Document every code in your API reference.

Cursor-Based Pagination (preferred)

GET /users?limit=20&cursor=eyJpZCI6MTAwfQ

Response:
{
  "data": [...],
  "pagination": {
    "next_cursor": "eyJpZCI6MTIwfQ",
    "has_more": true
  }
}

Use cursor pagination for large or frequently changing datasets. Encode cursors as opaque base64 strings. Never expose raw IDs in cursors.

Offset-Based Pagination (simple cases only)

GET /users?page=3&per_page=20

Response:
{
  "data": [...],
  "pagination": {
    "page": 3,
    "per_page": 20,
    "total": 245,
    "total_pages": 13
  }
}

Only use offset pagination when total count is cheap and dataset is small.

Filtering and Sorting

GET /orders?status=pending&created_after=2025-01-01&sort=-created_at,+total
GET /products?category=electronics&price_min=100&price_max=500
GET /users?search=john&fields=id,name,email

Use field selection (fields param) to reduce payload size. Prefix sort fields with - for descending.

Versioning

Prefer URL path versioning for simplicity:

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

Rules:

  • Never break v1 once published. Add fields, never remove them.
  • New required fields = new version
  • Deprecate old versions with Sunset header and 6-month notice
  • Support at most 2 active versions simultaneously

Request/Response Headers

Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>
X-Request-Id: <uuid>          # For tracing
X-RateLimit-Limit: 100        # Requests per window
X-RateLimit-Remaining: 47     # Remaining in window
X-RateLimit-Reset: 1700000000 # Window reset Unix timestamp
Retry-After: 30               # Seconds until rate limit resets

Always return X-Request-Id in responses for debugging.

OpenAPI Spec Guidelines

  • Write spec first, then implement (spec-driven development)
  • Use $ref for shared schemas: $ref: '#/components/schemas/User'
  • Define examples for every endpoint
  • Use oneOf/anyOf for polymorphic responses
  • Generate client SDKs from the spec, never hand-write them
  • Validate requests against the spec in middleware
yaml
paths:
  /users/{id}:
    get:
      operationId: getUser
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: User found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '404':
          $ref: '#/components/responses/NotFound'

Rate Limiting Strategy

  • Apply per-user, per-endpoint limits
  • Use sliding window algorithm (not fixed window)
  • Return 429 with Retry-After header
  • Exempt health check and auth endpoints from rate limits
  • Log rate-limited requests for abuse detection

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

Files

Just SKILL.md in skills/api-design-patterns of rohitg00/awesome-claude-code-toolkit.

Open the folder on GitHubat commit ebdf1d5

Compare with similar skills

API Design Patterns 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.

API Design Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
API Design Patterns this skillrohitg00/awesome-claude-code-toolkit2.7k—~1.2kAutomated safety check: PassApache-2.0
API DesignerJeffallan/claude-skills12k2 repos~2kAutomated safety check: PassMIT
Old Coder API DesignAmazingAng/old-coder7491 repos~3.4kAutomated safety check: PassMIT
OpenAPI Spec Generationwshobson/agents40k9 repos~511Automated safety check: PassMIT
API DesignWrongStack/WrongStack368—~1.3kAutomated safety check: PassMIT
API Contract Designrsmdt/the-startup536—~1.1kAutomated safety check: PassMIT

Similar skills

  • 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 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • Old Coder API Design

    AmazingAng/old-coder

    Reviews or designs an HTTP/JSON API's endpoints, auth, pagination, versioning and deprecations, guarding against inventing a bespoke interface or silently breaking consumers.

    749 GitHub starsUsed in 1 repo~3.4k tokens
    Backend & APIsAuto-check passed
  • Create, validate and maintain OpenAPI 3.1 specs for REST APIs, whether designed first or generated from existing code, and use them for docs and client SDKs.

    40k GitHub starsUsed in 9 repos~511 tokens
    Backend & APIsAuto-check passed
  • API Design

    WrongStack/WrongStack

    A skill your agent uses when designing, implementing, or reviewing an HTTP API — endpoints, request and response shapes, errors, pagination, versioning, and authorization.

    368 GitHub stars~1.3k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • API Contract Design

    rsmdt/the-startup

    REST and GraphQL API design patterns, OpenAPI/Swagger specifications, versioning strategies, and authentication patterns.

    536 GitHub stars~1.1k tokensUpdated 2 mo ago
    Backend & APIsAuto-check passed
  • API Design

    epam/ai-dial-chat

    Design, review, or change HTTP API contracts for AI DIAL Chat.

    504 GitHub stars~1.2k tokensUpdated today
    Backend & APIsAuto-check passed

More from rohitg00/awesome-claude-code-toolkit

All 37 skills in this repo
  • Accessibility Wcag

    rohitg00/awesome-claude-code-toolkit

    Web accessibility patterns for WCAG 2.2 compliance including ARIA, keyboard navigation, screen readers, and testing

    2.7k GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed
  • Authentication Patterns

    rohitg00/awesome-claude-code-toolkit

    Authentication and authorization patterns including OAuth2, JWT, RBAC, session management, and PKCE flows

    2.7k GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed
  • AWS Cloud Patterns

    rohitg00/awesome-claude-code-toolkit

    AWS cloud patterns for Lambda, ECS, S3, DynamoDB, and Infrastructure as Code with CDK/Terraform

    2.7k GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • CI CD Pipelines

    rohitg00/awesome-claude-code-toolkit

    CI/CD pipeline patterns for GitHub Actions, GitLab CI, testing strategies, and deployment automation

    2.7k GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Continuous Learning

    rohitg00/awesome-claude-code-toolkit

    Auto-extract patterns from coding sessions, track corrections, and build reusable knowledge with confidence scoring

    2.7k GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed
  • Data Engineering

    rohitg00/awesome-claude-code-toolkit

    Data engineering patterns for ETL pipelines, data warehousing, Apache Spark, and data quality validation

    2.7k GitHub stars~1.7k tokensUpdated 4 mo ago
    Auto-check passed

Works with

Categories

Questions about API Design Patterns

What does API Design Patterns do?

REST API design with resource naming, pagination, versioning, and OpenAPI spec generation. API Design Patterns is an agent skill from rohitg00/awesome-claude-code-toolkit.

When should I use API Design Patterns?

API Design Patterns fits situations like: tasks that involve API design; tasks that involve OpenAPI specifications; tasks that involve REST APIs.

How do I install API Design Patterns in Claude Code?

Run `npx skills add rohitg00/awesome-claude-code-toolkit --skill api-design-patterns -a claude-code`. Or copy the skill folder (skills/api-design-patterns in rohitg00/awesome-claude-code-toolkit) into .claude/skills/api-design-patterns in your project. Claude Code loads it when a task matches its description.

How do I install API Design Patterns in Codex?

Run `npx skills add rohitg00/awesome-claude-code-toolkit --skill api-design-patterns -a codex`. Or copy the skill folder (skills/api-design-patterns in rohitg00/awesome-claude-code-toolkit) into .agents/skills/api-design-patterns in your project. Codex loads it when a task matches its description.

Can I use API Design Patterns 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 rohitg00/awesome-claude-code-toolkit --skill api-design-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/api-design-patterns, .gemini/skills/api-design-patterns, .github/skills/api-design-patterns and .opencode/skills/api-design-patterns in your project.

What does API Design Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: API Design Patterns is instructions for the agent only.

Does API Design Patterns 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 API Design Patterns 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. Review the folder before installing.

What licence does API Design Patterns use?

API Design Patterns is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does API Design Patterns use?

About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to API Design Patterns?

Skills that share tags, products or a category with API Design Patterns: API Designer (Jeffallan/claude-skills, 12k stars), Old Coder API Design (AmazingAng/old-coder, 749 stars), OpenAPI Spec Generation (wshobson/agents, 40k stars) and API Design (WrongStack/WrongStack, 368 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains API Design Patterns?

rohitg00 (a GitHub user) maintains it in rohitg00/awesome-claude-code-toolkit, which has 2,683 GitHub stars. The repository holds 37 skills in this directory. The repository was last updated on May 12, 2026.

Source: rohitg00/awesome-claude-code-toolkit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.