api-design-patterns

api-design-patterns is a skill for Claude Code, Codex from NickCrew/Claude-Cortex. It costs 48 tokens per session (3,372 once invoked), scanned A, original, MIT.

Comprehensive REST and GraphQL API design patterns with versioning, pagination, error handling, and HATEOAS principles. Use when designing APIs, defining endpoints, or architecting service contracts requiring production-grade patterns.

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/nickcrew/claude-cortex/api-design-patterns
Any agent
npx skills add NickCrew/Claude-Cortex --skill api-design-patterns
Clone the repo
git clone --depth 1 https://github.com/NickCrew/Claude-Cortex

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/nickcrew/claude-cortex/api-design-patterns.svg)](https://agentmods.dev/skills/nickcrew/claude-cortex/api-design-patterns)
Your own site
<a href="https://agentmods.dev/skills/nickcrew/claude-cortex/api-design-patterns"><img src="https://agentmods.dev/badge/skills/nickcrew/claude-cortex/api-design-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,372 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown 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.00048 $0.03372
Opus 5 $0.00024 $0.01686
Sonnet 5 $0.00010 $0.00674
Haiku 4.5 $0.00005 $0.00337

Measured today against content hash 558fcdc94784, 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-patterns 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 today.

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-patterns/SKILL.md · 552 lines

How it starts

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

API Design Patterns

Expert guidance for designing scalable, maintainable REST and GraphQL APIs with industry-standard patterns for versioning, pagination, error handling, authentication, and service contracts.

When to Use This Skill

  • Designing new REST or GraphQL APIs from scratch
  • Refactoring existing APIs for better scalability and consistency
  • Defining service contracts for microservices architectures
  • Implementing versioning strategies for API evolution
  • Standardizing error handling and response formats across services
  • Designing pagination for large datasets
  • Implementing HATEOAS or hypermedia-driven APIs
  • Creating API specifications (OpenAPI, GraphQL Schema)

Quick Reference

Topic Load reference
Design Process skills/api-design-patterns/references/design-process.md

Core Principles

1. Resource-Oriented Design (REST)

URLs represent resources, not actions:

✓ GET    /users/123
✓ POST   /users
✓ PUT    /users/123
✓ DELETE /users/123

✗ GET    /getUser?id=123
✗ POST   /createUser
✗ POST   /deleteUser

Use HTTP methods semantically:

  • GET: Retrieve resource(s), idempotent, cacheable
  • POST: Create resource, non-idempotent
  • PUT: Replace entire resource, idempotent
  • PATCH: Partial update, idempotent
  • DELETE: Remove resource, idempotent

2. Consistent Naming Conventions

Resources:        /users, /orders, /products (plural nouns)
Nested:           /users/123/orders
Collections:      /users?status=active&page=2
Sub-resources:    /users/123/settings
Actions (rare):   /users/123/activate (POST)

3. HTTP Status Codes

Success:

  • 200 OK: Standard response for GET, PUT, PATCH
  • 201 Created: Resource created (POST), return Location header
  • 202 Accepted: Async processing started
  • 204 No Content: Success with no response body (DELETE)

Client Errors:

  • 400 Bad Request: Invalid syntax or validation failure
  • 401 Unauthorized: Authentication required or failed
  • 403 Forbidden: Authenticated but insufficient permissions
  • 404 Not Found: Resource doesn't exist
  • 409 Conflict: State conflict (duplicate, version mismatch)
  • 422 Unprocessable Entity: Semantic validation failure
  • 429 Too Many Requests: Rate limit exceeded

Read the full file on GitHub · 552 lines

Files

What ships with it

2 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. today First seen · 552 lines · 48 tokens per session scan A 558fcdc94784

Subscribe to this mod's changes

api-design-patterns is a skill published in the GitHub repository NickCrew/Claude-Cortex (37 stars, last pushed 2mo ago), licensed MIT. It adds 48 tokens to every session and 3,372 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-09-03.

Related

Other skills, from other repositories

api-design

Use when designing REST or GraphQL APIs, defining endpoints, implementing pagination/filtering, handling API versioning, or establishing API documentation with OpenAPI/Swagger.

MadAppGang/claude-code · 35 tokens

api-design

Use when settling the contract of an API you expose, before implementation: resources/URLs, REST vs GraphQL, versioning, one RFC 9457 error envelope, pagination, idempotency — emitted as OpenAPI 3.1. NOT implementing the endpoints (that is fastapi/nestjs/go/nodejs), NOT auth hardening (that is secure-coding), NOT…

ericrisco/rsc-harness · 105 tokens

api-design

API contract design for REST and GraphQL, covering resource shape, URL and header versioning with deprecation windows, RFC 9457 Problem Details error handling, and OpenAPI specs. Use when specifying the wire contract an endpoint exposes, choosing a versioning scheme, or standardizing error response bodies across…

yonatangross/orchestkit · 76 tokens

api-design-expert

Expert-level API design principles, REST, GraphQL, versioning, and API best practices.

personamanagmentlayer/pcl · 23 tokens

api-design

Use when designing new API endpoints, defining module boundaries, or establishing contracts between teams. Do NOT use for general code quality — use api-change-documentation for handoffs.

juanmhidalgo/claude-plugins · 37 tokens

api-contract-documentation

Use this skill when producing or reviewing API contract documentation for Salesforce integrations: versioning policy artifacts, request/response schema specs, error code catalogs, rate limit documentation, and OpenAPI generation for sObjects. Trigger keywords: Salesforce API versioning policy, API end-of-life policy…

BanibrataChatterjee/AwesomeSalesforceSkills · 107 tokens