api-design

api-design is a skill for Claude Code from timwukp/agent-skills-best-practice. It costs 72 tokens per session (1,930 once invoked), scanned A, original, MIT.

A design guide for REST and GraphQL APIs. APIs are interfaces that let software systems exchange data and request actions.

In plain words
What is it for?
Use it to create an OpenAPI specification, plan REST endpoints, or design a GraphQL schema for resources, searches, updates, authentication, and error handling.
Why use it?
It helps teams choose consistent URLs, operations, response codes, errors, pagination, filtering, and versioning before implementation. This makes an API easier for other developers and applications to use.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the engineering-skills plugin — 18 skills shipped together

Good fit Use it to create an OpenAPI specification, plan REST endpoints, or design a GraphQL schema for resources, searches, updates, authentication, and error handling.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/timwukp/agent-skills-best-practice/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 timwukp/agent-skills-best-practice --skill api-design
Clone the repo
git clone --depth 1 https://github.com/timwukp/agent-skills-best-practice

Made for: Claude Code.

Or install engineering-skills, the plugin that ships this one along with the rest of its 18 skills.

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/timwukp/agent-skills-best-practice/api-design.svg)](https://agentmods.dev/skills/timwukp/agent-skills-best-practice/api-design)
Your own site
<a href="https://agentmods.dev/skills/timwukp/agent-skills-best-practice/api-design"><img src="https://agentmods.dev/badge/skills/timwukp/agent-skills-best-practice/api-design.svg" alt="Measured on agentmods" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,930 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Data Exfiltration · line 126
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
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.00072 $0.01930
Opus 5 $0.00036 $0.00965
Sonnet 5 $0.00014 $0.00386
Haiku 4.5 $0.00007 $0.00193

Measured 8d ago against content hash 567d727c51e7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 8d 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/skills/api-design/SKILL.md · 302 lines

How it starts

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

API Design

Instructions

Step 1: Gather Requirements

Ask:

  1. What resources does this API manage? (e.g., users, orders, products)
  2. What operations are needed? (CRUD, search, bulk operations, async jobs)
  3. Who consumes it? (internal services, public clients, mobile apps)
  4. Auth model? (API key, OAuth2, JWT)
  5. Output format preference? (OpenAPI 3.0 YAML, endpoint list, or both)

Step 2: Resource Naming

Apply these naming conventions:

Rule Good Bad
Plural nouns /users /user, /getUsers
Nested resources /users/{id}/orders /getUserOrders
Lowercase with hyphens /order-items /orderItems, /order_items
No verbs in URLs /users/{id}/activate (POST) /activateUser
Max 3 levels deep /users/{id}/orders /users/{id}/orders/{id}/items/{id}/reviews

For deeply nested resources, promote to top-level with query filters:

GET /reviews?order_id=123&user_id=456

Step 3: HTTP Methods and Status Codes

Map operations to methods:

Operation Method Success Code Response Body
List/Search GET 200 Collection
Get single GET 200 Resource
Create POST 201 Created resource + Location header
Full update PUT 200 Updated resource
Partial update PATCH 200 Updated resource
Delete DELETE 204 Empty
Async operation POST 202 Job status + Location header

Error codes to use consistently:

  • 400 - Malformed request (bad JSON, missing required field)
  • 401 - Not authenticated
  • 403 - Authenticated but not authorized
  • 404 - Resource not found
  • 409 - Conflict (duplicate, version mismatch)
  • 422 - Valid JSON but failed business validation
  • 429 - Rate limited
  • 500 - Server error (never expose internals)

Step 4: Pagination, Filtering, and Sorting

Pagination (cursor-based preferred for large datasets):

GET /orders?cursor=eyJpZCI6MTAwfQ&limit=25

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

Read the full file on GitHub · 302 lines

Files

What ships with it

2 files 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. 8d ago First seen · 302 lines · 72 tokens per session scan A 567d727c51e7

Subscribe to this mod's changes

api-design is a skill published in the GitHub repository timwukp/agent-skills-best-practice (10 stars, last pushed yesterday), licensed MIT. It adds 72 tokens to every session and 1,930 once invoked, about $0.0004 per session on Opus 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-31.

Related

Other skills, from other repositories

sns

AWS SNS notification service for pub/sub messaging. Use when creating topics, managing subscriptions, configuring message filtering, sending notifications, or setting up mobile push.

itsmostafa/aws-agent-skills · 32 tokens

api-gateway

AWS API Gateway for REST and HTTP API management. Use when creating APIs, configuring integrations, setting up authorization, managing stages, implementing rate limiting, or troubleshooting API issues.

itsmostafa/aws-agent-skills · 38 tokens

cognito

AWS Cognito user authentication and authorization service. Use when setting up user pools, configuring identity pools, implementing OAuth flows, managing user attributes, or integrating with social identity providers.

itsmostafa/aws-agent-skills · 38 tokens

sqs

AWS SQS message queue service for decoupled architectures. Use when creating queues, configuring dead-letter queues, managing visibility timeouts, implementing FIFO ordering, or integrating with Lambda.

itsmostafa/aws-agent-skills · 39 tokens

rust

Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook. Use when writing new Rust code, reviewing or refactoring existing code, deciding between borrowing vs cloning or ownership patterns, implementing error handling with Result types, optimizing Rust code for performance, or writing…

FilippoDeSilva/skills · 64 tokens

prowler-test-api

Testing patterns for Prowler API: JSON:API, Celery tasks, RLS isolation, RBAC. Trigger: When writing tests for api/ (JSON:API requests/assertions, cross-tenant isolation, RBAC, Celery tasks, viewsets/serializers).

prowler-cloud/prowler · 62 tokens