Skip to main content
rule

nextjs-typescript-cursorrules-prompt-file — Cursor rule: what it

A Cursor rule that pins the Next.js and TypeScript stack and the agent's working order: plan first, one file at a time, fixed reply format.

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/nextjs-typescript-cursorrules-prompt-file.mdc
Open on GitHub

What nextjs-typescript-cursorrules-prompt-file does

The rule spells out the stack: Next.js on React, TypeScript, shadcn/ui components built on Radix UI primitives, Tailwind CSS for styling, Lucide React for icons. The backend side is Next.js API Routes in TypeScript. LLM work is expected through a Python wrapper plus an API endpoint that connects the frontend to it. Deployment is left open.

Then come the coding conventions. Every file opens with a one-line comment holding its path and name. Comments explain purpose first, effect only when it matters. The agent lists a short step-by-step plan, finishes one file before touching the next, and marks unfinished work with TODO:. Partial edits are out — the rule asks for the whole edited file back.

Responses follow a template: a line naming the language and the specialist role, the libraries involved, requirements, then the plan. Each reply closes with a compressed history, a source tree and the next task. You can steer detail with V=[0-3], from code golf up to a verbose version with extracted functions. The rule ships with alwaysApply: false, so in Cursor you have to attach it to globs **/* or invoke it yourself, otherwise it stays idle.

What it helps with

  • pin one Next.js and TypeScript stack for the agent
  • get a plan before any edits land
  • scale code detail with the V marker
  • finish one file before starting the next
  • flag unfinished spots with TODO comments

Example prompts for the agent

  • Set up the Next.js and TypeScript rule, then write a shadcn/ui form component
  • Add an API route for file uploads, V=1
  • Pick up where you left off

How to install nextjs-typescript-cursorrules-prompt-file

Manually: put the files in place

.cursor/rules/nextjs-typescript-cursorrules-prompt-file.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about nextjs-typescript-cursorrules-prompt-file

How do I install nextjs-typescript-cursorrules-prompt-file in Cursor?

Place the file at .cursor/rules/nextjs-typescript-cursorrules-prompt-file.mdc in your project root.

What does nextjs-typescript-cursorrules-prompt-file do?

It describes a Next.js and TypeScript stack with shadcn/ui and sets the agent's working order: a step-by-step plan, comment style, and a reply format with history and a source tree.

Why doesn't the rule apply on its own?

It carries alwaysApply: false, so in Cursor you need to attach it to globs **/* or call it manually.

Source text

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

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set68

playwright-defect-tracking-cursorrules-prompt-file A Cursor rule that makes the agent write Playwright tests tied to manual case IDs, with screenshots and logs as defect evidence. ★ 41,011repo stars plasticode-telegram-api-cursorrules-prompt-file A Cursor rule that points the assistant at PHP 7.4, Plasticode and the Telegram Bot API. Useful when your bot is built on Plasticode and you want PSR-12 code. ★ 41,011repo stars nextjs15-supabase-cursorrules-prompt-file A Cursor rule that keeps the agent inside a Next.js 15, Supabase and TypeScript strict stack — from session checks to RLS and Stripe keys. ★ 41,011repo stars nextjs-vercel-typescript-cursorrules-prompt-file A Cursor rule that sets code style and file structure for Next.js projects with TypeScript, Vercel middleware and a KV database. ★ 41,011repo stars nextjs-tailwind-typescript-apps-cursorrules-prompt A Cursor rule that points the assistant at Next.js, Tailwind CSS and TypeScript. It sets the working order: plan in pseudocode first, code after. ★ 41,011repo stars nextjs-react-typescript-cursorrules-prompt-file A Cursor rule that tells the agent how to write code in Next.js 14 App Router, React and TypeScript projects. ★ 41,011repo stars nextjs-app-router-cursorrules-prompt-file A Cursor rule that hands the agent a set of Next.js App Router habits: server components by default, file-based routing, separate files for loading and errors. ★ 41,011repo stars netlify-official-cursorrules-prompt-file A Cursor rule that hands the agent Netlify's official conventions: function types, environment access, and no stray CORS headers. ★ 41,011repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor