Next.js React Tailwind .cursorrules prompt file
About .cursorrules prompt file
What you can build
Component Library Generator: Create a tool that automates the generation of component libraries based on Shadcn UI, Tailwind, and TypeScript. It would allow developers to input component specifications and receive organized, stylized, and ready-to-use code.
Responsive UI Design Tool: Develop a web application that allows users to design and visualize responsive interfaces using Tailwind and Shadcn UI. Users can see real-time previews of their designs across various device sizes and export the code in TypeScript.
Code Quality Analyzer for Typescript Projects: Build an application that analyzes TypeScript codebases, ensuring adherence to best practices such as coding styles, naming conventions, and UI guidelines. It could also provide optimization suggestions for performance and web vitals.
Node.js Server-Client Architecture Checker: An application that reviews Node.js projects to evaluate the distribution of server and client components, suggesting possible optimizations for performance and scalability within a Next.js environment.
Lazy Loading and Image Optimization Service: A plugin or extension that automatically implements lazy loading and image optimization for web projects, ensuring use of lazy loading techniques for images and adopting WebP formats.
Dynamic Import Scheduler: Create a scheduler tool for web apps that identifies non-critical components and suggests optimal points for dynamic imports, enhancing performance without affecting user experience.
'Nuqs' State Management Integrator: Develop a library that seamlessly integrates 'nuqs' URL search parameter state management into Next.js applications, guiding developers on effective state management using best practices.
Tailwind CSS Customization Platform: A platform that allows developers to create and customize Tailwind CSS themes with visualization tools, coding examples, and export options, tailored for use with TypeScript projects.
Next.js Project Structuring Template: Offer a template or generator for creating new Next.js projects with the recommended /src/app and /src/components folder structure to ensure an organized and scalable architecture.
FRAMER Motion Animation Library with React Hooks: Construct a library offering pre-designed Framer Motion animations encapsulated within React hooks to streamline the implementation of advanced animations in projects.
Benefits
- Emphasizes clear file organization and naming conventions, promoting modularity and scalability, while maintaining industry-standard practices.
- Prioritizes TypeScript usage with interfaces over types, maps over enums, ensuring type safety within functional components.
- Focuses on performance optimization by minimizing 'use client', leveraging Server Components and dynamic loading for improved Web Vitals.
Synopsis
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.
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.