create-next-rest-framework-api
Installation
SKILL.md
Create Next REST Framework API
Implement Next.js APIs with next-rest-framework using schema-driven request validation, typed responses, and OpenAPI generation.
Workflow
- Pick router surface first: App Router (
docsRoute,route,routeOperation,rpcRoute) or Pages Router (docsApiRoute,apiRoute,apiRouteOperation,rpcApiRoute). - Load only the reference file needed for the task:
references/app-router.mdreferences/pages-router.mdreferences/forms-and-typed-responses.mdreferences/openapi-and-cli.md
- Define input and output schemas before handler logic.
- Add middleware only for cross-cutting concerns (auth, tracing, feature flags), and pass derived context through middleware return values.
- Wire docs and CLI (
generateandvalidate) so OpenAPI stays current in CI.