generic-react-code-reviewer — Claude Code skill: React code review
generic-react-code-reviewer walks your React/TypeScript diff for bugs, security holes, render costs and accessibility gaps. Fits right before a commit or when a pull request lands on your desk.
MIT 148 installs ★ 114 updated 2026-10-25
npx skills add travisjneuman/.claude --skill generic-react-code-reviewer -a claude-codeWhat generic-react-code-reviewer does
This skill reads the diff instead of running tests, lint and a build. It flags any sneaking into props, API responses or event handlers, wants outside data typed as unknown first and narrowed by a type guard, then checks hook dependency arrays and typed store slices in Zustand or Redux.
Budgets are spelled out: 100KB gzipped for the initial bundle, 50KB per lazy chunk, 300KB of JS in total. Anything above 20KB belongs behind lazy and Suspense. Animation is limited to transform and opacity; width, height and margins are out. Accessibility gets its own pass: focus trapping and Escape handling in modals, aria-label on icon-only buttons, dialog roles.
One catch: the skill builds on generic-code-reviewer, which carries the review method and the P0/P1/P2 ranking. Install that one too, or you end up with the React checklist and no way to sort the findings.
What it helps with
- catch a missing
useEffectdependency before it ships - strip
anyout of props and API responses - keep the initial bundle in budget with lazy chunks
- verify focus handling and labels in a modal
- move animations off width and margin onto transform
Example prompts for the agent
- Review the diff in
src/components/Checkout.tsxbefore I commit: types, hook deps, a11y. - Check this branch for bundle size and render performance problems.
- Run the React review skill over the new modal component.
How to install generic-react-code-reviewer
1Skills CLI (Vercel)
npx skills add travisjneuman/.claude --skill generic-react-code-reviewer -a claude-code2Manually: put the files in place
~/.claude/skills/generic-react-code-reviewer/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/generic-react-code-reviewer/
1Skills CLI (Vercel)
npx skills add travisjneuman/.claude --skill generic-react-code-reviewer -a codex2Manually: put the files in place
.agents/skills/generic-react-code-reviewer/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add travisjneuman/.claude --skill generic-react-code-reviewer -a cursor2Manually: put the files in place
.cursor/skills/generic-react-code-reviewer/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install travisjneuman/.claude skills/generic-react-code-reviewer2Manually: put the files in place
.github/skills/generic-react-code-reviewer/SKILL.md1Skills CLI (Vercel)
npx skills add travisjneuman/.claude --skill generic-react-code-reviewer -a gemini-cli2Platform CLI
gemini skills install https://github.com/travisjneuman/.claude --path skills/generic-react-code-reviewerManually: put the files in place
.devin/skills/generic-react-code-reviewer/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add travisjneuman/.claude --skill generic-react-code-reviewer -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about generic-react-code-reviewer
How do I install generic-react-code-reviewer in Claude Code?
Run npx skills add travisjneuman/.claude --skill generic-react-code-reviewer -a claude-code. The skill file lands at ~/.claude/skills/generic-react-code-reviewer/SKILL.md.
What does generic-react-code-reviewer do?
It goes through your React/TypeScript diff looking for bugs, security issues, wasted renders, accessibility misses and breaks from project standards.
Does it work without generic-code-reviewer?
It extends generic-code-reviewer, where the review method and the P0/P1/P2 priorities live. Without that base you get the React checklist alone.
Source text
SKILL.md · MIT
---
name: generic-react-code-reviewer
description: Review React/TypeScript code for bugs, security vulnerabilities, performance issues, accessibility gaps, and CLAUDE.md workflow compliance. Enforces TypeScript strict mode, GPU-accelerated animations, WCAG AA accessibility, bundle size limits, and surgical simplicity. Use when completing features, before commits, or reviewing pull requests.
---
# React Code Reviewer
Review React/TypeScript code against production quality standards.
**Extends:** [Generic Code Reviewer](../generic-code-reviewer/SKILL.md) - Read base skill for full code review methodology, P0/P1/P2 priority system, and judgment calls.
## Pre-Commit Validation
Validate by reading the diff, not by running a test/lint/build ladder; the checks below are what to look for.
## React-Specific Checks
### TypeScript Strict Mode
```typescript
// Required tsconfig.json settings
{
"compilerOptions": {
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true
}
}
```
- No `any` types for user input or API responses
- Validate external data with `unknown` first, then type guard
- Generic types over `any` in reusable utilities
### Component Patterns
| Pattern | Check |
| ------- | --------------------------- |
| Props | Interface defined, no `any` |
| State | Typed with Zustand/useState |
| Events | Typed event handlers |
| Refs | `useRef<ElementType>(null)` |
### Hook Dependency Arrays
```typescript
// P1 Issue: Missing dependencies
useEffect(() => {
fetchData(userId); // userId missing from deps
}, []); // ❌
// Correct
useEffect(() => {
fetchData(userId);
}, [userId]); // ✓
```
**Rule:** Enable `react-hooks/exhaustive-deps` ESLint rule.
### State Management (Zustand/Redux)
- Store slices properly typed
- Actions return void (update state directly)
- Selectors memoized for derived state
- Large data (>1MB) in IndexedDB, not localStorage
### React Query/SWR Patterns
```typescript
// Proper typing
const { data } = useQuery<User>({
queryKey: ["user", id],
queryFn: () => fetchUser(id),
});
// Check: staleTime, cacheTime configured
// Check: error boundaries for query failures
```
## Performance (P1)
### Bundle Size Targets
| Target | Threshold |
| ------------------ | --------------- |
| Initial bundle | < 100KB gzipped |
| Lazy-loaded chunks | < 50KB each |
| Total JS | < 300KB |
### Lazy Loading
```typescript
// Heavy components (>20KB) MUST be lazy loaded
const HeavyChart = lazy(() => import('./HeavyChart'));
const RichTextEditor = lazy(() => import('./RichTextEditor'));
// Wrap in Suspense
<Suspense fallback={<Skeleton />}>
<HeavyChart />
</Suspense>
```
### Memoization
```typescript
// Expensive calculations
const sortedItems = useMemo(() =>
items.sort((a, b) => a.date - b.date),
[items]
);
// Callback stability for child components
const handleClick = useCallback(() => {
doSomething(id);
}, [id]);
// Component memoization (when props are stable)
export const Item = memo(function Item({ data }: Props) {
return <div>{data.name}</div>;
});
```
### Animation (GPU-Accelerated Only)
```css
/* ✓ DO animate */
transform: translateY(-4px);
opacity: 0.5;
/* ❌ NEVER animate */
width, height, margin, padding, top, left
```
## Accessibility (P1)
### Focus Management
```typescript
// Modal focus trapping
useEffect(() => {
if (isOpen) {
const firstFocusable = modalRef.current?.querySelector("button, input");
firstFocusable?.focus();
}
}, [isOpen]);
// Escape to close
useEffect(() => {
const handleEscape = (e: KeyboardEvent) => {
if (e.key === "Escape") onClose();
};
window.addEventListener("keydown", handleEscape);
return () => window.removeEventListener("keydown", handleEscape);
}, [onClose]);
```
### ARIA in JSX
```tsx
// Icon-only buttons require labels
<button aria-label="Close modal">
<X className="w-5 h-5" />
</button>
// Dialogs
<div role="dialog" aria-modal="true" aria-labelledby="title">
<h2 id="title">Confirm Action</h2>
</div>
```
## Quick Review Checklist
**React-Specific (add to base checklist):**
- [ ] Hook dependencies correct
- [ ] Heavy components lazy loaded
- [ ] State management typed
- [ ] Memoization where beneficial
- [ ] Focus management in modals
## See Also
- [Generic Code Reviewer](../generic-code-reviewer/SKILL.md) - Base review methodology
- [Code Review Standards](../_shared/CODE_REVIEW_STANDARDS.md) - Full security/performance/accessibility
- [Design Patterns](../_shared/DESIGN_PATTERNS.md) - UI consistency
© travisjneuman · MIT · travisjneuman/.claude