Free Tool

Free Cursor Rules Examples Library

A Cursor rules examples library is a collection of copy-ready .cursor/rules files that teach Cursor your stack, architecture, testing, and review standards. Browse vetted .mdc examples, filter by framework, and copy the exact file you want to add to your repo.

next-app-router.mdc

8 matching examples

---
description: Server component defaults, route ownership, metadata, and data fetching rules for App Router projects.
globs: src/app/**/*.{ts,tsx},src/components/**/*.{ts,tsx}
alwaysApply: false
---

# Next.js App Router defaults

- Prefer server components for route shells, static content, and data reads.
- Add "use client" only for browser state, effects, event handlers, or browser-only APIs.
- Keep route-specific components close to their route unless they are reused by two or more routes.
- Export route metadata from the page or layout that owns the URL.
- Use the project's existing data helpers before adding new fetch wrappers.
- Do not read process.env from client components.
- For dynamic database-backed pages, set dynamic or caching behavior explicitly.

Bundle copies the currently filtered examples.

How to add Cursor rules

  1. Filter examples. Choose a stack and rule type that match the repo area you want Cursor to understand.
  2. Review the rule. Check the description, globs, alwaysApply setting, and instruction body before copying.
  3. Save the .mdc file. Create .cursor/rules in your repository and save the copied content using the suggested filename.
  4. Keep rules focused. Use several small rules instead of one large file so Cursor retrieves only the relevant guidance.

Anatomy of a Cursor rule

  • description - short retrieval hint that tells Cursor when the rule matters.
  • globs - file patterns that scope the rule to relevant code.
  • alwaysApply - use true only for rules that should apply to nearly every request.
  • Rule body - concrete instructions Cursor should follow while editing or reviewing files.

Frequently Asked Questions

What are Cursor rules?

+

Cursor rules are project or user instructions that tell Cursor how to work inside a codebase. Modern project rules live as .mdc files in .cursor/rules.

Where do Cursor project rules go?

+

Project rules go in the .cursor/rules directory at the repository root. Each rule is usually a separate .mdc file with frontmatter and instruction content.

What does alwaysApply mean in a Cursor rule?

+

alwaysApply controls whether Cursor should attach the rule automatically. Use it for broad team standards, and keep specialized framework rules scoped with globs.

How should I use globs in Cursor rules?

+

Use globs to target the files where a rule is relevant, such as src/app/**/*.tsx for Next.js routes or **/*.py for Python code.

Can I migrate old .cursorrules content?

+

Yes. Split broad .cursorrules instructions into focused .mdc files, add descriptions and globs, then place them under .cursor/rules.

Rules guide Cursor. Tornic runs the workflow.

Cursor rules make coding-agent edits more consistent. Tornic turns Claude, Codex, and Cursor CLI subscriptions into repeatable workflows with stable steps, visible handoffs, and no surprise API bills.

Try Tornic