1---2name: react-development3description: >-4 Builds React apps with container/view split, typed props, URL state, and5 data-fetching boundaries that stay testable. Use this skill when implementing6 or refactoring React features, hooks, or component architecture. Do not use7 when/for Storybook journey authoring alone (use storybook-journeys) or pure8 visual design tokens (use ui-design-principles).9version: 1.4.010libraries: ["@tanstack/react-query", "react-hook-form", "zod", "msw", "class-variance-authority", "nuqs"]11---1213# React Development1415## Critical rules1617- Frameworks are adapters, not architectures — business logic and Views stay portable.18- No `any`, no `as`. No framework imports in `components/`, `hooks/`, `lib/`, or `queries/`.19- Container orchestrates data; View is prop-driven and framework-free.20- Use DI `handlers` (user actions) and optional `deps` (platform capabilities) — never routers in Views.21- Handle loading, error, empty, and offline. Accessibility is required (WCAG 2.1 AA baseline).22- Test what pays: domain logic and critical flows, not snapshots.23- Before Container/View examples, patterns, interactions, or Storybook setup, read the matching resource below.2425## Workflow26271. Split presentation from framework: View props + handlers; Container owns router/query.282. Before choosing state mechanisms or Query/URL/form patterns, read [references/patterns.md](references/patterns.md).293. Choose the simplest state fit: React Query (server), URL/nuqs (shareable UI), `useState`/`useReducer` (local), Context (feature subtree), Zustand only after measuring.304. Avoid prop drilling deeper than 3 levels; restructure or introduce context.315. Enforce ESLint boundary rules so framework imports cannot leak into portable layers.326. Before interaction/a11y polish, read [references/interactions.md](references/interactions.md).337. Add Storybook stories for main variants; before Storybook-first setup, read [references/storybook.md](references/storybook.md).348. For WRONG vs CORRECT Container/View and handlers/deps, read [references/examples.md](references/examples.md).3536## Resources3738- [references/examples.md](references/examples.md) — Container/View, handlers/deps, a11y WRONG/CORRECT. Read when implementing or reviewing.39- [references/patterns.md](references/patterns.md) — React Query, URL state, React 19, forms, hooks, folders, ESLint. Read before data/state work.40- [references/interactions.md](references/interactions.md) — keyboard, targets, forms, feedback, animation, a11y, performance. Read before polish.41- [references/storybook.md](references/storybook.md) — per-component stories, MSW, play functions. Read when adding stories.4243## Validation4445- [ ] Presentational code has no framework imports; boundary ESLint passes46- [ ] Container/View split; DI `handlers`/`deps` for side effects47- [ ] URL state parsed once at boundary with Zod (or nuqs)48- [ ] React Query with a stable key factory49- [ ] Loading, error, empty states; skeletons match final layout50- [ ] Keyboard-operable; visible `:focus-visible`; hit targets ≥24px / ≥44px mobile51- [ ] Icon-only buttons have `aria-label`; `prefers-reduced-motion` respected52- [ ] Storybook covers main variants; tests only where they add value5354## Constraints5556- Throwaway spikes may prototype first; then apply this architecture before shipping.57- Adjacent: `storybook-journeys` (page flows), `ui-design-principles` (visual), `agent-browser` (browser verify), `testing-strategy`, `validation-boundary`, `fn-args-deps`, `strict-typescript`.