api-design

A guide for designing REST APIs, which are web interfaces that let programs exchange data using standard HTTP requests. It covers resource-based URLs and consistent JSON replies.

In plain words
What is it for?
Use it when designing, reviewing, generating, or assessing API resources, URL paths, relationships, fields, HTTP methods, and JSON responses.
Why use it?
It helps teams avoid inconsistent endpoint names, action-shaped URLs, and differing response formats across an API.

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/aps08/fullstack-clean-architecture/api_design
Any agent
npx skills add aps08/fullstack-clean-architecture --skill api_design
Clone the repo
git clone --depth 1 https://github.com/aps08/fullstack-clean-architecture

Made for: Claude Code, Codex.

Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,272 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.00021 $0.02272
Opus 5 $0.00010 $0.01136
Sonnet 5 $0.00004 $0.00454
Haiku 4.5 $0.00002 $0.00227

Measured yesterday against content hash bbeee393557d, 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 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.

.agents/skills/api_design/SKILL.md · 285 lines

How it starts

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

API Design Guide

Overview

This skill captures the principles and rules of RESTful API design. Apply it whenever designing, reviewing, generating, or evaluating APIs in the codebase.


1. Core Philosophy: Resource-Oriented Design

APIs must be designed around resources (nouns), not actions (verbs).

Key principles:

  • Model the API as a resource hierarchy — collections containing resources of the same type.
  • Expose a large number of resources with a small number of methods on each.
  • Use a stateless protocol: every request is independent; the server persists data, the client manages application state.
  • Resource relationships must form a directed acyclic graph — no cyclic references.
  • An API's resource model must not mirror the underlying database schema; that is an anti-pattern.

Design order (logical sequence):

  1. Identify the resources (nouns) the API provides.
  2. Define relationships and hierarchies between resources.
  3. Define the schema (fields) of each resource.
  4. Assign methods (verbs) to resources, preferring standard methods.

2. Resource Names

Resource names are hierarchical, slash-separated paths in the URL that uniquely identify a resource.

Format:

/{collection}/{resource_id}/{sub-collection}/{sub-resource_id}

Examples:

/shelves/shelf1/books/book2
/publishers/publisher1/books/book1

Rules:

  • Collection IDs are plural (e.g., books, shelves) unless the word has no plural form (e.g., weather, evidence).
  • Resource IDs must be URL-safe strings.
  • A resource must have exactly one canonical parent in the hierarchy.
  • Names are used across all methods consistently — the same resource name identifies the same resource everywhere in the API.

3. Standard Methods

Prefer standard methods over custom methods whenever the operation fits.

Method HTTP Mapping Request Body Response Body
List GET /{collection} None Contains array of resources
Get GET /{collection}/{resource_id} None Is the resource
Create POST /{collection} Contains resource Is the resource
Update PATCH /{collection}/{resource_id} Contains resource Is the resource
Delete DELETE /{collection}/{resource_id} None None (empty)

Read the full file on GitHub · 285 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 · 285 lines · 21 tokens per session scan A bbeee393557d

Subscribe to this mod's changes

api-design is a skill published in the GitHub repository aps08/fullstack-clean-architecture (2 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 21 tokens to every session and 2,272 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.