rest-api-design

Define REST API guidelines for HTTP semantics, error handling, and versioning.

2|Updated Feb 28, 2024
One-click install
npx skills add https://github.com/coagus/php-api-builder --skill rest-api-design-coagus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rest-api-design
Source: https://github.com/coagus/php-api-builder/tree/main/.claude/skills/rest-api-design
Command: npx skills add https://github.com/coagus/php-api-builder --skill rest-api-design-coagus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Clear, consistent REST API design reduces integration friction by ensuring predictable URLs, HTTP semantics, error handling, pagination, and OpenAPI docs.

Core Features & Use Cases

  • Defines resource-oriented URLs using nouns, pluralization, and kebab-case.
  • Guides HTTP methods mapping to CRUD operations, status codes, and RFC 7807 error responses.
  • Supports OpenAPI 3.1 generation from attributes and ensures consistent API contracts across services.
  • Example: design a new public API for a product catalog with versioned endpoints and standardized error reporting.

Quick Start

Model a new user resource with endpoints following REST conventions and RFC 7807 error handling.

Frequently Asked Questions about rest-api-design

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

FAQPage Schema
How do I design REST API URLs to ensure clear resource contracts?

To design REST API URLs with clear resource contracts, use resource-oriented nouns, pluralization, and kebab-case formatting. This ensures predictable endpoint structures and consistent HTTP semantics across your services.

What is the best way to handle REST API error reporting with HTTP status codes?

The best way to handle REST API error reporting is by mapping HTTP methods to standard status codes and using RFC 7807 compliant error responses. This provides standardized, predictable error handling for clients.

How do I generate OpenAPI 3.1 documentation from my REST API attributes?

OpenAPI 3.1 documentation can be generated directly from your REST API attributes. This ensures consistent API contracts and accurate endpoint documentation across services without manual specification writing.

When do I need API versioning and pagination in my REST endpoint design?

API versioning and pagination are needed when designing public REST APIs to manage resource changes over time and handle large datasets. Applying them to endpoint design ensures scalable and maintainable service contracts.

Does this REST API design approach support CRUD operations and standardized error formats?

Yes, this REST API design approach supports CRUD operations by mapping them to appropriate HTTP methods. It also enforces standardized RFC 7807 error formats to reduce integration friction across services.