nextjs-typescript-tailwind-cursorrules-prompt-file
Правило для Cursor, которое задаёт агенту стандарты проекта на Next.js, TypeScript и Tailwind CSS. Пригодится, когда нужно, чтобы новый код ложился в существующую структуру.
.cursor/rules/nextjs-typescript-tailwind-cursorrules-prompt-file.mdcЧто делает nextjs-typescript-tailwind-cursorrules-prompt-file
Файл описывает проект Astral — блок-эксплорер сети Autonomys на Next.js и TypeScript. Внутри перечислены разделы: компоненты, папка App для маршрутизации, кастомные хуки для состояния. Агент получает эту карту и опирается на неё при генерации кода.
Дальше идут требования к разработке: типизация через TypeScript, стандарты из конфигурации ESLint, адаптивность и доступность компонентов, стилизация через Tailwind CSS по заданной палитре. Отдельный блок про взаимодействие с ИИ: приоритет практик TypeScript и React, переиспользуемые компоненты по существующим шаблонам, минимум сгенерированных комментариев, валидация пользовательского ввода и обработка ошибок. Ещё в файле есть словарь терминов сети и ссылки на документацию Next.js, TypeScript, Tailwind и React.
Правило привязано к globs: **/*, но alwaysApply стоит в false — значит, его нужно подключать вручную, само оно не сработает. Часть содержимого заточена под конкретный проект: названия Astral и Autonomys, их URL и терминология. Для своего репозитория эти блоки придётся переписать, иначе агент будет тянуть чужие имена в ваш код.
Какие задачи решает
- объяснить агенту структуру папок Next.js-проекта
- заставить генерировать компоненты на TypeScript
- удержать стили в рамках Tailwind CSS
- получать переиспользуемые компоненты вместо одноразовых
- добавить валидацию ввода и обработку ошибок в новый код
Примеры запросов агенту
- Создай компонент карточки транзакции в папке Components, стили через Tailwind
- Добавь кастомный хук для загрузки данных и типизируй его ответ
- Перепиши этот компонент так, чтобы он был адаптивным и доступным
Как установить nextjs-typescript-tailwind-cursorrules-prompt-file
Вручную: положить файлы
.cursor/rules/nextjs-typescript-tailwind-cursorrules-prompt-file.mdcВо frontmatter: description, globs, alwaysApply
Вручную: положить файлы
.claude/rules/nextjs-typescript-tailwind-cursorrules-prompt-file.mdПоле paths во frontmatter ограничивает файлы: globs из источника → paths
AGENTS.md
Codex читает AGENTS.md: вставьте текст правила туда
Вручную: положить файлы
.github/instructions/nextjs-typescript-tailwind-cursorrules-prompt-file.instructions.mdПоле applyTo задаёт, к каким файлам применять: globs из источника → applyTo
Вручную: положить файлы
.devin/rules/nextjs-typescript-tailwind-cursorrules-prompt-file.mdВручную: положить файлы
.clinerules/nextjs-typescript-tailwind-cursorrules-prompt-file.mdПо шагам, с командами для каждой платформы: Cursor rules: файлы .mdc, четыре режима и замена .cursorrules
Вопросы о nextjs-typescript-tailwind-cursorrules-prompt-file
Как установить nextjs-typescript-tailwind-cursorrules-prompt-file в Cursor?
Создайте файл .cursor/rules/nextjs-typescript-tailwind-cursorrules-prompt-file.mdc и вставьте в него содержимое правила.
Что делает это правило?
Задаёт агенту Cursor контекст проекта на Next.js и TypeScript: структуру папок, требования к типизации, стилизацию через Tailwind CSS и правила генерации кода.
Почему правило не применяется само?
В нём указано alwaysApply: false, поэтому его нужно включить вручную для нужных файлов или запросов.
Исходный текст
nextjs-typescript-tailwind-cursorrules-prompt-file.mdc · CC0-1.0
--- description: "Cursor rules for Next.js development with TypeScript and Tailwind CSS integration." globs: **/* alwaysApply: false --- # Project Overview This project, named Astral, the Block Explorer of Autonomys network, is built using Next.js and TypeScript. It integrates various libraries for state management, UI components, and data fetching. # Key URLs - Astral Block Explorer: https://explorer.autonomys.xyz/ - GitHub Repository: https://github.com/autonomys/astral - Autonomys: https://autonomys.xyz/ - Academy: https://academy.autonomys.xyz/ - Documentation: https://docs.autonomys.xyz/ # Project Structure - **Components**: Contains reusable UI components. - **App**: Next.js app for routing. - **Hooks**: Custom React hooks for state management. # Development Guidelines - Use TypeScript for type safety. - Follow the coding standards defined in the ESLint configuration. - Ensure all components are responsive and accessible. - Use Tailwind CSS for styling, adhering to the defined color palette. # Important Scripts - `dev`: Starts the development server. - `build`: Builds the application for production. # AI Interaction Guidelines - When generating code, prioritize TypeScript and React best practices. - Ensure that any new components are reusable and follow the existing design patterns. - Minimize the use of AI generated comments, instead use clearly named variables and functions. - Always validate user inputs and handle errors gracefully. - Use the existing components and pages as a reference for the new components and pages. # Lexicon of Terms and Concepts - **H+AI (Human + Artificial Intelligence)**: The collaboration between humans and AI to enhance capabilities and ensure a harmonious coexistence. - **Autonomys Network**: A decentralized network designed to provide infrastructure for AI-powered decentralized applications (dApps). - **deAI Ecosystem**: A stack of components that includes distributed storage, compute, and a dApp/agent layer for building and deploying AI applications. - **Distributed Storage**: A system ensuring data integrity and availability for AI-related data. - **Distributed Compute**: Scalable computational resources for AI training and inference. - **dApp (Decentralized Application)**: Applications that run on a decentralized network, providing enhanced security and transparency. # Additional Resources - [Next.js Documentation](https://nextjs.org/docs) - [TypeScript Handbook](https://www.typescriptlang.org/docs/) - [Tailwind CSS Documentation](https://tailwindcss.com/docs) - [React Documentation](https://reactjs.org/docs/getting-started.html) - [Autonomys Overview](https://autonomys.xyz/)
© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules