api-design
Skill65 starsChanged 3 months agoMITView on GitHub
Design or review REST/GraphQL APIs when endpoints or contracts change.
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 164 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Use nouns for resources, not verbs: GET /users not GET /getUsers
- Very specific: line 24
Use kebab-case for multi-word paths: /order-items
“Common” is measured: kept by at least 6 in 10 of the 164 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
<!-- This is a SCAFFOLD skill -->API Design
When to Apply
- Classification: feature, architecture-change, hotfix (if touching API endpoints)
- Phase: /implement (design & build), /review (compliance check), /test (contract verification)
- Trigger: Task involves creating, modifying, or deprecating API endpoints
Conventions
Customize after /app-init: Replace these generic conventions with your project's ADR decisions.
Endpoint Naming
- Use nouns for resources, not verbs:
GET /usersnotGET /getUsers - Plural resource names:
/users,/orders,/products - Nested resources for relationships:
/users/:id/orders - Use kebab-case for multi-word paths:
/order-items
HTTP Methods
| Action | Method | Success Status | Idempotent |
| List | GET | 200 | Yes |
| Get one | GET | 200 | Yes |
| Create | POST | 201 | No |
| Full update | PUT | 200 | Yes |
| Partial update | PATCH | 200 | No |
| Delete | DELETE | 204 | Yes |
Error Response Format
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Email is required",
"details": {
"field": "email",
"constraint": "required"
}
}
}Standard Error Codes
| HTTP Status | When | Error Code Pattern |
| 400 | Invalid input | VALIDATION_ERROR, INVALID_FORMAT |
| 401 | Not authenticated | UNAUTHORIZED |
| 403 | Not permitted | FORBIDDEN |
| 404 | Resource not found | NOT_FOUND |
| 409 | Conflict (duplicate) | CONFLICT, DUPLICATE |
| 422 | Business rule violation | UNPROCESSABLE |
| 429 | Rate limited | RATE_LIMITED |
| 500 | Server error | INTERNAL_ERROR |
Pagination
{
"data": [...],
"pagination": {
"total": 100,
"page": 1,
"per_page": 20,
"has_next": true
}
}Versioning
- URL path versioning:
/api/v1/users - Breaking changes require new version
- Deprecation: add
Sunsetheader with date, keep old version for N months
Input Validation
- Validate at the controller/route level BEFORE business logic
- Return ALL validation errors at once (batch), not one at a time
- Sanitize strings: trim whitespace, escape HTML where applicable
- Enforce max lengths on all string fields
Checklist
During /implement:
- Every endpoint has input validation
- Every endpoint returns consistent error format
- Every endpoint has proper auth check (or explicit
publicannotation) - Pagination for list endpoints
- Rate limiting consideration (at least documented in spec)
- No sensitive data in URL parameters (use body or headers)
- Request/response examples in spec match implementation
During /review:
- No N+1 query patterns in list endpoints
- Proper HTTP status codes (not everything is 200)
- Idempotency for PUT/DELETE
- Error messages don't leak internal details (stack traces, SQL, paths)
- CORS configured per ADR policy
Heading-Scoped Read Note
For phase-entry loading, read only:
When to ApplyChecklist
Load Conventions, Anti-Patterns, and References on full read or cache miss only.
Anti-Patterns
- God endpoint: One endpoint that does everything based on query params. Split into specific endpoints.
- Verb in URL:
POST /createUser→POST /users - Inconsistent naming: Mixing
/userand/products(singular vs plural) - Swallowing errors: Catching exceptions and returning 200 with
{ success: false } - Leaking internals: Returning DB column names directly as API fields without mapping
- Missing 404: Returning empty 200 instead of 404 when resource doesn't exist
- Unbounded lists: List endpoints without pagination or default limits
References
- Project ADR:
docs/adr/ADR-002-project-architecture.md§ API Design - Security guardrails:
.agent/rules/security_guardrails.md(A01: Access Control, A03: Injection) - Spec template:
.agentcortex/templates/spec-app-feature.md§ API Contract
Other versions192 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- KbWen/agentic-os★ 22499% same
Wrote their own version · 191
- affaan-m/ECC★ 246ksame 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★ 502same name
- loulanyue/awesome-claude-notes★ 272same name
- DevelopersGlobal/ai-agent-skills★ 216same name
- kid-sid/claude-spellbook★ 190same name
- margelo/react-native-skills★ 172same name
- proyecto26/system-design-skills★ 118same 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.
Used alongsideProjects with it also use everything-claude-code, everything-claude-code-conventions 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.
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
InfopibeSkillinvestor-materials
Create and update pitch decks, one-pagers, investor memos, accelerator applications, financial models, and fundraising materials. Use when the user needs investor-facing documents, projections, use-of-funds tables, milestone plans, or materials that must stay internally consistent across multiple fundraising assets.
Also in 21 projects that use this
CodeWithBehnamSkilldmux-workflows
Multi-agent orchestration using dmux (tmux pane manager for AI agents). Patterns for parallel agent workflows across Claude Code, Codex, OpenCode, and other harnesses. Use when running multiple agent sessions in parallel or coordinating multi-agent development workflows.
Also in 16 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
- +1 more from Infopibe
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- auth-securitySkill
- database-designSkill
- dispatching-parallel-agentsSkill
- doc-lookupSkill
- frontend-patternsSkill
- karpathy-principlesSkill
- production-readinessSkill
- red-team-adversarialSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- using-git-worktreesSkill
- verification-before-completionSkill
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.

