К основному содержанию
правило

nextjs-supabase-shadcn-pwa-cursorrules-prompt-file — правило Cursor

Задаёт стандарты стека Next.js 15+, Supabase и Shadcn UI для Cursor. Вводит лимит на 150 строк в файле и строгий регламент ведения заметок сборки.

Установить в Cursor · Вручную: положить файлы Все способы и платформы ↓
.cursor/rules/nextjs-supabase-shadcn-pwa-cursorrules-prompt-file.mdc
Открыть на GitHub

Что делает nextjs-supabase-shadcn-pwa-cursorrules-prompt-file

Правило ориентирует модель на Next.js 15+ с App Router и архитектурой Progressive Web App. Запрещены классы: код строится строго функционально, с именованными экспортами и подходом RORO для функций. Для интерфейса используется Shadcn UI через команду npx shadcn@latest add, а состояние на клиенте отдаётся библиотеке Zustand.

Здесь действует жёсткое ограничение на объём кода. Длина одного файла не должна превышать 150 строк. Если модуль разрастается, Cursor обязан провести рефакторинг и разделить логику на части. Без готовой структуры папок /ProjectDocs/Build_Notes/ ассистент начнёт путаться в задачах: правило требует фиксировать цели и чек-листы в Markdown-файлах до написания кода.

Контекст проекта хранится в каталоге /ProjectDocs/contexts/. Менять мастер-файл projectContext.md разрешено только при согласованных изменениях требований. Если проект оформлен как монорепозиторий, общий код выносится в каталог packages/, а команды запускаются через Taskfile.yml.

Какие задачи решает

  • настроить разработку PWA на Next.js 15+ и Supabase
  • ограничить размер файлов 150 строками без разрастания модулей
  • стандартизировать ведение задач и контекста в каталоге /ProjectDocs/
  • исключить классы и перевести проект на функциональный TypeScript

Примеры запросов агенту

  • Создай клиентский компонент формы авторизации через Shadcn UI и Zustand
  • Сформируй файл заметок сборки для перехода на новую схему базы данных
  • Проверь компонент профиля на лимит в 150 строк и разбей его на модули

Как установить nextjs-supabase-shadcn-pwa-cursorrules-prompt-file

Вручную: положить файлы

.cursor/rules/nextjs-supabase-shadcn-pwa-cursorrules-prompt-file.mdc

Во frontmatter: description, globs, alwaysApply

По шагам, с командами для каждой платформы: Cursor rules: файлы .mdc, четыре режима и замена .cursorrules

Вопросы о nextjs-supabase-shadcn-pwa-cursorrules-prompt-file

Как установить nextjs-supabase-shadcn-pwa-cursorrules-prompt-file в Cursor?

Создайте файл правила в корне репозитория по пути .cursor/rules/nextjs-supabase-shadcn-pwa-cursorrules-prompt-file.mdc.

Что делает это правило?

Оно обязывает Cursor писать код для Next.js 15+ без классов, удерживать файлы в пределах 150 строк и документировать работу в /ProjectDocs/Build_Notes/.

Как правило требует оформлять задачи?

Перед началом работы модель создаёт файл в /ProjectDocs/Build_Notes/ с целями и чек-листом. Удалять пункты из чек-листа запрещено: готовые отмечаются, а ненужные вычёркиваются.

Исходный текст

