Skip to main content
skill CX Codex

react-expert · personamanagmentlayer — Claude Code skill: what it does, how to install

react-expert configures coding agents for React 18+ and Next.js, enforcing clean TypeScript interfaces, proper hook usage, and tests with React Testing Library.

Apache-2.0 200 installs ★ 45 updated 2026-10-12

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

What react-expert does

The skill guides agents through modern React 18+ conventions, covering state management, form handling, and Next.js patterns. It prevents anti-patterns such as passing props down deep component trees, using array indices as list keys, or declaring inline functions directly inside JSX elements.

Tool access covers file reads, writes, edits, directory searches, and package managers npm, pnpm, yarn, and bun. For testing, it directs the assistant toward user-centric test flows with React Testing Library and userEvent.

Your environment must meet Node.js 18.0.0 or higher and React 18.0.0 or higher for these patterns to function properly.

What it helps with

  • type React components and generic list structures cleanly with TypeScript
  • remove inline JSX handlers causing unnecessary component rerenders
  • replace deep prop drilling with localized context providers
  • write integration tests using React Testing Library and userEvent
  • split component bundles using lazy loading techniques

Example prompts for the agent

  • Refactor UserProfile.tsx to use React Context instead of passing props across layouts.
  • Optimize rerenders in ProductGrid.tsx by memoizing callbacks and list elements.
  • Create a test suite for RegistrationForm.tsx checking userEvent submissions with React Testing Library.

How to install react-expert

1Skills CLI (Vercel)

npx skills add personamanagmentlayer/pcl --skill react-expert -a claude-code

2Manually: put the files in place

~/.claude/skills/react-expert/SKILL.md

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

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about react-expert

How do I install react-expert in Claude Code?

Run npx skills add personamanagmentlayer/pcl --skill react-expert -a claude-code in your terminal. The configuration installs to ~/.claude/skills/react-expert/SKILL.md.

What does react-expert do?

It establishes standards for React 18+ and Next.js, steering the model toward functional components, safe memoization, strong typing, and behavioral testing.

What dependencies does react-expert require?

It requires Node.js version 18.0.0 or newer alongside React version 18.0.0 or above.

Source text

SKILL.md · Apache-2.0
---
name: react-expert
version: 1.1.0
description: >-
  Expert-level React development with hooks, performance optimization, state management,
  and modern patterns. Use when the user mentions frontend, hooks, JSX, TypeScript, or
  Next.js, or when the task involves Modern React, State Management, Forms, or Performance
  Optimization.
category: frameworks
author: PCL Team
license: Apache-2.0
tags:
  - react
  - frontend
  - hooks
  - jsx
  - typescript
  - nextjs
allowed-tools:
  - Read
  - Write
  - Edit
  - Bash(npm:*, pnpm:*, yarn:*, bun:*)
  - Glob
  - Grep
requirements:
  node: '>=18.0.0'
  react: '>=18.0.0'
---

# React Expert

You are an expert React developer with deep knowledge of modern React (18+), hooks, performance optimization, state management, and the React ecosystem. You write clean, performant, and maintainable React applications following best practices.

## Best Practices

### 1. Component Composition

```tsx
// Bad - prop drilling
function App() {
  const [user, setUser] = useState(null);
  return <Layout user={user} setUser={setUser} />;
}

// Good - context for global state
function App() {
  return (
    <AuthProvider>
      <Layout />
    </AuthProvider>
  );
}
```

### 2. Avoid Inline Functions in JSX

```tsx
// Bad - creates new function on every render
<button onClick={() => handleClick(id)}>Click</button>

// Good - memoized callback
const handleClick = useCallback(() => handleClick(id), [id]);
<button onClick={handleClick}>Click</button>

// Or if no dependencies
<button onClick={handleClick}>Click</button>
```

### 3. Key Props in Lists

```tsx
// Bad - index as key
items.map((item, index) => <Item key={index} item={item} />);

// Good - stable unique identifier
items.map((item) => <Item key={item.id} item={item} />);
```

### 4. Conditional Rendering

```tsx
// Good patterns
{
  isLoading && <Spinner />;
}
{
  error && <ErrorMessage error={error} />;
}
{
  data && <DataDisplay data={data} />;
}
{
  condition ? <ComponentA /> : <ComponentB />;
}
```

### 5. TypeScript with React

```tsx
// Props interface
interface ButtonProps {
  variant: 'primary' | 'secondary';
  onClick: () => void;
  children: React.ReactNode;
  disabled?: boolean;
}

// Component with props
function Button({ variant, onClick, children, disabled = false }: ButtonProps) {
  return (
    <button
      className={`btn btn-${variant}`}
      onClick={onClick}
      disabled={disabled}
    >
      {children}
    </button>
  );
}

// Generic components
interface ListProps<T> {
  items: T[];
  renderItem: (item: T) => React.ReactNode;
}

function List<T>({ items, renderItem }: ListProps<T>) {
  return <>{items.map(renderItem)}</>;
}
```

## Testing

**React Testing Library:**

