api-design

Provides REST API design conventions covering resource naming, status codes, pagination, and error responses.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/inuishan/PET --skill api-design-inuishan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: api-design
Source: https://github.com/inuishan/PET/tree/main/.codex/skills/api-design
Command: npx skills add https://github.com/inuishan/PET --skill api-design-inuishan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Designing consistent, developer-friendly REST APIs is hard when teams lack shared conventions, leading to inconsistent URLs, wrong status codes, and ad-hoc error formats that confuse API consumers. ## Core Features & Use Cases - Resource and URL Conventions: Enforces plural, kebab-case, noun-based resource naming with correct HTTP method semantics. - Response Standards: Defines success, collection, and error response envelopes with pagination (offset and cursor), filtering, sorting, and sparse fieldsets. - Production Concerns: Covers authentication, authorization, rate limiting headers, and versioning strategy with deprecation timelines. - Use Case: When adding a new endpoint to a Next.js, Django, or Go service, use this Skill to validate the URL structure, pick the right status codes, and generate a schema-validated implementation following the included checklist. ## Quick Start Ask the AI to design a REST API endpoint for creating and listing orders following the api-design conventions, including pagination and error handling.

Frequently Asked Questions about api-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design REST API endpoints with proper naming conventions?▼

Use plural, lowercase, kebab-case nouns for resources like /api/v1/team-members, and nest sub-resources for ownership such as /users/:id/orders. Avoid verbs in URLs except for non-CRUD actions like /orders/:id/cancel.

What HTTP status codes should a REST API return?▼

Return 200 for successful reads, 201 with a Location header for creations, 204 for deletions, 400 or 422 for validation failures, 404 for missing resources, 409 for conflicts, and 429 for rate limiting. Never return 200 for errors.

Should I use cursor or offset pagination for my API?▼

Use cursor pagination for large datasets, infinite scroll, and public APIs since it performs consistently and stays stable with concurrent inserts. Use offset pagination for admin dashboards, small datasets, and search results where users expect page numbers.

How do I version a REST API without breaking clients?▼

Start with URL path versioning like /api/v1/ and maintain at most two active versions. Non-breaking changes such as adding fields or endpoints need no new version, while removing fields or changing types requires one, with a Sunset header before retirement.

What should a standard API error response look like?▼

Return an error object with a machine-readable code, a human-readable message, and a details array containing field-level validation errors with field name, message, and code. Pair this with the correct HTTP status code such as 422 for semantic validation failures.