react-frontend

react-frontend is a cursor rule for Cursor from GoranErhartic/cursor-development-rules. It costs 0 tokens per session (800 once invoked), scanned A, original, MIT.

A React and TypeScript project guide that links common frontend tasks to rules for components, styling, forms, data fetching, routing, errors, performance, and testing. TypeScript adds checked types to JavaScript code.

In plain words
What is it for?
Use it as a reference when building or changing a React application that uses Tailwind CSS, TanStack Query, React Hook Form, Zod, and React Router.
Why use it?
It gives developers a consistent place to find the relevant conventions while working in this technology stack.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/goranerhartic/cursor-development-rules/react-frontend
Clone the repo
git clone --depth 1 https://github.com/GoranErhartic/cursor-development-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 react-frontend

README.md
[![agentmods](https://agentmods.dev/badge/rules/goranerhartic/cursor-development-rules/react-frontend.svg)](https://agentmods.dev/rules/goranerhartic/cursor-development-rules/react-frontend)
Your own site
<a href="https://agentmods.dev/rules/goranerhartic/cursor-development-rules/react-frontend"><img src="https://agentmods.dev/badge/rules/goranerhartic/cursor-development-rules/react-frontend.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 800 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.00800
Opus 5 $0.00000 $0.00400
Sonnet 5 $0.00000 $0.00160
Haiku 4.5 $0.00000 $0.00080

Measured yesterday against content hash d98a905d03f0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

react-frontend 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 yesterday.

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/languages/react/react-frontend.mdc · 72 lines

How it starts

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

React + TypeScript Frontend Guide

Stack

Layer Technology
Runtime React 18+
Language TypeScript
Styling Tailwind CSS
Data fetching TanStack Query
Forms React Hook Form
Validation Zod
Routing React Router v7
State Zustand, React context
Testing Vitest, React Testing Library
Build Vite or Next.js
Package Manager pnpm

Rule Routing

Consult these rules based on what you are working on:

Quick Reference

  • Build UI feature: languages/react/components.mdc, languages/react/styling.mdc, languages/react/accessibility.mdc
  • Build forms: languages/react/forms.mdc, languages/react/validation.mdc, languages/react/error-handling.mdc
  • Data/state flow: languages/react/data-fetching.mdc, languages/react/state-management.mdc, languages/react/testing.mdc
  • Routing/resilience: languages/react/routing.mdc, languages/react/error-boundaries.mdc, languages/react/performance.mdc

UI & Components

  • Component design, composition, compound components → languages/react/components.mdc
  • Styling (Tailwind, design tokens, dark mode) → languages/react/styling.mdc
  • Forms (React Hook Form, validation) → languages/react/forms.mdc
  • Accessibility (ARIA, keyboard, focus, screen readers) → languages/react/accessibility.mdc

Data & State

  • Data fetching (TanStack Query, cache, mutations) → languages/react/data-fetching.mdc
  • State management (Zustand, hooks, context) → languages/react/state-management.mdc

Routing & Navigation

  • React Router v7 (loaders, actions, nested routes) → languages/react/routing.mdc

Cross-Cutting

  • Code quality (TypeScript strict, React 19 idioms, hooks) → languages/react/code-quality.mdc
  • Validation (Zod schemas, type inference) → languages/react/validation.mdc
  • Error handling (Result pattern, global handling, toasts, async, forms) → languages/react/error-handling.mdc
  • Error Boundaries (class component, fallback UI, granular placement) → languages/react/error-boundaries.mdc
  • Security (XSS, CSP, secure storage, CORS) → languages/react/security.mdc
  • Input sanitization (DOMPurify, URL validation, file upload) → languages/react/input-sanitization.mdc
  • Performance (memo, useMemo, lazy loading, code splitting) → languages/react/performance.mdc
  • Testing (Vitest, React Testing Library, AAA) → languages/react/testing.mdc
  • Dependencies (pnpm workspace, security, licensing) → languages/react/dependencies.mdc

Read the full file on GitHub · 72 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. yesterday First seen · 72 lines · 0 tokens per session scan A d98a905d03f0

Subscribe to this mod's changes

react-frontend is a cursor rule published in the GitHub repository GoranErhartic/cursor-development-rules (19 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 800 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-09-03.