react

A set of rules for naming and structuring React user-interface code. React is a JavaScript library for building interactive screens.

In plain words
What is it for?
Use it when creating or changing React components, forms, and user-interface elements. It guides file names, exports, component boundaries, hooks, validation, and Tailwind-based styling.
Why use it?
It keeps components and files organized, making the code easier to reuse and maintain. It also sets consistent choices for validation, styling, and responsive layouts.

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/maccman/ai-expo-starter-template/react
Clone the repo
git clone --depth 1 https://github.com/maccman/ai-expo-starter-template

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 255 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 88% copy Near-identical to another mod 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.00255
Opus 5 $0.00000 $0.00128
Sonnet 5 $0.00000 $0.00051
Haiku 4.5 $0.00000 $0.00026

Measured 2d ago against content hash 087d2534e47d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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

Origin

This is a copy

88% identical to react — 2 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.cursor/rules/react.mdc · 28 lines

What it actually says

React Naming Conventions:

  • Use kebab-case for files and directories.

Components:

  • DO not use 'use client' or 'use server' statements
  • Favor named exports for components
  • Ensure components are modular, reusable, and maintain a clear separation of concerns.
  • Always split React components out so there is only ever one per file
  • Keep logic as low as possible. For example a PostItem should handling its own deletion, rather than passing the logic up in a property callback.
  • Rather than have a large function, like a TRPC mutation handler, inside the component, refactor and split it out into a generic helper or hooks lib.
  • Prefer the hooks pattern for complex logic. Look at existing examples in the project.
  • DO NOT import * as React from 'react', import each React function specifically
  • zod and react-hook-form packages are installed - use them.

UI and Styling:

  • Use Shadcn UI, Radix, and Tailwind Aria for components and styling
  • Prefer using Shadcn components for anything UI related
  • Implement responsive design with Tailwind CSS; use a mobile-first approach
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. 2d ago First seen · 28 lines · 255 tokens per session scan A 087d2534e47d

Subscribe to this mod's changes

react is a cursor rule published in the GitHub repository maccman/ai-expo-starter-template (4 stars, last pushed 11mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 255 tokens. A static security scan graded it A with 0 findings. It is 88% identical to react, differing in 2 lines, and is treated as a copy.