api-design

Designs RESTful APIs with PHP/Laravel implementation examples.

8|Updated Feb 9, 2026
One-click install
npx skills add https://github.com/zb-ss/opencode-workflows --skill api-design-zb-ss
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-design
Source: https://github.com/zb-ss/opencode-workflows/tree/main/skill/api-design
Command: npx skills add https://github.com/zb-ss/opencode-workflows --skill api-design-zb-ss

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to designing and implementing RESTful APIs, ensuring adherence to best practices for resource naming, HTTP methods, status codes, and response formats.

Core Features & Use Cases

  • RESTful Principles: Covers resource naming conventions and appropriate use of HTTP methods (GET, POST, PUT, PATCH, DELETE).
  • HTTP Status Codes: Details the meaning and usage of common 2xx, 4xx, and 5xx status codes for effective communication.
  • Response Formatting: Demonstrates structured JSON responses for single resources, collections, and error handling.
  • Versioning Strategies: Explains URL path, header, and query parameter versioning.
  • API Management: Includes guidance on filtering, sorting, pagination, authentication, rate limiting, and HATEOAS.
  • Security: Provides a checklist for secure API design.
  • Example Implementation: Shows a PHP/Laravel example for common API controller actions.

Quick Start

Generate a detailed API endpoint definition for a user resource including GET, POST, PUT, and DELETE methods with appropriate status codes and response structures.

Frequently Asked Questions about api-design

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

FAQPage Schema
What are the best practices for RESTful API resource naming and HTTP methods?

RESTful API design best practices dictate using plural nouns for resource naming and mapping HTTP methods directly to actions: GET for retrieval, POST for creation, PUT/PATCH for updates, and DELETE for removal.

How do I structure JSON responses and HTTP status codes for a web services API?

Structuring JSON responses for web services requires using standardized envelopes for single resources and collections, while mapping outcomes to appropriate HTTP status codes across 2xx success, 4xx client errors, and 5xx server errors.

What is the best way to implement API versioning, filtering, and pagination?

The best way to implement API versioning, filtering, and pagination involves choosing a strategy like URL path versioning, applying query parameters for sorting and filtering, and utilizing cursor or offset limits for pagination.

How do I add authentication and rate limiting to secure RESTful API endpoints?

To secure RESTful API endpoints, implement authentication mechanisms like OAuth or API keys, enforce rate limiting to prevent abuse, and follow a comprehensive security checklist to protect web services.

Can I use these RESTful API design guidelines with a PHP and Laravel backend?

Yes, you can use these RESTful API design guidelines with a PHP backend, as the implementation includes specific PHP and Laravel controller examples demonstrating common API actions for web services.