03-frontend-nextjs

03-frontend-nextjs is a cursor rule for Cursor from juandoroteoflesiauni-lang/Market-options-stocks-Scanner. It costs 0 tokens per session (1,391 once invoked), scanned A, original, Apache-2.0.

Rules for the trading terminal’s Next.js, React and TypeScript frontend. They define the required project phase, strict type checking, dark mode and when browser-side components may be used.

In plain words
What is it for?
Use it when editing frontend layouts, navigation, authentication helpers or React components, and when deciding whether code should run on the server or in the browser.
Why use it?
They keep frontend code consistent and prevent work on features that are outside the currently unlocked project phase.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is // 3. Internos (paths absolutos — NUNCA relativos con ../../).

Good fit Use it when editing frontend layouts, navigation, authentication helpers or React components, and when deciding whether code should run on the server or in the browser.

Compare 6 cursor rules from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/juandoroteoflesiauni-lang/Market-options-stocks-Scanner
agentmods
npx agentmods add rules/juandoroteoflesiauni-lang/market-options-stocks-scanner/03-frontend-nextjs

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 03-frontend-nextjs

README.md
[![agentmods](https://agentmods.dev/badge/rules/juandoroteoflesiauni-lang/market-options-stocks-scanner/03-frontend-nextjs/github.svg)](https://agentmods.dev/rules/juandoroteoflesiauni-lang/market-options-stocks-scanner/03-frontend-nextjs)
Your own site
<a href="https://agentmods.dev/rules/juandoroteoflesiauni-lang/market-options-stocks-scanner/03-frontend-nextjs"><img src="https://agentmods.dev/badge/rules/juandoroteoflesiauni-lang/market-options-stocks-scanner/03-frontend-nextjs/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 03-frontend-nextjs

Your own site · 80×15
<a href="https://agentmods.dev/rules/juandoroteoflesiauni-lang/market-options-stocks-scanner/03-frontend-nextjs"><img src="https://agentmods.dev/badge/rules/juandoroteoflesiauni-lang/market-options-stocks-scanner/03-frontend-nextjs.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,391 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.01391
Opus 5 $0.00000 $0.00696
Sonnet 5 $0.00000 $0.00278
Haiku 4.5 $0.00000 $0.00139

Measured 12d ago against content hash 9f9bb1650310, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

03-frontend-nextjs scanned grade A with 1 finding 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 12d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const response: any = await fetch(url)
.cursor/rules/03-frontend-nextjs.mdc · 189 lines

How it starts

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

⚡ FRONTEND NEXT.JS 16 — ESTÁNDARES v3.0

FASE LOCK ACTIVO: FASE 1

✅ Permitido: layout.tsx · TopNavigationBar · lib/env.ts · hooks/useAuthToken.ts
⛔ BLOQUEADO: dashboards · rutas secundarias · charts · WebSocket client · auth forms

Si se solicita algo fuera de Fase 1 → RECHAZAR con mensaje:

"⛔ Phase Lock: Esta feature es Fase [X]. Lock actual: Fase 1."

TYPESCRIPT — MODO ESTRICTO

// tsconfig.json — obligatorio
{
  "compilerOptions": {
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "noUncheckedIndexedAccess": true
  }
}
// ❌ PROHIBIDO — any
const handler = (event: any) => {}
const response: any = await fetch(url)

// ✅ CORRECTO — tipos específicos
const handler = (event: React.MouseEvent<HTMLButtonElement>) => {}
interface ApiResponse<T> { data: T; status: number }

COMPONENTES — REGLAS PRINCIPALES

// ✅ Server Component por defecto (sin directiva)
export function TradingPanel() {
  return <div>...</div>
}

// Solo agregar 'use client' si el componente usa:
// - useState, useEffect, useCallback
// - Eventos de browser (onClick, onChange directo)
// - APIs de browser (localStorage, etc.)
"use client";
export function LivePrice() {
  const [price, setPrice] = useState(0)
  // ...
}
// Máximo 100 líneas por componente.
// Si supera → extraer subcomponentes o un hook.

// ✅ Props tipadas con interface — nunca any
interface TopNavigationBarProps {
  items: NavigationItem[]
}

export function TopNavigationBar({ items }: TopNavigationBarProps) {
  return (...)
}

DISEÑO — DARK MODE OBLIGATORIO

// ❌ PROHIBIDO — referencia a light mode
className="dark:bg-gray-900 bg-white"

// ❌ PROHIBIDO — colores hardcodeados
style={{ color: "#f0f0f5" }}

// ✅ CORRECTO — CSS variables del design system
className="bg-bg-surface text-text-primary border-border-subtle"

// El Top Nav usa glassmorphism exacto:
const navClasses = [
  "fixed top-0 left-0 right-0 z-50 h-14",
  "flex items-center justify-between px-6",
  "bg-[rgba(17,17,24,0.72)] backdrop-blur-md",
  "border-b border-border-subtle",
].join(" ")

Read the full file on GitHub · 189 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. 12d ago First seen · 189 lines · 0 tokens per session scan A 9f9bb1650310

Subscribe to this mod's changes

03-frontend-nextjs is a cursor rule published in the GitHub repository juandoroteoflesiauni-lang/Market-options-stocks-Scanner (11 stars, last pushed 2mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,391 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.