API design reviewer

Comprehensive REST API design review with automated linting, breaking-change detection, and design scorecards.

How to use it

Claude Code
  1. Run the line below. It pulls the whole folder into ~/.claude/skills/api-design-reviewer, including the files SKILL.md points to.
  2. Describe your job in plain words. Claude Code follows the skill from there.
Claude Code — installs the whole folder, not just SKILL.md
npx degit alirezarezvani/claude-skills/engineering/skills/api-design-reviewer#main ~/.claude/skills/api-design-reviewer

For one project only, change the path to .claude/skills/api-design-reviewer. This skill also uses openapi.json, lint.json, openapi-v1.json, openapi-v2.json, breaking.json, scorecard.json — copying SKILL.md alone won't be enough. See the folder on GitHub.

Claude (web or desktop app)
  1. On this page open ⋯ → Download .md.
  2. Save it as SKILL.md in a folder, zip the folder, then Customize → Skills → + → Create skill → Upload a skill.
  3. Pick the file and Save. Claude shows the name and description and runs a security scan.
  4. Check the skill is switched on.
  5. Start a new chat and describe your job in plain words. The AI follows the skill from there.
ChatGPT or another app
  1. ChatGPT: make a Project and paste it into Instructions.
  2. Neither? Paste it at the top of a new chat — it works for that chat.
Not working?
  • Check which app you pasted it into — the steps above name the right one.
  • Some skills need the paid tier of Claude or ChatGPT.
Step-by-step guide with screenshots · Ask in the forum

Paste into Claude, ChatGPT or Cursor.

Source of API design reviewer

Show the full text433 lines
namedescription
api-design-reviewerComprehensive 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

# 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: /api/v1/users/123/orders
Actions: /api/v1/users/123/activate (POST)
Filtering: /api/v1/users?status=active&role=admin

Versioning Strategies

/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": "2026-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": "[email protected]",
  "_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/skills/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

  1. Consistency First: Maintain consistent naming, response formats, and patterns
  2. Documentation: Provide comprehensive, up-to-date API documentation
  3. Versioning: Plan for evolution with clear versioning strategies
  4. Error Handling: Implement consistent, informative error responses
  5. Security: Build security into every layer of the API
  6. Performance: Design for scale and efficiency from the start
  7. Backward Compatibility: Minimize breaking changes and provide migration paths
  8. Testing: Implement comprehensive testing including contract testing
  9. Monitoring: Add observability for API usage and performance
  10. Developer Experience: Prioritize ease of use and clear documentation

Common Anti-Patterns to Avoid

  1. Verb-based URLs: Use nouns for resources, not actions
  2. Inconsistent Response Formats: Maintain standard response structures
  3. Over-nesting: Avoid deeply nested resource hierarchies
  4. Ignoring HTTP Status Codes: Use appropriate status codes for different scenarios
  5. Poor Error Messages: Provide actionable, specific error information
  6. Missing Pagination: Always paginate list endpoints
  7. No Versioning Strategy: Plan for API evolution from day one
  8. Exposing Internal Structure: Design APIs for external consumption, not internal convenience
  9. Missing Rate Limiting: Protect your API from abuse and overload
  10. Inadequate Testing: Test all aspects including error cases and edge conditions

Regular use of the linting, breaking change detection, and scoring tools ensures continuous improvement and helps maintain API quality throughout the development lifecycle.

