What problem does it solve?
Inconsistent API integration leads to fragmented code, type errors, and security vulnerabilities. This skill provides a rigid, 5-file standardized pattern for organizing all API interactions, ensuring type safety, role-based access control, and maintainability across the codebase.
Core Features & Use Cases
- 5-File System: Enforces a clear structure for types (
endpoint-types.ts), URLs (endpoints.ts), generic clients (api-client.ts), admin clients (admin-api-client.ts), and protected wrappers (protected-endpoints.ts).
- Type-Safe API: Guarantees full TypeScript coverage from request parameters to response data, reducing runtime errors and improving developer experience.
- Role-Based Access: Integrates Supabase Auth for automatic authentication and explicit admin-only access patterns, enhancing security and control.
- Use Case: When adding a new feature that requires interacting with a backend API, use this skill to define the new endpoints, types, and client wrappers, ensuring they conform to the project's strict API standards.
Quick Start
Define new API types for a 'products' resource, including list, get, create, update, and delete operations, following the 5-file API organization pattern.