Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add travisjneuman/.claude --skill generic-react-code-reviewer -a claude-code
Open on GitHub

What 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 useEffect dependency before it ships
  • strip any out 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.tsx before 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-code

2Manually: put the files in place

~/.claude/skills/generic-react-code-reviewer/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/generic-react-code-reviewer/

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

Similar skills

All skills for Code review and refactoring →

From the same set117

The whole set →
onboarding-guide-creator onboarding-guide-creator builds role-specific onboarding plans with timelines, tasks, and milestones. Use it to draft a new hire welcome guide or training program. CX Codex +1 150installs customer-persona-builder customer-persona-builder builds ICPs, buyer personas and user archetypes from templates, with a weighted scoring matrix and interview questions behind them. CX Codex +1 149installs generic-static-code-reviewer generic-static-code-reviewer is a skill that checks static-site HTML, CSS and JS for bugs, security issues, page weight and accessibility before a commit. CX Codex +1 149installs podcast-producer podcast-producer is a Claude Code skill that helps plan a podcast launch, prepare episodes, and create show notes. It covers the workflow from episode idea to publication. CX Codex +1 148installs security This Claude Code skill covers security architecture, incident response, and vulnerability assessment. It activates for security program design, incident handling, and reviews against frameworks such as NIST and ISO 27001. CX Codex +1 148installs generic-code-reviewer generic-code-reviewer inspects code diffs for security risks, runtime errors, bundle bloat, and WCAG AA gaps. It adapts checks to your project stack and enforces workflow rules from CLAUDE.md. CX Codex +1 147installs monitoring-observability monitoring-observability equips AI coding agents to set up OpenTelemetry, structured JSON logging, and distributed tracing. Useful when defining SLO alerts or instrumenting services. CX Codex +1 146installs codebase-documenter codebase-documenter turns a repository into readable docs: README, architecture overview, onboarding guide, API reference and code comments. Handy when someone new has to understand the project. CX Codex +1 145installs

Project sponsors

Companies that keep this analytics open