# react-development

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

- rule · `type=rule` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline · ★ 267 repo stars
- Author: przeprogramowani
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/przeprogramowani/ai-rules-builder/tree/HEAD/.cursor/rules/react-development.mdc
- Updated: 2026-02-20
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/rules/react-development

## What it 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.

## Install

### Cursor (native platform)

**Manually: put the files in place**
- File: `.cursor/rules/react-development.mdc` — Frontmatter: description, globs, alwaysApply

### Claude Code

**Manually: put the files in place**
- File: `.claude/rules/react-development.md` — The paths frontmatter field limits the files: move globs from the source into paths

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/react-development.instructions.md` — The applyTo field sets which files it applies to: move globs from the source into applyTo

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/react-development.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/react-development.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/przeprogramowani/ai-rules-builder/tree/HEAD/.cursor/rules/react-development.mdc

## When to use it
- 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
- 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

## Similar
- [react-nextjs-development](https://affpapa.org/en/nevibecode/skills/react-nextjs-development.md) — skill · 2000 installs
- [react-frontend-development-expert](https://affpapa.org/en/nevibecode/agents/react-frontend-development-expert.md) — subagent · ★ 372 repo stars
- [add-integration](https://affpapa.org/en/nevibecode/skills/add-integration.md) — skill · 491 installs
- [stitch::react-components](https://affpapa.org/en/nevibecode/skills/stitchreact-components.md) — skill · 50400 installs
- [tauri-development](https://affpapa.org/en/nevibecode/skills/tauri-development.md) — skill · 1400 installs
- [modern-web-development](https://affpapa.org/en/nevibecode/skills/modern-web-development.md) — skill · 1300 installs

From the same set: [przeprogramowani/ai-rules-builder](https://affpapa.org/en/nevibecode/by/przeprogramowani/ai-rules-builder.md) — 24 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
