--- description: Project rules for Next.js globs: ["**/*"] alwaysApply: true --- # Cursor Project Rules ## Project Context - Project type: Next.js - Tech stack: Next.js, TypeScript, React, CSS modules - Coding style: Prefer small components, explicit types, accessible UI, and existing project patterns. - AI tool target: Cursor Rules ## Project Commands - Package manager: npm - Test: `npm test` - Build: `npm run build` - Lint: `npm run lint` ## How Cursor Should Work - Inspect existing patterns before adding new abstractions. - Keep edits scoped to the requested behavior. - Prefer typed, accessible, maintainable code. - Run targeted checks before final handoff when possible. - If a command fails, report the exact failure and the likely next step. ## Extra Instructions Before handoff, summarize changed files and mention any checks that could not be run.
Use the Cursor Rules generator to create a starter .cursor/rules/project.mdc file that keeps Cursor aligned with your repository. Good rules name real commands, file globs, coding style, and mistakes the AI should avoid.
What Makes A Good Cursor Rule
Good Cursor Rules are concrete and scoped. They explain which files the rule applies to, which patterns to reuse, and which validation commands matter for changes in that part of the repo.
How To Maintain Cursor Rules
Review rules when the codebase changes structure or when developers repeatedly correct the same AI behavior. Split rules by package or file type only when one project-level file becomes too broad.
FAQ
Where do Cursor Rules live?
Project rules commonly live under .cursor/rules, often starting with project.mdc.
Can rules target only some files?
Yes. Use globs to scope rules to packages, frameworks, or file types.