1---
2name: "api-design-reviewer"
3description: "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."
4---
5 
6# API Design Reviewer
7 
8**Tier:** POWERFUL
9**Category:** Engineering / Architecture
10**Maintainer:** Claude Skills Team
11 
12## Overview
13 
14The 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.
15 
16## Quick Start — run the tools first
17 
18```bash
19# 1. Lint an OpenAPI/Swagger spec for convention violations
20python3 scripts/api_linter.py openapi.json --format json -o lint.json
21 
22# 2. Detect breaking changes between two spec versions (gate: exits non-zero with --exit-on-breaking)
23python3 scripts/breaking_change_detector.py openapi-v1.json openapi-v2.json --format json --exit-on-breaking -o breaking.json
24 
25# 3. Score overall design quality (gate: --min-grade fails below threshold)
26python3 scripts/api_scorecard.py openapi.json --format json --min-grade B -o scorecard.json
27```
28 
29Review 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.
30 
31## Core Capabilities
32 
33### 1. API Linting and Convention Analysis
34- **Resource Naming Conventions**: Enforces kebab-case for resources, camelCase for fields
35- **HTTP Method Usage**: Validates proper use of GET, POST, PUT, PATCH, DELETE
36- **URL Structure**: Analyzes endpoint patterns for consistency and RESTful design
37- **Status Code Compliance**: Ensures appropriate HTTP status codes are used
38- **Error Response Formats**: Validates consistent error response structures
39- **Documentation Coverage**: Checks for missing descriptions and documentation gaps
40 
41### 2. Breaking Change Detection
42- **Endpoint Removal**: Detects removed or deprecated endpoints
43- **Response Shape Changes**: Identifies modifications to response structures
44- **Field Removal**: Tracks removed or renamed fields in API responses
45- **Type Changes**: Catches field type modifications that could break clients
46- **Required Field Additions**: Flags new required fields that could break existing integrations
47- **Status Code Changes**: Detects changes to expected status codes
48 
49### 3. API Design Scoring and Assessment
50- **Consistency Analysis** (30%): Evaluates naming conventions, response patterns, and structural consistency
51- **Documentation Quality** (20%): Assesses completeness and clarity of API documentation
52- **Security Implementation** (20%): Reviews authentication, authorization, and security headers
53- **Usability Design** (15%): Analyzes ease of use, discoverability, and developer experience
54- **Performance Patterns** (15%): Evaluates caching, pagination, and efficiency patterns
55 
56## REST Design Principles
57 
58### Resource Naming Conventions
59```
60✅ Good Examples:
61- /api/v1/users
62- /api/v1/user-profiles
63- /api/v1/orders/123/line-items
64 
65❌ Bad Examples:
66- /api/v1/getUsers
67- /api/v1/user_profiles
68- /api/v1/orders/123/lineItems
69```
70 
71### HTTP Method Usage
72- **GET**: Retrieve resources (safe, idempotent)
73- **POST**: Create new resources (not idempotent)
74- **PUT**: Replace entire resources (idempotent)
75- **PATCH**: Partial resource updates (not necessarily idempotent)
76- **DELETE**: Remove resources (idempotent)
77 
78### URL Structure Best Practices
79```
80Collection Resources: /api/v1/users
81Individual Resources: /api/v1/users/123
82Nested Resources: /api/v1/users/123/orders
83Actions: /api/v1/users/123/activate (POST)
84Filtering: /api/v1/users?status=active&role=admin
85```
86 
87## Versioning Strategies
88 
89### 1. URL Versioning (Recommended)
90```
91/api/v1/users
92/api/v2/users
93```
94**Pros**: Clear, explicit, easy to route
95**Cons**: URL proliferation, caching complexity
96 
97### 2. Header Versioning
98```
99GET /api/users
100Accept: application/vnd.api+json;version=1
101```
102**Pros**: Clean URLs, content negotiation
103**Cons**: Less visible, harder to test manually
104 
105### 3. Media Type Versioning
106```
107GET /api/users
108Accept: application/vnd.myapi.v1+json
109```
110**Pros**: RESTful, supports multiple representations
111**Cons**: Complex, harder to implement
112 
113### 4. Query Parameter Versioning
114```
115/api/users?version=1
116```
117**Pros**: Simple to implement
118**Cons**: Not RESTful, can be ignored
119 
120## Pagination Patterns
121 
122### Offset-Based Pagination
123```json
124{
125 "data": [...],
126 "pagination": {
127 "offset": 20,
128 "limit": 10,
129 "total": 150,
130 "hasMore": true
131 }
132}
133```
134 
135### Cursor-Based Pagination
136```json
137{
138 "data": [...],
139 "pagination": {
140 "nextCursor": "eyJpZCI6MTIzfQ==",
141 "hasMore": true
142 }
143}
144```
145 
146### Page-Based Pagination
147```json
148{
149 "data": [...],
150 "pagination": {
151 "page": 3,
152 "pageSize": 10,
153 "totalPages": 15,
154 "totalItems": 150
155 }
156}
157```
158 
159## Error Response Formats
160 
161### Standard Error Structure
162```json
163{
164 "error": {
165 "code": "VALIDATION_ERROR",
166 "message": "The request contains invalid parameters",
167 "details": [
168 {
169 "field": "email",
170 "code": "INVALID_FORMAT",
171 "message": "Email address is not valid"
172 }
173 ],
174 "requestId": "req-123456",
175 "timestamp": "2026-02-16T13:00:00Z"
176 }
177}
178```
179 
180### HTTP Status Code Usage
181- **400 Bad Request**: Invalid request syntax or parameters
182- **401 Unauthorized**: Authentication required
183- **403 Forbidden**: Access denied (authenticated but not authorized)
184- **404 Not Found**: Resource not found
185- **409 Conflict**: Resource conflict (duplicate, version mismatch)
186- **422 Unprocessable Entity**: Valid syntax but semantic errors
187- **429 Too Many Requests**: Rate limit exceeded
188- **500 Internal Server Error**: Unexpected server error
189 
190## Authentication and Authorization Patterns
191 
192### Bearer Token Authentication
193```
194Authorization: Bearer <token>
195```
196 
197### API Key Authentication
198```
199X-API-Key: <api-key>
200Authorization: Api-Key <api-key>
201```
202 
203### OAuth 2.0 Flow
204```
205Authorization: Bearer <oauth-access-token>
206```
207 
208### Role-Based Access Control (RBAC)
209```json
210{
211 "user": {
212 "id": "123",
213 "roles": ["admin", "editor"],
214 "permissions": ["read:users", "write:orders"]
215 }
216}
217```
218 
219## Rate Limiting Implementation
220 
221### Headers
222```
223X-RateLimit-Limit: 1000
224X-RateLimit-Remaining: 999
225X-RateLimit-Reset: 1640995200
226```
227 
228### Response on Limit Exceeded
229```json
230{
231 "error": {
232 "code": "RATE_LIMIT_EXCEEDED",
233 "message": "Too many requests",
234 "retryAfter": 3600
235 }
236}
237```
238 
239## HATEOAS (Hypermedia as the Engine of Application State)
240 
241### Example Implementation
242```json
243{
244 "id": "123",
245 "name": "John Doe",
246 "email": "[email protected]",
247 "_links": {
248 "self": { "href": "/api/v1/users/123" },
249 "orders": { "href": "/api/v1/users/123/orders" },
250 "profile": { "href": "/api/v1/users/123/profile" },
251 "deactivate": {
252 "href": "/api/v1/users/123/deactivate",
253 "method": "POST"
254 }
255 }
256}
257```
258 
259## Idempotency
260 
261### Idempotent Methods
262- **GET**: Always safe and idempotent
263- **PUT**: Should be idempotent (replace entire resource)
264- **DELETE**: Should be idempotent (same result)
265- **PATCH**: May or may not be idempotent
266 
267### Idempotency Keys
268```
269POST /api/v1/payments
270Idempotency-Key: 123e4567-e89b-12d3-a456-426614174000
271```
272 
273## Backward Compatibility Guidelines
274 
275### Safe Changes (Non-Breaking)
276- Adding optional fields to requests
277- Adding fields to responses
278- Adding new endpoints
279- Making required fields optional
280- Adding new enum values (with graceful handling)
281 
282### Breaking Changes (Require Version Bump)
283- Removing fields from responses
284- Making optional fields required
285- Changing field types
286- Removing endpoints
287- Changing URL structures
288- Modifying error response formats
289 
290## OpenAPI/Swagger Validation
291 
292### Required Components
293- **API Information**: Title, description, version
294- **Server Information**: Base URLs and descriptions
295- **Path Definitions**: All endpoints with methods
296- **Parameter Definitions**: Query, path, header parameters
297- **Request/Response Schemas**: Complete data models
298- **Security Definitions**: Authentication schemes
299- **Error Responses**: Standard error formats
300 
301### Best Practices
302- Use consistent naming conventions
303- Provide detailed descriptions for all components
304- Include examples for complex objects
305- Define reusable components and schemas
306- Validate against OpenAPI specification
307 
308## Performance Considerations
309 
310### Caching Strategies
311```
312Cache-Control: public, max-age=3600
313ETag: "123456789"
314Last-Modified: Wed, 21 Oct 2015 07:28:00 GMT
315```
316 
317### Efficient Data Transfer
318- Use appropriate HTTP methods
319- Implement field selection (`?fields=id,name,email`)
320- Support compression (gzip)
321- Implement efficient pagination
322- Use ETags for conditional requests
323 
324### Resource Optimization
325- Avoid N+1 queries
326- Implement batch operations
327- Use async processing for heavy operations
328- Support partial updates (PATCH)
329 
330## Security Best Practices
331 
332### Input Validation
333- Validate all input parameters
334- Sanitize user data
335- Use parameterized queries
336- Implement request size limits
337 
338### Authentication Security
339- Use HTTPS everywhere
340- Implement secure token storage
341- Support token expiration and refresh
342- Use strong authentication mechanisms
343 
344### Authorization Controls
345- Implement principle of least privilege
346- Use resource-based permissions
347- Support fine-grained access control
348- Audit access patterns
349 
350## Tools and Scripts
351 
352### api_linter.py
353Analyzes API specifications for compliance with REST conventions and best practices.
354 
355**Features:**
356- OpenAPI/Swagger spec validation
357- Naming convention checks
358- HTTP method usage validation
359- Error format consistency
360- Documentation completeness analysis
361 
362### breaking_change_detector.py
363Compares API specification versions to identify breaking changes.
364 
365**Features:**
366- Endpoint comparison
367- Schema change detection
368- Field removal/modification tracking
369- Migration guide generation
370- Impact severity assessment
371 
372### api_scorecard.py
373Provides comprehensive scoring of API design quality.
374 
375**Features:**
376- Multi-dimensional scoring
377- Detailed improvement recommendations
378- Letter grade assessment (A-F)
379- Benchmark comparisons
380- Progress tracking
381 
382## Integration Examples
383 
384### CI/CD Integration
385```yaml
386- name: "api-linting"
387 run: python scripts/api_linter.py openapi.json
388 
389- name: "breaking-change-detection"
390 run: python scripts/breaking_change_detector.py openapi-v1.json openapi-v2.json
391 
392- name: "api-scorecard"
393 run: python scripts/api_scorecard.py openapi.json
394```
395 
396### Pre-commit Hooks
397```bash
398#!/bin/bash
399python engineering/skills/api-design-reviewer/scripts/api_linter.py api/openapi.json
400if [ $? -ne 0 ]; then
401 echo "API linting failed. Please fix the issues before committing."
402 exit 1
403fi
404```
405 
406## Best Practices Summary
407 
4081. **Consistency First**: Maintain consistent naming, response formats, and patterns
4092. **Documentation**: Provide comprehensive, up-to-date API documentation
4103. **Versioning**: Plan for evolution with clear versioning strategies
4114. **Error Handling**: Implement consistent, informative error responses
4125. **Security**: Build security into every layer of the API
4136. **Performance**: Design for scale and efficiency from the start
4147. **Backward Compatibility**: Minimize breaking changes and provide migration paths
4158. **Testing**: Implement comprehensive testing including contract testing
4169. **Monitoring**: Add observability for API usage and performance
41710. **Developer Experience**: Prioritize ease of use and clear documentation
418 
419## Common Anti-Patterns to Avoid
420 
4211. **Verb-based URLs**: Use nouns for resources, not actions
4222. **Inconsistent Response Formats**: Maintain standard response structures
4233. **Over-nesting**: Avoid deeply nested resource hierarchies
4244. **Ignoring HTTP Status Codes**: Use appropriate status codes for different scenarios
4255. **Poor Error Messages**: Provide actionable, specific error information
4266. **Missing Pagination**: Always paginate list endpoints
4277. **No Versioning Strategy**: Plan for API evolution from day one
4288. **Exposing Internal Structure**: Design APIs for external consumption, not internal convenience
4299. **Missing Rate Limiting**: Protect your API from abuse and overload
43010. **Inadequate Testing**: Test all aspects including error cases and edge conditions
431 
432 
433Regular use of the linting, breaking change detection, and scoring tools ensures continuous improvement and helps maintain API quality throughout the development lifecycle.

Discussion

Alternatives

Also in Services & APIsSee all 533 in Development →