api-design

Design REST and Supabase edge-function API endpoints with schemas, authentication, and RLS-aware queries.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/4asaanAI/Claude-patches --skill api-design-4asaanai
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: api-design
Source: https://github.com/4asaanAI/Claude-patches/tree/main/framework-foundry/Claude%20Plugins/layaa-ai/skills/api-design
Command: npx skills add https://github.com/4asaanAI/Claude-patches --skill api-design-4asaanai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Many API specifications lack consistent routes, clear request/response schemas, and proper security controls; this Skill provides a structured template to design endpoints that are secure, predictable, and RLS-aware for Supabase edge functions and traditional REST services.

Core Features & Use Cases

  • Route and Method Definition: Specify HTTP methods and precise paths for each endpoint.
  • Schema Design: Define required and optional request fields and clear success and error response shapes.
  • Authentication & RLS Guidance: Recommend JWT, API key, or service role usage and outline row-level security policies for Supabase edge functions.
  • Operational Concerns: Include error handling conventions and rate-limiting guidance.
  • Use Case: Create a Supabase edge function endpoint for a chat feature that enforces per-user RLS, JWT auth, standard error responses, and a defined rate limit.

Quick Start

Design a POST /functions/v1/chat endpoint that accepts a JSON message string, returns a JSON reply, enforces JWT authentication with RLS policies restricting rows to the authenticated user, and defines standard error responses and rate limits.

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 Supabase row-level security (RLS)?▼

The best way to design secure REST API endpoints with authentication and error handling is to use a structured template that specifies HTTP methods, defines JSON schemas, outlines JWT/API key requirements, and standardizes error codes to ensure predictable and safe client interactions.

How do I create a Supabase edge function endpoint that enforces JWT auth?▼

To define request and response JSON schemas for your REST API, you specify required and optional request fields along with clear success and error response shapes. This structured schema design ensures web and mobile clients parse predictable data formats.

Can I use this approach to design APIs for both web and mobile clients?▼

Yes, you can use this approach to design APIs for both web and mobile clients. It generates API specifications with precise paths, detailed JSON schemas, and standard error codes that ensure consistent backend service integration across different platforms.

What should I include in REST API error handling and rate-limiting policies?▼

REST API error handling and rate-limiting policies should include standard error codes, clear error messages, and defined rate limits. This operational guidance prevents abuse and provides clients with actionable feedback when requests fail.