nextjs-15

nextjs-15 is a cursor rule for Cursor from Renvia-code/best-cursor-rules. It costs 0 tokens per session (1,624 once invoked), scanned A, original, CC0-1.0.

A set of coding rules for Next.js 15, a framework for building web applications with React. It covers the App Router, server-side components, data loading, forms, and styling.

In plain words
What is it for?
Use it when building or reviewing Next.js 15 applications, especially pages, data fetching, forms, and interactive components.
Why use it?
It gives developers consistent guidance for choosing where code runs and how common Next.js tasks should be organized.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when building or reviewing Next.js 15 applications, especially pages, data fetching, forms, and interactive components.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/renvia-code/best-cursor-rules/nextjs-15
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/Renvia-code/best-cursor-rules

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-15

README.md
[![agentmods](https://agentmods.dev/badge/rules/renvia-code/best-cursor-rules/nextjs-15/github.svg)](https://agentmods.dev/rules/renvia-code/best-cursor-rules/nextjs-15)
Your own site
<a href="https://agentmods.dev/rules/renvia-code/best-cursor-rules/nextjs-15"><img src="https://agentmods.dev/badge/rules/renvia-code/best-cursor-rules/nextjs-15/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-15

Your own site · 80×15
<a href="https://agentmods.dev/rules/renvia-code/best-cursor-rules/nextjs-15"><img src="https://agentmods.dev/badge/rules/renvia-code/best-cursor-rules/nextjs-15.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,624 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.01624
Opus 5.5 $0.00000 $0.00650
Sonnet 5.5 $0.00000 $0.00325
Haiku 4.5 $0.00000 $0.00162

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

Security

Grade A, and why

nextjs-15 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.

rules/frameworks/nextjs-15.mdc · 334 lines

How it starts

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

Next.js 15 Best Practices

Overview

Aspect Recommendation
Router App Router (default)
Components Server Components by default
Data Fetching async/await in Server Components
Forms Server Actions + useActionState
Styling Tailwind CSS or CSS Modules

Server Components (Default)

Server Components are the default in App Router. Only use 'use client' when needed.

When to use Client Components

'use client'  // Add ONLY when you need:

// ✅ Browser APIs (window, localStorage)
// ✅ Event handlers (onClick, onChange)
// ✅ Hooks (useState, useEffect, useContext)
// ✅ Third-party client libraries

✅ DO: Keep components server-side by default

// app/users/page.tsx - Server Component (no directive needed)
export default async function UsersPage() {
  const users = await getUsers()  // Direct database/API call
  return <UserList users={users} />
}

❌ DON'T: Add 'use client' unnecessarily

// Bad - this doesn't need to be a client component
'use client'
export default function About() {
  return <div>About us</div>  // No interactivity needed
}

Data Fetching

Fetch in Server Components

// app/products/page.tsx
async function getProducts() {
  const res = await fetch('https://api.example.com/products', {
    next: { revalidate: 3600 }  // Cache for 1 hour
  })
  return res.json()
}

export default async function ProductsPage() {
  const products = await getProducts()
  return <ProductGrid products={products} />
}

Cache Options

Option Use Case
{ cache: 'force-cache' } Static data (default)
{ cache: 'no-store' } Dynamic data (every request)
{ next: { revalidate: 60 } } ISR - revalidate every 60s

Server Actions

Form with Server Action

// app/actions.ts
'use server'

export async function createUser(formData: FormData) {
  const name = formData.get('name')
  await db.user.create({ data: { name } })
  revalidatePath('/users')
}

Read the full file on GitHub · 334 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 · 334 lines · 0 tokens per session scan A 371d0cf8ab3c

Subscribe to this mod's changes

nextjs-15 is a cursor rule published in the GitHub repository Renvia-code/best-cursor-rules (13 stars, last pushed 12mo ago), licensed CC0-1.0. It costs nothing until one of its globs matches a file; then it loads 1,624 tokens. 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

nextjs-15 compared with cursor rules from other repositories

nextjs-15 next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
nextjs-15Renvia-code/best-cursor-rulesCursor rule1312mo agoCC0-1.0A0Cursor
semiotic-react-dataviz-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A7,632Cursor
react-tanstack-router-query-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A1,995Cursor
react-formengine-ai-form-builder-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A1,681Cursor
cursorrules-cursor-ai-nextjs-14-tailwind-seo-setupPatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A1,195Cursor
nextjs15-supabase-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A1,137Cursor
react-zustand-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A1,148Cursor