NextJS15

NextJS15 is a cursor rule for Cursor from TheSethRose/DevRules. It costs 1,428 tokens per session, scanned A, original, MIT.

Rules for building Next.js 15 applications with TypeScript and Tailwind, covering project structure, components, rendering, loading, and errors. Next.js is a framework for building web applications.

In plain words
What is it for?
Structuring App Router projects, placing shared code, deciding between server and browser components, loading content dynamically, and handling errors.
Why use it?
It provides consistent conventions for organising the code and choosing how pages and components should run.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Structuring App Router projects, placing shared code, deciding between server and browser components, loading content dynamically, and handling errors.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/thesethrose/devrules/nextjs15
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/TheSethRose/DevRules

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 NextJS15

README.md
[![agentmods](https://agentmods.dev/badge/rules/thesethrose/devrules/nextjs15/github.svg)](https://agentmods.dev/rules/thesethrose/devrules/nextjs15)
Your own site
<a href="https://agentmods.dev/rules/thesethrose/devrules/nextjs15"><img src="https://agentmods.dev/badge/rules/thesethrose/devrules/nextjs15/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 NextJS15

Your own site · 80×15
<a href="https://agentmods.dev/rules/thesethrose/devrules/nextjs15"><img src="https://agentmods.dev/badge/rules/thesethrose/devrules/nextjs15.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,428 This file is loaded in full into every session.
When invoked 1,428 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 original No closer match found 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.01428 $0.01428
Opus 5.5 $0.00571 $0.00571
Sonnet 5.5 $0.00286 $0.00286
Haiku 4.5 $0.00143 $0.00143

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

Security

Grade A, and why

NextJS15 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.

.cursor/rules/technologies/NextJS15.mdc · 95 lines

How it starts

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

Next.js Best Practices

Project Structure

  • Use the App Router directory structure (app/, components/, lib/ are common top-level folders).
  • Place route-specific components, layouts, pages, loading/error UIs within the app directory following App Router conventions.
  • Place shared, reusable components outside the app directory (e.g., in components/).
  • Place utilities, helpers, constants, and types in lib/ or utils/.
  • Use lowercase kebab-case for directory and file names (e.g., components/auth-wizard, app/user-profile/page.tsx).

Components & Rendering

  • Use Server Components by default for better performance and data fetching.
  • Mark components requiring interactivity, browser APIs, or state/lifecycle hooks explicitly with 'use client' at the top.
  • Prefer passing Server Components as props (children) to Client Components where possible to minimize Client bundle size.
  • Wrap Client Components that suspend (e.g., data fetching with hooks) in <Suspense> with an appropriate fallback UI.
  • Use next/dynamic for dynamic loading of components that are not critical for the initial page load.
  • Implement proper error boundaries (error.tsx files in the App Router) to handle runtime errors gracefully.
  • Place static content, constants, and type/interface definitions towards the end of the file for readability.

Performance

  • Optimize images using next/image: Ensure proper width, height, priority props, consider fill prop, and use modern formats like WebP if applicable.
  • Minimize unnecessary use of useEffect and client-side state (useState) in Client Components. Fetch data on the server where possible.
  • Favor Server Components (RSC) for data fetching and rendering static content.
  • Implement caching strategies effectively: Utilize Next.js fetch caching, Route Segment caching, and consider revalidate options. Understand the difference between static and dynamic rendering.

Data Fetching

  • Primarily use Server Components for data fetching (async/await directly in components).
  • Use Route Handlers (route.ts) for API endpoints.
  • Implement proper error handling (e.g., try/catch) for data fetching operations.
  • Utilize Next.js extended fetch API options for caching and revalidation (cache, next.revalidate).
  • Handle loading states using loading.tsx files or <Suspense> boundaries.
  • Handle error states using error.tsx files.

Read the full file on GitHub · 95 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 · 95 lines · 1,428 tokens per session scan A 16c8b4df6ae5

Subscribe to this mod's changes

NextJS15 is a cursor rule published in the GitHub repository TheSethRose/DevRules (26 stars, last pushed 1y ago), licensed MIT. It adds 1,428 tokens to every session, about $0.0057 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

NextJS15 compared with cursor rules from other repositories

NextJS15 next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
NextJS15TheSethRose/DevRulesCursor rule261y agoMITA1,428Cursor
pyspark-etl-best-practices-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A3,275Cursor
kotlin-ktor-development-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A2,078Cursor
kotlin-springboot-best-practices-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A1,518Cursor
nextjs-tanstack-query-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A1,847Cursor
go-backend-scalability-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A1,200Cursor
jest-unit-testing-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A935Cursor