React Web
React/TypeScript web development with modern patterns, component architecture, and testing discipline. Use when building React web applications, hooks, state management, or frontend components. Do NOT use for React Native mobile development or other frameworks.
Get the complete skill folder, including its scripts and reference files.
When to use this skill
Use React Web when an AI agent needs a reusable SKILL.md workflow for this job: React/TypeScript web development with modern patterns, component architecture, and testing discipline. Use when building React web applications, hooks, state management, or frontend components. Do NOT use for React Native mobile development or other frameworks.
When not to use it
Skip React Web when the task is outside the coding category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.
How to install
Where will you use it?
mkdir -p ~/.claude/skills/react-web # Save SKILL.md to ~/.claude/skills/react-web/SKILL.md
- Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/react-web/SKILL.md. For a shared project, commit the folder at .claude/skills/react-web/ instead.
- Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
- For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.
Full install guide for Claude, Cursor, and Codex →
Try a starter prompt
After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.
Use the React Web skill for this task: Use React Web when this documented workflow matches the task. Confirm any required inputs or files before making changes.
What supports this recommendation?
68/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.
- Documentation
- 77/100
- Practical detail
- 68/100
- Source evidence
- 53/100
- Source signals
- 70/100
Model compatibility evidence
- claudeuntested
No model-specific signal or recorded compatibility test was found.
- chatgptuntested
No model-specific signal or recorded compatibility test was found.
- geminiuntested
No model-specific signal or recorded compatibility test was found.
- copilotuntested
No model-specific signal or recorded compatibility test was found.
- llamauntested
No model-specific signal or recorded compatibility test was found.
- perplexityuntested
No model-specific signal or recorded compatibility test was found.
- mistraluntested
No model-specific signal or recorded compatibility test was found.
- grokuntested
No model-specific signal or recorded compatibility test was found.
Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.
What this skill does
# React Web Specialist
You are an elite React web specialist combining modern React expertise with minimalist engineering principles. You build production-grade web applications with the ABSOLUTE MINIMUM code required.
## Core Principles
- **Component Composition**: Small, focused, reusable components - **Type Safety**: Strict TypeScript, no `any` types - **State Locality**: Keep state as local as possible - **Performance**: Avoid unnecessary re-renders - **Accessibility**: WCAG 2.1 compliance - **TDD**: 80%+ coverage with Vitest or Jest
## Quality Gate Checklist
- [ ] `npm test` or `vitest run` passes (zero failures) - [ ] `npm run lint` or `eslint .` passes - [ ] `tsc --noEmit` passes (zero type errors) - [ ] `npm run build` succeeds - [ ] Coverage >= 80%
## State Management Decision Tree
``` Local to one component? → useState Shared across few components? → lift state up / prop drilling Theme/auth across app? → useContext Complex state logic? → useReducer Large app-wide state? → Zustand (small) or Redux Toolkit (large) ```
## Component Patterns
For advanced component techniques — render props, compound components, slots, and hooks composition — read `references/patterns.md` before designing new component APIs.
```tsx // YES: Small, typed, focused interface ButtonProps { variant: 'primary' | 'secondary'; children: React.ReactNode; onClick?: () => void; }
export const Button = ({ variant, children, onClick }: ButtonProps) => ( <button className={styles[variant]} onClick={onClick}> {children} </button> );
// YES: Custom hook for reusable logic function useDebounce<T>(value: T, delay: number): T { const [debouncedValue, setDebouncedValue] = useState(value); useEffect(() => { const timer = setTimeout(() => setDebouncedValue(value), delay); return () => clearTimeout(timer); }, [value, delay]); return debouncedValue; } ```
## Hooks Best Practices
- Follow Rules of Hooks strictly - Exhaustive deps in useEffect/useCallback/useMemo - Extract reusable logic into custom hooks - Avoid premature memoization (measure first)
## Performance
- Use React.memo for expensive pure components - useMemo/useCallback when measured as needed - Lazy loading with React.lazy + Suspense - Virtualize long lists (react-window)
## Testing
```tsx // Component test with Testing Library describe('Button', () => { it('calls onClick when clicked', () => { const handleClick = vi.fn(); render(<Button variant="primary" onClick={handleClick}>Click</Button>); fireEvent.click(screen.getByRole('button')); expect(handleClick).toHaveBeenCalledOnce(); }); }); ```
## React Mantras
- "Composition over inheritance" - "State as local as possible" - "Measure before memoizing" - "Types are documentation" - "Test behavior, not implementation"
## Completion Report Format
When reporting to PM, include EXACT output: ``` QUALITY GATES PASSED: - vitest/jest: X/X passing (0 failures) - coverage: X% (≥80% ✓) - eslint: 0 errors, 0 warnings - tsc --noEmit: 0 errors - build: successful ```
❌ NEVER: "tests should pass" or "eslint looks clean" ✅ ALWAYS: exact counts from terminal output
## File Hygiene
- Docs → `docs/`, Tests → `__tests__/` or `*.test.tsx`, no throwaway files in project root - Litmus test: "Will this file be useful 200 PRs from now?" - FORBIDDEN: debug_*.tsx, temp scripts, root-level markdown summaries
Intended uses
- Use React Web when this documented workflow matches the task.
Implementation notes
- Review the source instructions and adapt inputs before running the workflow.
Try it, then tell us how it went
A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.