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.
git clone --depth 1 https://github.com/nedcodes-ok/cursor-doctorWrote 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/nedcodes-ok/cursor-doctor/react)<a href="https://agentmods.dev/rules/nedcodes-ok/cursor-doctor/react"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursor-doctor/react/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.
<a href="https://agentmods.dev/rules/nedcodes-ok/cursor-doctor/react"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursor-doctor/react.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00565 | $0.00565 |
| Opus 5.5 | $0.00226 | $0.00226 |
| Sonnet 5.5 | $0.00113 | $0.00113 |
| Haiku 4.5 | $0.00056 | $0.00056 |
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 1mo 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.
This is a copy
100% identical to react — 0 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.
How it starts
The opening of the file, as written. The whole thing — 55 lines — stays where its author put it; the contents beside it link to each section on GitHub.
React Cursor Rules
You are an expert React developer. Follow these rules:
Components
- Functional components only. No class components
- Keep under 150 lines. Extract hooks and sub-components early
- Named exports, one component per file
- Descriptive names: UserProfileCard not Card
- Colocate styles, tests, and types with the component file
- Props interface named
{ComponentName}Props, defined above the component - Default props via destructuring defaults, not
defaultProps - Avoid spreading props blindly (
{...props}). Be explicit about what's passed
State Management
- useState for local UI state, useReducer for complex logic with multiple related values
- Lift state only as high as needed — avoid prop drilling beyond 2 levels
- Context for global concerns (theme, auth, locale). Never for frequently updating values
- Server state belongs in TanStack Query or SWR, not useState/useReducer/Context
- Derive values from existing state instead of syncing with useEffect
- URL is state too: use searchParams for filters, pagination, selected tabs
- Form state: use controlled inputs for validation, uncontrolled (refs) for simple forms
Hooks
- Follow Rules of Hooks. Use ESLint plugin
- Extract reusable logic into custom hooks (use* prefix)
- useMemo/useCallback only with demonstrated performance need — profile first
- Complete dependency arrays. Never disable exhaustive-deps
- useEffect is for synchronization with external systems, not for derived state
- Cleanup functions in useEffect for subscriptions, timers, event listeners
- Custom hooks should return objects (not arrays) when returning 3+ values
Patterns
- Composition over configuration: children/render props over config objects
- Handle loading, error, and empty states in every data component
- ErrorBoundary at route/feature boundaries, not around individual components
- React.lazy + Suspense for route-level code splitting
- Container/presenter split: logic hooks in containers, pure rendering in presenters
- Avoid conditional hooks. Move conditions inside the hook or split components
- Render lists in their own component to isolate re-renders
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.
- 1mo ago First seen · 55 lines · 565 tokens per session scan A 022a2f18c45b
react is a cursor rule published in the GitHub repository nedcodes-ok/cursor-doctor (9 stars, last pushed 7mo ago), licensed MIT. It adds 565 tokens to every session, about $0.0023 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to react, differing in 0 lines, and is treated as a copy.
Other cursor rules, from other repositories
component-development
Modern React + TypeScript component patterns — hooks, typed props, performance optimization, forms, and testing.
app-router-patterns
Next.js 14+ App Router patterns — Server Components, Client Components, Route Handlers, Server Actions, and metadata API.
data-fetching
Data fetching patterns with TanStack Query, Server Components, and Supabase.
web
Web build conventions (separate from native and RN JS).
components
Component patterns and UI conventions.
3d-graphics
Three.js / React Three Fiber syntax: scene setup, R3F hooks, models, controls. Load for 3D code — taste, perf budgets, and mobile WebGL live in the 3d-web-experiences skill.