nextjs-supabase-shadcn-pwa-cursorrules-prompt-file.mdc · CC0-1.0
---
description: "Cursor rules for Nextjs Supabase Shadcn Pwa."
globs: **/*
alwaysApply: false
---
## Key Principles

- **Code Quality & Style**

  - Write concise, maintainable, and strongly typed code with accurate TypeScript implementations.
  - Embrace functional, declarative programming. Avoid OOP and classes.
  - Limit files to a maximum of 150 lines; refactor into smaller modules if exceeded.
  - Prefer iteration and modularization over duplication.
  - Use descriptive, semantic variable names with auxiliary verbs (e.g., `isLoading`, `hasError`).
  - Use lowercase with dashes for directories and files (e.g., `components/auth-wizard`).
  - Favor named exports for components.
  - Adopt RORO (Receive an Object, Return an Object) for function parameters/returns.
  - Always attain to use DRY (Don't Repeat Yourself) principles.
  - Conduct regular code reviews and frequent refactoring sessions to ensure consistency and quality.
  - Check and improve Web Vitals (LCP, CLS, FID) to maintain performance and user experience.

- **Create 'Build Notes':**

  - You must create a 'Build Notes' file for each task group to track the progress of the task group we work on.
  - **Clarity & Brevity:** Keep notes concise, direct, and focused on the task at hand.
  - **Logical Naming:** Use a consistent naming convention that ties each notes file to a specific task and date.
  - **Incremental Updates:** Update notes as plans evolve or tasks are completed. Append rather than overwrite.
  - **Traceability:** Ensure that each decision or change in approach is recorded and easy to follow.

- **Review 'Project Contexts':**

  - You must review the `projectContext.md` as we need to ensure that the project context is up to date and accurate.
  - **Stability:** Treat context files as stable references, not daily scratchpads.
  - **Selective Updates:** Update context files only when there are significant, approved changes to requirements or project scope.
  - **Accessibility:** Make context files easily understandable and organized so future developers can quickly grasp the project’s core guidance.

- **Stack and Framework Conventions**

  - Target **Next.js 15+** and leverage the App Router, React Server Components (RSC), and SSR capabilities.
  - Use Zustand for state management in client components when necessary.
  - Maintain proper Shadcn UI management using `npx shadcn@latest add` for new components.
  - Follow a mobile-first approach and responsive design patterns.
  - Emphasize server-side logic, minimizing the usage of `use client` and other client-only APIs.
  - Structure project as Progressive Web App (PWA) with offline capabilities, app-like experience, and installability across devices.

- **Monorepo & Tooling**

  - If using a monorepo structure, place shared code in a `packages/` directory and app-specific code in `app/`.
  - Use `Taskfile.yml` commands for development, testing, and deployment tasks.
  - Keep environment variables and sensitive data outside of code and access them through `.env` files or similar configuration.

Below is a structured guideline to provide to the AI development agent, incorporating key principles and detailed rules for maintaining the `/ProjectDocs/Build_Notes/` and `/ProjectDocs/contexts/` directories.

---

### Rules for Build Notes Files

1. **Location & Naming:**

   - Store all notes files in `/ProjectDocs/Build_Notes/`.
   - Use a logical, descriptive naming convention, e.g., `build-title_phase-#_task-group-name.md`.
   - Use the `<build-title>` to describe the build task.
   - Use the `<phase-#>` to apply the Phase # to the build task.
   - Use the `<task-group-name>` to describe the task group name.
   - Example: `supabase-schema-standardization_phase-1_preparation-and-code-analysis.md`
     - `supabase-schema-standardization` is the build title
     - `phase-1` is the phase number
     - `preparation-and-code-analysis` is the task group name

2. **Content Structure:**

   - Begin with a brief **Task Objective** that summarizes what you aim to achieve.
   - Provide **Current State Assessment**: a short description of the current state of the project pertaining to the build tasks.
   - Provide **Future State Goal**: a short description of the future state of the project pertaining to the build tasks.
   - Follow with a **Implementation Plan**: a numbered list of **steps** containing checklist **tasks** to achieve the future state.
   - Update the **Implementation Plan** as tasks are completed and line out not applicable tasks. NEVER DELETE TASKS FROM THE PLAN.
   - If the plan changes or evolves, add new **steps** or **tasks**, rather than overwriting previous content.

3. **When to Update:**

   - **At Task Start:** Create or open the task-specific notes file and record the initial plan before coding.
   - **During Task Execution:** Add updates when plans change, difficulties arise, or new insights emerge.
   - **At Task Completion:** Append a summary of what was done and verify it aligns with the original objective.

4. **Style & Tone:**

   - Keep notes succinct, on-topic, and free of unrelated commentary.
   - Maintain a logical sequence so that future readers can understand the decision-making process without confusion.

5. **Completion of Build Notes:**

   - Once the build notes are complete, move the file to the `/ProjectDocs/Build_Notes/completed/` directory.
   - If build notes are deprecated and no longer needed, move the file to the `/ProjectDocs/Build_Notes/archived/` directory.

---

### Rules for Context Files

1. **Master Project Context (`projectContext.md`):**

   - Located in `/ProjectDocs/contexts/`.
   - Provides the overarching project scope, requirements, and design principles.
   - Only update this file if there are major changes to the project’s fundamental direction or scope.

2. **Additional Context Files:**

   - Supplementary files (e.g., `uiContext.md`, `featureAContext.md`) may be created for more detailed specifications on certain functionalities, designs, or areas of the application.
   - Keep these files stable. Update them only when new, approved changes need to be documented.
   - Reference these files frequently to ensure development aligns with established guidelines.

3. **Change Management:**

   - Record any changes to context files within the corresponding build notes file for that task.
   - Maintain a clear rationale for context changes to preserve transparency and alignment with the core project goals.

---

## Project Structure

Adopt a clear, modular directory structure:

© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules

Похожие правила IDE

Все правила IDE по теме «Фронтенд и UI» →
winui3 официальный github Правило задаёт рекомендации для WinUI 3 и Windows App SDK: от XAML и потоков до окон и MVVM. Пригодится, чтобы Copilot учитывал особенности настольных приложений Windows. ★ 40 451звёзд репо vue официальный github Правило задаёт Copilot стандарты Vue 3: Composition API, <script setup>, реактивность, Pinia и Vue Router. Пригодится, когда агент пишет компоненты в вашем стиле. ★ 40 451звёзд репо tanstack-start-shadcn-tailwind официальный github Правило задаёт Copilot стек TanStack Start, Shadcn/ui и Tailwind CSS и требует валидировать внешние данные через Zod. ★ 40 451звёзд репо tailwind-v4-vite официальный github Правило помогает подключить Tailwind CSS v4 к проекту на Vite через официальный плагин. Пригодится и для новой установки, и при переходе с v3. ★ 40 451звёзд репо svelte официальный github Направляет GitHub Copilot на стандарты Svelte 5 и SvelteKit 2: руны вместо старых сторов, типизация компонентов и безопасная работа с SSR. ★ 40 451звёзд репо power-bi-custom-visuals-development официальный github Правило для GitHub Copilot, которое подсказывает агенту, как писать кастомные визуалы Power BI на React, D3.js и TypeScript. ★ 40 451звёзд репо

Из того же набора234

Весь набор →
nextjs-typescript-cursorrules-prompt-file Правило для Cursor задаёт стек Next.js с TypeScript и порядок работы агента: план, стиль кода, формат ответа. Пригодится, если вы пишете фронтенд на Next.js. ★ 41 024звёзд репо nextjs-tanstack-query Задаёт стандарты связки Next.js App Router и TanStack Query v5. Направляет Cursor при настройке гидратации кэша, серверных мутаций и оптимистичных обновлений интерфейса. ★ 41 024звёзд репо nextjs-tanstack-query-cursorrules-prompt-file Правило задаёт паттерны для Next.js App Router и TanStack Query v5: гидратация кэша, Server Actions и оптимистичные обновления. ★ 41 024звёзд репо nextjs-tailwind-typescript-apps-cursorrules-prompt Правило для Cursor, которое настраивает ассистента на Next.js, Tailwind CSS и TypeScript. Оно задаёт порядок работы: сначала план в псевдокоде, потом код. ★ 41 024звёзд репо nextjs-seo-dev-cursorrules-prompt-file Правило задаёт Cursor контекст для разработки Next.js с SEO-ориентиром, комментариями и фиксированными настройками проекта. ★ 41 024звёзд репо nextjs-react-typescript-cursorrules-prompt-file Правило для Cursor, которое задаёт агенту стиль кода в проектах на Next.js 14 App Router, React и TypeScript. ★ 41 024звёзд репо nextjs-react-tailwind-cursorrules-prompt-file Задаёт правила разработки на Next.js App Router, React, Tailwind CSS и Shadcn UI. Направляет Cursor генерировать серверные компоненты и соблюдать единую структуру файлов. ★ 41 024звёзд репо nextjs-material-ui-tailwind-css-cursorrules-prompt Правило задаёт стек Next.js с TypeScript, Tailwind CSS, Material UI и App Router. Подходит для проектов, где эти библиотеки уже выбраны. ★ 41 024звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой