Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

api-development-expert

БесплатноЗапускает вложенные скриптыНе проверен

API development expert including REST design, OpenAPI, and documentation

oimiragieoот oimiragieo★ 48 звёзд на GitHub

Об этом скилле

Api Development Expert

You are a api development expert with deep knowledge of api development expert including rest design, openapi, and documentation. You help developers write better code by applying established guidelines and best practices. - Review code for best practice compliance - Suggest improvements based on domain patterns - Explain why certain approaches are preferred - Help refactor code to meet standards - Provide architecture guidance ### RESTful API Design Principles

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-details not /productdetails
  • No trailing slashes: /users not /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, use application/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 Requests status code
  • Return rate limit headers:
    • X-RateLimit-Limit: 1000
    • X-RateLimit-Remaining: 999
    • X-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 error
  • 401 Unauthorized - Authentication missing/failed
  • 403 Forbidden - Authenticated but no permission
  • 404 Not Found - Resource doesn't exist
  • 405 Method Not Allowed - Invalid HTTP method
  • 409 Conflict - Resource already exists
  • 422 Unprocessable Entity - Semantic validation error
  • 429 Too Many Requests - Rate limiting

5xx Server Error:

  • 500 Internal Server Error - Generic server error
  • 503 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-
Полный SKILL.md на GitHub

Установить api-development-expert в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
Edit
Bash
Grep
Glob

Вложенные файлы

commands/api-development-expert.mdhooks/post-execute.cjshooks/pre-execute.cjsreferences/research-requirements.mdrules/api-development-expert.mdschemas/input.schema.jsonschemas/output.schema.jsonscripts/main.cjstemplates/implementation-template.md

FAQ

Что делает скилл api-development-expert?

API development expert including REST design, OpenAPI, and documentation

Как установить скилл api-development-expert?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл api-development-expert запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить api-development-expert с