| description | applyTo |
|---|---|
Next.js + Tailwind development standards and instructions |
**/*.tsx, **/*.ts, **/*.jsx, **/*.js, **/*.css |
Instructions for high-quality Next.js applications with Tailwind CSS styling and TypeScript.
- Latest Next.js (App Router)
- TypeScript for type safety
- Tailwind CSS for styling
- App Router with server and client components
- Group routes by feature/domain
- Implement proper error boundaries
- Use React Server Components by default
- Leverage static optimization where possible
- Strict mode enabled
- Clear type definitions
- Proper error handling with type guards
- Zod for runtime type validation
- Tailwind CSS with consistent color palette
- Responsive design patterns
- Dark mode support
- Follow container queries best practices
- Maintain semantic HTML structure
- React Server Components for server state
- React hooks for client state
- Proper loading and error states
- Optimistic updates where appropriate
- Server Components for direct database queries
- React Suspense for loading states
- Proper error handling and retry logic
- Cache invalidation strategies
- Input validation and sanitization
- Proper authentication checks
- CSRF protection
- Rate limiting implementation
- Secure API route handling
- Image optimization with next/image
- Font optimization with next/font
- Route prefetching
- Proper code splitting
- Bundle size optimization
- Plan component hierarchy
- Define types and interfaces
- Implement server-side logic
- Build client components
- Add proper error handling
- Implement responsive styling
- Add loading states
- Write tests