api-design

api-design is a skill for Claude Code, Codex from halflength-ampleness75/claude-code-recipes. It costs 0 tokens per session (1,864 once invoked), scanned A, original, MIT.

Guidance for designing web APIs using common REST conventions. A REST API is a set of web endpoints that applications use to read and change data, such as users or orders.

In plain words
What is it for?
Use it when defining endpoints, choosing HTTP methods, naming resources, handling related data, designing responses, or planning API versions.
Why use it?
Inconsistent URLs, request methods, status codes, pagination, filters, and error formats make APIs harder to use and maintain. These rules provide a shared structure for those choices.

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/halflength-ampleness75/claude-code-recipes/api-design
Any agent
npx skills add halflength-ampleness75/claude-code-recipes --skill api-design
Clone the repo
git clone --depth 1 https://github.com/halflength-ampleness75/claude-code-recipes

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for api-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/halflength-ampleness75/claude-code-recipes/api-design.svg)](https://agentmods.dev/skills/halflength-ampleness75/claude-code-recipes/api-design)
Your own site
<a href="https://agentmods.dev/skills/halflength-ampleness75/claude-code-recipes/api-design"><img src="https://agentmods.dev/badge/skills/halflength-ampleness75/claude-code-recipes/api-design.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,864 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.01864
Opus 5 $0.00000 $0.00932
Sonnet 5 $0.00000 $0.00373
Haiku 4.5 $0.00000 $0.00186

Measured 5d ago against content hash ec41ef86f211, 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 5d 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 · 228 lines

How it starts

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

API Design

REST API conventions: URL structure, HTTP methods, status codes, pagination, filtering, error responses, and versioning.

URL Structure

  1. Use nouns, not verbs — the HTTP method provides the verb
  2. Use plural resource names/users, /orders, /products
  3. Use kebab-case for multi-word resources/order-items, not /orderItems
  4. Nest resources to show relationships — max 2 levels deep
  5. Use query parameters for filtering, not path segments
# Good
GET    /api/v1/users
GET    /api/v1/users/123
GET    /api/v1/users/123/orders
POST   /api/v1/users
PATCH  /api/v1/users/123
DELETE /api/v1/users/123

# Bad
GET    /api/v1/getUsers
GET    /api/v1/user/123
POST   /api/v1/users/123/orders/456/items/789/notes   # too deeply nested

HTTP Methods

Method Purpose Idempotent Request Body Success Code
GET Read resource(s) Yes No 200
POST Create resource No Yes 201
PUT Replace resource entirely Yes Yes 200
PATCH Partial update No* Yes 200
DELETE Remove resource Yes No 204

*PATCH is not guaranteed idempotent, but should be designed to be when possible.

Rules

  1. GET requests must be safe — no side effects, no state changes
  2. POST for creation — return the created resource with Location header
  3. Use PATCH over PUT — partial updates are more practical than full replacement
  4. DELETE should be idempotent — deleting a non-existent resource returns 204, not 404

Status Codes

Use the correct status code. When in doubt, refer to this table:

Success (2xx)

Code Meaning When to Use
200 OK Successful GET, PUT, PATCH
201 Created Successful POST that creates a resource
204 No Content Successful DELETE, or PUT/PATCH with no response body

Client Errors (4xx)

Code Meaning When to Use
400 Bad Request Malformed JSON, invalid field values, validation errors
401 Unauthorized Missing or invalid authentication
403 Forbidden Authenticated but lacks permission
404 Not Found Resource does not exist
409 Conflict Duplicate resource, state conflict
422 Unprocessable Entity Valid JSON but fails business rules
429 Too Many Requests Rate limit exceeded

Read the full file on GitHub · 228 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 228 lines · 0 tokens per session scan A ec41ef86f211

Subscribe to this mod's changes

api-design is a skill published in the GitHub repository halflength-ampleness75/claude-code-recipes (2 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,864 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-31.

Related

Other skills, from other repositories

todos

This chat has a shared, live TODO plan — your tasks for the conversation, which the user also edits. Read this skill and reach for the todo tools whenever a request takes more than a couple of steps. It covers the plan model (group = task, items = its steps; loose items are the user's lane), how to work it: propose…

JetBrains/thinkrail · 127 tokens

writing-workflow-skills

Use when adding a new workflow skill to pi-thinkrail-workflow, changing an existing workflow skill's role, trigger, handoff, or structure, or checking a workflow skill against the workflow system's rules. Not for authoring general-purpose skills outside this package.

JetBrains/thinkrail · 60 tokens

writing-specs

Use when a workflow step drafts or revises a spec artifact — a goal-and-requirements, an architecture, or a module SPEC — or when a workflow skill names it at such a step. The shared quality bar for specs — not a workflow, nothing to execute.

JetBrains/thinkrail · 59 tokens

clarify

Adaptive requirements clarification with auto-depth routing. Shallow (Q&A) for simple tasks, Deep (exploration + DRAFT + PLAN) for complex ones. Escalates automatically when ambiguity persists.

mag123c/toktrack · 43 tokens

ai-ml-development

AI and machine learning development with PyTorch, TensorFlow, and LLM integration. Use when building ML models, training pipelines, fine-tuning LLMs, or implementing AI features.

travisjneuman/.claude · 43 tokens

authentication-patterns

OAuth 2.0, JWT, SSO, MFA, NextAuth/Clerk/Supabase Auth implementation patterns.

travisjneuman/.claude · 28 tokens