401-nextjs-pages

401-nextjs-pages is a cursor rule for Cursor from johnpolacek/vibecode.party.starter. It costs 0 tokens per session (386 once invoked), scanned A, original, MIT.

A coding rule for Next.js 14 pages that receive URL parameters or search filters. It specifies how these values should be typed and awaited.

In plain words
What is it for?
Use it when creating or updating Next.js pages with route parameters or search parameters, especially when fetching data on the server.
Why use it?
It prevents page code from handling asynchronous parameters incorrectly and keeps browser-only state in a separate client component.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when creating or updating Next.js pages with route parameters or…

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/johnpolacek/vibecode.party.starter/401-nextjs-pages
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/johnpolacek/vibecode.party.starter

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 401-nextjs-pages

README.md
[![agentmods](https://agentmods.dev/badge/rules/johnpolacek/vibecode.party.starter/401-nextjs-pages.svg)](https://agentmods.dev/rules/johnpolacek/vibecode.party.starter/401-nextjs-pages)
Your own site
<a href="https://agentmods.dev/rules/johnpolacek/vibecode.party.starter/401-nextjs-pages"><img src="https://agentmods.dev/badge/rules/johnpolacek/vibecode.party.starter/401-nextjs-pages.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 386 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.00386
Opus 5 $0.00000 $0.00193
Sonnet 5 $0.00000 $0.00077
Haiku 4.5 $0.00000 $0.00039

Measured 7d ago against content hash 135aa21d3827, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

401-nextjs-pages 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 7d 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/400-frontend/401-nextjs-pages.mdc · 59 lines

What it actually says

Next.js Page Props Rule

Description

This rule defines how to handle page props in Next.js components, particularly for pages that receive params or searchParams.

Rule Details

  1. Page props should be typed with Promise for params and searchParams
  2. The main page component should be async
  3. Params should be awaited at the start of the component
  4. Client-side state management should be moved to a separate client component

Example:

interface PageProps {
  params: Promise<{
    slug: string
  }>,
  searchParams?: Promise<{
    query?: string
  }>
}

export default async function Page({ params, searchParams }: PageProps) {
  const { slug } = await params
  const { query } = await searchParams || {}

  // Server-side data fetching here
  const data = await getData(slug)

  return (
    <ClientComponent data={data} />
  )
}

'use client'
function ClientComponent({ data }: { data: Data }) {
  // Client-side state management here
  const [state, setState] = useState()
  
  return (
    // JSX
  )
}

When to Use

  • When creating new Next.js pages that receive params or searchParams
  • When updating existing pages to handle async props correctly
  • When splitting components between server and client responsibilities

Why This Rule Exists

Next.js 14 introduces a new pattern for handling page props where params and searchParams are promises that need to be awaited. This rule ensures consistent handling of these props across the application and proper separation of server and client components.

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. 7d ago First seen · 59 lines · 386 tokens per session scan A 135aa21d3827

Subscribe to this mod's changes

401-nextjs-pages is a cursor rule published in the GitHub repository johnpolacek/vibecode.party.starter (27 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 386 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.