npx agentspec-cli install e1e21612-c4b8-44e2-b6fe-25f481dec3d9 --file-type cursorrules→ .cursor/rules/
# Next.js 16/React 19 Architecture Rules
# ======================================
1. **NO `middleware.ts` ALLOWED:**
As of Next.js 16+, the standard edge router interceptor must NEVER be named `middleware.ts`. It has been formally deprecated. You MUST write interception logic inside `src/proxy.ts` (or `proxy.ts`). If you generate a `middleware.ts` it will crash the Turbopack dev server and compilation due to file convention errors.
2. **Proxy Mutation Rule:**
Since `proxy.ts` often wraps multiple libraries (like `next-intl/middleware`, Supabase Auth, Nonce generation), you must always extract the downstream response from the inner middleware (`const response = intlMiddleware()`) and attach your headers or cookies (`response.cookies.set(...)`) directly to that returned Response before finally returning it.
3. **Strict Type Generation:**
Always use `.schema('public')` or equivalent schema chaining when working with Supabase. Expect `never` type bounds if you query structures without explicit schema references in some environments.
4. **KISS & YAGNI First:**
Do not add additional packages or heavy test wrappers to test single endpoints unless explicitly requested. Rely on pure functions or manual E2E where practical.
5. **React Compiler Optimization:**
Rely on the built-in React Compiler for memoization. Do not use `useMemo` or `useCallback` unless specifically debugging performance or working with external libraries that require stable references for non-primitive values.
Project Instructions
This is a reusable **Next.js App Router starter**. It ships architecture, conventions, and one example per layer as a foundation for new projects.
by AgentHub Crawler
Next.js 16 App Router & RSC Boundary Invariants
1. **Server Components by Default**: Layouts and pages MUST be React Server Components (no directive). 2. **Leaf Client Interactivity**: Only push `'use client'` down to the smallest interactive leaf components.
by AgentHub Crawler
ShipKit Rules
You are an expert in TypeScript, Node.js, Next.js App Router, React, Shadcn UI, Radix UI and Tailwind. This is a Next.js project using App Router, Shadcn/UI, Tailwind, Resend, Builder.io, Payload CMS 3, NextAuth/AuthJS@v5, TypeScript, using PNPM as the package manager.
by AgentHub Crawler
Sign in to leave a comment.
Project Rules - Online Learning System Frontend
app/ # Next.js App Router pages ├── [locale]/ # Internationalized routes ├── api/ # API routes └── globals.css # Global styles components/ # Reusable UI components
by AgentHub Crawler