api-design
Skill2 starsChanged 4 months agoMITView on GitHub
You MUST consult this skill when designing or reviewing any API — REST, gRPC, or OpenAPI specs. Also trigger on resource modeling, field naming, pagination, error handling, versioning, custom vs standard methods, or reviewing an existing API for consistency problems — even if the user doesn't mention AEP. NOT for implementation details (framework setup, middleware config) or general software design (see software-design).
191 other projects use a version of this.
Adopted by
Most recently taken up by
- RostislavDugin/postgresustheir own version, first seen Nov 8, 2026
- Markssuave/Markssuave-Agent-skillstheir own version, first seen Nov 8, 2026
- Rojios/everything-claude-codetheir own version, first seen Nov 8, 2026
- ishandutta2007/Awesome-Claude-Skillstheir own version, first seen Nov 8, 2026
- databasus/databasustheir own version, first seen Nov 8, 2026
- lhbsaa/apex-unifiedtheir own version, first seen Nov 8, 2026
Used with
Projects with it also use db-design, everything-claude-code and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
yuexueyuSkilldb-design
数据库工程师技能 - Schema设计、索引优化、并发安全、数据库审计。当你涉及数据库表/字段/索引/SQL/迁移/MCP数据库操作、建表改表、写查询时必须使用此技能。即使用户只是说"加个字段"或"查下数据",也应触发。
Also in 4 projects that use this
InfopibeSkilleverything-claude-code
Also in 9 projects that use this
mryeastcodeSkilleverything-claude-code-conventions
Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.
Also in 8 projects that use this
tpavanipradeepSkillnextjs-turbopack
Next.js 16+ and Turbopack — incremental bundling, FS caching, dev speed, and when to use Turbopack vs webpack.
Also in 15 projects that use this
Indium-AI-LabsSkilldata-pipeline-design
Design batch or incremental ETL and ELT pipelines and warehouse models: grain, partitioning, idempotent loads, late-arriving data, data quality tests, PII controls, and cost monitoring, before building them. Use when adding or changing a dbt model, warehouse table, scheduled transformation, or ingestion job. Not for transactional schema design (use the database-design skill) or event-sourced stores (use the event-sourcing-architecture skill).
Also in 3 projects that use this
thejordanleopoldSkillthird-party-integration
Use when integrating with external APIs, payment processors (Stripe), webhooks, or third-party services. Use when implementing API clients with authentication and rate limiting, handling webhooks with signature verification and idempotency, writing contract tests for external services, or isolating third-party dependencies behind adapters. Triggers: \"Stripe\", \"payment integration\", \"webhook\", \"third-party API\", \"external service\", \"API client\", \"integrate with\", \"signature verification\", \"idempotency key\".
Also in 3 projects that use this
Other versions191 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 191
- affaan-m/ECC★ 246ksame name
- databasus/databasus★ 9.3ksame name
- RostislavDugin/postgresus★ 9.3ksame name
- authgear/authgear-server★ 2.1ksame name
- xu-xiang/everything-claude-code-zh★ 1.9ksame name
- Aaronontheweb/dotnet-skills★ 1.2ksame name
- epam/ai-dial-chat★ 501same name
- loulanyue/awesome-claude-notes★ 272same name
- KbWen/agentic-os★ 229same name
- DevelopersGlobal/ai-agent-skills★ 216same name
181 more not listed
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 repository67 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-architectureSkill
- agent-evaluationSkill
- agent-memorySkill
- agent-post-trainingSkill
- agent-self-evolutionSkill
- agent-tool-designSkill
- application-architectureSkill
- brainstormSkill
- code-reviewerSkill
- coding-agent-designSkill
- concurrency-designSkill
- context-engineeringSkill
- dockerSkill
- game-audioSkill
- game-designSkill
- game-narrativeSkill
- game-patternsSkill
- game-performanceSkill
- game-renderingSkill
- game-visualsSkill
- git-commitSkill
- git-prSkill
- godot-shaderSkill
- godotSkill
- gpu-rendering-architectureSkill
- grafanaSkill
- helmSkill
- homelab-monitoringSkill
- k3sSkill
- k8s-networkingSkill
- k8s-operationsSkill
- k8s-storageSkill
- k8s-workloadsSkill
- knowledge-baseSkill
- level-designSkill
- llm-inference-servingSkill
- loggingSkill
- logqlSkill
- love2d-fennelSkill
- love2dSkill
- ml-platform-architectureSkill
- ml-post-trainingSkill
- multi-agent-collaborationSkill
- nix-dendriticSkill
- nix-packagingSkill
- nixSkill
- odin-designSkill
- odin-gamedevSkill
- orchestratorSkill
- physical-ai-systemsSkill
- plannerSkill
- prd-to-storiesSkill
- prd-writingSkill
- promqlSkill
- pr-reviewerSkill
- python-designSkill
- rag-designSkill
- ray-data-pipelinesSkill
- ray-kubernetes-infrastructureSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 165 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 62
Prefer standard > batch > custom > streaming.
“Common” is measured: kept by at least 6 in 10 of the 165 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
AEP-Compliant API Design
Design APIs following AEP (Google, Microsoft, Roblox, IBM). The payoff: Terraform providers, CLIs, UIs, and MCP servers auto-generate because they can predict the API shape from resource hierarchies.
Core principle: design resource hierarchies (nouns), not procedure collections (verbs).
Designing around caller intent
Design the API surface around what callers actually want, expressed in their vocabulary — not around how the implementation is structured internally. A networking API should expose connect, read_message, write_message, and disconnect. Exposing a "socket" instead leaks a Unix implementation concept that bundles unrelated concerns (files, network, device I/O) into a single abstraction callers never asked for. The right question is: what does the caller need to accomplish, and what are the fewest, most coherent calls that let them do it?
No footgun-by-omission. Nothing should fail silently because the caller forgot to set an obscure flag or initialize an optional field. Mandatory low-level knobs are a design smell; sensible, safe behavior should be the default, with explicit opt-in for deviation.
Separate the escape hatch. Provide raw or low-level bindings as a distinct layer for the rare callers who genuinely need them. The common-case API should not force everyone through low-level machinery. (See software-design's "layered interfaces" for the structural pattern.)
Difficulty is not a virtue. Jonathan Blow argues — with OpenGL and Vulkan as examples — that keeping a hard API because you feel pride in having mastered it is not a design principle; it is a cost imposed on every future caller. Complexity is only justified when it is essential to the problem domain, which is rare.
Design Process
For every API, answer these four questions in order:
- What are the resources (things)?
- What's the parent-child hierarchy?
- What does each resource's schema look like?
- Which standard methods does each resource need?
Before (verb-oriented — hard to auto-generate clients):
POST /v1/createProject
POST /v1/archiveProject
POST /v1/getProjectTasksAfter (resource-oriented — predictable, tooling-friendly):
POST /v1/projects # Create
GET /v1/projects/{project_id} # Get
GET /v1/projects # List
PATCH /v1/projects/{project_id} # Update
DELETE /v1/projects/{project_id} # Delete
POST /v1/projects/{project_id}:archive # Custom method (state transition)
GET /v1/projects/{project_id}/tasks # Nested collectionModel a resource hierarchy, not a database schema — the API is a contract, not a DB mirror. Resource relationships must form a DAG (no cycles).
Standard Methods (AEP-130–135)
Prefer standard > batch > custom > streaming. Each step down costs tooling compatibility.
| Method | Verb + Path | Key Rules |
| Get | GET /v1/{path} | Every resource needs Get so clients can verify mutations |
| List | GET /v1/{parent}/collection | Response array is results, not the type name. Paginate from day one |
| Create | POST /v1/{parent}/collection?id=X | ID is a query param, not body. Support user-specified IDs by default |
| Update | PATCH /v1/{path} | Merge-patch semantics (application/merge-patch+json). Never PUT |
| Delete | DELETE /v1/{path} | Require force: bool when first-class children exist |
| Custom | POST /v1/{path}:verb | State transitions that can't be expressed as field updates |
OperationId naming: {Verb}{Singular} for standard (GetBook, CreateBook), List{Plural} for List (ListBooks).
Conventions That Diverge From Common Practice
These AEP rules are the ones most likely to be missed. Each exists for a specific reason:
resultsarray in List responses — notbooksorusers. A consistent name lets generic clients parse any collection without knowing the resource type.idas query param on Create —POST /v1/tasks?id=my-task. Keeps the body a clean resource representation. Without user-specified IDs, Create isn't safely retryable and declarative clients (Terraform) can't reconcile state.PATCH+ merge-patch, neverPUT— PUT requires the full resource, so adding a new schema field silently becomes breaking (old clients reset it to zero value on every update)._timesuffix on timestamps —create_time,update_time. Never_at, never camelCase. This makes timestamps recognizable across all AEP APIs.- Permissions before existence — always check auth first (->
403), then existence (->404). Reversing this leaks which resources exist to unauthorized callers. - RFC 9457 errors —
Content-Type: application/problem+jsonwithtype,status,title,detail. Dynamic variables indetailmust also appear as top-level fields for programmatic access. - State transitions via custom methods —
:archive,:publish, not PATCH on astatefield. State machines need server-side validation that Update can't express. - Duplicate Create ID ->
409 ALREADY_EXISTS, unless caller can't see the duplicate ->403(avoids leaking existence info).
Review Checklist
- Resources use nouns, not verbs; hierarchy forms a DAG
- List response array is
results - Create supports user-specified
idas query param - Update uses
PATCH+ merge-patch, notPUT - Timestamps use
_timesuffix, RFC 3339 format - Pagination on all List methods from day one
- Permissions checked before existence
- Errors use
application/problem+json(RFC 9457) - State transitions use custom methods, not Update
- Delete with children requires
force: bool create_time,update_time,etagon mutable resourcespathfield is output-only on every resource- Long-running operations (LROs) return
202 Acceptedwith Operation resource - Does the surface expose caller intent, or leak an internal implementation concept?
- When the API accepts raw input, does conversion raise on invalid data rather than silently accepting it? (parse, don't validate — see
software-design/references/type-driven-design.md) - Does every method name accurately describe ALL of what it does, including side effects? (Least Astonishment)
- Do consistent name patterns signal consistent behavior across the surface? (
delete_*always deletes, never soft-deletes sometimes) - Are defaults safe? (fail closed, return empty collection not null, require explicit opt-in for dangerous behavior)
References
| Reference | When to read it |
references/field-naming.md | Designing paths, naming fields, or reviewing naming consistency |
references/patterns.md | Implementing pagination, error responses, LROs, soft delete, state machines, idempotency, validate-only, singletons, or enumerations |
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.

