Skip to main content
rule CX Codex

react-development — Claude Code rule: what it does, how to install

react-development sets coding standards for React components inside an Astro app: hooks over classes, memoization, Tailwind-driven responsiveness.

AGPL-3.0 ★ 267 updated 2026-02-20

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/react-development.mdc
Open on GitHub

What react-development does

This rule tells Claude Code how to write React components in an Astro project. It pushes functional components built on hooks, wrapping components that re-render often with the same props in React.memo(), and reaching for useCallback on event handlers and useMemo on costly calculations.

It also covers code-splitting: React.lazy() paired with Suspense, plus the client:only directive for components that need window and must run purely in the browser rather than on the server. Responsive layout is handled through Tailwind's breakpoint variants (sm:, md:, lg:) instead of hand-rolled media queries.

The scope stays narrow. It says nothing about Astro page structure, testing, or build setup, focusing only on how the React components themselves are written.

What it helps with

  • move event handlers into useCallback so child components skip unneeded re-renders
  • wrap a heavy component in React.memo() when props stay the same across renders
  • attach client:only to a component that depends on window
  • split a bundle with React.lazy() and Suspense
  • switch a layout to Tailwind breakpoints instead of manual media queries

Example prompts for the agent

  • Wrap this list render in useMemo so it skips recalculating on every pass
  • Move the click handler into useCallback and memoize the component with React.memo
  • Mark this component client:only since it reads from window

How to install react-development

Manually: put the files in place

.cursor/rules/react-development.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about react-development

How do I install react-development in Claude Code?

Place the rule file at .claude/rules/react-development.md.

What does the react-development rule do?

It sets coding standards for React components built inside an Astro app, covering functional components with hooks, React.memo, useCallback, useMemo, and code-splitting with React.lazy and Suspense.

How does it handle responsive design?

It requires Tailwind breakpoint variants like sm:, md:, and lg: instead of manually recalculating styles for different screen sizes.

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set24

The whole set →
shadcn-init The shadcn-init command sets up shadcn/ui in a project and adds a defined set of components. Use it when you want the UI files placed in the expected directory with the new-york theme. CX Codex +1 ★ 267repo stars shadcn-status-checkpoint shadcn-status-checkpoint — a command that documents implementation progress for UI components in a structured markdown file. Keeps your work history clear when developing complex views across multiple AI conversations. CX Codex +1 ★ 267repo stars astro Guidelines for Claude Code to generate server-side pages and endpoints in Astro. Ensures type safety, middleware handling, and request validation. CX Codex +1 ★ 267repo stars playwright-e2e-testing Enforces Playwright E2E testing standards: Page Object Model, locators, browser context isolation, and parallel runs. CX Codex +1 ★ 267repo stars github-action Guides Claude Code in generating GitHub Actions workflows with scoped secrets, composite steps, and upstream version checks. CX Codex +1 ★ 267repo stars shadcn-resume-implementation shadcn-resume-implementation is a Claude Code command that resumes frontend work from a saved status. It uses the implementation plan, frontend rules, and type definitions. CX Codex +1 ★ 267repo stars shadcn-plan-summary shadcn-plan-summary — a command that captures decisions from UI architecture sessions. Extracts choices about layout, flows, API integration, and state management, then compiles them into a structured report for the next development phase. CX Codex +1 ★ 267repo stars test-plan test-plan is a Claude Code rule that builds a project-specific test plan from the codebase and tech stack. It writes the result in Polish as Markdown. CX Codex +1 ★ 267repo stars

Project sponsors

Companies that keep this analytics open