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/inboxpraveen/minimize-cursor-cost/nextjsgit clone --depth 1 https://github.com/inboxpraveen/Minimize-Cursor-CostWrote 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.
[](https://agentmods.dev/rules/inboxpraveen/minimize-cursor-cost/nextjs)<a href="https://agentmods.dev/rules/inboxpraveen/minimize-cursor-cost/nextjs"><img src="https://agentmods.dev/badge/rules/inboxpraveen/minimize-cursor-cost/nextjs.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.00509 |
| Opus 5 | $0.00000 | $0.00254 |
| Sonnet 5 | $0.00000 | $0.00102 |
| Haiku 4.5 | $0.00000 | $0.00051 |
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 5d 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.
What it actually says
Next.js Rules
Detect the router first
- App Router: files under
app/, usespage.tsx/layout.tsx/route.ts. - Pages Router: files under
pages/, uses default-exported components. - Don't mix idioms across routers.
Server vs Client Components
- A component is server by default in App Router. Add
"use client"only when needed (state, effects, browser APIs, event handlers). - Don't sprinkle
"use client""to be safe" — it disables the biggest perf wins. - Don't import server-only modules (e.g.,
fs,node:*) into client components.
Data Fetching
- App Router: prefer server components +
fetchwith caching. Don't introduce SWR/React Query in server components. - Pages Router: match existing pattern (
getServerSidePropsvsgetStaticProps). - Don't change
revalidate,cache, ordynamicvalues without flagging.
Routing
- Don't restructure
app/orpages/folders to refactor URLs unless asked. - Don't move files between routers.
- Don't add catch-all or dynamic segments speculatively.
API / Route Handlers
- App Router:
route.tshandlers — match existing return shape (ResponsevsNextResponse). - Pages Router:
pages/api/*— match existing handler signature. - Don't add middleware unless asked.
Server Actions
- Add
"use server"only when the function actually runs on the server. - Don't pass server-action references to non-form props without flagging.
Images / Fonts / Metadata
- Use
next/image,next/font, andmetadata/generateMetadataonly if siblings already do. - Don't switch from
<img>to<Image>as a side-effect.
Never
- Don't change
next.config.*while doing a feature task. - Don't change
tsconfig.jsonpaths or compiler options unless asked. - Don't add
experimentalflags tonext.config. - Don't introduce a new auth provider — match existing (NextAuth/Clerk/Supabase/etc.).
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.
- 5d ago First seen · 47 lines · 0 tokens per session scan A 756b26ecf552
nextjs is a cursor rule published in the GitHub repository inboxpraveen/Minimize-Cursor-Cost (7 stars, last pushed 20d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 509 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-31.
Other cursor rules, from other repositories
sample_cursor_rule
React component best practices.
component-patterns
Frontend component architecture and patterns. Apply when creating or editing UI components.
state-management
Frontend state management patterns and best practices. Apply when managing client state.
performance
Frontend performance optimization rules. Apply when optimizing UI or bundle.
solana-transaction-safety
Safe Solana transaction submission patterns using Helius Sender.
data-fetching
Data fetching patterns with TanStack Query, Server Components, and Supabase.