Config Generator

Cursor Rules Generator

Choose a project stack, generate a .cursor/rules .mdc file, then copy rules with globs, commands, style, and review guardrails.

Last updated: July 26, 2026

Rule template
.cursor/rules/project.mdc
---
description: Next.js app, routes, React components, server actions, and frontend checks
globs: ["app/**/*","components/**/*","lib/**/*","pages/**/*","next.config.*","package.json"]
alwaysApply: true
---

# Cursor Project Rules

File: .cursor/rules/nextjs.mdc

## 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 for .cursor/rules and .mdc Files

## Project Commands

- Package manager: npm
- Test: `npm test`
- Build: `npm run build`
- Lint: `npm run lint`

## Stack-Specific Rules

- Use existing app router, component, and data-fetching patterns before adding new abstractions.
- Keep server and client component boundaries explicit.
- Preserve accessibility, responsive layout, metadata, and route-level SEO behavior.
- Run lint, tests, and build checks before handoff.

## Avoid

- Do not introduce duplicate fetch wrappers or UI primitives when local helpers exist.
- Do not move client-only code into server components.
- Do not hide build or hydration failures.

## 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.
- Link related rules from the Cursor Rules Directory when this file grows too broad.

## Extra Instructions

Before handoff, summarize changed files and mention any checks that could not be run.

Use the Cursor Rules generator to create stack-specific .cursor/rules .mdc files for Next.js, Python, Laravel, Chrome extension, and SaaS projects. Good rules name real commands, file globs, coding style, and mistakes the AI should avoid.

Choose A Stack Template

Start from the project stack closest to your repository. The generator fills globs, commands, review guardrails, and stack-specific warnings for Next.js, Python API, Laravel, Chrome extension, and SaaS workflows.

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, which validation commands matter, and what Cursor should avoid when editing that part of the repo.

Example .mdc Output

A focused .mdc file should include frontmatter, globs, stable project context, commands, and review rules.

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, framework, 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 or stack-specific files such as nextjs.mdc and tests.mdc.

Can rules target only some files?

Yes. Use globs to scope rules to packages, frameworks, file types, tests, or product areas.

Which templates are included?

The generator includes Next.js, Python, Laravel, Chrome extension, and SaaS presets, plus a generic fallback for other stacks.

Should one repo have multiple .mdc files?

Yes, when rules differ by package, framework, or workflow. Keep a project baseline and split specialized rules only when needed.