rest-api-design
Design RESTful APIs following best practices for resource modeling, HTTP methods, status codes, versioning, and documentation. Use when creating new APIs, designing endpoints, or improving existing API architecture.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o rest-api-design.zip https://jpskill.com/download/21515.zip && unzip -o rest-api-design.zip && rm rest-api-design.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/21515.zip -OutFile "$d\rest-api-design.zip"; Expand-Archive "$d\rest-api-design.zip" -DestinationPath $d -Force; ri "$d\rest-api-design.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
rest-api-design.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
rest-api-designフォルダができる - 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
- 同梱ファイル
- 9
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
REST API デザイン
目次
概要
直感的で一貫性があり、リソース指向アーキテクチャの業界ベストプラクティスに従った REST API を設計します。
使用する場面
- 新しい RESTful API を設計する場合
- エンドポイント構造を作成する場合
- リクエスト/レスポンス形式を定義する場合
- API バージョニングを実装する場合
- API 仕様を文書化する場合
- 既存の API をリファクタリングする場合
クイックスタート
最小限の動作例:
✅ 良いリソース名(名詞、複数形)
GET /api/users
GET /api/users/123
GET /api/users/123/orders
POST /api/products
DELETE /api/products/456
❌ 悪いリソース名(動詞、一貫性がない)
GET /api/getUsers
POST /api/createProduct
GET /api/user/123 (単数形/複数形が一貫していない)
リファレンスガイド
references/ ディレクトリ内の詳細な実装:
| ガイド | 内容 |
|---|---|
| リソース命名 | リソース命名、HTTP メソッドと操作 |
| リクエスト例 | リクエスト例 |
| クエリパラメータ | クエリパラメータ |
| レスポンス形式 | レスポンス形式 |
| HTTP ステータスコード | HTTP ステータスコード、API バージョニング、認証とセキュリティ、レート制限ヘッダー |
| OpenAPI ドキュメント | OpenAPI ドキュメント |
| 完全な例: Express.js | const express = require("express"); |
ベストプラクティス
✅ するべきこと
- リソースには動詞ではなく名詞を使用する
- コレクションには複数形を使用する
- 命名規則に一貫性を持たせる
- 適切な HTTP ステータスコードを返す
- コレクションにページネーションを含める
- フィルタリングとソートのオプションを提供する
- API をバージョン管理する
- OpenAPI で徹底的に文書化する
- HTTPS を使用する
- レート制限を実装する
- 明確なエラーメッセージを提供する
- 日付には ISO 8601 を使用する
❌ するべきではないこと
- エンドポイント名に動詞を使用する
- エラーに対して 200 を返す
- 内部 ID を不必要に公開する
- リソースを過度にネストする(最大 2 レベル)
- 一貫性のない命名を使用する
- 認証を忘れる
- 機密データを返す
- バージョニングなしで後方互換性を破る
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
REST API Design
Table of Contents
Overview
Design REST APIs that are intuitive, consistent, and follow industry best practices for resource-oriented architecture.
When to Use
- Designing new RESTful APIs
- Creating endpoint structures
- Defining request/response formats
- Implementing API versioning
- Documenting API specifications
- Refactoring existing APIs
Quick Start
Minimal working example:
✅ Good Resource Names (Nouns, Plural)
GET /api/users
GET /api/users/123
GET /api/users/123/orders
POST /api/products
DELETE /api/products/456
❌ Bad Resource Names (Verbs, Inconsistent)
GET /api/getUsers
POST /api/createProduct
GET /api/user/123 (inconsistent singular/plural)
Reference Guides
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Resource Naming | Resource Naming, HTTP Methods & Operations |
| Request Examples | Request Examples |
| Query Parameters | Query Parameters |
| Response Formats | Response Formats |
| HTTP Status Codes | HTTP Status Codes, API Versioning, Authentication & Security, Rate Limiting Headers |
| OpenAPI Documentation | OpenAPI Documentation |
| Complete Example: Express.js | const express = require("express"); |
Best Practices
✅ DO
- Use nouns for resources, not verbs
- Use plural names for collections
- Be consistent with naming conventions
- Return appropriate HTTP status codes
- Include pagination for collections
- Provide filtering and sorting options
- Version your API
- Document thoroughly with OpenAPI
- Use HTTPS
- Implement rate limiting
- Provide clear error messages
- Use ISO 8601 for dates
❌ DON'T
- Use verbs in endpoint names
- Return 200 for errors
- Expose internal IDs unnecessarily
- Over-nest resources (max 2 levels)
- Use inconsistent naming
- Forget authentication
- Return sensitive data
- Break backward compatibility without versioning
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (2,612 bytes)
- 📎 references/complete-example-expressjs.md (2,607 bytes)
- 📎 references/http-status-codes.md (1,356 bytes)
- 📎 references/openapi-documentation.md (1,883 bytes)
- 📎 references/query-parameters.md (405 bytes)
- 📎 references/request-examples.md (755 bytes)
- 📎 references/resource-naming.md (955 bytes)
- 📎 references/response-formats.md (1,183 bytes)
- 📎 scripts/validate-api.sh (440 bytes)