api-design

api-design is a skill for Claude Code, Codex from asgarovf/locusai. It costs 37 tokens per session (1,303 once invoked), scanned A, original, MIT.

Guidance for designing and implementing REST APIs, which are web interfaces that let programs exchange data through URLs and HTTP requests. It covers routes, validation, errors, conventions, and API documentation.

In plain words
What is it for?
Use it when creating or improving API endpoints, planning API architecture, handling errors, or documenting an API with OpenAPI or Swagger. It covers common operations such as listing, creating, updating, and deleting resources.
Why use it?
It helps keep endpoints predictable and consistent for the programs that use them. It also reduces ambiguity around request validation, response status codes, error handling, and resource naming.

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/asgarovf/locusai/api-design
Any agent
npx skills add asgarovf/locusai --skill api-design
Clone the repo
git clone --depth 1 https://github.com/asgarovf/locusai

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/asgarovf/locusai/api-design.svg)](https://agentmods.dev/skills/asgarovf/locusai/api-design)
Your own site
<a href="https://agentmods.dev/skills/asgarovf/locusai/api-design"><img src="https://agentmods.dev/badge/skills/asgarovf/locusai/api-design.svg" alt="Measured on agentmods" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,303 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.00037 $0.01303
Opus 5 $0.00018 $0.00651
Sonnet 5 $0.00007 $0.00261
Haiku 4.5 $0.00004 $0.00130

Measured 4d ago against content hash 89dac9d16741, 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 4d 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 · 195 lines

How it starts

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

API Design

When to use this skill

  • Designing new API endpoints
  • Adding routes to an existing API
  • Improving API error handling or validation
  • Documenting APIs (OpenAPI/Swagger)
  • Reviewing API design for best practices

RESTful conventions

URL structure

GET    /users          → List users
POST   /users          → Create user
GET    /users/:id      → Get single user
PUT    /users/:id      → Replace user
PATCH  /users/:id      → Partial update
DELETE /users/:id      → Delete user

GET    /users/:id/orders    → List user's orders (nested resource)
POST   /users/:id/orders    → Create order for user

Naming rules

  • Plural nouns for resources: /users not /user
  • Kebab-case for multi-word: /order-items not /orderItems
  • No verbs in URLs: POST /users not POST /createUser
  • Nest logically: Max 2 levels deep, then use query params

HTTP status codes

Code When to use
200 Success (GET, PUT, PATCH)
201 Created (POST)
204 No content (DELETE)
400 Bad request (validation error)
401 Unauthorized (no/invalid auth)
403 Forbidden (insufficient permissions)
404 Not found
409 Conflict (duplicate, state conflict)
422 Unprocessable entity (semantic error)
429 Too many requests (rate limit)
500 Internal server error

Request/Response patterns

Consistent response envelope

// Success
{
  "data": { "id": 1, "name": "Alice" },
  "meta": { "requestId": "abc-123" }
}

// List with pagination
{
  "data": [{ "id": 1 }, { "id": 2 }],
  "meta": {
    "total": 45,
    "page": 1,
    "perPage": 20,
    "totalPages": 3
  }
}

// Error
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid input",
    "details": [
      { "field": "email", "message": "Must be a valid email" }
    ]
  }
}

Pagination

GET /users?page=2&per_page=20        # Offset-based
GET /users?cursor=eyJpZCI6MTB9&limit=20  # Cursor-based (preferred for large datasets)

Read the full file on GitHub · 195 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. 4d ago First seen · 195 lines · 37 tokens per session scan A 89dac9d16741

Subscribe to this mod's changes

api-design is a skill published in the GitHub repository asgarovf/locusai (23 stars, last pushed 5mo ago), licensed MIT. It adds 37 tokens to every session and 1,303 once invoked, about $0.0002 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-30.

Related

Other skills, from other repositories

api-testing

Comprehensive API testing, validation, and test suite generation.

laragentic/agents · 14 tokens

create-tutorial

Scaffold a new Membrane API Gateway tutorial in the api-gateway repo — the numbered self-teaching YAML under distribution/tutorials/ /, its support files and README links, and the matching auto-discovered integration test. Use whenever the user asks to create, add, write, or scaffold a tutorial (or a tutorial step)…

membrane/api-gateway · 97 tokens

optimize-interceptor-docs

Rewrite the reference documentation of a Membrane config element so the page generated at membrane-api.io comes out clean, exact, and reference-style. Use whenever the user wants to write, improve, optimize, polish, or review the docs / Javadoc / @description / @yaml example of an interceptor, plugin, or any…

membrane/api-gateway · 173 tokens

review-branch

Review the current git branch against master — code quality, refactoring opportunities, regressions, correctness, and test coverage — and print a severity-grouped markdown report. Use whenever the user asks to review the branch, review their changes against master, do a pre-PR / pre-merge review, or asks "is this…

membrane/api-gateway · 125 tokens

membrane-config

Generate a Membrane API Gateway configuration example or snippet — an apis.yaml (default) or, when explicitly asked, a legacy proxies.xml. Use this whenever the user wants a config, example, or snippet for Membrane: routing a port to a backend, a flow with plugins (setHeader, rateLimiter, basicAuthentication, openapi…

membrane/api-gateway · 167 tokens

release-notes

Generate GitHub release notes for the Membrane api-gateway repo by collecting the commits between the last release and master, grouping them into Features / Improvements / Fixes / Security / Dependencies, and linking each to its PR. Use whenever the user wants to draft, extract, or write release notes / a changelog /…

membrane/api-gateway · 124 tokens