selmakcby/claude-agents-skills/api-design
Claude Code and agent skill by selmakcby/claude-agents-skills
Trust tier 2
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Backend API design specialist. Use when building REST/GraphQL APIs, designing endpoints, data models, or backend architecture. Covers RESTful principles, HTTP semantics, error handling, versioning, and OWASP-aligned security.
Install
npx vskill@latest install selmakcby/claude-agents-skills/api-designSKILL.md
API Design Principles
When to trigger
- Designing a new API endpoint
- Adding routes to existing API
- Database schema work that affects API contract
- Keywords: "endpoint", "API", "route", "backend", "server", "REST", "GraphQL"
Core RESTful principles
Resource-oriented URLs
- Nouns, not verbs:
/users/123, not/getUser?id=123 - Pluralize resources:
/orders, not/order - Nest only when expressing parent/child:
/users/:id/orders - Max 2 levels deep — beyond that, use query params
HTTP methods (correct semantics)
| Method | Use for | Idempotent | Safe | |
|---|---|---|---|---|
| GET | Read | Yes | Yes | |
| POST | Create | No | No | |
| PUT | Replace (full update) | Yes | No | |
| PATCH | Partial update | No* | No | |
| DELETE | Remove | Yes | No |
\* PATCH can be idempotent depending on semantics.
Status codes (correct use)
- 200 OK — successful GET/PUT/PATCH with body
- 201 Created — successful POST creating resource
- 204 No Content — successful DELETE or action with no body
- 400 Bad Request — validation failure
- 401 Unauthorized — missing/invalid auth
- 403 Forbidden — authenticated but not authorized
- 404 Not Found — resource doesn't exist
- 409 Conflict — version mismatch, duplicate resource
- 422 Unprocessable Entity — semantic validation failure
- 429 Too Many Requests — rate limited
- 500 Internal Server Error — unhandled server fault
Response envelope
Consistent shape for all responses:
Endpoint design patterns
Pagination
- Cursor-based for large/changing sets:
?cursor=abc&limit=20 - Offset-based for small stable sets:
?page=1&limit=20 - Always cap
limitserver-side (max 100)
Filtering
- Query params:
?status=active&created_after=2024-01-01 - Sort:
?sort=-created_at(minus prefix = descending)
Versioning
- URL path:
/v1/users,/v2/users(easiest to deprecate) - Never introduce breaking changes to existing version
Security (mandatory)
- Authentication — every non-public endpoint checks auth first
- Authorization — row-level checks, not just auth-exists
- Input validation — Zod schema on every request body + query
- Rate limiting — public routes + AI/LLM routes especially
- CORS — whitelist, not
* - Output filtering — never leak internal IDs or PII in error messages
- Webhook signatures — verify signature before trusting payload
Error handling
- Never expose stack traces to the client
- Log server-side with request ID
- Return structured error:
{ code: "INVALID_INPUT", message: "...", field: "email" } - HTTP status code must match error type
Output format
Rules
- RESTful first. Only use GraphQL / RPC if there's a concrete reason.
- No breaking changes to existing API versions. Ever.
- Every endpoint validates input — no "we'll add validation later".
- Every endpoint has a test (unit for business logic, integration for HTTP layer).
- Document before coding. OpenAPI spec or at least a Markdown contract.
- Rate limit on day 1 — retrofitting is painful.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingmy-project-demo/.claude/skills/api-design/SKILL.md
Popularity
- Repository stars
- 138
- Repository forks
- 20
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/selmakcby/claude-agents-skills/api-design)