api-design

api-design is a skill for Claude Code, Codex from SkillMedev/skills. It costs 155 tokens per session (1,546 once invoked), scanned A, original, MIT.

A guide to designing REST APIs, which are web interfaces that let software exchange data using standard web requests. It covers resource names, request methods, response codes, errors, pagination, and filtering.

In plain words
What is it for?
Use it to plan endpoint names and behavior, choose correct HTTP status codes, define error and list-response formats, and produce a specification for API consumers.
Why use it?
It prevents inconsistent endpoints and misleading responses that force every API user to add special cases. Clear rules are easier to build against and harder to break later.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to plan endpoint names and behavior, choose correct HTTP status codes, define error and list-response formats, and produce a specification for API consumers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/skillmedev/skills/api-design
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.

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

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/skillmedev/skills/api-design/github.svg)](https://agentmods.dev/skills/skillmedev/skills/api-design)
Your own site
<a href="https://agentmods.dev/skills/skillmedev/skills/api-design"><img src="https://agentmods.dev/badge/skills/skillmedev/skills/api-design/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for api-design

Your own site · 80×15
<a href="https://agentmods.dev/skills/skillmedev/skills/api-design"><img src="https://agentmods.dev/badge/skills/skillmedev/skills/api-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 155 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,546 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00155 $0.01546
Opus 5.5 $0.00062 $0.00618
Sonnet 5.5 $0.00031 $0.00309
Haiku 4.5 $0.00015 $0.00155

Measured 1mo ago against content hash 944dbc96ebeb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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 · 109 lines

How it starts

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

REST API Design

APIs are products: the consumer's mental model, not your database schema, decides the shape. The costly mistake this skill prevents is shipping an inconsistent surface - mixed naming, wrong status codes, offset pagination on a growing table - that every consumer then hardcodes around, making it effectively unfixable once integrated.

Operating procedure

Work in this order. Resources come before methods because method semantics depend on what the resource is; error and pagination contracts come before the spec is written because retrofitting them breaks consumers.

Step 1: gather inputs

Collect before designing. Label any assumption as a guess.

  1. The consumers: internal services, first-party clients, or external developers. External consumers raise the consistency bar - default to external if unknown.
  2. The core nouns of the domain and which ones own which (drives nesting).
  3. Expected collection sizes and growth. A list that can exceed ~10,000 rows rules out offset pagination.
  4. Read/write ratio and latency expectations per endpoint.
  5. Auth model (affects 401 vs 403 correctness).

Step 2: name resources

  • Plural nouns: /users, /orders, /products.
  • Nest one level for ownership: /users/{id}/orders. Do not nest deeper than two levels - flatten with filters instead (/orders?user_id=... beats /users/{id}/orders/{oid}/items/{iid}).
  • No verbs in paths; the HTTP method is the verb. For genuine actions that fit no CRUD verb (e.g. sending an invoice), model a subresource POST: POST /invoices/{id}/send-attempts.
  • Consistent case: kebab-case for multi-word path segments, snake_case for JSON fields - pick once, apply everywhere.

Step 3: assign methods and status codes

  • GET: read, idempotent, no request body. 200 with body.
  • POST: create. Return 201 plus a Location header pointing at the new resource. Return the created representation in the body so the client skips a follow-up GET.
  • PUT: full replace, idempotent. Missing fields mean "clear", not "keep".
  • PATCH: partial update (JSON Merge Patch or JSON Patch - state which in the spec).
  • DELETE: remove, idempotent, returns 204. Deleting an already-deleted resource returns 204 or 404 - pick one and document it.
  • Errors: 400 for malformed input, 401 for missing/invalid credentials, 403 for valid credentials without permission, 404 for absent resources (also use 404 instead of 403 when revealing existence is a leak), 409 for state conflicts, 422 for well-formed but semantically invalid input, 429 for rate limits (with Retry-After), 500 for server faults - never expose stack traces or internal identifiers.

Read the full file on GitHub · 109 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. 1mo ago Changed · +2 lines · -1 tokens per session 944dbc96ebeb
  2. 3mo ago First seen · 107 lines · 156 tokens per session scan A 221e583e98a5

Subscribe to this mod's changes

api-design is a skill published in the GitHub repository SkillMedev/skills (28 stars, last pushed 1mo ago), licensed MIT. It adds 155 tokens to every session and 1,546 once invoked, about $0.0006 per session on Opus 5.5. 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

api-design compared with skills from other repositories

api-design next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
api-designSkillMedev/skillsSkill281mo agoMITA155Claude Code, Codex
add-matrixnanocoai/nanoclawSkill31ktodayMITA19Claude Code
laravel-specialistJeffallan/claude-skillsSkill13ktodayMITA86Claude Code
django-storages-s3Jeffallan/claude-skillsSkill13ktodayMITA138Claude Code
websocket-engineerJeffallan/claude-skillsSkill13ktodayMITA36Claude Code
cognitoitsmostafa/aws-agent-skillsSkill1.2ktodayMITA38Claude Code
snsitsmostafa/aws-agent-skillsSkill1.2ktodayMITA32Claude Code