api-design

api-design is a skill for Claude Code, Codex from OKHP3/skillz. It costs 96 tokens per session (1,037 once invoked), scanned A, original, MIT.

A guide for designing interfaces that other programs, teams, or users will depend on, such as REST endpoints, remote procedure calls, library functions, command-line commands, or event messages.

In plain words
What is it for?
Use it before implementing a public API, library surface, command-line interface, or event-data contract.
Why use it?
It helps avoid interfaces that expose internal database details or are awkward and difficult to change later. The design starts from how callers need to use the interface.

Skill for Claude CodeCodex

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

Good fit Use it before implementing a public API, library surface, command-line interface, or event-data contract.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/okhp3/skillz/api-design
View source ↗ OKHP3/skillz
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 OKHP3/skillz --skill api-design
Clone the repo
git clone --depth 1 https://github.com/OKHP3/skillz

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/okhp3/skillz/api-design/github.svg)](https://agentmods.dev/skills/okhp3/skillz/api-design)
Your own site
<a href="https://agentmods.dev/skills/okhp3/skillz/api-design"><img src="https://agentmods.dev/badge/skills/okhp3/skillz/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/okhp3/skillz/api-design"><img src="https://agentmods.dev/badge/skills/okhp3/skillz/api-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 96 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,037 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.00096 $0.01037
Opus 5.5 $0.00038 $0.00415
Sonnet 5.5 $0.00019 $0.00207
Haiku 4.5 $0.00010 $0.00104

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

community/api-design/SKILL.md · 98 lines

How it starts

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

API design

An API is a promise. Implementation is cheap to change; a published interface is not, because every caller has to move with you. Design it as though you cannot change it, because roughly speaking you cannot.

Design from the caller's side. Write the code that calls your API before you write the API. If that code is awkward, the design is wrong, and you have found out in two minutes instead of after three teams have integrated.

1. Model the domain, not the storage

The most common failure is exposing your database schema through HTTP. It couples every consumer to your internal structure, so a routine table split becomes everyone's migration.

Name resources and operations in the language your users use, not your tables. If a caller must understand your persistence model to use the API, the abstraction has already failed.

Done when: you could change the storage layer without touching the interface.

2. Make the wrong call impossible

Design so misuse does not compile, or fails immediately and clearly:

  • Required things are required. Not optional-with-a-runtime-check.
  • Enums over free strings for anything with a fixed set of values.
  • Distinct types over booleans. create(user, true, false) is unreadable at the call site and easy to get backwards.
  • No parameter whose valid values the caller has to guess.
  • Reject unknown fields rather than silently ignoring them — a typo'd field name that is quietly dropped is a bug that surfaces days later.

Done when: a caller who ignores the docs still cannot fail silently.

3. Design the errors as carefully as the successes

Errors are half the interface and usually get a tenth of the thought.

  • A stable machine-readable code, separate from the human message. Callers branch on the code; the message is free to change.
  • Say what to do, not only what went wrong. "Order not found — it may belong to another account" beats "404".
  • Distinguish retryable from terminal. A caller cannot back off correctly without this.
  • Never leak internals: stack traces, SQL, internal hostnames.
  • Be consistent. One error shape across the whole surface.

Read the full file on GitHub · 98 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. 2mo ago First seen · 98 lines · 96 tokens per session scan A d04116d3be9f

Subscribe to this mod's changes

api-design is a skill published in the GitHub repository OKHP3/skillz (4 stars, last pushed 3d ago), licensed MIT. It adds 96 tokens to every session and 1,037 once invoked, about $0.0004 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-09-03.

Related

api-design compared with skills from other repositories

api-design next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
api-designOKHP3/skillzSkill43d agoMITA96Claude Code, Codex
feature-workflowsiva01c/claude-pluginsSkill1625d agoMITA101Claude Code
drupal-module-developmentsiva01c/claude-pluginsSkill1625d agoMITA29Claude Code
houtu-dependencieslujiafa/houtu-project-skillsSkill266mo agoMITA283Claude Code, Codex
scale-to-millionsRudra-narayan-muduli-001/Scale-to-MillionsSkill23mo agoMITA130Claude Code, Codex
microservices-designfabiandistler/agentsSkill2yesterdaynoneA48Claude Code, Codex
web-auth-integrator0x-Professor/Agent-Skills-HubSkill129mo agoApache-2.0A20Claude Code, Codex