api-design-patterns
Skill2.7k starsChanged 10 months agoApache-2.0View on GitHub
REST API design with resource naming, pagination, versioning, and OpenAPI spec generation
5 other projects use a version of this.
Trending
Less talk lately.thin dataabout the whole repository
Most recently taken up by
- sabahattink/antigravity-fullstack-hqtheir own version, first seen Sep 20, 2026
- 4444J99/a-i--skillstheir own version, first seen Jun 7, 2026
- valentinesamuel/claude-skillsword for word, first seen Apr 19, 2026
- hieutrtr/ai1-skillstheir own version, first seen Feb 5, 2026
- benshapyro/cadre-devkit-claudetheir own version, first seen Dec 6, 2025
Who's talking about rohitg00/awesome-claude-code-toolkit
- sudosubin/agents.nix“agent-skills.github.rohitg00.awesome-claude-code-toolkit: init at 0.5.0”GitHub · Oct 1, 2026
- uizze/uizze“docs: track Claude Code Toolkit distribution PR”GitHub · Aug 18, 2026
- hslee16/Archy“chore(distribution): submit archy to awesome-mcp-servers and awesome-claude-code-toolkit”GitHub · Jul 25, 2026
- Nexcyfr/nexcy-site“Vague 1D : workflows et templates internes Claude Code core”GitHub · Jun 11, 2026
- taeyeon-Kim/claude-starter-kit“감사 리포트 2026-04-14 (2차): Warning 0건, Info 4건 — Phase 3.8 첫 실행”GitHub · Apr 14, 2026
The biggest 5 of 7 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 7
Talked about on GitHub (7 times).
On GitHub · 7
- Oct 1, 2026agent-skills.github.rohitg00.awesome-claude-code-toolkit: init at 0.5.0 — sudosubin/agents.nix0 reactions
- Aug 18, 2026docs: track Claude Code Toolkit distribution PR — uizze/uizze0 reactions
- Jul 25, 2026chore(distribution): submit archy to awesome-mcp-servers and awesome-claude-code-toolkit — hslee16/Archy0 reactions · 4 comments
- Jun 11, 2026Vague 1D : workflows et templates internes Claude Code core — Nexcyfr/nexcy-site0 reactions · 1 comment
- Apr 14, 2026감사 리포트 2026-04-14 (2차): Warning 0건, Info 4건 — Phase 3.8 첫 실행 — taeyeon-Kim/claude-starter-kit0 reactions
2 more on GitHub
- Apr 13, 2026Audit candidate: rohitg00/awesome-claude-code-toolkit — xiaolai/nlpm0 reactions · 5 comments
- Apr 6, 2026Audit candidate: rohitg00/awesome-claude-code-toolkit — xiaolai/nlpm0 reactions · 2 comments
Other versions5 projects use a version of this.
Word for word · 1
- valentinesamuel/claude-skills★ 1100% same
Edited · 0
None found.
Wrote their own version · 4
- sabahattink/antigravity-fullstack-hq★ 30same name
- 4444J99/a-i--skills★ 17same name
- benshapyro/cadre-devkit-claude★ 9same name
- hieutrtr/ai1-skills★ 8same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository40 other files it gives its agents.
- rules/agents.mdAGENTS.md
- accessibility-wcagSkill
- agentkit-seoSkill
- authentication-patternsSkill
- aws-cloud-patternsSkill
- ci-cd-pipelinesSkill
- claude-memory-kitSkill
- continuous-learningSkill
- database-optimizationSkill
- data-engineeringSkill
- deep-diveSkill
- devops-automationSkill
- django-patternsSkill
- docker-best-practicesSkill
- frontend-excellenceSkill
- git-advancedSkill
- golang-idiomsSkill
- graphql-designSkill
- kubernetes-operationsSkill
- llm-integrationSkill
- manage-skillsSkill
- mcp-developmentSkill
- microservices-designSkill
- mobile-developmentSkill
- monitoring-observabilitySkill
- nextjs-masterySkill
- performance-optimizationSkill
- postgres-optimizationSkill
- prompt-engineeringSkill
- python-best-practicesSkill
- react-patternsSkill
- redis-patternsSkill
- rust-systemsSkill
- security-hardeningSkill
- springboot-patternsSkill
- styleseedSkill
- tdd-masterySkill
- testing-strategiesSkill
- typescript-advancedSkill
- websocket-realtimeSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 7 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Use plural nouns: /users, /orders, /products
- Very specific: line 13
Use kebab-case: /user-profiles, not /userProfiles
- Very specific: line 14
Never put verbs in URLs: /users/{id}/activate is wrong, use POST /users/{id}/activation
- Distinctive: line 59
Use consistent error codes across the API.
- Distinctive: line 76
Use cursor pagination for large or frequently changing datasets.
- Distinctive: line 95
Only use offset pagination when total count is cheap and dataset is small.
- Very specific: line 105
Use field selection (fields param) to reduce payload size.
- Distinctive: line 109
Prefer URL path versioning for simplicity:
- Distinctive: line 116
Never break v1 once published.
- Very specific: line 134
Always return X-Request-Id in responses for debugging.
- Distinctive: line 138
Write spec first, then implement (spec-driven development)
- Very specific: line 139
Use $ref for shared schemas: $ref: '#/components/schemas/User'
- Very specific: line 141
Use oneOf/anyOf for polymorphic responses
- Distinctive: line 171
Use sliding window algorithm (not fixed window)
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
API Design Patterns
Resource Naming
- Use plural nouns:
/users,/orders,/products - Nest for relationships:
/users/{id}/orders - Max nesting depth: 2 levels. Beyond that, use query params or top-level resources
- Use kebab-case:
/user-profiles, not/userProfiles - Never put verbs in URLs:
/users/{id}/activateis wrong, usePOST /users/{id}/activation
HTTP Methods
| Method | Purpose | Idempotent | Request Body | Success Code |
| GET | Read resource(s) | Yes | No | 200 |
| POST | Create resource | No | Yes | 201 |
| PUT | Full replace | Yes | Yes | 200 |
| PATCH | Partial update | No | Yes | 200 |
| DELETE | Remove resource | Yes | No | 204 |
Return Location header on POST with the URL of the created resource.
Status Codes
200 OK - Successful read/update
201 Created - Successful creation
204 No Content - Successful delete
400 Bad Request - Validation error (include field-level errors)
401 Unauthorized - Missing or invalid authentication
403 Forbidden - Authenticated but not authorized
404 Not Found - Resource does not exist
409 Conflict - State conflict (duplicate, version mismatch)
422 Unprocessable - Semantically invalid (valid JSON, bad values)
429 Too Many Reqs - Rate limited (include Retry-After header)
500 Internal Error - Unhandled server error (never expose stack traces)Error Response Format
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"details": [
{ "field": "email", "message": "Must be a valid email address" },
{ "field": "age", "message": "Must be at least 18" }
]
}
}Use consistent error codes across the API. Document every code in your API reference.
Cursor-Based Pagination (preferred)
GET /users?limit=20&cursor=eyJpZCI6MTAwfQ
Response:
{
"data": [...],
"pagination": {
"next_cursor": "eyJpZCI6MTIwfQ",
"has_more": true
}
}Use cursor pagination for large or frequently changing datasets. Encode cursors as opaque base64 strings. Never expose raw IDs in cursors.
Offset-Based Pagination (simple cases only)
GET /users?page=3&per_page=20
Response:
{
"data": [...],
"pagination": {
"page": 3,
"per_page": 20,
"total": 245,
"total_pages": 13
}
}Only use offset pagination when total count is cheap and dataset is small.
Filtering and Sorting
GET /orders?status=pending&created_after=2025-01-01&sort=-created_at,+total
GET /products?category=electronics&price_min=100&price_max=500
GET /users?search=john&fields=id,name,emailUse field selection (fields param) to reduce payload size. Prefix sort fields with - for descending.
Versioning
Prefer URL path versioning for simplicity:
/api/v1/users
/api/v2/usersRules:
- Never break v1 once published. Add fields, never remove them.
- New required fields = new version
- Deprecate old versions with
Sunsetheader and 6-month notice - Support at most 2 active versions simultaneously
Request/Response Headers
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>
X-Request-Id: <uuid> # For tracing
X-RateLimit-Limit: 100 # Requests per window
X-RateLimit-Remaining: 47 # Remaining in window
X-RateLimit-Reset: 1700000000 # Window reset Unix timestamp
Retry-After: 30 # Seconds until rate limit resetsAlways return X-Request-Id in responses for debugging.
OpenAPI Spec Guidelines
- Write spec first, then implement (spec-driven development)
- Use
$reffor shared schemas:$ref: '#/components/schemas/User' - Define
examplesfor every endpoint - Use
oneOf/anyOffor polymorphic responses - Generate client SDKs from the spec, never hand-write them
- Validate requests against the spec in middleware
paths:
/users/{id}:
get:
operationId: getUser
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: User found
content:
application/json:
schema:
$ref: '#/components/schemas/User'
'404':
$ref: '#/components/responses/NotFound'Rate Limiting Strategy
- Apply per-user, per-endpoint limits
- Use sliding window algorithm (not fixed window)
- Return
429withRetry-Afterheader - Exempt health check and auth endpoints from rate limits
- Log rate-limited requests for abuse detection
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

