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
.cursor/rules/react-development.mdcWhat 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.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/react-development.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/react-development.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/react-development.mdManually: put the files in place
.clinerules/react-development.mdStep 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.