Declarative .mdcQuy tắc Cursor/Claude/Windsurf & quy trình làm việc n8nQuy tắc IDEĐã kiểm tra rò rỉ bí mật
Bộ định tuyến ứng dụng Next.js 16.4, proxy.ts & Quy tắc kiến trúc React 19.2
Bộ quy tắc Con trỏ khai báo .mdc và CLAUDE.md thực thi chặn yêu cầu Next.js 16 src/proxy.ts, thông số không đồng bộ/searchParams và mã thông báo Tailwind CSS v4.
Tệp quy tắc IDE & Tác nhân khai báo
---
description: Enforce Next.js 16 src/proxy.ts routing, React 19 Server Components, and async dynamic APIs
globs: frontend/src/**/*.{ts,tsx,css}
alwaysApply: true
---
# Next.js 16.4 & React 19.2 App Router Standards
- Use `src/proxy.ts` exporting `export function proxy(request: NextRequest)` for locale and header routing; NEVER create legacy `middleware.ts`.
- Always `await params` and `await searchParams` (`Promise<{ locale: string, ... }>`) inside `page.tsx`, `layout.tsx`, and `generateMetadata`.
- Default every component to a React Server Component; add `"use client"` strictly to leaf interactive islands requiring browser state or event listeners.
- Fetch independent GraphQL/REST resources concurrently via `Promise.all([...])` to eliminate server waterfall latency.
- Use Tailwind CSS v4 `@import "tailwindcss";` with semantic CSS custom properties (`var(--bg-surface)`, `var(--text-primary)`) keeping light theme as default.
## Verification Check
```bash
npx tsc --noEmit && test ! -f src/middleware.ts
```Ghi chú Thiết lập Cộng đồng & Đánh giá Sản xuất (0)
Chưa có ghi chú cộng đồng nào. Chia sẻ mẹo cấu hình sản xuất của bạn bên dưới.
Trình kiểm tra lược đồ tài nguyên và công cụ MCP
| Mã định danh công cụ/tài nguyên | Thông số đầu vào | Hành vi thực thi |
|---|---|---|
| enforce_proxy_ts_convention | src/proxy.ts | Mandates Next.js 16 export function proxy(request) and forbids deprecated middleware.ts files. |
| enforce_async_rsc_params | src/app/**/page.tsx | Requires awaiting Promise-typed params, searchParams, cookies(), and headers() in Server Components. |