A collection of standardized guidelines for Next.js projects in Cursor IDE to ensure consistent code quality and best practices.
This repository contains Cursor IDE rules for Next.js applications. These rules help maintain consistent code quality and adhere to best practices when developing Next.js applications.
Cursor Rules are guidelines that help AI assistants (like Claude in Cursor) understand your project's conventions and best practices. When you add these rules to your project, Cursor's AI can provide more accurate and useful code suggestions, completions, and refactorings that align with your project's standards.
Without rules:
User: "Create a component for a form"
Claude: *generates a basic React component with no specific form library or project conventions*
With rules:
User: "Create a component for a form"
Claude: *generates a component using your project's form library (React Hook Form, Formik, etc.), follows project naming conventions, and includes proper TypeScript types and validation patterns*
- Copy the
.cursorrulesfile to the root of your Next.js project - Copy the
.cursor/rulesdirectory to your project - Make any project-specific adjustments to the rules as needed
When working with Cursor IDE, the AI will now understand your project's guidelines and provide suggestions that align with these standards.
For detailed installation and customization instructions, see the Usage Guide.
For practical examples of how rules improve Claude's assistance, see the Examples Document.
These rules provide guidance for:
- Next.js 14+ App Router best practices
- Client/server component organization
- TypeScript usage
- UI component library integration
- State management
- Internationalization
- Custom hooks
- TypeScript type safety
- ESLint conformance
- Responsive design patterns
- Testing standards
- Code documentation
- Component size management
- Component responsibility segregation
- Feature-based organization
- Atomic design principles
- Business logic separation
- State management practices
- Image optimization
- Data fetching strategies
- Rendering optimization
- Memoization patterns
- Code splitting techniques
The rules are organized into the following categories:
- Base TypeScript: Fundamental TypeScript standards for Next.js projects
- React Components: Guidelines for creating React components
- Form Components: Best practices for form implementation
- Next.js Pages: Standards for page components and routing
- Redux Store: Patterns for state management with Redux
- Services: Business logic and API integration guidelines
These rules are designed to be adaptable to different project requirements. You can modify them to fit your specific project needs:
- Adjust UI library references (Mantine, shadcn/ui, Material UI, etc.)
- Modify state management approaches (Redux, Context API, Zustand, etc.)
- Customize internationalization requirements
- Add project-specific conventions
MIT