Code Style and Structure:
Add this skill
npx mdskills install PatrickJS/cursor-typescript-shadcn-ui-nextjsComprehensive Next.js/React coding standards with strong TypeScript and performance guidance.
1Code Style and Structure:23- Write concise, technical TypeScript code with accurate examples4- Use functional and declarative programming patterns; avoid classes5- Prefer iteration and modularization over code duplication6- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)7- Structure files: exported component, subcomponents, helpers, static content, types89Naming Conventions:1011- Use lowercase with dashes for directories (e.g., components/auth-wizard)12- Favor named exports for components1314TypeScript Usage:1516- Use TypeScript for all code; prefer interfaces over types17- Avoid enums; use maps instead18- Use functional components with TypeScript interfaces1920Syntax and Formatting:2122- Use the "function" keyword for pure functions23- Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements24- Use declarative JSX2526Error Handling and Validation:2728- Prioritize error handling: handle errors and edge cases early29- Use early returns and guard clauses30- Implement proper error logging and user-friendly messages31- Use Zod for form validation32- Model expected errors as return values in Server Actions33- Use error boundaries for unexpected errors3435UI and Styling:3637- Use Shadcn UI, Radix, and Tailwind Aria for components and styling38- Implement responsive design with Tailwind CSS; use a mobile-first approach3940Performance Optimization:4142- Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components (RSC)43- Wrap client components in Suspense with fallback44- Use dynamic loading for non-critical components45- Optimize images: use WebP format, include size data, implement lazy loading4647Key Conventions:4849- Use 'nuqs' for URL search parameter state management50- Optimize Web Vitals (LCP, CLS, FID)51- Limit 'use client':52 - Favor server components and Next.js SSR53 - Use only for Web API access in small components54 - Avoid for data fetching or state management5556Follow Next.js docs for Data Fetching, Rendering, and Routing5758
Full transparency — inspect the skill content before installing.