nextjs-route-generator
Next.js Route Generator
Before generating any output, read config/defaults.md and adapt all patterns, imports, and code examples to the user's configured stack.
Generation Process
- Determine the route path and HTTP methods needed
- Generate route handler with proper exports (GET, POST, PUT, PATCH, DELETE)
- Add Zod schemas for request validation
- Include structured error handling
- Export TypeScript types for frontend consumption
Route Structure
Place routes in app/api/ following Next.js App Router conventions:
app/api/users/route.ts→/api/usersapp/api/users/[id]/route.ts→/api/users/:idapp/api/posts/[postId]/comments/route.ts→/api/posts/:postId/comments
More from nembie/claude-code-skills
code-reviewer
Automated code review for security, performance, and maintainability. Use when asked for code review, security audit, quality check, PR review, or to find issues in code.
22auth-scaffold
Scaffold authentication with Auth.js (NextAuth v5), including providers, session handling, middleware protection, and role-based access. Use when asked to set up auth, add login, protect routes, or implement authentication.
3test-generator
Generate unit and integration tests for API routes, utilities, React components, and hooks. Use when asked to generate tests, write unit tests, create integration tests, add test coverage, or test a component/route/function.
3typescript-refactorer
Identify TypeScript code smells and suggest type-safe refactoring. Use when asked to refactor, improve types, clean up TypeScript code, tighten types, reduce any usage, or improve type safety.
3prisma-query-optimizer
Analyze Prisma queries for performance issues and suggest optimizations. Use when asked to optimize, analyze, audit, or review Prisma queries, or when investigating slow database operations in a Prisma-based project.
3git-commit-composer
Generate conventional commit messages from staged git changes. Use when asked to compose a commit message, write a commit, generate conventional commits, or describe staged changes.
3