api-design-patterns
RESTful API design, error handling, versioning, and best practices. Use when designing APIs, reviewing endpoints, implementing error responses, or setting up API structure. Triggers on "design API", "review API", "REST best practices", or "API patterns".
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o api-design-patterns.zip https://jpskill.com/download/23216.zip && unzip -o api-design-patterns.zip && rm api-design-patterns.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/23216.zip -OutFile "$d\api-design-patterns.zip"; Expand-Archive "$d\api-design-patterns.zip" -DestinationPath $d -Force; ri "$d\api-design-patterns.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
api-design-patterns.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
api-design-patternsフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 2
📖 Claude が読む原文 SKILL.md(中身を展開)
この本文は AI(Claude)が読むための原文(英語または中国語)です。日本語訳は順次追加中。
API Design Patterns
RESTful API design principles for building consistent, developer-friendly APIs. Contains 38 rules across 7 categories covering resource design, error handling, security, pagination, versioning, response format, and documentation.
Metadata
- Version: 2.0.0
- Rule Count: 38 rules across 7 categories
- License: MIT
When to Apply
Reference these guidelines when:
- Designing new API endpoints
- Reviewing existing API structure
- Implementing error handling and validation
- Setting up pagination, filtering, and sorting
- Planning API versioning strategy
- Configuring API security (auth, CORS, rate limiting)
- Writing API documentation (OpenAPI/Swagger)
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Resource Design | CRITICAL | rest- |
| 2 | Error Handling | CRITICAL | error- |
| 3 | Security | CRITICAL | sec- |
| 4 | Pagination & Filtering | HIGH | page-, filter-, sort- |
| 5 | Versioning | HIGH | ver- |
| 6 | Response Format | MEDIUM | resp- |
| 7 | Documentation | MEDIUM | doc- |
Quick Reference
1. Resource Design (CRITICAL)
rest-nouns-not-verbs- Use nouns for endpoints, not verbsrest-plural-resources- Use plural resource namesrest-http-methods- Correct HTTP method usage (GET, POST, PUT, PATCH, DELETE)rest-nested-resources- Proper resource nesting (max 2 levels)rest-status-codes- Appropriate HTTP status codesrest-idempotency- Idempotent operations with idempotency keysrest-hateoas- Hypermedia links for discoverabilityrest-resource-actions- Non-CRUD actions as sub-resources
2. Error Handling (CRITICAL)
error-consistent-format- Consistent error response structureerror-meaningful-messages- Helpful, actionable error messageserror-validation-details- Field-level validation errorserror-error-codes- Machine-readable error codeserror-no-stack-traces- Never expose stack traces in productionerror-request-id- Include request IDs for debugging
3. Security (CRITICAL)
sec-authentication- Proper auth implementation (OAuth2/JWT)sec-authorization- Resource-level permissions (RBAC)sec-rate-limiting- Prevent abuse with rate limitingsec-input-validation- Validate and sanitize all inputsec-cors-config- CORS configuration with whitelistssec-https-only- Enforce HTTPS for all trafficsec-sensitive-data- Protect passwords, tokens, PII
4. Pagination & Filtering (HIGH)
page-cursor-based- Cursor pagination for large datasetspage-offset-based- Offset pagination for simple casespage-consistent-params- Consistent parameter namingpage-metadata- Include pagination metadata in responsesfilter-query-params- Filter via query parameterssort-flexible- Flexible sorting with-prefix for descending
5. Versioning (HIGH)
ver-url-path- Version in URL path (/api/v1/)ver-header-based- Version via Accept headerver-backward-compatible- Maintain backward compatibilityver-deprecation- Deprecation strategy with Sunset header
6. Response Format (MEDIUM)
resp-consistent-structure- Consistent response enveloperesp-json-conventions- JSON naming conventionsresp-partial-responses- Field selection (sparse fieldsets)resp-compression- Response compression (gzip/Brotli)
7. Documentation (MEDIUM)
doc-openapi- OpenAPI/Swagger specificationdoc-examples- Request/response examplesdoc-changelog- API changelog
Essential Guidelines
Resource Naming
# ❌ Verbs in URLs
GET /getUsers
POST /createUser
# ✅ Nouns with HTTP methods
GET /users # List users
POST /users # Create user
GET /users/123 # Get user
PUT /users/123 # Update user (full)
PATCH /users/123 # Update user (partial)
DELETE /users/123 # Delete user
Error Response Format
{
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid data",
"details": [
{
"field": "email",
"code": "INVALID_FORMAT",
"message": "Please provide a valid email address"
}
],
"request_id": "req_abc123"
}
}
Pagination
{
"data": [...],
"meta": {
"current_page": 2,
"per_page": 20,
"total_pages": 10,
"total_count": 195
},
"links": {
"first": "/users?page=1&per_page=20",
"prev": "/users?page=1&per_page=20",
"next": "/users?page=3&per_page=20",
"last": "/users?page=10&per_page=20"
}
}
Rate Limiting Headers
HTTP/1.1 200 OK
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 998
X-RateLimit-Reset: 1640995200
How to Use
Read individual rule files for detailed explanations:
rules/rest-http-methods.md
rules/error-consistent-format.md
rules/page-cursor-based.md
rules/sec-authentication.md
rules/ver-url-path.md
rules/doc-openapi.md
References
- RESTful API Guidelines
- Zalando RESTful API Guidelines
- Microsoft API Guidelines
- Google API Design Guide
- OpenAPI Specification
Full Compiled Document
For the complete guide with all rules expanded: AGENTS.md
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (5,833 bytes)
- 📎 README.md (1,809 bytes)