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

tailwind-css-nextjs-guide-cursorrules-prompt-file — правило Cursor

Набор инструкций для Cursor по вёрстке на Tailwind CSS и DaisyUI в Next.js. Задаёт строгий TypeScript, правила Biome и базовые соглашения для смарт-контрактов.

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

Что делает tailwind-css-nextjs-guide-cursorrules-prompt-file

Файл настраивает генерацию кода под Pages Router в Next.js. Он требует оформлять динамические пути через скобки вроде [id].tsx, забирать данные через getServerSideProps или getStaticProps и оптимизировать графику компонентом next/image. Стилизацию предписывает делать через служебные классы Tailwind CSS и готовые компоненты DaisyUI без самописного CSS.

Внутри зашиты строгие требования к чистоте проекта. В tsconfig.json должен быть активен strict-режим, а тип any запрещён в пользу unknown с проверками типов во время выполнения. Для форматирования и линтинга используется Biome. Неожиданная деталь: правило также содержит секции по работе со Starknet React и языком Cairo, поэтому в структуре проекта ожидается каталог contracts. Без установленного пакета Biome запуск проверок перед коммитом завершится ошибкой.

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

  • стандартизировать компоненты на Tailwind CSS и DaisyUI
  • настроить линтинг и форматирование через Biome
  • структурировать выборку данных и роуты в Next.js
  • исключить тип any в кодовой базе TypeScript

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

  • Сделай карточку профиля на DaisyUI и Tailwind CSS с валидацией входных пропсов.
  • Напиши страницу [id].tsx с выборкой данных через getServerSideProps и строгой типизацией.
  • Добавь хук для отслеживания статуса транзакции в Starknet React.

Как установить tailwind-css-nextjs-guide-cursorrules-prompt-file

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

.cursor/rules/tailwind-css-nextjs-guide-cursorrules-prompt-file.mdc

Во frontmatter: description, globs, alwaysApply

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

Вопросы о tailwind-css-nextjs-guide-cursorrules-prompt-file

Как установить tailwind-css-nextjs-guide-cursorrules-prompt-file в Cursor?

Сохраните текст правила в файл .cursor/rules/tailwind-css-nextjs-guide-cursorrules-prompt-file.mdc в корне вашего проекта.

Для какого роутера Next.js написаны эти инструкции?

Правило ориентировано на классический Pages Router, так как напрямую требует использовать [id].tsx, getServerSideProps и getStaticProps.

Какой инструмент форматирования задаёт это правило?

Для проверки и форматирования кода предписан Biome, настроенный через biome.json и pre-commit хуки.

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

