api-design

api-design is a skill for Claude Code from shennawardana23/skillme. It costs 56 tokens per session (871 once invoked), scanned A, original, Apache-2.0.

A guide to designing REST and RPC APIs, which are ways for software systems to communicate through defined operations and data formats. It covers request and response contracts, errors, validation, naming, pagination, and safe schema changes.

In plain words
What is it for?
It is for planning or reviewing API endpoints, defining their inputs and outputs, handling errors consistently, validating untrusted data at the boundary, and making additive or breaking schema changes.
Why use it?
It helps prevent clients from depending on inconsistent responses or undocumented behaviour that later becomes difficult to change.

Skill for Claude Code

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

Part of the skillme plugin — 137 skills, 2 commands shipped together

Good fit It is for planning or reviewing API endpoints, defining their inputs and outputs, handling errors consistently, validating untrusted data at the boundary, and making additive or breaking schema changes.

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

Made for: Claude Code.

Or install skillme, the plugin that ships this one along with the rest of its 137 skills, 2 commands.

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/shennawardana23/skillme/api-design/github.svg)](https://agentmods.dev/skills/shennawardana23/skillme/api-design)
Your own site
<a href="https://agentmods.dev/skills/shennawardana23/skillme/api-design"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/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/shennawardana23/skillme/api-design"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/api-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 871 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.00056 $0.00871
Opus 5 $0.00028 $0.00436
Sonnet 5 $0.00011 $0.00174
Haiku 4.5 $0.00006 $0.00087

Measured 9d ago against content hash f503ede1512e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 9d 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 · 83 lines

How it starts

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

API and Interface Design

Design interfaces that are hard to misuse: consistent error shape, additive changes only once a contract ships, and validation only at the boundary where untrusted input enters.

Hyrum's Law

With enough users of an API, every observable behavior becomes a de facto contract — regardless of what the documentation promises.

Undocumented quirks, error text, timing, and field ordering all become things someone depends on once observed. Design implication: don't expose what you're not willing to keep stable, and plan for deprecation at design time, not as an afterthought.

Core rules

  1. Contract first. Define the request/response types before implementing the handler.
  2. One error shape, everywhere.
    { "error": { "code": "VALIDATION_ERROR", "message": "email is required", "details": {} } }
    
    Never mix throwing, returning null, and returning {error} across different endpoints in the same API — the caller can't predict behavior.
  3. Validate at the boundary only. HTTP handlers, form submissions, and third-party API responses are untrusted; internal function calls that already received validated types are not — re-validating there is wasted code that obscures where the real boundary is.
  4. Additive changes only, once shipped. New optional fields are safe. Changing a field's type, removing a field, or changing status-code semantics for an existing endpoint is a breaking change — ship it as a new version or a new endpoint, never as a silent modification.
  5. Pagination on every list endpoint, from the first version — adding it later is itself a breaking change to response shape.

Gotchas

  • A PATCH that silently ignores unknown fields is easy to build and easy to misuse — a client sending a typo'd field name gets no error and no effect, and won't notice until data looks wrong days later. Reject unknown fields at the boundary instead of ignoring them.
  • REST resource URLs with verbs (/api/createTask) are a naming smell that correlates with inconsistent HTTP-method semantics elsewhere in the same API — grep for this pattern as a quick signal to review further.
  • A third-party API response is untrusted data even when the third party is a well-known vendor: validate its shape before using it in any decision or rendering path.

Read the full file on GitHub · 83 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. 9d ago First seen · 83 lines · 56 tokens per session scan A f503ede1512e

Subscribe to this mod's changes

api-design is a skill published in the GitHub repository shennawardana23/skillme (2 stars, last pushed 12d ago), licensed Apache-2.0. It adds 56 tokens to every session and 871 once invoked, about $0.0003 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

temporal-developer

Develop, debug, and manage Temporal applications across Python, TypeScript, Go, Java, .NET, Ruby, and Rust. Use when the user is building workflows, activities, or workers with a Temporal SDK, debugging issues like non-determinism errors, stuck workflows, or activity retries, using Temporal CLI, Temporal Server, or…

temporalio/skill-temporal-developer · 161 tokens

fastify-best-practices

A reference guide for building Fastify, a Node.js framework for web servers and REST APIs, with JavaScript or TypeScript. It covers routes, plugins, validation, errors, testing, logging, security, databases, and deployment.

sutchan/Agent-Skills-Hub · 0 tokens

insforge-cli

Use this skill whenever someone needs a backend, or when managing InsForge backend and cloud infrastructure with the InsForge CLI. For application code that calls InsForge from a frontend, backend, or edge function, use the insforge app-integration skill instead.

sutchan/Agent-Skills-Hub · 0 tokens

php-pro

A set of practices for building PHP applications with modern PHP, Laravel, or Symfony. PHP is a programming language commonly used for server-side web applications.

sutchan/Agent-Skills-Hub · 120 tokens

better-auth-best-practices

A guide for configuring Better Auth, a TypeScript authentication library, on the server and client. It covers database adapters, sessions, plugins, environment variables, migrations, and a basic health check.

sutchan/Agent-Skills-Hub · 67 tokens

insforge-debug

A troubleshooting guide for InsForge projects, covering their backend, database, command-line tool, local development, and deployments. InsForge is a backend and database service for applications.

sutchan/Agent-Skills-Hub · 0 tokens