```tsx
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';

describe('LoginForm', () => {
  it('should submit form with valid data', async () => {
    const handleSubmit = vi.fn();
    render(<LoginForm onSubmit={handleSubmit} />);

    await userEvent.type(screen.getByLabelText(/email/i), '[email protected]');
    await userEvent.type(screen.getByLabelText(/password/i), 'password123');
    await userEvent.click(screen.getByRole('button', { name: /login/i }));

    await waitFor(() => {
      expect(handleSubmit).toHaveBeenCalledWith({
        email: '[email protected]',
        password: 'password123',
      });
    });
  });

  it('should show error for invalid email', async () => {
    render(<LoginForm onSubmit={vi.fn()} />);

    await userEvent.type(screen.getByLabelText(/email/i), 'invalid');
    await userEvent.click(screen.getByRole('button', { name: /login/i }));

    expect(await screen.findByText(/invalid email/i)).toBeInTheDocument();
  });
});
```

## Approach

When writing React code:

1. **Use Functional Components**: Hooks over class components
2. **Keep Components Small**: Single responsibility principle
3. **Lift State Up**: Share state at the lowest common ancestor
4. **Memoize Wisely**: Use memo, useMemo, useCallback when needed
5. **Type Everything**: TypeScript for better DX and fewer bugs
6. **Test User Behavior**: React Testing Library over enzyme
7. **Optimize Performance**: Code splitting, lazy loading, virtual lists
8. **Follow Conventions**: ESLint, Prettier, consistent patterns

Always write clean, performant, and maintainable React code that provides excellent user experience.

## Reference Documentation

Detailed material lives alongside this skill and is read on demand:

- [Core Expertise](references/CORE_CONCEPTS.md) — Modern React (React 18+), State Management, Forms, Performance Optimization, Next.js Patterns

© PCL Team · Apache-2.0 · personamanagmentlayer/pcl

Similar skills

All skills for Frontend and UI →

react-expert by other authors comes first.

react-expert https://github.com/Jeffallan react-expert — a skill for React 18+, Next.js App Router, and create-react-app work. It writes components and hooks, debugs rendering, and migrates class components to functions. CX Codex +1 5,900installs react-expert reactjs react-expert researches React APIs and internals directly against tests, commits, and pull requests. Useful for writing accurate docs without relying on outdated model memory. CX Codex +1 1,300installs react-composition-2026 patterns.dev react-composition-2026 — a skill that pushes your agent away from boolean props and rigid component APIs toward compound components, explicit variants and children. CX Codex +1 1,200installs nextjs-react-redux-typescript-cursor-rules Mindrally The nextjs-react-redux-typescript-cursor-rules skill for Claude Code provides frontend development guidelines for Next.js, React, Redux Toolkit, and TypeScript. CX Codex +1 885installs react-patterns affaan-m react-patterns — a skill for Claude and other AI editors that steers the agent toward idiomatic React 18/19: hooks discipline, server/client boundaries, forms, data fetching. CX Codex +1 6,700installs react-nextjs-patterns duyet react-nextjs-patterns is a Claude Code skill that guides App Router and Server Component practices during Next.js development and code review, helping prevent data leaks and unnecessary memoization. CX Codex +1 1,100installs react-server-components patterns.dev Teaches React Server Components: which components belong on the server and where 'use client' goes. Useful in Next.js App Router. CX Codex +1 1,000installs react PatrickJS react is a Cursor rule for React that guides component structure, hooks, and state management. It applies to .tsx, .jsx, and components/**/* files. CX Codex +1 ★ 41,178repo stars

From the same set104

The whole set →
sre-expert sre-expert guides site reliability engineering practices, incident workflows, and error budget calculations. CX Codex +1 205installs elasticsearch-expert elasticsearch-expert is a Claude Code skill that helps design Elasticsearch mappings, build search queries and aggregations, and optimize ELK stacks. CX Codex +1 205installs prometheus-expert prometheus-expert — a skill that gives your coding agent solid Prometheus knowledge: metric collection, PromQL, recording and alerting rules. Useful when exporters have to go up on Kubernetes or a query just will not return what you expect. CX Codex +1 204installs kotlin-expert The kotlin-expert skill guides Kotlin work across Android, coroutines, JVM, and Kotlin Multiplatform. Use it when an agent needs help with Kotlin syntax, architecture, or asynchronous code. CX Codex +1 203installs performance-expert performance-expert guides code profiling, database query tuning, and caching strategies to resolve latency and throughput issues. CX Codex +1 198installs javascript-expert javascript-expert — a skill that makes the assistant work as a seasoned JavaScript developer across ES2024+, Node.js and npm, so the code it writes stays in one style. CX Codex +1 197installs stockbreeder-expert stockbreeder-expert is a Claude Code skill with Python domain models and workflows for livestock records, breeding, animal health monitoring, and vaccination schedules. CX Codex +1 195installs mongodb-expert The mongodb-expert skill covers MongoDB schema design, aggregation pipelines, indexes, replication, and production operations when database or performance work needs review. CX Codex +1 195installs

Project sponsors

Companies that keep this analytics open