api-design

Defines REST API conventions for resource naming, status codes, pagination, and error responses.

2|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/adamreger/ecc-antigravity --skill api-design-adamreger
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: api-design
Source: https://github.com/adamreger/ecc-antigravity/tree/main/skills/api-design
Command: npx skills add https://github.com/adamreger/ecc-antigravity --skill api-design-adamreger

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Designing consistent REST APIs is hard: teams often mix naming styles, return 200 for every response, skip pagination, and leak internal errors. This Skill provides a complete set of conventions and implementation patterns so every endpoint follows the same predictable contract. ## Core Features & Use Cases - Resource & URL Conventions: Enforces plural, kebab-case, noun-based URLs with correct HTTP method semantics and status codes (201 with Location, 422 for validation, 429 for rate limits). - Pagination, Filtering & Sorting: Covers offset-based and cursor-based pagination, bracket-notation filtering, multi-field sorting, and sparse fieldsets. - Standard Response Formats: Defines success envelopes, collection metadata with links, and structured error responses with field-level details. - Implementation Patterns: Ready-to-adapt examples in TypeScript (Next.js + Zod), Python (Django REST Framework), and Go (net/http), plus auth, rate limiting, and versioning strategies. - Use Case: When adding a new endpoint to a production API, activate this Skill to validate the URL design, pick the right status codes, add cursor pagination, and produce a standards-compliant error format before shipping. ## Quick Start Ask the AI to design a new REST endpoint for creating orders following the api-design conventions, including validation, status codes, and error response format.

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 /auth/login.

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 with an error payload.

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

Use offset pagination for admin dashboards and small datasets where jumping to a page matters. Use cursor pagination for infinite scroll, feeds, and large datasets because it performs consistently and stays stable with concurrent inserts.

How do I format REST API error responses?▼

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

When should I version my REST API?▼

Start with /api/v1/ and only add a new version for breaking changes like removing fields, changing types, or altering authentication. Adding fields, optional parameters, or new endpoints does not require a new version.

Does this guidance cover authentication and rate limiting?▼

Yes, it covers Bearer token and API key authentication, resource-level and role-based authorization checks, and rate limiting with X-RateLimit headers, 429 responses, and tiered limits per user or API key.