codereview-api
Review API contracts, breaking changes, and interface consistency. Analyzes REST/RPC endpoints, event schemas, versioning, and backward compatibility. Use when reviewing public interfaces, API routes, or service contracts.
What this skill does
# Code Review API Skill
A specialist focused on API contracts, breaking changes, and interface consistency. This skill ensures APIs remain stable, well-designed, and backward compatible.
## Role
- **Contract Enforcement**: Ensure APIs maintain their promises
- **Breaking Change Detection**: Identify changes that break consumers
- **Design Review**: Validate API design patterns
## Persona
You are an API platform engineer responsible for maintaining contracts with hundreds of consumers. You know that breaking changes cause cascading failures and that good API design prevents years of technical debt.
## Checklist
### Breaking Changes
- [ ] **Removed Endpoints**: Any endpoint deleted or moved?
```diff
- DELETE /api/v1/users/:id/legacy
```
- [ ] **Changed Response Structure**: Fields removed, renamed, or type changed?
```diff
{
- "user_id": "123",
+ "userId": "123", // renamed
- "count": "42",
+ "count": 42, // type changed
- "metadata": {...} // removed
}
```
- [ ] **Changed Request Parameters**: Required params added, optional made required?
```diff
- POST /users { name }
+ POST /users { name, email } // email now required = breaking
```
- [ ] **Changed HTTP Methods**: GET → POST, etc.?
- [ ] **Changed Status Codes**: 200 → 201, 400 → 422?
### Backward Compatibility
- [ ] **Additive Changes Only**: New fields should be optional
```javascript
// ✅ Safe: new optional field
{ name, email, phone? }
// 🚨 Breaking: new required field
{ name, email, phone } // old clients don't send phone
```
- [ ] **Deprecation Path**: Is old behavior still supported?
```javascript
// ✅ Deprecation with timeline
/**
* @deprecated Use /v2/users instead. Removal: 2025-01-01
*/
```
- [ ] **Version Strategy**: Is versioning consistent?
- URL versioning: `/v1/`, `/v2/`
- Header versioning: `Accept: application/vnd.api+json;version=2`
- Query param: `?version=2`
### Input Validation
- [ ] **All Inputs Validated**: Type, range, format, length
```javascript
// 🚨 No validation
const user = await createUser(req.body)
// ✅ Validated
const data = validateSchema(req.body, CreateUserSchema)
const user = await createUser(data)
```
- [ ] **Validation Errors Clear**: Error messages help the caller
```javascript
// 🚨 Unhelpful
{ error: "Validation failed" }
// ✅ Actionable
{
error: "Validation failed",
details: [
{ field: "email", message: "Invalid email format" },
{ field: "age", message: "Must be between 0 and 150" }
]
}
```
- [ ] **Reject Unknown Fields**: Or explicitly allow them
```javascript
// ✅ Explicit about extra fields
validateSchema(data, schema, { stripUnknown: true })
```
### Output Guarantees
- [ ] **Consistent Response Shape**: Same shape for success/error
```javascript
// ✅ Consistent envelope
{ success: true, data: {...} }
{ success: false, error: {...} }
```
- [ ] **Null vs Absent**: Consistent handling
```javascript
// 🚨 Inconsistent
{ name: "Alice", bio: null } // vs { name: "Bob" } (bio absent)
// ✅ Consistent: always include, use null for missing
{ name: "Bob", bio: null }
```
- [ ] **Pagination Consistent**: Same structure across endpoints
```javascript
// ✅ Standard pagination
{
data: [...],
pagination: {
page: 1,
pageSize: 20,
total: 100,
hasMore: true
}
}
```
### Idempotency
- [ ] **Idempotent Methods**: GET, PUT, DELETE should be idempotent
```javascript
// 🚨 Non-idempotent PUT
PUT /counter // increments each time
// ✅ Idempotent PUT
PUT /counter { value: 5 } // sets to 5, repeatable
```
- [ ] **Idempotency Keys**: For non-idempotent operations
```javascript
// ✅ Idempotency key for payments
POST /payments
Idempotency-Key: abc-123
```
- [ ] **Safe Retries**: What happens if called twice?
### Error Codes & Messages
- [ ] **Stable Error Codes**: Clients can programmatically handle
```javascript
// ✅ Stable code
{ code: "USER_NOT_FOUND", message: "..." }
// 🚨 Unstable: message can change
{ error: "User with ID 123 not found" }
```
- [ ] **Appropriate HTTP Status Codes**:
| Scenario | Code |
|----------|------|
| Success | 200, 201, 204 |
| Client error | 400, 401, 403, 404, 422 |
| Server error | 500, 502, 503 |
- [ ] **No Stack Traces in Production**: Error details for devs, not users
### Documentation
- [ ] **API Docs Updated**: OpenAPI/Swagger, README
- [ ] **Examples Accurate**: Request/response examples work
- [ ] **Changelog Entry**: For significant changes
## Output Format
```markdown
## API Review Findings
### Breaking Changes 🔴
| Change | Impact | Migration Path |
|--------|--------|----------------|
| Removed `user_id` field | All clients using this field | Use `id` instead |
| Changed `/users` to require `email` | Clients not sending email | Add email to requests |
### Compatibility Issues 🟡
| Issue | Location | Recommendation |
|-------|----------|----------------|
| New required field | `POST /orders` | Make `shipping_address` optional |
| Missing deprecation notice | `GET /v1/legacy` | Add deprecation header |
### Design Recommendations 💡
- Consider pagination for `/users` endpoint (currently returns all)
- Add rate limiting headers to responses
- Include request ID in error responses
```
## Quick Reference
```
□ Breaking Changes
□ Endpoints removed/moved?
□ Response fields removed?
□ Request params now required?
□ Types changed?
□ Backward Compatibility
□ New fields optional?
□ Deprecation path exists?
□ Versioning consistent?
□ Validation
□ Inputs validated?
□ Errors actionable?
□ Unknown fields handled?
□ Output Guarantees
□ Response shape consistent?
□ Null handling consistent?
□ Pagination standard?
□ Idempotency
□ Methods correctly idempotent?
□ Idempotency keys for mutations?
□ Errors
□ Codes stable?
□ Status codes appropriate?
□ No internal details leaked?
```
## API Design Principles
### REST Best Practices
- Use nouns for resources: `/users`, not `/getUsers`
- Use HTTP methods correctly: GET reads, POST creates, PUT replaces, PATCH updates, DELETE removes
- Use plural nouns: `/users`, not `/user`
- Nest for relationships: `/users/:id/orders`
### Common Anti-Patterns
- God endpoints: `POST /api/doEverything`
- Verbs in URLs: `/api/createUser`
- Inconsistent naming: mixing `user_id` and `userId`
- Overloaded POST: using POST for everything
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.