スキル一覧に戻る
nguyenthienthanh

api-designer

by nguyenthienthanh

Aura Frog — AI-powered structured development plugin for Claude Code Turn Claude Code into a full-fledged dev platform: Aura Frog brings 24 specialized agents, a 9-phase TDD workflow, built-in quality gates and 70+ commands so your team doesn’t need to manually draft prompts — just call the right command and follow guided instructions.

3🍴 2📅 2026年1月22日
GitHubで見るManusで実行

SKILL.md


name: api-designer description: "Design consistent, RESTful APIs with proper versioning, documentation, and error handling." autoInvoke: false priority: medium triggers:

  • "API design"
  • "REST API"
  • "endpoint design"

Skill: API Designer

Category: Dev Expert Version: 1.0.0 Used By: backend-nodejs, backend-python, backend-go, backend-laravel


Overview

Design consistent, RESTful APIs with proper versioning, documentation, and error handling.


1. RESTful Conventions

MethodEndpointPurposeResponse
GET/usersList all200 + array
GET/users/:idGet one200 / 404
POST/usersCreate201 + created
PUT/users/:idReplace200 / 404
PATCH/users/:idUpdate200 / 404
DELETE/users/:idDelete204 / 404

Nested Resources

GET    /users/:userId/orders          # User's orders
POST   /users/:userId/orders          # Create order for user
GET    /users/:userId/orders/:orderId # Specific order

2. Naming Conventions

TypeConventionExample
ResourcesPlural nouns/users, /orders
ActionsVerbs (rare)/auth/login, /reports/generate
Query paramssnake_case?page_size=20
Request/ResponsecamelCase{ "firstName": "John" }

3. Versioning Strategies

StrategyExampleWhen to Use
URL Path/v1/usersMost common, clear
HeaderAccept: application/vnd.api+json;version=1Clean URLs
Query/users?version=1Simple but messy

Recommended: URL path (/api/v1/...)


4. Response Format

Success

{
  "data": { "id": "123", "name": "John" },
  "meta": { "timestamp": "2025-01-01T00:00:00Z" }
}

List with Pagination

{
  "data": [{ "id": "1" }, { "id": "2" }],
  "meta": {
    "page": 1,
    "pageSize": 20,
    "total": 100,
    "totalPages": 5
  }
}

Error

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid input",
    "fields": { "email": "Invalid format" }
  }
}

5. Status Codes

CodeMeaningWhen to Use
200OKSuccessful GET/PUT/PATCH
201CreatedSuccessful POST
204No ContentSuccessful DELETE
400Bad RequestInvalid input
401UnauthorizedNo/invalid auth
403ForbiddenNo permission
404Not FoundResource missing
409ConflictDuplicate/state conflict
422UnprocessableValidation failed
429Too ManyRate limited
500Server ErrorUnexpected error

6. Pagination Patterns

Offset-based (Simple)

GET /users?page=2&page_size=20

Cursor-based (Scalable)

GET /users?cursor=eyJpZCI6MTAwfQ&limit=20
PatternProsCons
OffsetSimple, jump to pageSlow on large datasets
CursorConsistent, fastNo page jumping

7. Filtering & Sorting

# Filter
GET /users?status=active&role=admin

# Sort
GET /users?sort=created_at:desc,name:asc

# Search
GET /users?q=john

# Combined
GET /users?status=active&sort=name:asc&page=1&page_size=20

8. API Documentation (OpenAPI)

openapi: 3.0.0
info:
  title: User API
  version: 1.0.0
paths:
  /users:
    get:
      summary: List users
      parameters:
        - name: page
          in: query
          schema: { type: integer, default: 1 }
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserList'

9. API Design Checklist

  • RESTful resource naming
  • Consistent response format
  • Proper status codes
  • Pagination for lists
  • Error responses with codes
  • Versioning strategy
  • OpenAPI documentation
  • Rate limiting headers

Best Practices

Do's

  • Use plural nouns for resources
  • Return created/updated resource
  • Include pagination metadata
  • Document with OpenAPI
  • Version from day one

Don'ts

  • Use verbs in resource names
  • Return different formats per endpoint
  • Expose internal IDs/structures
  • Ignore backward compatibility
  • Skip error code standards

Version: 1.0.0 | Last Updated: 2025-11-28

スコア

総合スコア

65/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

レビュー

💬

レビュー機能は近日公開予定です