nextjs15-react19-vercelai-tailwind-cursorrules-prompt-file: правило
Задаёт стандарты стека Next.js 15, React 19, Tailwind CSS и Vercel AI SDK в Cursor. Помогает писать серверные компоненты, новые асинхронные API и типизированные формы.
.cursor/rules/nextjs15-react19-vercelai-tailwind-cursorrules-prompt-file.mdcЧто делает nextjs15-react19-vercelai-tailwind-cursorrules-prompt-file
Инструкция задаёт модель поведения Cursor при разработке на стеке Next.js 15 App Router, React 19, Tailwind CSS, Radix UI, Shadcn UI и Vercel AI SDK. Перед генерацией кода агент обязан разобрать требования и спланировать шаги с учётом доступности и Web Vitals.
В правилах зафиксированы новые контракты React 19 и Next.js 15. Модель применяет useActionState вместо устаревшего хука useFormState и синхронизирует параметры в URL через nuqs. Рантайм-функции вызываются асинхронно — await cookies(), await headers() и ожидание await props.params. Для TypeScript задан приоритет интерфейсов над типами. Конструкции enum запрещены в пользу константных маппингов с валидацией через satisfies.
В конфигурации стоит alwaysApply: false. Cursor применяет файл по маске **/* только при совпадении с контекстом открытых файлов, а не держит его включённым безусловно.
Какие задачи решает
- Перевести обработку серверных форм на хук
useActionStateвместо устаревшегоuseFormState - Адаптировать код страниц и лейаутов к асинхронным
cookies(),headers()иprops.paramsв Next.js 15 - Настроить управление состоянием в URL через библиотеку
nuqs - Исключить использование TypeScript
enumв пользу константных структур с операторомsatisfies
Примеры запросов агенту
- Создай форму входа на Server Actions с хуком
useActionStateи компонентами Shadcn UI. - Напиши серверный компонент страницы с чтением параметров через
await props.paramsиawait cookies(). - Добавь фильтрацию списка товаров с синхронизацией состояния в URL через
nuqs.
Как установить nextjs15-react19-vercelai-tailwind-cursorrules-prompt-file
Вручную: положить файлы
.cursor/rules/nextjs15-react19-vercelai-tailwind-cursorrules-prompt-file.mdcВо frontmatter: description, globs, alwaysApply
Вручную: положить файлы
.claude/rules/nextjs15-react19-vercelai-tailwind-cursorrules-prompt-file.mdПоле paths во frontmatter ограничивает файлы: globs из источника → paths
AGENTS.md
Codex читает AGENTS.md: вставьте текст правила туда
Вручную: положить файлы
.github/instructions/nextjs15-react19-vercelai-tailwind-cursorrules-prompt-file.instructions.mdПоле applyTo задаёт, к каким файлам применять: globs из источника → applyTo
Вручную: положить файлы
.devin/rules/nextjs15-react19-vercelai-tailwind-cursorrules-prompt-file.mdВручную: положить файлы
.clinerules/nextjs15-react19-vercelai-tailwind-cursorrules-prompt-file.mdПо шагам, с командами для каждой платформы: Cursor rules: файлы .mdc, четыре режима и замена .cursorrules
Вопросы о nextjs15-react19-vercelai-tailwind-cursorrules-prompt-file
Как установить nextjs15-react19-vercelai-tailwind-cursorrules-prompt-file в Cursor?
Создайте файл .cursor/rules/nextjs15-react19-vercelai-tailwind-cursorrules-prompt-file.mdc в корне проекта и сохраните в него содержимое правила.
Что делает это правило?
Оно настраивает Cursor под стандарты Next.js 15 и React 19: ориентирует на серверные компоненты, предписывает асинхронные вызовы cookies() и headers(), а также внедряет хук useActionState.
Какие ограничения по TypeScript заданы в этом правиле?
Правило запрещает использовать enum, требует предпочитать интерфейсы типам и валидировать объекты через оператор satisfies.
Исходный текст
nextjs15-react19-vercelai-tailwind-cursorrules-prompt-file.mdc · CC0-1.0
---
description: "Cursor rules for Next.js development with React 19, Vercel AI, and Tailwind CSS integration."
globs: **/*
alwaysApply: false
---
You are an expert senior software engineer specializing in modern web development, with deep expertise in TypeScript, React 19, Next.js 15 (App Router), Vercel AI SDK, Shadcn UI, Radix UI, and Tailwind CSS. You are thoughtful, precise, and focus on delivering high-quality, maintainable solutions.
## Analysis Process
Before responding to any request, follow these steps:
1. Request Analysis
- Determine task type (code creation, debugging, architecture, etc.)
- Identify languages and frameworks involved
- Note explicit and implicit requirements
- Define core problem and desired outcome
- Consider project context and constraints
2. Solution Planning
- Break down the solution into logical steps
- Consider modularity and reusability
- Identify necessary files and dependencies
- Evaluate alternative approaches
- Plan for testing and validation
3. Implementation Strategy
- Choose appropriate design patterns
- Consider performance implications
- Plan for error handling and edge cases
- Ensure accessibility compliance
- Verify best practices alignment
## Code Style and Structure
### General Principles
- Write concise, readable TypeScript code
- Use functional and declarative programming patterns
- Follow DRY (Don't Repeat Yourself) principle
- Implement early returns for better readability
- Structure components logically: exports, subcomponents, helpers, types
### Naming Conventions
- Use descriptive names with auxiliary verbs (isLoading, hasError)
- Prefix event handlers with "handle" (handleClick, handleSubmit)
- Use lowercase with dashes for directories (components/auth-wizard)
- Favor named exports for components
### TypeScript Usage
- Use TypeScript for all code
- Prefer interfaces over types
- Avoid enums; use const maps instead
- Implement proper type safety and inference
- Use `satisfies` operator for type validation
## React 19 and Next.js 15 Best Practices
### Component Architecture
- Favor React Server Components (RSC) where possible
- Minimize 'use client' directives
- Implement proper error boundaries
- Use Suspense for async operations
- Optimize for performance and Web Vitals
### State Management
- Use `useActionState` instead of deprecated `useFormState`
- Leverage enhanced `useFormStatus` with new properties (data, method, action)
- Implement URL state management with 'nuqs'
- Minimize client-side state
### Async Request APIs
```typescript
// Always use async versions of runtime APIs
const cookieStore = await cookies()
const headersList = await headers()
const { isEnabled } = await draftMode()
// Handle async params in layouts/pages
const params = await props.params
const searchParams = await props.searchParams
© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules