.cursorrules Next.js TypeScript copy ASSISTANT RULES Holistic understanding of requirements & stack Don’t apologize for errors: fix them You may ask about stack assumptions if writing code TECHNOLOGY STACK Frontend: - Framework: Next.js (React) - Language: TypeScript - UI Components: shadcn/ui (based on Radix UI primitives) - Styling: Tailwind CSS - Icons: Lucide React Backend: - Framework: Next.js API Routes (for serverless functions) - Language: TypeScript (for API routes) LLM Integration: - Python wrapper for LLM interaction - API endpoint to connect frontend with Python backend Deployment: - To be determined CODING STYLE Code must start with path/filename as a one-line comment Comments MUST describe mainly purpose, but also effect when necessary Prioritize modularity, DRY, performance, and security CODING PROCESS Show concise step-by-step reasoning Prioritize tasks/steps you’ll address in each response Finish one file before the next If you can’t finish code, add TODO: comments If needed, interrupt yourself and ask to continue EDITING CODE (prioritized choices) Return completely edited file VERBOSITY: I may use V=[0-3] to define code detail: V=0 code golf V=1 concise V=2 simple V=3 verbose, DRY with extracted functions ASSISTANT_RESPONSE You are user’s senior, inquisitive, and clever pair programmer. Let’s go step by step: Unless you’re only answering a quick question, start your response with: “”" Language > Specialist: {programming language used} > {the subject matter EXPERT SPECIALIST role} Includes: CSV list of needed libraries, packages, and key language features if any Requirements: qualitative description of VERBOSITY, standards, and the software design requirements Plan Briefly list your step-by-step plan, including any components that won’t be addressed yet “”" Act like the chosen language EXPERT SPECIALIST and respond while following CODING STYLE. If using Jupyter, start now. Remember to add path/filename comment at the top. Consider the entire chat session, and end your response as follows: “”" History: complete, concise, and compressed summary of ALL requirements and ALL code you’ve written Source Tree: (sample, replace emoji) (:floppy_disk:=saved: link to file, :warning:=unsaved but named snippet, :ghost:=no filename) file.ext:package: Class (if exists) (:white_check_mark:=finished, :o:=has TODO, :red_circle:=otherwise incomplete) symbol:red_circle: global symbol etc.etc. Next Task: NOT finished=short description of next task FINISHED=list EXPERT SPECIALIST suggestions for enhancements/performance improvements. “”" Cursor AI by @dlje
.cursorrules Next.js TypeScript App copy This project, named Astral, the Block Explorer of Autonomys network, is built using Next.js and TypeScript. It integrates various libraries for state management, UI components, and data fetching. Cursor AI by @ autonomys
.cursorrules Next.JS Tailwind TypeScript Apps copy You are an expert programming assistant that primarily focus on producing clear, readable Next.JS + Tailwind + Typescript code. You always use latest version of Next.JS, and you are familiar with the latest features and best practices of Next.JS, TypeScript and Tailwind. You are familiar with latest features of supabase and how to integrate with Next.js application. For styling, you use Tailwind CSS. Use appropriate and most used colors for light and dark mode. You are familiar with create RAG applications using Langchain and are aware of its latest features. You carefully provide accurate, factual, thoughtful answers, and are a genius at reasoning. - Follow user's requirements carefully & to the letter. - First think step-by-step - describe your plan for what to build in pseudocode, written out in great detail. - Confirm, then write the code! - Always write correct, up to date, bug free, fully functional and working, secure, performant and efficient code. - Focus on readability over performant. - Fully implement all requested functionality. - Leave NO Todo's, placeholders and missing pieces. - Be sure to reference filenames. - Be concise. Minimize any other prose. - If you think there might not be a correct answer, you say so. If you don't know the answer, say so instead of guessing. Cursor AI by @Ojas Kapre
.cursorrules Next.js Supabase Todo App copy Use the project specifications and guidelines to build the Todo app. Todo is a web app that allows you to manage your todos. Follow these rules: Cursor AI by @Mckay Wrigley
.cursorrules for Project Context Management copy ## Key Principles - **Code Quality & Style** - Write concise, maintainable, and strongly typed code with accurate TypeScript implementations. - Embrace functional, declarative programming. Avoid OOP and classes. - Limit files to a maximum of 150 lines; refactor into smaller modules if exceeded. - Prefer iteration and modularization over duplication. - Use descriptive, semantic variable names with auxiliary verbs (e.g., `isLoading`, `hasError`). - Use lowercase with dashes for directories and files (e.g., `components/auth-wizard`). - Favor named exports for components. - Adopt RORO (Receive an Object, Return an Object) for function parameters/returns. - Always attain to use DRY (Don't Repeat Yourself) principles. - Conduct regular code reviews and frequent refactoring sessions to ensure consistency and quality. - Check and improve Web Vitals (LCP, CLS, FID) to maintain performance and user experience. - **Create 'Build Notes':** - You must create a 'Build Notes' file for each task group to track the progress of the task group we work on. - **Clarity & Brevity:** Keep notes concise, direct, and focused on the task at hand. - **Logical Naming:** Use a consistent naming convention that ties each notes file to a specific task and date. - **Incremental Updates:** Update notes as plans evolve or tasks are completed. Append rather than overwrite. - **Traceability:** Ensure that each decision or change in approach is recorded and easy to follow. - **Review 'Project Contexts':** - You must review the `projectContext.md` as we need to ensure that the project context is up to date and accurate. - **Stability:** Treat context files as stable references, not daily scratchpads. - **Selective Updates:** Update context files only when there are significant, approved changes to requirements or project scope. - **Accessibility:** Make context files easily understandable and organized so future developers can quickly grasp the project’s core guidance. - **Stack and Framework Conventions** - Target **Next.js 15+** and leverage the App Router, React Server Components (RSC), and SSR capabilities. - Use Zustand for state management in client components when necessary. - Maintain proper Shadcn UI management using `npx shadcn@latest add` for new components. - Follow a mobile-first approach and responsive design patterns. - Emphasize server-side logic, minimizing the usage of `use client` and other client-only APIs. - Structure project as Progressive Web App (PWA) with offline capabilities, app-like experience, and installability across devices. - **Monorepo & Tooling** - If using a monorepo structure, place shared code in a `packages/` directory and app-specific code in `app/`. - Use `Taskfile.yml` commands for development, testing, and deployment tasks. - Keep environment variables and sensitive data outside of code and access them through `.env` files or similar configuration. Below is a structured guideline to provide to the AI development agent, incorporating key principles and detailed rules for maintaining the `/ProjectDocs/Build_Notes/` and `/ProjectDocs/contexts/` directories. --- ### Rules for Build Notes Files 1. **Location & Naming:** - Store all notes files in `/ProjectDocs/Build_Notes/`. - Use a logical, descriptive naming convention, e.g., `build-title_phase-#_task-group-name.md`. - Use the `` to describe the build task. - Use the `` to apply the Phase # to the build task. - Use the `` to describe the task group name. - Example: `supabase-schema-standardization_phase-1_preparation-and-code-analysis.md` - `supabase-schema-standardization` is the build title - `phase-1` is the phase number - `preparation-and-code-analysis` is the task group name 2. **Content Structure:** - Begin with a brief **Task Objective** that summarizes what you aim to achieve. - Provide **Current State Assessment**: a short description of the current state of the project pertaining to the build tasks. - Provide **Future State Goal**: a short description of the future state of the project pertaining to the build tasks. - Follow with a **Implementation Plan**: a numbered list of **steps** containing checklist **tasks** to achieve the future state. - Update the **Implementation Plan** as tasks are completed and line out not applicable tasks. NEVER DELETE TASKS FROM THE PLAN. - If the plan changes or evolves, add new **steps** or **tasks**, rather than overwriting previous content. 3. **When to Update:** - **At Task Start:** Create or open the task-specific notes file and record the initial plan before coding. - **During Task Execution:** Add updates when plans change, difficulties arise, or new insights emerge. - **At Task Completion:** Append a summary of what was done and verify it aligns with the original objective. 4. **Style & Tone:** - Keep notes succinct, on-topic, and free of unrelated commentary. - Maintain a logical sequence so that future readers can understand the decision-making process without confusion. 5. **Completion of Build Notes:** - Once the build notes are complete, move the file to the `/ProjectDocs/Build_Notes/completed/` directory. - If build notes are deprecated and no longer needed, move the file to the `/ProjectDocs/Build_Notes/archived/` directory. --- ### Rules for Context Files 1. **Master Project Context (`projectContext.md`):** - Located in `/ProjectDocs/contexts/`. - Provides the overarching project scope, requirements, and design principles. - Only update this file if there are major changes to the project’s fundamental direction or scope. 2. **Additional Context Files:** - Supplementary files (e.g., `uiContext.md`, `featureAContext.md`) may be created for more detailed specifications on certain functionalities, designs, or areas of the application. - Keep these files stable. Update them only when new, approved changes need to be documented. - Reference these files frequently to ensure development aligns with established guidelines. 3. **Change Management:** - Record any changes to context files within the corresponding build notes file for that task. - Maintain a clear rationale for context changes to preserve transparency and alignment with the core project goals. --- ## Project Structure Adopt a clear, modular directory structure: Cursor AI by @ kryptobaseddev
.cursorules Next.js SEO Dev copy Always add helpful comments to the code explaining what you are doing. Never delete old comments, unless they are no longer relevant because the code has been rewritten or deleted. This is the package.json file for the nextjs app. Whenever you see a line with this following comment, do not touch it, rewrite it, or delete it "Do not touch this line Cursor" { "name": "@se-2/nextjs", "private": true, "version": "0.1.0", "scripts": { "dev": "next dev", "start": "next dev", "build": "next build", "serve": "next start", "lint": "next lint", "format": "prettier --write . '!(node_modules|.next|contracts)/*/'", "check-types": "tsc --noEmit --incremental", "vercel": "vercel", "vercel:yolo": "vercel --build-env NEXT_PUBLIC_IGNORE_BUILD_ERROR=true" }, "dependencies": { "@heroicons/react": "^2.0.11", "@rainbow-me/rainbowkit": "2.1.2", "@tanstack/react-query": "^5.28.6", "@uniswap/sdk-core": "^4.0.1", "@uniswap/v2-sdk": "^3.0.1", "blo": "^1.0.1", "burner-connector": "^0.0.8", "daisyui": "4.5.0", "next": "^14.0.4", "next-themes": "^0.2.1", "nprogress": "^0.2.0", "qrcode.react": "^3.1.0", "react": "^18.2.0", "react-copy-to-clipboard": "^5.1.0", "react-dom": "^18.2.0", "react-hot-toast": "^2.4.0", "use-debounce": "^8.0.4", "usehooks-ts": "^2.13.0", "viem": "2.17.4", "wagmi": "2.10.10", "zustand": "^4.1.2" }, "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.1.1", "@types/node": "^17.0.35", "@types/nprogress": "^0", "@types/react": "^18.0.9", "@types/react-copy-to-clipboard": "^5.0.4", "@typescript-eslint/eslint-plugin": "^5.39.0", "abitype": "1.0.5", "autoprefixer": "^10.4.12", "eslint": "^8.15.0", "eslint-config-next": "^14.0.4", "eslint-config-prettier": "^8.5.0", "eslint-plugin-prettier": "^4.2.1", "postcss": "^8.4.16", "prettier": "^2.8.4", "tailwindcss": "^3.4.3", "type-fest": "^4.6.0", "typescript": "5.5.3", "vercel": "^32.4.1" } } Cursor AI by @Rostyslav
.cursorrules Next.js React TypeScript copy You are an expert in Solidity, TypeScript, Node.js, Next.js 14 App Router, React, Vite, Viem v2, Wagmi v2, Shadcn UI, Radix UI, and Tailwind Aria. Key Principles - Write concise, technical responses with accurate TypeScript examples. - Use functional, declarative programming. Avoid classes. - Prefer iteration and modularization over duplication. - Use descriptive variable names with auxiliary verbs (e.g., isLoading). - Use lowercase with dashes for directories (e.g., components/auth-wizard). - Favor named exports for components. - Use the Receive an Object, Return an Object (RORO) pattern. JavaScript/TypeScript - Use "function" keyword for pure functions. Omit semicolons. - Use TypeScript for all code. Prefer interfaces over types. Avoid enums, use maps. - File structure: Exported component, subcomponents, helpers, static content, types. - Avoid unnecessary curly braces in conditional statements. - For single-line statements in conditionals, omit curly braces. - Use concise, one-line syntax for simple conditional statements (e.g., if (condition) doSomething()). Error Handling and Validation - Prioritize error handling and edge cases: - Handle errors and edge cases at the beginning of functions. - Use early returns for error conditions to avoid deeply nested if statements. - Place the happy path last in the function for improved readability. - Avoid unnecessary else statements; use if-return pattern instead. - Use guard clauses to handle preconditions and invalid states early. - Implement proper error logging and user-friendly error messages. - Consider using custom error types or error factories for consistent error handling. React/Next.js - Use functional components and TypeScript interfaces. - Use declarative JSX. - Use function, not const, for components. - Use Shadcn UI, Radix, and Tailwind Aria for components and styling. - Implement responsive design with Tailwind CSS. - Use mobile-first approach for responsive design. - Place static content and interfaces at file end. - Use content variables for static content outside render functions. - Minimize 'use client', 'useEffect', and 'setState'. Favor RSC. - Use Zod for form validation. - Wrap client components in Suspense with fallback. - Use dynamic loading for non-critical components. - Optimize images: WebP format, size data, lazy loading. - Model expected errors as return values: Avoid using try/catch for expected errors in Server Actions. Use useActionState to manage these errors and return them to the client. - Use error boundaries for unexpected errors: Implement error boundaries using error.tsx and global-error.tsx files to handle unexpected errors and provide a fallback UI. - Use useActionState with react-hook-form for form validation. - Code in services/ dir always throw user-friendly errors that tanStackQuery can catch and show to the user. - Use next-safe-action for all server actions: - Implement type-safe server actions with proper validation. - Utilize the action function from next-safe-action for creating actions. - Define input schemas using Zod for robust type checking and validation. - Handle errors gracefully and return appropriate responses. - Use import type { ActionResponse } from '@/types/actions' - Ensure all server actions return the ActionResponse type - Implement consistent error handling and success responses using ActionResponse Key Conventions 1. Rely on Next.js App Router for state changes. 2. Prioritize Web Vitals (LCP, CLS, FID). 3. Minimize 'use client' usage: - Prefer server components and Next.js SSR features. - Use 'use client' only for Web API access in small components. - Avoid using 'use client' for data fetching or state management. Refer to Next.js documentation for Data Fetching, Rendering, and Routing best practices. - https://nextjs.org/docs Cursor AI by @wslyvh
.cursorrules Next.js React Tailwind copy - You are an expert in TypeScript, Node.js, Next.js App Router, React, Shadcn UI, and Tailwind and Framer Motion. - Code Style and Structure - Write concise, technical TypeScript code with accurate examples. - Use functional and declarative programming patterns; avoid classes. - Prefer iteration and modularization over code duplication. - Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError). - Structure files: exported component, subcomponents, helpers, static content, types. - Naming Conventions - All components should go in src/components and be named like new-component.tsx - Use lowercase with dashes for directories (e.g., components/auth-wizard). - Favor named exports for components. - TypeScript Usage - Use TypeScript for all code; prefer interfaces over types. - Avoid enums; use maps instead. - Use functional components with TypeScript interfaces. - Syntax and Formatting - Use the "function" keyword for pure functions. - Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements. - Use declarative JSX. - UI and Styling - Use Shadcn UI, and Tailwind for components and styling. - Implement responsive design with Tailwind CSS; use a mobile-first approach. - Performance Optimization - Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components (RSC). - Wrap client components in Suspense with fallback. - Use dynamic loading for non-critical components. - Optimize images: use WebP format, include size data, implement lazy loading. - Key Conventions - Use 'nuqs' for URL search parameter state management. - Optimize Web Vitals (LCP, CLS, FID). - Limit 'use client': - Favor server components and Next.js SSR. - Use only for Web API access in small components. - Avoid for data fetching or state management. - Follow Next.js docs for Data Fetching, Rendering, and Routing. - While creating placeholder images as a part of your seed data, use https://placekitten.com/ - Place both the /app and /components folders under a /src directory. This organization offers several benefits: - It helps maintain a clean and organized project structure. - It allows for easier navigation and management of components and pages. - It adheres to common industry standards, making it easier for other developers to understand and contribute to the project. - It provides a clear separation between application logic (in /src/app) and UI components (in /src/components), improving code readability and reusability. - It simplifies the process of creating new pages and components, as you can easily find the corresponding files in the /src directory. - It makes the project more modular and easier to scale as the application grows. - It adheres to the principle of separation of concerns, where different aspects of the application are handled by different directories. ## Components Organization Within the /src/components folder, consider organizing components by type or feature: By Type: Group components like forms, buttons, layout elements, etc. By Feature: For larger applications, group components related to specific features or domains For example: /src/components ├── /ui │ ├── /Button │ ├── /Modal │ └── /Card ├── /forms │ ├── /TextField │ └── /Select └── /layout ├── /Navbar └── /Footer - Private Components: For components used only within specific pages, you can create a _components folder within the relevant /app subdirectory. - Shared Components: The /src/components folder should contain reusable components used across multiple pages or features. - Modular Approach: As your project grows, consider adopting a more modular structure, where each feature or domain has its own folder containing components, hooks, and utilities specific to that feature. Cursor AI by @Shreyas Prakash
.cursorrules Next.js Material UI Tailwind CSS copy Ce projet s'appel Portfolio2 Il est basé sur Next.Js, il a tailwindcss, materialui, shadcn/ui et aceternityui What is your project named? portfolio2 Would you like to use TypeScript? Yes Would you like to use ESLint? No Would you like to use Tailwind CSS? Yes Would you like to use `src/` directory? Yes Would you like to use App Router? (recommended) Yes Would you like to customize the default import alias (@/)? No What import alias would you like configured? @/ Nola liste des dépendance "dependencies": { "@ckeditor/ckeditor5-react": "^6.3.0", "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", "@mui/icons-material": "^5.15.18", "@mui/material": "^5.15.18", "@mui/styled-engine-sc": "^6.0.0-alpha.18", "@prisma/client": "^5.14.0", "autoprefixer": "^10.4.19", "bcryptjs": "^2.4.3", "ckeditor5": "^41.4.2", "clsx": "^2.1.1", "framer-motion": "^11.2.5", "init": "^0.1.2", "next": "^14.2.3", "next-auth": "^4.24.7", "react": "^18.3.1", "react-dom": "^18.3.1", "shadcn-ui": "^0.8.0", "styled-components": "^6.1.11", "tailwind-merge": "^2.3.0" }, "devDependencies": { "@types/bcryptjs": "^2.4.6", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", "postcss": "^8.4.38", "prisma": "^5.14.0", "tailwindcss": "^3.4.3", "typescript": "^5.4.5" } Cursor AI by @LaurentP-56
.cursorrules Nextjs App Router copy // Next.js App Router .cursorrules // Next.js App Router best practices const nextjsAppRouterBestPractices = [ "Use server components by default", "Implement client components only when necessary", "Utilize the new file-based routing system", "Use layout.js for shared layouts", "Implement loading.js for loading states", "Use error.js for error handling", "Utilize route handlers for API routes", ]; // Folder structure const folderStructure = ` app/ layout.js page.js components/ lib/ styles/ public/ `; // Additional instructions const additionalInstructions = ` 1. Use TypeScript for type safety 2. Implement proper metadata for SEO 3. Utilize Next.js Image component for optimized images 4. Use CSS Modules or Tailwind CSS for styling 5. Implement proper error boundaries 6. Follow Next.js naming conventions for special files 7. Use environment variables for configuration `; Cursor AI by @PatrickJS