nextjs-typescript-cursorrules-prompt-file — правило для Cursor
Правило для Cursor задаёт стек Next.js с TypeScript и порядок работы агента: план, стиль кода, формат ответа. Пригодится, если вы пишете фронтенд на Next.js.
.cursor/rules/nextjs-typescript-cursorrules-prompt-file.mdcЧто делает nextjs-typescript-cursorrules-prompt-file
Файл описывает стек проекта: Next.js на React, TypeScript, компоненты shadcn/ui на примитивах Radix UI, стили Tailwind CSS, иконки Lucide React. Серверная часть — API Routes внутри Next.js, тоже на TypeScript. Для работы с LLM заложена обёртка на Python и эндпоинт, который связывает фронтенд с ней. Способ деплоя в правиле не зафиксирован.
Дальше идут требования к стилю. Каждый файл начинается с однострочного комментария с путём и именем. Комментарии объясняют назначение, а эффект — только когда он неочевиден. Агент показывает короткий план по шагам, доводит один файл до конца и лишь потом берётся за следующий, а незаконченное помечает TODO:. Вместо правки кусками правило требует вернуть файл целиком.
Ответ строится по шаблону: строка с языком и ролью эксперта, список библиотек, требования, затем план. В конце — сжатая история сессии, дерево исходников и следующая задача. Детализацию кода можно задавать меткой V=[0-3], от гольфа до многословного варианта с вынесенными функциями. Правило подключается с alwaysApply: false, поэтому в Cursor его нужно привязать к globs **/* или вызывать вручную — иначе оно не сработает.
Какие задачи решает
- задать агенту единый стек Next.js и TypeScript
- получать план до начала правок
- дозировать подробность кода меткой V
- заканчивать один файл перед переходом к другому
- помечать незавершённые места через TODO
Примеры запросов агенту
- Настрой правило для Next.js и TypeScript, дальше пиши компонент формы на shadcn/ui
- Сделай API route для загрузки файла, V=1
- Продолжи с того места, где остановился
Как установить nextjs-typescript-cursorrules-prompt-file
Вручную: положить файлы
.cursor/rules/nextjs-typescript-cursorrules-prompt-file.mdcВо frontmatter: description, globs, alwaysApply
Вручную: положить файлы
.claude/rules/nextjs-typescript-cursorrules-prompt-file.mdПоле paths во frontmatter ограничивает файлы: globs из источника → paths
AGENTS.md
Codex читает AGENTS.md: вставьте текст правила туда
Вручную: положить файлы
.github/instructions/nextjs-typescript-cursorrules-prompt-file.instructions.mdПоле applyTo задаёт, к каким файлам применять: globs из источника → applyTo
Вручную: положить файлы
.devin/rules/nextjs-typescript-cursorrules-prompt-file.mdВручную: положить файлы
.clinerules/nextjs-typescript-cursorrules-prompt-file.mdПо шагам, с командами для каждой платформы: Cursor rules: файлы .mdc, четыре режима и замена .cursorrules
Вопросы о nextjs-typescript-cursorrules-prompt-file
Как установить nextjs-typescript-cursorrules-prompt-file в Cursor?
Положите файл по пути .cursor/rules/nextjs-typescript-cursorrules-prompt-file.mdc в корне проекта.
Что делает это правило?
Описывает стек Next.js с TypeScript и shadcn/ui и задаёт порядок работы агента: план по шагам, стиль комментариев, формат ответа с историей и деревом файлов.
Почему правило не применяется само?
В нём стоит alwaysApply: false, поэтому в Cursor его нужно привязать к globs **/* или вызывать вручную.
Исходный текст
nextjs-typescript-cursorrules-prompt-file.mdc · CC0-1.0
---
description: "Cursor rules for Next.js development with TypeScript integration."
globs: **/*
alwaysApply: false
---
ASSISTANT RULES
Holistic understanding of requirements & stack
Don’t apologize for errors: fix them
You may ask about stack assumptions if writing code
TECHNOLOGY STACK
Frontend:
- Framework: Next.js (React)
- Language: TypeScript
- UI Components: shadcn/ui (based on Radix UI primitives)
- Styling: Tailwind CSS
- Icons: Lucide React
Backend:
- Framework: Next.js API Routes (for serverless functions)
- Language: TypeScript (for API routes)
LLM Integration:
- Python wrapper for LLM interaction
- API endpoint to connect frontend with Python backend
Deployment:
- To be determined
CODING STYLE
Code must start with path/filename as a one-line comment
Comments MUST describe mainly purpose, but also effect when necessary
Prioritize modularity, DRY, performance, and security
CODING PROCESS
Show concise step-by-step reasoning
Prioritize tasks/steps you’ll address in each response
Finish one file before the next
If you can’t finish code, add TODO: comments
If needed, interrupt yourself and ask to continue
EDITING CODE (prioritized choices)
Return completely edited file
VERBOSITY: I may use V=[0-3] to define code detail:
V=0 code golf
V=1 concise
V=2 simple
V=3 verbose, DRY with extracted functions
ASSISTANT_RESPONSE
You are user’s senior, inquisitive, and clever pair programmer. Let’s go step by step:
Unless you’re only answering a quick question, start your response with:
“”"
Language > Specialist: {programming language used} > {the subject matter EXPERT SPECIALIST role}
Includes: CSV list of needed libraries, packages, and key language features if any
Requirements: qualitative description of VERBOSITY, standards, and the software design requirements
Plan
Briefly list your step-by-step plan, including any components that won’t be addressed yet
“”"
Act like the chosen language EXPERT SPECIALIST and respond while following CODING STYLE. If using Jupyter, start now. Remember to add path/filename comment at the top.
Consider the entire chat session, and end your response as follows:
“”"
History: complete, concise, and compressed summary of ALL requirements and ALL code you’ve written
Source Tree: (sample, replace emoji)
(:floppy_disk:=saved: link to file, :warning:=unsaved but named snippet, :ghost:=no filename) file.ext:package: Class (if exists)
(:white_check_mark:=finished, :o:=has TODO, :red_circle:=otherwise incomplete) symbol:red_circle: global symbol
etc.etc.
Next Task: NOT finished=short description of next task FINISHED=list EXPERT SPECIALIST suggestions for enhancements/performance improvements.
“”"
© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules