AI SummarySystematic REST API development with error handling, validation, and consistent response formats. This Skill enforces: Apply when building API routes, handling errors, or designing responses.
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to install the "API Development" skill in my project. Please run this command in my terminal: # Install skill into your project mkdir -p .claude/skills/examples && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/examples/SKILL.md "https://raw.githubusercontent.com/ThamJiaHe/claude-code-handbook/main/skills/examples/api-development-skill.md" Then restart Claude Code (or reload the window in Cursor) so the skill is picked up.
Description
Build REST APIs with proper error handling, status codes, request validation, response formatting, and rate limiting. Apply when creating API routes, handling errors, validating input, or designing API responses.
Overview
This Skill enforces: • HTTP status codes (appropriate, not overused) • RFC 7807 Problem Details for errors • Input validation and sanitization • Consistent response formatting • Request correlation IDs • Rate limiting • Security-first error messages • Centralized error handling Apply when building API routes, handling errors, or designing responses.
API Development
Systematic REST API development with error handling, validation, and consistent response formats.
Status Code Categories
| Range | Purpose | Common Examples | |-------|---------|-----------------| | 200-299 | Success | 200 OK, 201 Created, 204 No Content | | 300-399 | Redirection | 301 Moved Permanently, 302 Found | | 400-499 | Client Errors | 400 Bad Request, 401 Unauthorized, 404 Not Found | | 500-599 | Server Errors | 500 Internal Error, 503 Service Unavailable |
Correct Status Codes
`ts // ✅ GOOD: Specific status codes 200 // GET: Resource retrieved 201 // POST: Resource created 204 // DELETE: Resource deleted (no content) 400 // Bad Request: Validation failed 401 // Unauthorized: Not authenticated 403 // Forbidden: Authenticated but no permission 404 // Not Found: Resource doesn't exist 409 // Conflict: Duplicate email 422 // Unprocessable Entity: Semantic error 429 // Too Many Requests: Rate limited 500 // Internal Server Error: Server bug // ❌ BAD: Vague status codes 200 // Success response for everything 500 // Error response for everything 200 // Returned even when validation failed `
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster