api-design

A guide to designing web APIs, including REST APIs and GraphQL APIs. It covers resource names, HTTP status codes, response formats, and related practices.

In plain words
What is it for?
Use it when planning endpoints, choosing status codes, structuring responses, or reviewing an API design.
Why use it?
It helps keep an API predictable for the programs that use it and makes success and error responses easier to understand.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/nth5693/gemini-kit/api-design
Any agent
npx skills add nth5693/gemini-kit --skill api-design
Clone the repo
git clone --depth 1 https://github.com/nth5693/gemini-kit

Made for: Claude Code, Codex.

Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 700 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00700
Opus 5 $0.00000 $0.00350
Sonnet 5 $0.00000 $0.00140
Haiku 4.5 $0.00000 $0.00070

Measured 3d ago against content hash 287680c27aa1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

api-design scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/api-design/SKILL.md · 135 lines

How it starts

The opening of the file, as written. The whole thing — 135 lines — stays where its author put it; the contents beside it link to each section on GitHub.

API Design Skill

Overview

RESTful API patterns, GraphQL design, and API best practices.

RESTful Design Principles

1. Resource Naming

✅ Good:
GET    /users          # List users
GET    /users/123      # Get user
POST   /users          # Create user
PUT    /users/123      # Update user
DELETE /users/123      # Delete user

❌ Bad:
GET /getUsers
POST /createUser
GET /user/delete/123

2. HTTP Status Codes

// Success
200 OK           - Successful GET/PUT
201 Created      - Successful POST
204 No Content   - Successful DELETE

// Client Errors
400 Bad Request      - Invalid input
401 Unauthorized     - Auth required
403 Forbidden        - No permission
404 Not Found        - Resource doesn't exist
422 Unprocessable    - Validation failed

// Server Errors
500 Internal Error   - Server bug
503 Service Unavailable - Maintenance

3. Response Format

// Success response
{
  "data": {
    "id": "123",
    "name": "John",
    "email": "[email protected]"
  }
}

// Error response
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Email is required",
    "details": [
      { "field": "email", "message": "This field is required" }
    ]
  }
}

// List with pagination
{
  "data": [...],
  "meta": {
    "page": 1,
    "perPage": 20,
    "total": 150,
    "totalPages": 8
  }
}

4. Pagination

// Offset-based
GET /posts?page=2&limit=20

// Cursor-based (better for large datasets)
GET /posts?cursor=abc123&limit=20

5. Filtering & Sorting

// Filtering
GET /posts?status=published&author=123

// Sorting
GET /posts?sort=-createdAt,title  // - for DESC

API Versioning

// URL versioning (recommended)
GET /api/v1/users

// Header versioning
GET /api/users
Accept: application/vnd.myapp.v1+json

Rate Limiting

import rateLimit from 'express-rate-limit';

const limiter = rateLimit({
  windowMs: 15 * 60 * 1000, // 15 minutes
  max: 100, // 100 requests per window
  message: { error: 'Too many requests' },
});

app.use('/api/', limiter);

Read the full file on GitHub · 135 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 135 lines · 0 tokens per session scan A 287680c27aa1

Subscribe to this mod's changes

api-design is a skill published in the GitHub repository nth5693/gemini-kit (375 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 700 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

triage-issue

Investigate a reported bug to root cause, then emit a TDD-shaped fix plan as an issue artifact. Trigger when the user reports a bug, says "triage", asks for issue investigation, or wants a fix plan before code changes.

OutlineDriven/odin-gemini-cli-extension · 54 tokens

minimalist-general

Subtraction-first thinking for non-coding tasks: writing, planning, research, summarizing, decision-making, or any request that isn't producing code. Same discipline as the minimalist coding skill — question whether the ask is even needed, reuse what already exists, do the smallest thing that fully answers it …

DivyeshJayswal/minimalist · 160 tokens

minimalist

Subtraction-first engineering for any coding task. Use when writing, fixing, refactoring, reviewing, or designing code; when choosing dependencies; or whenever the user asks for minimalist, less code, simplest thing, YAGNI, or complains about bloat. Prefer deletion, existing code, stdlib, and native platform features…

DivyeshJayswal/minimalist · 77 tokens

minimalist-audit

Audit a codebase or directory for deletion candidates: dead code, unused dependencies, single-use abstractions, config that never varies, and duplicated helpers. Use when the user says "minimalist audit" or asks what can be deleted from a project.

DivyeshJayswal/minimalist · 55 tokens

minimalist-gain

Report what minimalist actually measured in this session or project — LOC avoided, scope rejected, dependencies declined. Use when the user says "minimalist gain", "what did you save", or asks for the savings report.

DivyeshJayswal/minimalist · 48 tokens

minimalist-review

Review code, a diff, or a PR strictly for bloat: unrequested abstractions, dead scope, dependency creep, symptom-patching, and drive-by changes. Use when the user says "minimalist review", asks "is this over-engineered?", or wants a leanness review of a change.

DivyeshJayswal/minimalist · 67 tokens