tailwind-css-nextjs-guide-cursorrules-prompt-file.mdc · CC0-1.0
---
description: "Cursor rules for Tailwind CSS development with Next.js integration."
globs: **/*
alwaysApply: false
---
Prompt Generation Rules:

- Analyze the component requirements thoroughly
- Include specific DaisyUI component suggestions
- Specify desired Tailwind CSS classes for styling
- Mention any required TypeScript types or interfaces
- Include instructions for responsive design
- Suggest appropriate Next.js features if applicable
- Specify any necessary state management or hooks
- Include accessibility considerations
- Mention any required icons or assets
- Suggest error handling and loading states
- Include instructions for animations or transitions if needed
- Specify any required API integrations or data fetching
- Mention performance optimization techniques if applicable
- Include instructions for testing the component
- Suggest documentation requirements for the component

General Component Creation Guidelines:

- Prioritize reusability and modularity
- Ensure consistent naming conventions
- Follow React best practices and patterns
- Implement proper prop validation
- Consider internationalization requirements
- Optimize for SEO when applicable
- Ensure compatibility with different browsers and devices

General Rules:

- Enable strict TypeScript (strict: true in tsconfig.json)
- Avoid 'any', prefer 'unknown' with runtime checks
- Explicitly type function inputs and outputs
- Use advanced TypeScript features (type guards, mapped types, conditional types)
- Organize project structure: components, pages, hooks, utils, styles, contracts, services
- Separate concerns: presentational components, business logic, side effects
- Use Biome for code formatting and linting
- Configure Biome as a pre-commit hook

Next.js Rules:

- Use dynamic routes with bracket notation ([id].tsx)
- Validate and sanitize route parameters
- Prefer flat, descriptive routes
- Use getServerSideProps for dynamic data, getStaticProps/getStaticPaths for static
- Implement Incremental Static Regeneration (ISR) where appropriate
- Use next/image for optimized images
- Configure image layout, priority, sizes, and srcSet attributes

TypeScript Rules:

- Enable all strict mode options in tsconfig.json
- Explicitly type all variables, parameters, and return values
- Use utility types, mapped types, and conditional types
- Prefer 'interface' for extendable object shapes
- Use 'type' for unions, intersections, and primitive compositions
- Document complex types with JSDoc
- Avoid ambiguous union types, use discriminated unions when necessary

TailwindCSS and DaisyUI Rules:

- Use TailwindCSS utility classes for styling
- Avoid custom CSS unless absolutely necessary
- Maintain consistent order of utility classes
- Use Tailwind's responsive variants for adaptive designs
- Leverage DaisyUI components for rapid development
- Customize DaisyUI components only when necessary
- Define and use design tokens in tailwind.config.js

Starknet React Rules:

- Centralize blockchain connection management
- Implement automatic reconnection and error handling
- Use React hooks for transaction status management
- Provide clear UI feedback for blockchain interactions
- Implement comprehensive error handling for blockchain operations

Cairo Rules:

- Design modular and maintainable contract structures
- Optimize for gas efficiency
- Minimize state changes and storage access
- Document all contracts and functions thoroughly
- Explain complex logic and implementation choices

Development Process:

- Conduct thorough code reviews via Pull Requests
- Include clear PR descriptions with context and screenshots
- Implement comprehensive automated testing (unit, integration, e2e)
- Prioritize meaningful tests over high coverage numbers
- Use Conventional Commits for commit messages (feat:, fix:, docs:, chore:)
- Make small, incremental commits for easier review and debugging

Biome Rules:

- Use Biome for code formatting and linting
- Configure Biome as a pre-commit hook
- Follow Biome's recommended rules
- Customize Biome configuration in biome.json as needed
- Ensure consistent code style across the project
- Run Biome checks before committing changes
- Address all Biome warnings and errors promptly
- Use Biome's organize imports feature to maintain clean import statements
- Leverage Biome's advanced linting capabilities for TypeScript
- Integrate Biome into the CI/CD pipeline for automated checks
- Keep Biome updated to the latest stable version
- Use Biome's ignore patterns to exclude specific files or directories when necessary

© 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

Весь набор →
tanstack-query-v5-cursorrules-prompt-file Правило для Cursor, которое задаёт агенту стиль работы с TanStack Query v5: ключи запросов, мутации, оптимистичные обновления, Suspense и префетчинг. ★ 41 024звёзд репо tailwind Задаёт стандарты вёрстки на Tailwind CSS и правила для компонентов UI. Срабатывает при редактировании стилей и разметки JSX или TSX. ★ 41 024звёзд репо tailwind-shadcn-ui-integration-cursorrules-prompt- Правило задаёт стиль работы Cursor с Tailwind и shadcn/ui: просит сначала расписать план, а затем писать читаемый код на TypeScript и Next.js. ★ 41 024звёзд репо tailwind-react-firebase-cursorrules-prompt-file Правило для Cursor задаёт, как писать мобильное веб-приложение на Tailwind, React и Firebase: сначала мобильная вёрстка, потом остальное. ★ 41 024звёзд репо swiftui-guidelines-cursorrules-prompt-file Правило задаёт рекомендации для SwiftUI-кода: от архитектуры и конкурентности до тестов и превью. Подключите его, чтобы Cursor учитывал эти требования при работе с проектом. ★ 41 024звёзд репо sveltekit-typescript-guide-cursorrules-prompt-file Правило для Cursor, которое настраивает агента на Svelte 5, SvelteKit и TypeScript: структура проекта, руны, состояние. ★ 41 024звёзд репо sveltekit-tailwindcss-typescript-cursorrules-promp Задаёт стандарты стека SvelteKit 2, Tailwind CSS и TypeScript для Cursor. Помогает генерировать типизированные компоненты с правильной структурой файлов. ★ 41 024звёзд репо sveltekit-restful-api-tailwind-css-cursorrules-pro Правило задаёт рекомендации для разработки на SvelteKit: от REST API и Tailwind CSS до тестов, документации и Windows-команд. Пригодится, если хотите закрепить эти требования в проекте Cursor. ★ 41 024звёзд репо

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

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