What problem does it solve?
This Skill addresses the boilerplate of exposing backend services through Next.js API routes by providing a consistent pattern for authenticated proxies, error handling, and caching.
Core Features & Use Cases
- API proxying: Create routes that forward requests to a backend service with proper error handling and retries.
- Server-side aggregation: Build endpoints that fetch and combine data from multiple sources to reduce frontend complexity.
- Security & caching: Centralize authentication, rate limiting, and set caching headers to improve performance for frontend apps.
- Use Case: Example: expose a votes tally endpoint at /api/votes/tally that proxies to the internal API and caches responses for 60 seconds.
Quick Start
Use the add-api-route skill to scaffold a new Next.js API route at src/pages/api/voters/stats.ts that proxies to /api/voters/statistics with caching.