api-design-first

api-design-first is a skill for Claude Code, Codex from d-o-hub/github-template-ai-agents. It costs 76 tokens per session (1,054 once invoked), scanned A, original, MIT.

A guide to designing REST APIs, which are web services organized around resources such as users or orders, and documenting them with OpenAPI 3.0, a standard format for API descriptions.

In plain words
What is it for?
Use it to plan endpoints, define request and response schemas, choose HTTP methods and status codes, and document filtering, pagination, sorting, and versioning.
Why use it?
It creates a shared contract for endpoints and data before implementation, helping teams avoid inconsistent names, responses, and version changes.

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/d-o-hub/github-template-ai-agents/api-design-first
Any agent
npx skills add d-o-hub/github-template-ai-agents --skill api-design-first
Clone the repo
git clone --depth 1 https://github.com/d-o-hub/github-template-ai-agents

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-first

README.md
[![agentmods](https://agentmods.dev/badge/skills/d-o-hub/github-template-ai-agents/api-design-first.svg)](https://agentmods.dev/skills/d-o-hub/github-template-ai-agents/api-design-first)
Your own site
<a href="https://agentmods.dev/skills/d-o-hub/github-template-ai-agents/api-design-first"><img src="https://agentmods.dev/badge/skills/d-o-hub/github-template-ai-agents/api-design-first.svg" alt="Measured on agentmods" height="20"></a>
Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,054 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.00076 $0.01054
Opus 5 $0.00038 $0.00527
Sonnet 5 $0.00015 $0.00211
Haiku 4.5 $0.00008 $0.00105

Measured 4d ago against content hash a48096d4b6d5, 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-first 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.

.agents/skills/api-design-first/SKILL.md · 160 lines

How it starts

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

API Design First

Design RESTful APIs using design-first principles with comprehensive OpenAPI 3.0 specifications.

When to Use

  • User asks to design an API or create an API spec
  • Planning endpoints, modeling request/response schemas
  • Discussing API versioning or OpenAPI/Swagger documentation
  • Even if they just say "design the API" or "create the OpenAPI spec"

Design Principles

1. API-First Mindset

  • Design the API contract before implementation
  • Use OpenAPI 3.0 as the source of truth
  • Generate code from specifications, not vice versa

2. RESTful Design

  • Use nouns for resources (not verbs)
  • Leverage HTTP methods semantically
  • Implement proper status codes
  • Support filtering, pagination, and sorting

3. Consistency

  • Follow naming conventions throughout
  • Use consistent request/response formats
  • Maintain backward compatibility with versioning

Resource Naming

GET    /users              # List users
GET    /users/{id}         # Get specific user
POST   /users              # Create user
PUT    /users/{id}         # Update user (full)
PATCH  /users/{id}         # Partial update
DELETE /users/{id}         # Delete user
GET    /users/{id}/orders  # Sub-resource collection

HTTP Status Codes

Code Usage
200 Successful GET, PUT, PATCH
201 Successful POST (resource created)
204 Successful DELETE
400 Bad request (validation error)
401 Unauthorized
403 Forbidden
404 Resource not found
409 Conflict (duplicate, etc.)
422 Unprocessable entity
429 Rate limited
500 Server error

Request/Response Patterns

Pagination

{
  "data": [...],
  "meta": {
    "page": 1,
    "per_page": 20,
    "total": 150,
    "total_pages": 8
  },
  "links": {
    "self": "/users?page=1",
    "next": "/users?page=2",
    "last": "/users?page=8"
  }
}

Error Response

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Request validation failed",
    "details": [
      { "field": "email", "message": "Invalid email format" }
    ]
  }
}

Read the full file on GitHub · 160 lines

Files

What ships with it

4 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. 4d ago First seen · 160 lines · 76 tokens per session scan A a48096d4b6d5

Subscribe to this mod's changes

api-design-first is a skill published in the GitHub repository d-o-hub/github-template-ai-agents (2 stars, last pushed yesterday), licensed MIT. It adds 76 tokens to every session and 1,054 once invoked, about $0.0004 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

paper-slides

Generate conference presentation slides (beamer LaTeX → PDF + editable PPTX) from a compiled paper, with speaker notes and full talk script. Use when user says "做PPT", "做幻灯片", "make slides", "conference talk", "presentation slides", "生成slides", "写演讲稿", or wants beamer slides for a conference talk.

wanshuiyin/Auto-claude-code-research-in-sleep · 81 tokens

paper-talk

End-to-end conference talk pipeline: paper → slide outline → Beamer + PPTX → per-page polish → assurance checks (claim / citation / anonymity) → final export and report. Default-good for academic conference talks (NeurIPS / ICML / ICLR / VALSE / 投稿 talks). Trigger phrases: "做 talk", "做 PPT 全流程", "talk pipeline"…

wanshuiyin/Auto-claude-code-research-in-sleep · 113 tokens

formula-derivation

Structures and derives research formulas when the user wants to 推导公式, build a theory line, organize assumptions, turn scattered equations into a coherent derivation, or rewrite theory notes into a paper-ready formula document. Use when the derivation target is not yet fully fixed, the main object still needs to be…

wanshuiyin/Auto-claude-code-research-in-sleep · 84 tokens

paper-writing

Workflow 3: Full paper writing pipeline that goes from a narrative report to a polished, submission-ready PDF. Use when user says "写论文全流程", "write paper pipeline", "从报告到PDF", "paper writing", or wants the complete paper generation workflow.

wanshuiyin/Auto-claude-code-research-in-sleep · 58 tokens

citra

Skill "citra" from SylphxAI/pdf-reader-mcp, covering citra — pdf evidence for agents, install, or, tools and sdk.

SylphxAI/pdf-reader-mcp · 0 tokens

csv-to-sif

Export a project's FF&E product-library CSV as dealer-system SIF. Use to produce a .sif schedule; use sif-to-csv for the reverse direction.

AlpacaLabsLLC/skills-for-architects · 38 tokens