What problem does it solve?
The process of creating or modifying API routes in OBigode requires consistent authentication, robust input validation with Zod, reliable error handling, and correct TypeScript typings across all routes. This Skill provides a clear blueprint to ensure these concerns are addressed uniformly.
Core Features & Use Cases
- Enforces authentication and authorization using the project's helpers (getSession, requireRole).
- Validates request bodies with Zod schemas defined in src/lib/validations.
- Implements centralized error handling and predictable response structures.
- Ensures type-safety with the Prisma client integration in src/lib/prisma.
- Provides guidance for structuring routes under src/app/api to maintain isolation and consistency.
Quick Start
Create a new API route under src/app/api following the example pattern and implement authentication, validation, and error handling as demonstrated.