cursor-rules / rules
Cursor rule8 starsChanged 19 months agoMITView on GitHub
Next.js Application Development Standards
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository17 other files it gives its agents.
- .cursor/rules/aws-bedrock.mdcCursor rule
- .cursor/rules/aws-cloudformation.mdcCursor rule
- .cursor/rules/aws-dynamodb.mdcCursor rule
- .cursor/rules/aws-eventbridge.mdcCursor rule
- .cursor/rules/aws-gamelift.mdcCursor rule
- .cursor/rules/aws-iam.mdcCursor rule
- .cursor/rules/aws-lambda.mdcCursor rule
- .cursor/rules/aws-sagemaker.mdcCursor rule
- .cursor/rules/aws-sam.mdcCursor rule
- .cursor/rules/aws-vpc.mdcCursor rule
- .cursor/rules/base.mdcCursor rule
- .cursor/rules/docs-structure.mdcCursor rule
- .cursor/rules/expo.mdcCursor rule
- .cursor/rules/react.mdcCursor rule
- .cursor/rules/react-native.mdcCursor rule
- .cursor/rules/readme-documentation.mdcCursor rule
- .cursor/rules/typescript.mdcCursor rule
The file
Show its rules and text
We split this nextjs.mdc into the rules it gives an agent
47 rules. About 0 are common, 46 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈46
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Use the App Router for new projects
- Distinctive: line 18
Create reusable components in a dedicated components directory
- Distinctive: line 20
Use custom hooks for shared logic
- Distinctive: line 22
Keep utility functions in a utils directory
- Distinctive: line 26
Use the folder-based routing system effectively
- Distinctive: line 28
Create loading and error states for each route
- Distinctive: line 29
Use route groups for organizational purposes
- Distinctive: line 32
Use dynamic segments for parameterized routes
- Distinctive: line 36
Use React Server Components by default
- Distinctive: line 38
Keep components focused on single responsibilities
- Distinctive: line 40
Create reusable UI components in a component library
- Distinctive: line 46
Use React Server Components for server-side data fetching
- Distinctive: line 52
Use suspense boundaries for loading states
- Distinctive: line 56
Use Image component for optimized images
- Distinctive: line 58
Use dynamic imports for code splitting
- Distinctive: line 61
Use React.memo for expensive components
- Distinctive: line 66
Use React Context for shared state when appropriate
- Distinctive: line 68
Use local state for component-specific state
- Distinctive: line 71
Avoid excessive global state
- Distinctive: line 72
Use React Query for server state management
- Distinctive: line 76
Use CSS Modules or Tailwind CSS for styling
- Distinctive: line 78
Create responsive designs with mobile-first approach
- Distinctive: line 79
Use CSS variables for theming
- Distinctive: line 81
Create a consistent component design system
- Very specific: line 86
Use NextAuth.js or Clerk for authentication
- Distinctive: line 87
Create proper authorization middleware
- Distinctive: line 95
Create well-structured API routes
- Distinctive: line 97
Use appropriate HTTP status codes
- Distinctive: line 102
Use appropriate response formats
- Distinctive: line 106
Use semantic HTML for better accessibility
- Distinctive: line 107
Create a sitemap.xml and robots.txt
- Distinctive: line 109
Add structured data where applicable
- Distinctive: line 110
Ensure proper heading hierarchy
- Distinctive: line 115
Write unit tests for components and utilities
- Distinctive: line 116
Create integration tests for pages and features
- Distinctive: line 118
Use React Testing Library for component testing
- Distinctive: line 120
Create proper test mocks
- Distinctive: line 121
Test accessibility with appropriate tools
- Distinctive: line 125
Use Vercel or similar platforms for deployment
- Distinctive: line 127
Create proper CI/CD pipelines
- Distinctive: line 128
Run tests before deployment
- Distinctive: line 130
Use feature flags for controlled releases
- Distinctive: line 131
Create proper rollback procedures
- Distinctive: line 135
Use next-intl or similar for translations
- Distinctive: line 137
Create language switcher components
- Distinctive: line 147
Use appropriate ARIA attributes
- Distinctive: line 150
Test with screen readers
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
--- description: Next.js Application Development Standards globs: alwaysApply: false --- --- Description: Next.js Application Development Standards Globs: **/*.tsx, **/*.ts, **/pages/**/*, **/app/**/*, **/components/**/* --- # Next.js Development Standards @base.mdc @typescript.mdc ## Project Structure - Use the App Router for new projects - Structure pages logically by feature or route - Create reusable components in a dedicated components directory - Group related functionality in feature directories - Use custom hooks for shared logic - Implement services for API interactions - Keep utility functions in a utils directory - Separate UI components from data fetching ## App Router Best Practices - Use the folder-based routing system effectively - Implement layouts for shared UI across routes - Create loading and error states for each route - Use route groups for organizational purposes - Leverage parallel routes for complex layouts - Implement intercepting routes for modals and slideovers - Use dynamic segments for parameterized routes - Implement proper route handlers for API endpoints ## Component Architecture - Use React Server Components by default - Mark client components with 'use client' directive when needed - Keep components focused on single responsibilities - Implement proper prop validation with TypeScript - Create reusable UI components in a component library - Leverage composition over inheritance - Implement proper error boundaries - Organize components by domain or feature ## Data Fetching - Use React Server Components for server-side data fetching - Implement proper caching strategies - Leverage SWR or React Query for client-side data fetching - Handle loading and error states gracefully - Optimize fetch requests with appropriate cache headers - Implement pagination for large data sets - Use suspense boundaries for loading states - Implement proper error handling for failed requests ## Performance Optimization - Use Image component for optimized images - Implement font optimization with next/font - Use dynamic imports for code splitting - Implement route prefetching for faster navigation - Optimize third-party scripts with Script component - Use React.memo for expensive components - Implement proper bundling strategies - Leverage Edge runtime for performance-critical paths ## State Management - Use React Context for shared state when appropriate - Implement Redux or Zustand for complex state management - Use local state for component-specific state - Leverage URL state for sharable state - Implement proper state persistence strategies - Avoid excessive global state - Use React Query for server state management - Implement proper loading and error states ## Styling Approaches - Use CSS Modules or Tailwind CSS for styling - Implement consistent design tokens - Create responsive designs with mobile-first approach - Use CSS variables for theming - Implement dark mode support - Create a consistent component design system - Leverage CSS-in-JS solutions sparingly ## Authentication & Authorization - Implement secure authentication strategies - Use NextAuth.js or Clerk for authentication - Create proper authorization middleware - Protect API routes with authentication checks - Implement proper role-based access control - Handle authentication errors gracefully - Secure cookies and tokens properly - Implement proper session management ## API Development - Create well-structured API routes - Implement proper input validation - Use appropriate HTTP status codes - Implement consistent error handling - Create API documentation - Version APIs when necessary - Implement rate limiting for public APIs - Use appropriate response formats ## SEO Optimization - Implement proper metadata for each page - Use semantic HTML for better accessibility - Create a sitemap.xml and robots.txt - Implement proper OpenGraph tags - Add structured data where applicable - Ensure proper heading hierarchy - Optimize for Core Web Vitals - Implement proper canonical URLs ## Testing - Write unit tests for components and utilities - Create integration tests for pages and features - Implement end-to-end tests for critical flows - Use React Testing Library for component testing - Implement Cypress or Playwright for E2E testing - Create proper test mocks - Test accessibility with appropriate tools - Implement visual regression testing ## Deployment & CI/CD - Use Vercel or similar platforms for deployment - Implement preview deployments for PRs - Create proper CI/CD pipelines - Run tests before deployment - Implement proper environment variable management - Use feature flags for controlled releases - Create proper rollback procedures - Monitor performance after deployment ## Internationalization - Use next-intl or similar for translations - Implement proper locale detection - Create language switcher components - Support RTL languages when needed - Implement proper date and number formatting - Create localized routes - Test internationalized content - Implement proper fallbacks for missing translations ## Accessibility - Follow WCAG guidelines - Implement keyboard navigation - Use appropriate ARIA attributes - Create accessible forms - Implement proper focus management - Test with screen readers - Create high-contrast modes - Implement proper error messaging
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

