.cursorrules Next.js React Tailwind

Modern Web Development Toolkit

A collection of tools for building scalable, responsive web applications using Tailwind CSS, TypeScript, and Next.js, emphasizing performance and maintainability.

Core Tools

  • Component Library Generator:
    Auto-generate Shadcn UI/Tailwind components with TypeScript types using CLI input or JSON specs.
  • Responsive UI Design Tool:
    Visualize breakpoints (sm/md/lg/xl) in real-time with Tailwind’s grid/flex utilities.

Code Analysis & Optimization

  • TypeScript Code Quality Analyzer:
    Enforce naming conventions and UI guidelines aligned with Tailwind’s mobile-first patterns.
  • Node.js Architecture Checker:
    Audit Next.js server/client component distribution using Vercel’s optimization strategies.

Performance Enhancers

  • Lazy Loading Service:
    Auto-apply loading="lazy" and WebP conversion via @astrojs/image-like techniques.
  • Dynamic Import Scheduler:
    Identify non-critical components for code splitting using Next.js’ dynamic.

State & Styling Solutions

  • ‘nuqs’ State Integrator:
    Manage URL params in Next.js with type-safe query synchronization.
  • Tailwind Customization Platform:
    Create themes with Fluid’s clamp()-based scaling and export configs for TypeScript.

Project Scaffolding

  • Next.js Template:
    Enforce /src/app routing and /src/components structure for scalability.
  • Framer Motion Hooks Library:
    Pre-built animations (e.g., fade-ins) via React hooks, optimized for Tailwind + TypeScript.

Key Technologies:

  • Tailwind CSS (Breakpoints: sm:640px, md:768px, lg:1024px
  • Next.js App Router
  • TypeScript
  • Shadcn UI

Overview of .cursorrules prompt

The .cursorrules file outlines coding conventions and organizational best practices for a TypeScript project using Node.js, Next.js App Router, React, Shadcn UI, Tailwind, and Framer Motion. It emphasizes concise and technical coding styles, preferring functional and declarative programming patterns. The file suggests using descriptive naming conventions, TypeScript interfaces over types, and avoiding certain patterns like enums. It highlights the importance of file structuring, responsive UI design with Tailwind CSS, and performance optimization techniques such as limiting client-side interactions and employing server components. The organization of the components is suggested to be either by type or feature within a structured directory layout, enhancing modularity and scalability. The project structure under a /src directory is emphasized for clarity and adherence to industry standards.

Updated: March 17, 2025
Developers building scalable, organized Next.js projects with TypeScript, React, and Tailwind will benefit from this prompt's guidelines to maintain structure, performance, and readability.
Usefull for: