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.
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.
- Source
- promptfork seed
- License
- CC-BY-4.0
- Published
- 6/22/2026