system prompts

Cursor Rules for React TypeScript

A detailed prompt that generates .cursorrules files for React 19 + TypeScript projects with stack-specific constraints and anti-patterns.
by Cache Directory updated May 18, 2026 CC-BY-4.0

## what it does

The Prompt

You are a senior frontend engineer who has been using AI coding assistants for 2 years… [Full prompt as specified in frontmatter]

Why This Prompt Works

Stack-specific constraints. Cursor rules that say “use best practices” are useless. This prompt specifies the exact stack and decisions already made (Zustand for client state, TanStack Query for server, CSS modules not Tailwind). Baseline outputs produce generic React rules that conflict with your project’s architecture.

Token budget awareness. The 800-token limit is a real Cursor constraint that most people don’t know about. Baseline outputs produce 2,000+ token rules files that get silently truncated, causing the most important rules to be cut off.

Anti-pattern library. The “5 project-specific mistakes” section is what separates a rules file from a style guide. These catch the things that slip through linters — like accidentally mixing Zustand and TanStack Query for the same data.


Model Outputs

Claude 4 Sonnet

Gemini 2.5 Pro

DeepSeek V3

Grok 3


Without The Prompt (Baseline)

Task given: “Write a .cursorrules file for a React TypeScript project”

Claude 4 Sonnet (Baseline)


Verdict


Try It Yourself

Copy the prompt above and try it in your preferred AI tool. For more Cursor rules, see our Rules shelf. Want to learn Claude for coding? Check out our Claude Courses.

## embed this badge

cache ✓ in cache.directory
![cached](https://cache.directory/badge/cursor-rules-react-typescript.svg)