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.
npx agentmods add rules/renvia-code/best-cursor-rules/nextjs-15git clone --depth 1 https://github.com/Renvia-code/best-cursor-rulesWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01624 |
| Opus 5 | $0.00000 | $0.00812 |
| Sonnet 5 | $0.00000 | $0.00325 |
| Haiku 4.5 | $0.00000 | $0.00162 |
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 2d 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.
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')
}
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.
- 2d ago First seen · 334 lines · 0 tokens per session scan A 371d0cf8ab3c
nextjs-15 is a cursor rule published in the GitHub repository Renvia-code/best-cursor-rules (12 stars, last pushed 9mo 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.
Other cursor rules, from other repositories
ankra-cli
Ankra CLI rules and best practices for managing Kubernetes clusters via the Ankra platform.
cypress-api-testing-cursorrules-prompt-file
Cursor rules for Cypress development with API testing.
cypress-e2e-testing-cursorrules-prompt-file
Cursor rules for Cypress development with E2E testing.
github-cursorrules-prompt-file-instructions
Cursor rules for GitHub development with instructions integration.
fastapi-production-architecture-cursorrules-prompt-file
Cursor rules for FastAPI services with router/service/repository boundaries, typed provider adapters, bulkhead isolation, idempotency, and domain exceptions.
flutter-riverpod-cursorrules-prompt-file
Cursor rules for Flutter Riverpod.