rest-openapi-spec-design

rest-openapi-spec-design is a skill for Claude Code, Codex from hamzabellouch/agent-skills. It costs 40 tokens per session (2,498 once invoked), scanned A, original, MIT.

A set of standards for designing REST APIs and their OpenAPI 3.1 specifications. An API is a defined way for software systems to exchange requests and responses, while OpenAPI documents that contract.

In plain words
What is it for?
It is for designing versioned APIs, defining reusable schemas, validating requests and responses, documenting rate limits and errors, supporting safe retries, and testing API contracts with mock servers.
Why use it?
It helps teams agree on the API structure before coding and avoid inconsistent URLs, data formats, error responses, pagination, and update behavior.

Skill for Claude CodeCodex

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

Good fit It is for designing versioned APIs, defining reusable schemas, validating requests and responses, documenting rate limits and errors, supporting safe retries, and testing API contracts with mock servers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hamzabellouch/agent-skills/rest-openapi-spec-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 hamzabellouch/agent-skills --skill rest-openapi-spec-design
Clone the repo
git clone --depth 1 https://github.com/hamzabellouch/agent-skills

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 rest-openapi-spec-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/rest-openapi-spec-design/github.svg)](https://agentmods.dev/skills/hamzabellouch/agent-skills/rest-openapi-spec-design)
Your own site
<a href="https://agentmods.dev/skills/hamzabellouch/agent-skills/rest-openapi-spec-design"><img src="https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/rest-openapi-spec-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 rest-openapi-spec-design

Your own site · 80×15
<a href="https://agentmods.dev/skills/hamzabellouch/agent-skills/rest-openapi-spec-design"><img src="https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/rest-openapi-spec-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,498 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.
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.00040 $0.02498
Opus 5 $0.00020 $0.01249
Sonnet 5 $0.00008 $0.00500
Haiku 4.5 $0.00004 $0.00250

Measured 10d ago against content hash c7fdbf4a6639, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

rest-openapi-spec-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 10d 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.

APIs and Integration Design/rest-openapi-spec-design/SKILL.md · 331 lines

How it starts

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

RESTful API & OpenAPI 3.1 Specification Design

Overview

This skill provides comprehensive standards and operational patterns for designing contract-first RESTful APIs using the OpenAPI 3.1 Specification (OAS 3.1). It covers clean schema definitions, reusable $ref components, pagination, rate limiting headers, idempotency keys, error contracts (RFC 7807), and automated mock server validation.


1. Contract-First API Design Principles

  1. Contract-First Workflow: Define the OpenAPI 3.1 schema before writing backend code. Validate requests and responses strictly against the OAS spec using middleware.
  2. Resource-Oriented Nouns: Use plural nouns for resource endpoints (/v1/orders, /v1/users/{userId}/invoices). Avoid verbs in URI paths (use POST /v1/orders/{id}/cancel only for RPC-style actions when RESTful state update is unsuitable).
  3. HTTP Method Semantics:
    • GET: Idempotent & safe resource retrieval.
    • POST: Non-idempotent resource creation or action execution.
    • PUT: Idempotent resource replacement (requires full body).
    • PATCH: Idempotent partial resource update (JSON Patch RFC 6902 or JSON Merge Patch RFC 7396).
    • DELETE: Idempotent resource removal.
  4. Standardized Error Handling (RFC 7807): All API errors must return application/problem+json formatted responses containing type, title, status, detail, and instance.
  5. API Versioning: Enforce explicit semantic versioning in the URL path (/v1/, /v2/) or content negotiation via custom Accept headers (Accept: application/vnd.company.v1+json).

2. API Architecture & Standard Headers

[ Client Application ]
       │
       │ 1. Request with Bearer Token & Idempotency-Key
       ▼
[ API Gateway / Reverse Proxy ] ──(Rate Limit Check: X-RateLimit-*)
       │
       │ 2. Validate Request against OpenAPI Spec
       ▼
[ Microservice Backend ] ──(RFC 7807 Problem Detail on Failure)
Standard Header Direction Purpose Example Value
Authorization Request Bearer JWT / API Key authentication Bearer eyJhbGciOiJKV1Qi...
Idempotency-Key Request Guarantee safe retry execution for POST actions 7b9e1d2c-8a4f-4e3b-9c2d-1a0e9f8c7b6a
X-RateLimit-Limit Response Max requests permitted in current window 1000
X-RateLimit-Remaining Response Remaining quota in active window 984
X-RateLimit-Reset Response UTC Epoch seconds when quota resets 1770000000
Content-Type Both Media type payload indicator application/json / application/problem+json

Read the full file on GitHub · 331 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. 10d ago First seen · 331 lines · 40 tokens per session scan A c7fdbf4a6639

Subscribe to this mod's changes

rest-openapi-spec-design is a skill published in the GitHub repository hamzabellouch/agent-skills (4 stars, last pushed 1mo ago), licensed MIT. It adds 40 tokens to every session and 2,498 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-31.