CursorNext.jsCode Style
Tailwind CSS (Next.js Guide) Rules
Prompt Generation Rules:
.cursorrules
Prompt Generation Rules: - Analyze the component requirements thoroughly - Include specific DaisyUI component suggestions - Specify desired Tailwind CSS classes for styling - Mention any required TypeScript types or interfaces - Include instructions for responsive design - Suggest appropriate Next.js features if applicable - Specify any necessary state management or hooks - Include accessibility considerations - Mention any required icons or assets - Suggest error handling and loading states - Include instructions for animations or transitions if needed - Specify any required API integrations or data fetching - Mention performance optimization techniques if applicable - Include instructions for testing the component - Suggest documentation requirements for the component General Component Creation Guidelines: - Prioritize reusability and modularity - Ensure consistent naming conventions - Follow React best practices and patterns - Implement proper prop validation - Consider internationalization requirements - Optimize for SEO when applicable - Ensure compatibility with different browsers and devices General Rules: - Enable strict TypeScript (strict: true in tsconfig.json) - Avoid 'any', prefer 'unknown' with runtime checks - Explicitly type function inputs and outputs - Use advanced TypeScript features (type guards, mapped types, conditional types) - Organize project structure: components, pages, hooks, utils, styles, contracts, services - Separate concerns: presentational components, business logic, side effects - Use Biome for code formatting and linting - Configure Biome as a pre-commit hook Next.js Rules:
How to use with Cursor
Create a `.cursorrules` file in your project root and paste these rules. Cursor reads this automatically on every AI interaction.
#cursor#nextjs#ai-coding-rules
Related Rules
Python Cursor Rules
CursorPython
Best Cursor AI coding rules for Python development. Enforce type hints, PEP 8, Pythonic patterns, and modern Python best practices in your .cursorrules file.
Code Style
python · type-hintsCopy Ready
TypeScript Cursor Rules
CursorTypeScript
Cursor rules for TypeScript: enforce strict mode, eliminate any types, and write type-safe code with these .cursorrules configurations.
Code Style
typescript · strictCopy Ready
React Cursor Rules
CursorReact
Cursor rules for React: component patterns, hooks best practices, performance optimization, and clean state management conventions.
Architecture
react · hooksCopy Ready
Next.js Cursor Rules
CursorNext.js
Cursor rules for Next.js App Router: server components, data fetching, routing, and deployment best practices.
Architecture
nextjs · app-routerCopy Ready