nextjs-typescript-cursorrules-prompt-file

nextjs-typescript-cursorrules-prompt-file is a cursor rule for coding agents from PatrickJS/awesome-cursorrules. It costs 0 tokens per session (615 once invoked), scanned A, a copy of next-type-llm, CC0-1.0.

A set of Cursor rules for a Next.js and TypeScript application using React components, Tailwind CSS, and Next.js API routes. API routes are server endpoints that receive requests and return data or perform actions.

In plain words
What is it for?
Use it when adding or editing frontend components, server API endpoints, styling, or Python-connected language-model features in the described application.
Why use it?
It establishes project conventions for code structure, naming, comments, security, and the development process. This reduces inconsistent files and unclear implementation choices.

Cursor rule

About the project

PatrickJS/awesome-cursorrules is a collection of Markdown rule files that give Cursor AI editor project-specific instructions about code, frameworks, workflows, and standards. Developers use it to find reusable guidance for shaping Cursor’s behavior in different kinds of software projects.

PatrickJS/awesome-cursorrules · 40,722 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/patrickjs/awesome-cursorrules/nextjs-typescript-cursorrules-prompt-file
Clone the repo
git clone --depth 1 https://github.com/PatrickJS/awesome-cursorrules

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nextjs-typescript-cursorrules-prompt-file

README.md
[![agentmods](https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/nextjs-typescript-cursorrules-prompt-file.svg)](https://agentmods.dev/rules/patrickjs/awesome-cursorrules/nextjs-typescript-cursorrules-prompt-file)
Your own site
<a href="https://agentmods.dev/rules/patrickjs/awesome-cursorrules/nextjs-typescript-cursorrules-prompt-file"><img src="https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/nextjs-typescript-cursorrules-prompt-file.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 615 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 91% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00615
Opus 5 $0.00000 $0.00308
Sonnet 5 $0.00000 $0.00123
Haiku 4.5 $0.00000 $0.00061

Measured yesterday against content hash e0fa6a2e9a64, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

nextjs-typescript-cursorrules-prompt-file scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

91% identical to next-type-llm — 34 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

rules/nextjs-typescript-cursorrules-prompt-file.mdc · 81 lines

What it actually says

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. “”"

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 81 lines · 615 tokens per session scan A e0fa6a2e9a64

Subscribe to this mod's changes

nextjs-typescript-cursorrules-prompt-file is a cursor rule published in the GitHub repository PatrickJS/awesome-cursorrules (40,722 stars, last pushed 3mo ago), licensed CC0-1.0. It costs nothing until one of its globs matches a file; then it loads 615 tokens. A static security scan graded it A with 0 findings. It is 91% identical to next-type-llm, differing in 34 lines, and is treated as a copy.