api-design

Design and review server-side API routes with consistent response formats and validation.

4|Updated Apr 16, 2026
One-click install
npx skills add https://github.com/AshenDulsanka/agent-arche --skill api-design-ashendulsanka
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-design
Source: https://github.com/AshenDulsanka/agent-arche/tree/main/skills/api-design
Command: npx skills add https://github.com/AshenDulsanka/agent-arche --skill api-design-ashendulsanka

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps address the challenges of creating and maintaining secure, consistent, and reliable server-side API routes by providing guidelines and tools for API design, validation, error handling, and more.

Core Features & Use Cases

  • Consistent Response Envelope: Ensures every endpoint returns the same structure for success and error responses.
  • Semantic HTTP Status Codes: Adheres to best practices for using the right HTTP status codes to indicate the success or failure of requests.
  • Input Validation: Validates user input at the boundary of the route to prevent common injection attacks and data corruption.
  • Error Handling: Offers guidance on never exposing internal details and providing clear error messages.
  • Authentication & Authorization: Includes considerations for securing APIs and ensuring users have the correct permissions.
  • Rate Limiting: Provides strategies for protecting APIs from abuse by limiting the number of requests a user can make in a certain time frame.
  • CORS Configuration: Offers advice on configuring Cross-Origin Resource Sharing for public APIs.
  • Security Checklist: Ensures all security best practices are considered before shipping an API route.

Quick Start

Design or review an API endpoint using the api-design skill and ensure it follows best practices for security and consistency.

Frequently Asked Questions about api-design

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

FAQPage Schema
What's the best way to structure consistent API response formats and error handling?

Consistent API design uses a standard response envelope for all success and error outputs. Structured error handling ensures internal details are never exposed, providing clear messages and semantic HTTP status codes for every server-side route.

How do I validate API input to prevent injection attacks and data corruption?

API input validation should be applied at the route boundary to prevent injection attacks and data corruption. Validating user input immediately upon entry ensures malicious payloads are rejected before processing server-side API endpoints.

What HTTP status codes should I use for successful and failed API requests?

Semantic HTTP status codes indicate API request success or failure accurately. Best practices involve using specific codes like 200 for success, 400 for bad input validation, 401 for authentication issues, and 429 for rate limiting.

How do I secure server-side API routes with authentication and rate limiting?

Securing API routes requires implementing authentication patterns to verify user permissions and applying rate limiting strategies. Rate limiting protects APIs from abuse by restricting the number of requests a user can make within a specific time frame.

Do I need to configure CORS for public APIs and what security checklist should I follow?

Public APIs require Cross-Origin Resource Sharing (CORS) configuration to control browser access. Following an API security checklist ensures authentication, input validation, and rate limiting are verified before shipping any API route.

Can I use this API design approach for any server-side API architecture?

This API design approach suits developers and API architects working on any server-side API endpoints. It focuses on establishing API consistency and security across the entire architecture without relying on specific framework dependencies.