Project rules for a Next.js app
Stack, folder map, error shape, naming, and test command on half a page. Stops Cursor inventing packages and folders.
---
description: Project rules for a Next.js App Router repo
alwaysApply: true
---
# Project rules
Stack: Next.js App Router, TypeScript, pnpm, Tailwind.
Folders:
- Routes: app/
- UI primitives: components/ui. Reuse these. Do not invent a new button.
- Shared helpers: lib/
- Do not create a new package or a new top-level folder.
If a helper is missing, ask before creating it. Prefer lib/ over a new utils/.
API errors: { error: string, code?: string }. Match the nearby route handler.
Naming: kebab-case files, PascalCase components. Match the sibling file.
Tests: pnpm test. Colocate as *.test.ts.
Do not change schema, auth, or payments unless the prompt names those files.
No drive-by refactors.