Skill-Details
api-design-reviewer
Supports EM technical governance, but is a narrow API-review specialty.
Vor Nutzung prüfen
Die automatische Prüfung bewertet Relevanz, nicht Sicherheit oder Empfehlung. Lies vor der Nutzung die Quellanweisungen.
SKILL.md
Dieser Auszug wurde bei der Prüfung gespeichert. Die externe Quelle enthält die vollständige und aktuelle Version.
--- name: "api-design-reviewer" description: "Comprehensive REST API design review with automated linting, breaking-change detection, and design scorecards. Catches inconsistent conventions, missing versioning, and design smells before APIs ship. Use when reviewing a PR that adds or changes API endpoints, auditing an existing API for v2 migration, or establishing API standards for a team." --- # 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. ## Quick Start — run the tools first ```bash # 1. Lint an OpenAPI/Swagger spec for convention violations python3 scripts/api_linter.py openapi.json --format json -o lint.json # 2. Detect breaking changes between two spec versions (gate: exits non-zero with --exit-on-breaking) python3 scripts/breaking_change_detector.py openapi-v1.json openapi-v2.json --format json --exit-on-breaking -o breaking.json # 3. Score overall design quality (gate: --min-grade fails below threshold) python3 scripts/api_scorecard.py openapi.json --format json --min-grade B -o scorecard.json ``` Review flow: run all three, report linter findings + breaking changes + grade to the user, fix, then re-run until the linter is clean, `--exit-on-breaking` passes (or breaking changes are version-bumped), and the scorecard meets the agreed `--min-grade`. Never sign off an API review on prose alone — attach the tool outputs. ## 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:Vollständige Quelle auf GitHub lesen (öffnet externe Seite)