api-development-expert
БесплатноЗапускает вложенные скриптыНе проверенAPI development expert including REST design, OpenAPI, and documentation
от oimiragieo★ 48 звёзд на GitHubОб этом скилле
Api Development Expert
When designing REST APIs, follow these core architectural principles:
Resource-Oriented Design
- Use nouns for resources (plural form):
/users,/products,/orders - Avoid verbs in URIs: ❌
/getUsers,/createProduct - Structure hierarchically:
/users/{userId}/orders(orders belonging to a user) - Use lowercase with hyphens:
/product-detailsnot/productdetails - No trailing slashes:
/usersnot/users/
HTTP Methods (Verbs with Purpose)
GET- Retrieve resources (idempotent & safe, no side effects)POST- Create new resources (not idempotent, returns 201 Created with Location header)PUT- Replace entire resource or upsert (idempotent)PATCH- Partial update (not idempotent, useapplication/json-patch+json)DELETE- Remove resource (idempotent, returns 204 No Content or 200 OK)
Query Parameters for Filtering, Sorting, and Pagination
- Filtering:
/products?category=electronics&price_gt=100 - Sorting:
/products?sort_by=price&order=desc - Pagination:
/products?page=2&limit=10- Use offset-based (simple but inefficient for deep pages) or cursor-based (efficient for large datasets)
API Versioning Strategies
Choose one and stick to it:
- URI Versioning (Most common):
/v1/users,/api/v2/products- Simple for clients, but makes URIs less clean
- Header Versioning:
Accept: application/vnd.myapi.v1+json- Cleaner URIs, but slightly complex for caching and some clients
- Content Negotiation: Use Accept header to specify desired media type and version
OpenAPI/Swagger Specification
Use OpenAPI 3.0+ to define your API specification:
Benefits:
- Machine-readable API specification
- Auto-generates interactive documentation portals
- Client SDK generation
- Request/response schema validation
- IDE and API tool auto-validation
Define schemas for:
- Request parameters (required fields, allowed values, data types)
- Response structures
- Error responses
- Authentication methods
- Enum lists for restricted values
Example: Define validation rules so invalid requests are caught before reaching your backend
Rate Limiting Patterns
Protect against abuse and ensure fair usage:
Implementation strategies:
- Use
429 Too Many Requestsstatus code - Return rate limit headers:
X-RateLimit-Limit: 1000X-RateLimit-Remaining: 999X-RateLimit-Reset: 1640000000
- Common patterns:
- Fixed window: Simple but allows bursts at boundaries
- Sliding window: More accurate, prevents boundary gaming
- Token bucket: Allows controlled bursts
- Leaky bucket: Smooths out traffic
Error Handling Standards
Consistent Error Response Structure:
{
"error": {
"code": "validation_error",
"message": "Input validation failed.",
"details": [{ "field": "email", "message": "Invalid email format." }]
}
}
Use Appropriate HTTP Status Codes:
2xx Success: 200 OK, 201 Created, 204 No Content
3xx Redirection: 301 Moved Permanently, 304 Not Modified
4xx Client Error:
400 Bad Request- General client error401 Unauthorized- Authentication missing/failed403 Forbidden- Authenticated but no permission404 Not Found- Resource doesn't exist405 Method Not Allowed- Invalid HTTP method409 Conflict- Resource already exists422 Unprocessable Entity- Semantic validation error429 Too Many Requests- Rate limiting
5xx Server Error:
500 Internal Server Error- Generic server error503 Service Unavailable- Service temporarily down
Provide machine-readable codes AND human-readable messages
Authentication Patterns
OAuth 2.1 (Industry standard for delegated authorization)
- Mandatory PKCE for all authorization code flows
- Authorization Code + PKCE flow for SPAs, mobile, and web apps
- Removed flows: Implicit grant and Resource Owner Password Credentials (security risks)
- Exact redirect URI matching (no wildcards)
- Never send bearer tokens in query strings (use Authorization header)
- Implement refresh token rotation or sender-constrained tokens
JWT (JSON Web Tokens) for stateless authentication:
- Short expiry times (≤15 minutes for access tokens)
- Use refresh tokens for long-lived sessions
- Include claims for authorization decisions
- Validate signature, expiry, and issuer
API Keys for simpler integrations:
- Use for service-
Установить api-development-expert в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashGrepGlobВложенные файлы
FAQ
Что делает скилл api-development-expert?
API development expert including REST design, OpenAPI, and documentation
Как установить скилл api-development-expert?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл api-development-expert запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic