nextjs

nextjs is a cursor rule for Cursor from nedcodes-ok/cursor-doctor. It costs 842 tokens per session, scanned A, a copy of nextjs, MIT.

A set of coding rules for building Next.js applications with the App Router, which uses the app/ folder to define pages and routes. It covers server-rendered components, data loading, and server-side actions.

In plain words
What is it for?
Use it when creating or changing Next.js pages, route components, data fetching, loading and error states, or server actions.
Why use it?
It gives the coding agent consistent guidance about where code belongs and how Next.js features should be used. This reduces misplaced logic, unnecessary browser code, and inconsistent data handling.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: mentions Cursor.

Good fit Use it when creating or changing Next.js pages, route components, data fetching, loading and error states, or server actions.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/nedcodes-ok/cursor-doctor/nextjs
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.

Clone the repo
git clone --depth 1 https://github.com/nedcodes-ok/cursor-doctor

Made for: Cursor.

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

README.md
[![agentmods](https://agentmods.dev/badge/rules/nedcodes-ok/cursor-doctor/nextjs/github.svg)](https://agentmods.dev/rules/nedcodes-ok/cursor-doctor/nextjs)
Your own site
<a href="https://agentmods.dev/rules/nedcodes-ok/cursor-doctor/nextjs"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursor-doctor/nextjs/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nextjs

Your own site · 80×15
<a href="https://agentmods.dev/rules/nedcodes-ok/cursor-doctor/nextjs"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursor-doctor/nextjs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 842 This file is loaded in full into every session.
When invoked 842 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% 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.1 $0.00842 $0.00842
Opus 5.5 $0.00337 $0.00337
Sonnet 5.5 $0.00168 $0.00168
Haiku 4.5 $0.00084 $0.00084

Measured 3mo ago against content hash 4f3cdbb53d04, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

nextjs 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 3mo ago.

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

100% identical to nextjs — 0 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.

pro-kit/templates/frameworks/nextjs.mdc · 54 lines

How it starts

The opening of the file, as written. The whole thing — 54 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Next.js Cursor Rules

You are an expert Next.js developer using App Router (v14+). Follow these rules:

Architecture

  • Use App Router (app/ directory) for all new code
  • Default to Server Components. "use client" only for interactivity/hooks/browser APIs
  • "use client" marks the boundary — everything imported into a client component becomes client too, even if not marked. Keep client boundaries as low in the tree as possible
  • Use route groups (parentheses folders) for organization without URL impact
  • Keep page.tsx thin — compose from smaller components, page only wires them together
  • Colocate components with their route: app/dashboard/_components/ not a global components/ folder

Data Fetching

  • Fetch in Server Components with async/await — no useEffect for server data
  • fetch() requests with the same URL and options are automatically deduped within a render pass — don't cache manually
  • Use next: { revalidate: seconds } for time-based ISR, next: { tags: [...] } for on-demand with revalidateTag()
  • Server Actions for mutations — they run server-side even when called from client components
  • loading.tsx for Suspense boundaries per route segment, error.tsx for error boundaries
  • Do not fetch in layouts if child routes need different data — layouts don't re-render on navigation

Rendering Gotchas

  • Static rendering is default. Using cookies(), headers(), or searchParams opts the entire route into dynamic rendering — isolate dynamic parts with Suspense
  • generateStaticParams for dynamic route pre-rendering at build time — without it, dynamic segments are rendered on-demand
  • for all images (handles lazy loading, srcset, WebP). Set explicit width/height or use fill with a sized parent — unsized images cause layout shift
  • Do not import server-only code in client components — use the server-only package to get a build-time error instead of a runtime leak

Read the full file on GitHub · 54 lines

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. 3mo ago First seen · 54 lines · 842 tokens per session scan A 4f3cdbb53d04

Subscribe to this mod's changes

nextjs is a cursor rule published in the GitHub repository nedcodes-ok/cursor-doctor (10 stars, last pushed 8mo ago), licensed MIT. It adds 842 tokens to every session, about $0.0034 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to nextjs, differing in 0 lines, and is treated as a copy.

Related

nextjs compared with cursor rules from other repositories

nextjs next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
nextjsnedcodes-ok/cursor-doctorCursor rule108mo agoMITA842Cursor
test-patternstugkanboz/awesome-cursorrulesCursor rule242mo agoMITA2,177Cursor
testing-fundamentalstugkanboz/awesome-cursorrulesCursor rule242mo agoMITA26Cursor
componentskensaurus/cursor-kenjiCursor rule92mo agoMITA0Cursor
minimax-m3-self-evolutionmadebyaris/advance-minimax-m3-cursor-rulesCursor rule1265mo agoMITA26Cursor
skill-authoringmadebyaris/advance-minimax-m3-cursor-rulesCursor rule1265mo agoMITA42Cursor
gitkensaurus/cursor-kenjiCursor rule92mo agoMITA5Cursor