PromptFork

Generate an opinionated Cursor ruleset for a Next.js App Router plus TS monorepo

Produces a complete, opinionated Cursor rules file for a Next.js App Router TypeScript monorepo, with every rule paired with a one-line rationale so the agent follows your stack instead of inventing patterns.

Open in Studio
Prompt
You are a senior staff engineer who configures AI coding assistants to respect a codebase's conventions. Generate a complete, opinionated Cursor rules file.

Repo context:
- Monorepo tool: [Turborepo / Nx / pnpm workspaces]
- Package manager: [pnpm / npm / yarn]
- Next.js version: [14 / 15], App Router, TypeScript strict.
- Key packages: [LIST — e.g. 'apps/web (Next.js), apps/admin (Next.js), packages/ui, packages/db (Prisma), packages/config']
- Styling: [Tailwind / CSS Modules / styled-components]
- State / data: [Server Components by default / TanStack Query / Zustand]

Generate a single .cursorrules file (project rules) that is specific to THIS repo, not generic boilerplate. Cover at minimum:

1. Architecture map — the package layout, what lives where, and which package owns shared code.
2. App Router conventions — co-location rules, when to use Server vs Client Components, the 'use client' boundary, and where route handlers and server actions go.
3. TypeScript rules — strict mode, no implicit any, the types-vs-interfaces convention for this repo, no @ts-ignore without a comment.
4. Import rules — absolute imports via the configured path aliases, no deep cross-package relative imports, import ordering.
5. Data-fetching rules — prefer Server Components for reads, where mutations go, how to type Prisma/client payloads, no fetch in a client component when the server can do it.
6. Styling rules — the chosen system, token usage, no inline magic values, conditional className patterns.
7. Testing rules — the test framework, where tests live, what must be covered before a change is 'done'.
8. PR / commit rules — conventional commits, and what a complete change includes (types, tests, docs if the API changed).

Critical format rules:
- Every rule MUST be followed by a one-line 'Why:' rationale so the agent understands intent, not just the letter.
- Be opinionated and concrete to THIS stack. Ban the wrong patterns by name (e.g. no getServerSideProps in an App Router repo).
- Keep it under roughly 120 lines so it fits Cursor's context comfortably. No filler.

Output the full .cursorrules file in a single fenced code block, then a 5-bullet summary of the most important conventions it enforces.

Success signal: the output is good only if every rule has a rationale, the rules are specific to Next.js App Router and this monorepo layout (not copy-pasteable to a different stack), and the wrong-pattern bans are named explicitly.

Use case

Use when you want Cursor to consistently respect your monorepo conventions, routing, server/client boundaries, and import rules instead of guessing.

When to use this

When onboarding Cursor to a Next.js App Router monorepo. Not for Pages Router projects or single-package apps.

Follow-up prompts

  • Add a separate ruleset for the design-system package with component prop conventions.
  • Generate the matching AGENTS.md so other agents share the same rules.
  • Add lint-and-test-before-suggesting rules tied to the exact package manager scripts.
#cursor#cursorrules#nextjs#typescript#monorepo
Source
promptfork seed
License
CC-BY-4.0
Published
6/22/2026

More prompts you might like

.cursorrules for a strict TypeScript + React codebase

A tuned .cursorrules file that keeps Cursor's agent on-convention: strict types, no dead code, match existing patterns.

New

Generate an opinionated Cursor ruleset for a Python data-engineering repo

Produces a complete Cursor rules file for a Python data-engineering codebase covering DAG conventions, testing, type hints, the SQL/Python boundary, and env handling, each rule justified so the agent respects your pipelines.

#cursor#cursorrules
New

Generate an opinionated Cursor ruleset for a Rust or C++ systems repo

Produces a complete Cursor rules file for a Rust or C++ systems codebase covering ownership, unsafe policy, error handling, concurrency, and build rules, each justified so the agent writes memory-safe, idiomatic code.

#cursor#cursorrules
New

Next.js 15 App Router page with streaming, caching, and server data

Scaffold a production App Router page: Server Component data fetching, Suspense streaming for instant TTFB, correct cache strategy (fetch cache vs unstable_cache vs revalidatePath), loading/error boundaries, and generateMetadata — with the non-obvious patterns most tutorials skip.

New

Tailwind analytics dashboard with animated stat cards, dark mode, and skeleton loading

Production-grade dashboard layout: KPI cards with counting animations and trend sparklines, a chart area, activity table — all with dark mode, skeleton loading states, and responsive breakpoints defined to the pixel.

New

Supabase RLS: owner-write, public-read policies for a table

Generate correct, non-recursive RLS policies so anyone reads published rows and only owners edit their own.

New