Our review
Creates a Backend for Frontend (BFF) layer in Next.js using Route Handlers, with explicit validation and caching strategy.
Strengths
- Aggregates multiple backend APIs into a single endpoint.
- Hides sensitive tokens and credentials from the client.
- Normalizes responses for the UI.
- Enforces per-tenant isolation in queries and caches.
Limitations
- Adds extra latency due to server-side aggregation.
- Requires maintaining Route Handler code.
- Improper caching can lead to stale data.
When you need to aggregate multiple backend APIs and hide credentials from the frontend.
When the backend API is already client-friendly or when latency is critical and caching overhead is unacceptable.
Security analysis
SafeThis skill provides architectural guidance for building a backend-for-frontend with Next.js, no executable commands or security-sensitive operations are performed.
No concerns found
Examples
Create a Next.js BFF route handler that aggregates user data from two external APIs, with caching and tenant isolation.Implement a BFF layer in Next.js to normalize responses from different microservices into a single schema.Set up a Next.js Route Handler as a BFF to call an external API with a secret key, returning only safe fields to the client.name: next-bff description: Create a Next.js BFF layer with Route Handlers and server data access. disable-model-invocation: true
Next.js BFF (Backend for Frontend)
Implement a BFF using Route Handlers with explicit validation and caching.
When to Use
- Aggregating multiple backend APIs
- Hiding credentials and tokens
- Normalizing responses for the UI
- Enforcing per-tenant isolation (if multi-tenant)
Inputs
- External services to aggregate
- Auth requirements
- Cache strategy (no-store vs revalidate)
- Tenant identification (subdomain, path, header)
Instructions
- Create Route Handlers under
app/api/. - Fetch from upstream services on the server with timeouts.
- Normalize and validate responses.
- Apply caching and revalidation explicitly.
- Map upstream errors to stable API responses.
- Enforce tenant isolation in queries and caches.
Output
- BFF endpoints with typed, normalized responses and cache strategy.
Next.js App Router Expert
Development
A skill that turns Claude into a Next.js App Router expert.
README Generator
Development
Creates professional and comprehensive README.md files for your projects.
API Documentation Writer
Development
Generates comprehensive API documentation in OpenAPI/Swagger format.