Endpoint and route-handler rules for Next.js App Router projects. Use when implementing `app/api/**/route.ts`, BFF endpoints, webhooks, uploads, streaming responses, or deciding request validation, response shape, status codes, auth, and error contracts.
Keep endpoints boring, typed, and thin.
{ data, meta? }{ error: { code, message, details? }, meta?: { requestId? } }GET must be side-effect free.POST for create/command operations.PATCH over PUT unless replacing the full resource.DELETE idempotent whenever possible.meta with cursor/page information.route.ts when the logic is reusable.references/response-shapes.md for status-code and payload examples.