api-design-rest

Guidance for designing HTTP APIs, which let software communicate over the web, using predictable resources, operations, and error responses.

In plain words
What is it for?
Use it when building services, adding entities, creating partner integrations or webhooks, or standardizing an inconsistent REST API.
Why use it?
It prevents clients from having to guess how endpoints behave and helps keep an API consistent as it grows.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/kraitdev/skill.md/api-design-rest
Any agent
npx skills add KraitDev/skiLL.Md --skill api-design-rest
Clone the repo
git clone --depth 1 https://github.com/KraitDev/skiLL.Md

Made for: Claude Code, Codex.

Per session 15 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,631 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00015 $0.01631
Opus 5 $0.00008 $0.00816
Sonnet 5 $0.00003 $0.00326
Haiku 4.5 $0.00002 $0.00163

Measured yesterday against content hash 566a6d5d1eed, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

api-design-rest 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 yesterday.

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/backend/api-design-rest/SKILL.md · 157 lines

How it starts

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

RESTful API Design

Purpose

REST APIs MUST be intuitive, predictable, and semantically correct. This skill ensures APIs use HTTP methods correctly, communicate errors clearly via standard formats, and maintain consistency across resources so clients can interact with them reliably without surprise behavior.

When to use

  • Building a new backend service exposing resources
  • Adding a new domain entity to an existing API
  • Creating integration endpoints for third-party partners
  • Designing webhooks or callback mechanisms
  • Standardizing an inconsistent API across a microservices architecture

When NOT to use

  • Error handling specifics (use Error Handling Architecture skill)
  • API authentication/authorization (separate concern)
  • Rate limiting or throttling strategies (separate concern)
  • GraphQL design (different paradigm)

Inputs required

  • Existing API codebase or documented business entities
  • HTTP framework (Express, Django, FastAPI, etc.)
  • OpenAPI/Swagger familiarity preferred

Workflow

  1. Identify Resources: Map business entities to Plural Nouns (users, orders, invoices, not getUsers)
  2. Assign Verbs: Map CRUD operations to HTTP methods: GET (read), POST (create), PUT (replace), PATCH (update), DELETE (remove)
  3. Design URL Hierarchy: Nest resources logically but NO DEEPER than 2 levels (e.g., /users/{id}/orders ONLY)
  4. Standardize Responses: All success payloads wrapped consistently; all errors use RFC 7807 format
  5. Add Pagination: For collection endpoints, REQUIRE limit and offset (or cursor-based pagination)
  6. Version the API: Use /v1/ prefix or header-based versioning from day one
  7. Document with OpenAPI: Generate OpenAPI schema automatically or maintain it in sync

Rules

  • MUST use HTTP status codes semantically (see failure conditions below)
  • MUST NOT use verbs in URLs (no GET /getUsers)
  • MUST NOT nest resources beyond 2 levels deep
  • MUST use lowercase URLs with hyphens for multi-word resource names
  • MUST require API versioning
  • MUST return RFC 7807 problem details for ALL errors
  • MUST paginate collection responses

Read the full file on GitHub · 157 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. yesterday First seen · 157 lines · 15 tokens per session scan A 566a6d5d1eed

Subscribe to this mod's changes

api-design-rest is a skill published in the GitHub repository KraitDev/skiLL.Md (7 stars, last pushed 2mo ago), licensed MIT. It adds 15 tokens to every session and 1,631 once invoked, about $0.0001 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.