api-design

api-design is a skill for Claude Code, Codex from ericrisco/rsc-harness. It costs 105 tokens per session (3,080 once invoked), scanned A, original, MIT.

A guide for defining the contract of an API, the rules that tell clients which URLs, requests, responses, errors, and paging behavior to expect.

In plain words
What is it for?
Use it to choose REST, GraphQL, or a combination; define resources and URLs, versioning, error responses, pagination, and safe handling of repeated requests.
Why use it?
It settles these decisions before anyone writes server code, reducing incompatible client expectations and repeated redesign. It can capture the result as an OpenAPI 3.1 document, a standard machine-readable API description.

Skill for Claude CodeCodex

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

Good fit Use it to choose REST, GraphQL, or a combination; define resources and URLs, versioning, error responses, pagination, and safe handling of repeated requests.

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

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/ericrisco/rsc-harness/api-design/github.svg)](https://agentmods.dev/skills/ericrisco/rsc-harness/api-design)
Your own site
<a href="https://agentmods.dev/skills/ericrisco/rsc-harness/api-design"><img src="https://agentmods.dev/badge/skills/ericrisco/rsc-harness/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/ericrisco/rsc-harness/api-design"><img src="https://agentmods.dev/badge/skills/ericrisco/rsc-harness/api-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 105 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,080 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: 3 findings, up to high

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 →

  • high Tool Misuse · line 45
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • medium Data Exfiltration · line 78
    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.
  • medium Data Exfiltration · line 135
    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.00105 $0.03080
Opus 5.5 $0.00042 $0.01232
Sonnet 5.5 $0.00021 $0.00616
Haiku 4.5 $0.00011 $0.00308

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

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/verify.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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 · 183 lines

How it starts

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

API design

Your one job

You design the contract an API exposes. You do not write the handler. The deliverable is a set of decisions a backend skill can implement directly: resource shapes, URLs, methods, the status-code map, one error envelope, pagination params, versioning rules — ideally captured as an OpenAPI 3.1 document.

When the user names a framework (FastAPI, NestJS, Go, Node), they own the build; you are pulled in for contract questions. Settle the contract first, then hand off (see Handoff). Keep every decision framework-neutral: nothing here should mention an ORM, a router, or a DI container.

REST vs GraphQL vs hybrid

Pick on traffic shape, not fashion. Decide once, write it down.

Situation Choose Why
CRUD-ish resources, public API, HTTP caching matters REST URLs map to resources; CDN/proxy caching works on GET + ETag out of the box
Many client shapes, deep nested graphs, mobile over-fetch is real GraphQL one round-trip, client picks fields; no N endpoints per screen
Stable resource API + one rich read surface for a client app Hybrid REST for the system of record, a GraphQL read layer on top

Operational gotcha that decides monitoring: GraphQL returns HTTP 200 even when a field errored — failures live in an errors[] array next to partial data. Your dashboards cannot alert on 5xx; you must alert on the errors[] payload. REST signals failure with the HTTP status itself. If your ops team lives on status-code SLOs, that is a point for REST. Schema/nullability design, mutation and error-union conventions, and this error model in full: references/graphql-design.md.

Resource & URL modeling

Resources are nouns; HTTP methods are the verbs. Never put a verb in a path.

Rules, each with its reason:

  • Plural collections, consistent everywhere — /projects, /projects/{id}. Pick plural and never mix singular in; inconsistent naming is the most-cited design smell.
  • Nest sub-resources one level — /projects/{id}/tasks. Deeper than one level (/projects/{p}/tasks/{t}/comments/{c}) gets unreadable; link to the flat resource instead (/comments/{c}).
  • Methods carry intent — GET read, POST create, PUT full replace, PATCH partial update, DELETE remove. A path never says what it does.
  • Filter/sort/select via query string, not new paths — ?status=open&sort=-created_at&fields=id,title. One GET /projects handles all of it; don't mint /projects/open and /projects/byDate.

Read the full file on GitHub · 183 lines

Files

What ships with it

7 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. 1mo ago First seen · 183 lines · 105 tokens per session scan A 4758665caa06

Subscribe to this mod's changes

api-design is a skill published in the GitHub repository ericrisco/rsc-harness (227 stars, last pushed today), licensed MIT. It adds 105 tokens to every session and 3,080 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-08-30.

Related

Other skills, from other repositories

api-design

Use when designing REST or GraphQL APIs, defining endpoints, implementing pagination/filtering, handling API versioning, or establishing API documentation with OpenAPI/Swagger.

MadAppGang/claude-code · 35 tokens

api-design-patterns

Comprehensive REST and GraphQL API design patterns with versioning, pagination, error handling, and HATEOAS principles. Use when designing APIs, defining endpoints, or architecting service contracts requiring production-grade patterns.

NickCrew/Claude-Cortex · 48 tokens

api-designer

Designs production-grade APIs — REST, GraphQL, gRPC, and AsyncAPI patterns including pagination, versioning, error handling, rate limiting, and API governance. Use when the user asks to design APIs, create endpoints, build an API layer, write OpenAPI specs, or needs help with REST/GraphQL/gRPC service design.

buiphucminhtam/forgewright · 73 tokens

api-design

Design REST APIs with consistent naming, error handling, versioning, and pagination. Use when designing a new API, reviewing an existing one, or writing an OpenAPI spec.

chandrudp29/skillhub · 38 tokens

api-design

REST API design patterns. URL naming, HTTP status codes, pagination, RFC 7807 error responses, versioning, and OpenAPI.

pan94u/forge · 31 tokens

api-versioning-strategy

Choosing and operating an HTTP API versioning strategy that doesn't break clients — Stripe's date-based pinned versions, the Deprecation/Sunset header pair (RFC 9745 + RFC 8594), URI vs header vs media-type approaches, and the version-transformer pattern. Grounded in Stripe's published architecture and IETF RFCs.

curiositech/windags-skills · 74 tokens