api-design

api-design is a skill for Claude Code, Codex from CODE-SAURABH/OpenSkills. It costs 79 tokens per session (3,735 once invoked), scanned A, original, MIT.

A set of guidance for designing APIs, the interfaces that software uses to exchange data, across REST, GraphQL, gRPC, and WebSocket systems.

In plain words
What is it for?
Defining API contracts, endpoints, request and response formats, versioning, error handling, and the choice between common API styles.
Why use it?
It helps prevent inconsistent endpoints, unclear errors, breaking changes, and confusing behavior for developers using the API.

Skill for Claude CodeCodex

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

Good fit Defining API contracts, endpoints, request and response formats, versioning, error handling, and the choice between common API styles.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/code-saurabh/openskills/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 CODE-SAURABH/OpenSkills --skill api-design
Clone the repo
git clone --depth 1 https://github.com/CODE-SAURABH/OpenSkills

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/code-saurabh/openskills/api-design/github.svg)](https://agentmods.dev/skills/code-saurabh/openskills/api-design)
Your own site
<a href="https://agentmods.dev/skills/code-saurabh/openskills/api-design"><img src="https://agentmods.dev/badge/skills/code-saurabh/openskills/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/code-saurabh/openskills/api-design"><img src="https://agentmods.dev/badge/skills/code-saurabh/openskills/api-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,735 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.00079 $0.03735
Opus 5.5 $0.00032 $0.01494
Sonnet 5.5 $0.00016 $0.00747
Haiku 4.5 $0.00008 $0.00374

Measured 1mo ago against content hash 7d404bad4212, 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.

api-design/SKILL.md · 405 lines

How it starts

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

API Design

Approach every API as a product. The developer calling your API is your user. An API that is hard to understand, inconsistent, or unpredictable is a broken product — even if it technically works.

Design the API before writing a single line of implementation. An API is a contract. Changing it after clients depend on it is expensive. Getting it right upfront is cheap.


API Design Principles

  • Spec first, implement second. Write the OpenAPI spec, GraphQL schema, or proto file before any implementation. The spec is the contract. Implementation details are irrelevant to the caller.
  • Consistency is the most important quality. Every endpoint in an API should behave according to the same rules: same error format, same naming convention, same pagination pattern, same auth mechanism. Inconsistency forces callers to write special-case code for every endpoint.
  • APIs are forever. Every field you add is a field you must support until you version or sunset the API. Every field you remove is a breaking change. Design with permanence in mind.
  • Design for the caller, not the data model. Your database schema is an implementation detail. Your API shape should reflect what callers need, not what your ORM produces.
  • Explicit over implicit. Undefined behaviour in an API becomes the behaviour callers depend on. Make every behaviour explicit: required vs optional fields, error codes, rate limits, pagination behaviour at the end of a list.
  • Developer experience is a first-class requirement. An API that requires a PhD to understand will not be adopted. Good error messages, consistent naming, and accurate documentation are as important as correct behaviour.

Step 0: Ground the API Design

Before designing any endpoint, answer these questions:

  1. Who is the caller? Internal service, third-party developer, mobile app, browser, CLI? Each has different needs (auth mechanism, response size, error verbosity).
  2. What resources does the API expose? List the core domain entities the API manages.
  3. What operations does each resource support? CRUD is not always the right decomposition — sometimes cancel, approve, publish are better verbs than generic CRUD.
  4. What are the read/write patterns? High-read, low-write? Real-time? Bulk operations? Streaming? This determines the API style.
  5. What are the latency and payload size constraints? A mobile API on a 3G connection has different constraints than a backend-to-backend integration.
  6. What versioning strategy is needed from day one? If this API will have external consumers, versioning must be designed in before the first endpoint ships.

Read the full file on GitHub · 405 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. 1mo ago First seen · 405 lines · 79 tokens per session scan A 7d404bad4212

Subscribe to this mod's changes

api-design is a skill published in the GitHub repository CODE-SAURABH/OpenSkills (3 stars, last pushed 2mo ago), licensed MIT. It adds 79 tokens to every session and 3,735 once invoked, about $0.0003 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-31.

Related

Other skills, from other repositories

better-auth

Skill for integrating Better Auth - comprehensive TypeScript authentication framework for Cloudflare D1, Next.js, Nuxt, and 15+ frameworks. Use when adding auth, encountering D1 adapter errors, or implementing OAuth/2FA/RBAC features.

secondsky/claude-skills · 53 tokens

cloudflare-durable-objects

Cloudflare Durable Objects for stateful coordination and real-time apps. Use for chat, multiplayer games, WebSocket hibernation, or encountering class export, migration, alarm errors.

secondsky/claude-skills · 43 tokens

cloudflare-images

This skill should be used when the user asks to "upload images to Cloudflare", "implement direct creator upload", "configure image transformations", "optimize WebP/AVIF", "create image variants", "generate signed URLs", "add image watermarks", "integrate with Next.js/Remix", "configure webhooks", "debug CORS errors"…

secondsky/claude-skills · 104 tokens

cloudflare-queues

This skill should be used when the user asks to "set up Cloudflare Queues", "create a message queue", "implement queue consumer", "process background jobs", "configure queue retry logic", "publish messages to queue", "implement dead letter queue", or encountering "queue timeout", "message retry", "throughput…

secondsky/claude-skills · 78 tokens

cloudflare-r2

Cloudflare R2 S3-compatible object storage. Use for buckets, uploads, CORS, presigned URLs, or encountering R2ERROR, CORS failures, multipart issues.

secondsky/claude-skills · 41 tokens

cloudflare-email-routing

Cloudflare Email Routing for receiving/sending emails via Workers. Use for email workers, forwarding, allowlists, or encountering Email Trigger errors, worker call failures, SPF issues.

secondsky/claude-skills · 40 tokens