🛠️ API Design Reviewer
API設計のレビューを、設計原則や業界標準に照らし合わせて、問題点や改善点を指摘し、より使いやすく効率的なAPI設計を支援するSkill。
📺 まず動画で見る(YouTube)
▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗
※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。
📜 元の英語説明(参考)
API Design Reviewer
🇯🇵 日本人クリエイター向け解説
API設計のレビューを、設計原則や業界標準に照らし合わせて、問題点や改善点を指摘し、より使いやすく効率的なAPI設計を支援するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o api-design-reviewer.zip https://jpskill.com/download/4368.zip && unzip -o api-design-reviewer.zip && rm api-design-reviewer.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/4368.zip -OutFile "$d\api-design-reviewer.zip"; Expand-Archive "$d\api-design-reviewer.zip" -DestinationPath $d -Force; ri "$d\api-design-reviewer.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
api-design-reviewer.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
api-design-reviewerフォルダができる - 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-17
- 取得日時
- 2026-05-18
- 同梱ファイル
- 6
💬 こう話しかけるだけ — サンプルプロンプト
- › API Design Reviewer を使って、最小構成のサンプルコードを示して
- › API Design Reviewer の主な使い方と注意点を教えて
- › API Design Reviewer を既存プロジェクトに組み込む方法を教えて
これをClaude Code に貼るだけで、このSkillが自動発動します。
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
API デザインレビューア
ティア: POWERFUL
カテゴリ: エンジニアリング / アーキテクチャ
メンテナー: Claude Skills Team
概要
API デザインレビューアスキルは、REST の慣習、ベストプラクティス、業界標準に焦点を当て、API デザインの包括的な分析とレビューを提供します。このスキルは、自動リンティング、破壊的変更の検出、デザインスコアカードを通じて、エンジニアリングチームが一貫性があり、保守可能で、適切に設計された API を構築するのに役立ちます。
コア機能
1. API リンティングと慣習分析
- リソース命名規則: リソースには kebab-case、フィールドには camelCase を強制します。
- HTTP メソッドの使用: GET、POST、PUT、PATCH、DELETE の適切な使用を検証します。
- URL 構造: 一貫性と RESTful なデザインのためにエンドポイントパターンを分析します。
- ステータスコード準拠: 適切な HTTP ステータスコードが使用されていることを確認します。
- エラー応答形式: 一貫したエラー応答構造を検証します。
- ドキュメントカバレッジ: 記述の欠落やドキュメントのギャップをチェックします。
2. 破壊的変更の検出
- エンドポイントの削除: 削除または非推奨になったエンドポイントを検出します。
- 応答形状の変更: 応答構造の変更を識別します。
- フィールドの削除: API 応答で削除または名前変更されたフィールドを追跡します。
- 型の変更: クライアントを壊す可能性のあるフィールド型の変更を検出します。
- 必須フィールドの追加: 既存の統合を壊す可能性のある新しい必須フィールドにフラグを立てます。
- ステータスコードの変更: 予期されるステータスコードの変更を検出します。
3. API デザインのスコアリングと評価
- 一貫性分析 (30%): 命名規則、応答パターン、構造の一貫性を評価します。
- ドキュメント品質 (20%): API ドキュメントの完全性と明確さを評価します。
- セキュリティ実装 (20%): 認証、認可、セキュリティヘッダーをレビューします。
- ユーザビリティデザイン (15%): 使いやすさ、発見しやすさ、開発者エクスペリエンスを分析します。
- パフォーマンスパターン (15%): キャッシング、ページネーション、効率性パターンを評価します。
REST デザイン原則
リソース命名規則
✅ Good Examples:
- /api/v1/users
- /api/v1/user-profiles
- /api/v1/orders/123/line-items
❌ Bad Examples:
- /api/v1/getUsers
- /api/v1/user_profiles
- /api/v1/orders/123/lineItems
HTTP メソッドの使用
- GET: リソースを取得します (安全、冪等)
- POST: 新しいリソースを作成します (冪等ではない)
- PUT: リソース全体を置き換えます (冪等)
- PATCH: リソースの部分的な更新を行います (必ずしも冪等ではない)
- DELETE: リソースを削除します (冪等)
URL 構造のベストプラクティス
Collection Resources: /api/v1/users
Individual Resources: /api/v1/users/123
Nested Resources: /api/v1/users/123/orders
Actions: /api/v1/users/123/activate (POST)
Filtering: /api/v1/users?status=active&role=admin
バージョニング戦略
1. URL バージョニング (推奨)
/api/v1/users
/api/v2/users
長所: 明確、明示的、ルーティングが容易
短所: URL の増殖、キャッシングの複雑さ
2. ヘッダーバージョニング
GET /api/users
Accept: application/vnd.api+json;version=1
長所: クリーンな URL、コンテンツネゴシエーション
短所: 視認性が低い、手動テストが難しい
3. メディアタイプバージョニング
GET /api/users
Accept: application/vnd.myapi.v1+json
長所: RESTful、複数の表現をサポート
短所: 複雑、実装が難しい
4. クエリパラメータバージョニング
/api/users?version=1
長所: 実装が簡単
短所: RESTful ではない、無視される可能性がある
ページネーションパターン
オフセットベースのページネーション
{
"data": [...],
"pagination": {
"offset": 20,
"limit": 10,
"total": 150,
"hasMore": true
}
}
カーソルベースのページネーション
{
"data": [...],
"pagination": {
"nextCursor": "eyJpZCI6MTIzfQ==",
"hasMore": true
}
}
ページベースのページネーション
{
"data": [...],
"pagination": {
"page": 3,
"pageSize": 10,
"totalPages": 15,
"totalItems": 150
}
}
エラー応答形式
標準エラー構造
{
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid parameters",
"details": [
{
"field": "email",
"code": "INVALID_FORMAT",
"message": "Email address is not valid"
}
],
"requestId": "req-123456",
"timestamp": "2024-02-16T13:00:00Z"
}
}
HTTP ステータスコードの使用
- 400 Bad Request: 無効なリクエスト構文またはパラメータ
- 401 Unauthorized: 認証が必要
- 403 Forbidden: アクセス拒否 (認証済みだが認可されていない)
- 404 Not Found: リソースが見つからない
- 409 Conflict: リソースの競合 (重複、バージョン不一致)
- 422 Unprocessable Entity: 構文は有効だが意味論的エラー
- 429 Too Many Requests: レート制限を超過
- 500 Internal Server Error: 予期せぬサーバーエラー
認証と認可のパターン
ベアラートークン認証
Authorization: Bearer <token>
API キー認証
X-API-Key: <api-key>
Authorization: Api-Key <api-key>
OAuth 2.0 フロー
Authorization: Bearer <oauth-access-token>
ロールベースアクセス制御 (RBAC)
{
"user": {
"id": "123",
"roles": ["admin", "editor"],
"permissions": ["read:users", "write:orders"]
}
}
レート制限の実装
ヘッダー
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200
制限超過時の応答
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests",
"retryAfter": 3600
}
}
HATEOAS (Hypermedia as the Engine of Application State)
実装例
{
"id": "123",
"name": "John Doe",
"email": "john@example.com",
"_links": {
"self": { "href": "/api/v1/users/123" },
"orders": { "href": "/api/v1/users/123/orders" },
"profile": { "href": "/api/v1/users/123/profile" },
"deactivate": {
"href": "/api/v1 📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
API Design Reviewer
Tier: POWERFUL
Category: Engineering / Architecture
Maintainer: Claude Skills Team
Overview
The API Design Reviewer skill provides comprehensive analysis and review of API designs, focusing on REST conventions, best practices, and industry standards. This skill helps engineering teams build consistent, maintainable, and well-designed APIs through automated linting, breaking change detection, and design scorecards.
Core Capabilities
1. API Linting and Convention Analysis
- Resource Naming Conventions: Enforces kebab-case for resources, camelCase for fields
- HTTP Method Usage: Validates proper use of GET, POST, PUT, PATCH, DELETE
- URL Structure: Analyzes endpoint patterns for consistency and RESTful design
- Status Code Compliance: Ensures appropriate HTTP status codes are used
- Error Response Formats: Validates consistent error response structures
- Documentation Coverage: Checks for missing descriptions and documentation gaps
2. Breaking Change Detection
- Endpoint Removal: Detects removed or deprecated endpoints
- Response Shape Changes: Identifies modifications to response structures
- Field Removal: Tracks removed or renamed fields in API responses
- Type Changes: Catches field type modifications that could break clients
- Required Field Additions: Flags new required fields that could break existing integrations
- Status Code Changes: Detects changes to expected status codes
3. API Design Scoring and Assessment
- Consistency Analysis (30%): Evaluates naming conventions, response patterns, and structural consistency
- Documentation Quality (20%): Assesses completeness and clarity of API documentation
- Security Implementation (20%): Reviews authentication, authorization, and security headers
- Usability Design (15%): Analyzes ease of use, discoverability, and developer experience
- Performance Patterns (15%): Evaluates caching, pagination, and efficiency patterns
REST Design Principles
Resource Naming Conventions
✅ Good Examples:
- /api/v1/users
- /api/v1/user-profiles
- /api/v1/orders/123/line-items
❌ Bad Examples:
- /api/v1/getUsers
- /api/v1/user_profiles
- /api/v1/orders/123/lineItems
HTTP Method Usage
- GET: Retrieve resources (safe, idempotent)
- POST: Create new resources (not idempotent)
- PUT: Replace entire resources (idempotent)
- PATCH: Partial resource updates (not necessarily idempotent)
- DELETE: Remove resources (idempotent)
URL Structure Best Practices
Collection Resources: /api/v1/users
Individual Resources: /api/v1/users/123
Nested Resources: /api/v1/users/123/orders
Actions: /api/v1/users/123/activate (POST)
Filtering: /api/v1/users?status=active&role=admin
Versioning Strategies
1. URL Versioning (Recommended)
/api/v1/users
/api/v2/users
Pros: Clear, explicit, easy to route
Cons: URL proliferation, caching complexity
2. Header Versioning
GET /api/users
Accept: application/vnd.api+json;version=1
Pros: Clean URLs, content negotiation
Cons: Less visible, harder to test manually
3. Media Type Versioning
GET /api/users
Accept: application/vnd.myapi.v1+json
Pros: RESTful, supports multiple representations
Cons: Complex, harder to implement
4. Query Parameter Versioning
/api/users?version=1
Pros: Simple to implement
Cons: Not RESTful, can be ignored
Pagination Patterns
Offset-Based Pagination
{
"data": [...],
"pagination": {
"offset": 20,
"limit": 10,
"total": 150,
"hasMore": true
}
}
Cursor-Based Pagination
{
"data": [...],
"pagination": {
"nextCursor": "eyJpZCI6MTIzfQ==",
"hasMore": true
}
}
Page-Based Pagination
{
"data": [...],
"pagination": {
"page": 3,
"pageSize": 10,
"totalPages": 15,
"totalItems": 150
}
}
Error Response Formats
Standard Error Structure
{
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid parameters",
"details": [
{
"field": "email",
"code": "INVALID_FORMAT",
"message": "Email address is not valid"
}
],
"requestId": "req-123456",
"timestamp": "2024-02-16T13:00:00Z"
}
}
HTTP Status Code Usage
- 400 Bad Request: Invalid request syntax or parameters
- 401 Unauthorized: Authentication required
- 403 Forbidden: Access denied (authenticated but not authorized)
- 404 Not Found: Resource not found
- 409 Conflict: Resource conflict (duplicate, version mismatch)
- 422 Unprocessable Entity: Valid syntax but semantic errors
- 429 Too Many Requests: Rate limit exceeded
- 500 Internal Server Error: Unexpected server error
Authentication and Authorization Patterns
Bearer Token Authentication
Authorization: Bearer <token>
API Key Authentication
X-API-Key: <api-key>
Authorization: Api-Key <api-key>
OAuth 2.0 Flow
Authorization: Bearer <oauth-access-token>
Role-Based Access Control (RBAC)
{
"user": {
"id": "123",
"roles": ["admin", "editor"],
"permissions": ["read:users", "write:orders"]
}
}
Rate Limiting Implementation
Headers
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200
Response on Limit Exceeded
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests",
"retryAfter": 3600
}
}
HATEOAS (Hypermedia as the Engine of Application State)
Example Implementation
{
"id": "123",
"name": "John Doe",
"email": "john@example.com",
"_links": {
"self": { "href": "/api/v1/users/123" },
"orders": { "href": "/api/v1/users/123/orders" },
"profile": { "href": "/api/v1/users/123/profile" },
"deactivate": {
"href": "/api/v1/users/123/deactivate",
"method": "POST"
}
}
}
Idempotency
Idempotent Methods
- GET: Always safe and idempotent
- PUT: Should be idempotent (replace entire resource)
- DELETE: Should be idempotent (same result)
- PATCH: May or may not be idempotent
Idempotency Keys
POST /api/v1/payments
Idempotency-Key: 123e4567-e89b-12d3-a456-426614174000
Backward Compatibility Guidelines
Safe Changes (Non-Breaking)
- Adding optional fields to requests
- Adding fields to responses
- Adding new endpoints
- Making required fields optional
- Adding new enum values (with graceful handling)
Breaking Changes (Require Version Bump)
- Removing fields from responses
- Making optional fields required
- Changing field types
- Removing endpoints
- Changing URL structures
- Modifying error response formats
OpenAPI/Swagger Validation
Required Components
- API Information: Title, description, version
- Server Information: Base URLs and descriptions
- Path Definitions: All endpoints with methods
- Parameter Definitions: Query, path, header parameters
- Request/Response Schemas: Complete data models
- Security Definitions: Authentication schemes
- Error Responses: Standard error formats
Best Practices
- Use consistent naming conventions
- Provide detailed descriptions for all components
- Include examples for complex objects
- Define reusable components and schemas
- Validate against OpenAPI specification
Performance Considerations
Caching Strategies
Cache-Control: public, max-age=3600
ETag: "123456789"
Last-Modified: Wed, 21 Oct 2015 07:28:00 GMT
Efficient Data Transfer
- Use appropriate HTTP methods
- Implement field selection (
?fields=id,name,email) - Support compression (gzip)
- Implement efficient pagination
- Use ETags for conditional requests
Resource Optimization
- Avoid N+1 queries
- Implement batch operations
- Use async processing for heavy operations
- Support partial updates (PATCH)
Security Best Practices
Input Validation
- Validate all input parameters
- Sanitize user data
- Use parameterized queries
- Implement request size limits
Authentication Security
- Use HTTPS everywhere
- Implement secure token storage
- Support token expiration and refresh
- Use strong authentication mechanisms
Authorization Controls
- Implement principle of least privilege
- Use resource-based permissions
- Support fine-grained access control
- Audit access patterns
Tools and Scripts
api_linter.py
Analyzes API specifications for compliance with REST conventions and best practices.
Features:
- OpenAPI/Swagger spec validation
- Naming convention checks
- HTTP method usage validation
- Error format consistency
- Documentation completeness analysis
breaking_change_detector.py
Compares API specification versions to identify breaking changes.
Features:
- Endpoint comparison
- Schema change detection
- Field removal/modification tracking
- Migration guide generation
- Impact severity assessment
api_scorecard.py
Provides comprehensive scoring of API design quality.
Features:
- Multi-dimensional scoring
- Detailed improvement recommendations
- Letter grade assessment (A-F)
- Benchmark comparisons
- Progress tracking
Integration Examples
CI/CD Integration
- name: "api-linting"
run: python scripts/api_linter.py openapi.json
- name: "breaking-change-detection"
run: python scripts/breaking_change_detector.py openapi-v1.json openapi-v2.json
- name: "api-scorecard"
run: python scripts/api_scorecard.py openapi.json
Pre-commit Hooks
#!/bin/bash
python engineering/api-design-reviewer/scripts/api_linter.py api/openapi.json
if [ $? -ne 0 ]; then
echo "API linting failed. Please fix the issues before committing."
exit 1
fi
Best Practices Summary
- Consistency First: Maintain consistent naming, response formats, and patterns
- Documentation: Provide comprehensive, up-to-date API documentation
- Versioning: Plan for evolution with clear versioning strategies
- Error Handling: Implement consistent, informative error responses
- Security: Build security into every layer of the API
- Performance: Design for scale and efficiency from the start
- Backward Compatibility: Minimize breaking changes and provide migration paths
- Testing: Implement comprehensive testing including contract testing
- Monitoring: Add observability for API usage and performance
- Developer Experience: Prioritize ease of use and clear documentation
Common Anti-Patterns to Avoid
- Verb-based URLs: Use nouns for resources, not actions
- Inconsistent Response Formats: Maintain standard response structures
- Over-nesting: Avoid deeply nested resource hierarchies
- Ignoring HTTP Status Codes: Use appropriate status codes for different scenarios
- Poor Error Messages: Provide actionable, specific error information
- Missing Pagination: Always paginate list endpoints
- No Versioning Strategy: Plan for API evolution from day one
- Exposing Internal Structure: Design APIs for external consumption, not internal convenience
- Missing Rate Limiting: Protect your API from abuse and overload
- Inadequate Testing: Test all aspects including error cases and edge conditions
Conclusion
The API Design Reviewer skill provides a comprehensive framework for building, reviewing, and maintaining high-quality REST APIs. By following these guidelines and using the provided tools, development teams can create APIs that are consistent, well-documented, secure, and maintainable.
Regular use of the linting, breaking change detection, and scoring tools ensures continuous improvement and helps maintain API quality throughout the development lifecycle.
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (11,964 bytes)
- 📎 references/api_antipatterns.md (13,707 bytes)
- 📎 references/rest_design_rules.md (10,444 bytes)
- 📎 scripts/api_linter.py (38,344 bytes)
- 📎 scripts/api_scorecard.py (65,939 bytes)
- 📎 scripts/breaking_change_detector.py (49,030 bytes)