Next.js with TypeScript and Tailwind UI best practices
Add this skill
npx mdskills install PatrickJS/cursor-nextjsSolid Next.js best practices covering modern App Router patterns and performance optimization
1---2description: Next.js with TypeScript and Tailwind UI best practices3globs: **/*.tsx, **/*.ts, src/**/*.ts, src/**/*.tsx4---56# Next.js Best Practices78## Project Structure9- Use the App Router directory structure10- Place components in `app` directory for route-specific components11- Place shared components in `components` directory12- Place utilities and helpers in `lib` directory13- Use lowercase with dashes for directories (e.g., `components/auth-wizard`)1415## Components16- Use Server Components by default17- Mark client components explicitly with 'use client'18- Wrap client components in Suspense with fallback19- Use dynamic loading for non-critical components20- Implement proper error boundaries21- Place static content and interfaces at file end2223## Performance24- Optimize images: Use WebP format, size data, lazy loading25- Minimize use of 'useEffect' and 'setState'26- Favor Server Components (RSC) where possible27- Use dynamic loading for non-critical components28- Implement proper caching strategies2930## Data Fetching31- Use Server Components for data fetching when possible32- Implement proper error handling for data fetching33- Use appropriate caching strategies34- Handle loading and error states appropriately3536## Routing37- Use the App Router conventions38- Implement proper loading and error states for routes39- Use dynamic routes appropriately40- Handle parallel routes when needed4142## Forms and Validation43- Use Zod for form validation44- Implement proper server-side validation45- Handle form errors appropriately46- Show loading states during form submission4748## State Management49- Minimize client-side state50- Use React Context sparingly51- Prefer server state when possible52- Implement proper loading states
Full transparency — inspect the skill content before installing.