Agent skill

React

by blencorp in blencorp/claude-code-kit

Core React 19 patterns including hooks, Suspense, lazy loading, component structure, TypeScript best practices, and performance optimization.

MITAuto-check passedFrontend & Design

Install React

skills CLI
$ npx skills add blencorp/claude-code-kit --skill react -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install blencorp/claude-code-kit react --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/blencorp/claude-code-kit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/cli/kits/react/skills/react .claude/skills/react && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
react
GitHub stars
106
Token cost
~2.5k tokens
SKILL.md length
255 words
Files
6
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Core React 19 patterns including hooks, Suspense, lazy loading, component structure, TypeScript best practices, and performance optimization.

  • Works in 3 steps: Conditional Hooks → Missing Dependencies → Mutating State
  • Working with React components
  • SKILL.md covers Purpose, When to Use This Skill, Quick Start and Core Hooks Patterns, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

React is an agent skill from blencorp/claude-code-kit. Core React 19 patterns including hooks, Suspense, lazy loading, component structure, TypeScript best practices, and performance optimization. Use when working with React components, hooks, lazy loading, Suspense boundaries, or React-specific TypeScript patterns.

Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files (for example `resources/component-patterns.md`, `resources/hooks-patterns.md` and `resources/performance.md`).

It sits in Frontend & Design, covering Web performance, React components and Performance optimization. It works with React and TypeScript. The repository describes itself as: Claude Code infrastructure with auto-activating skills and framework-specific kits. Install complete Claude Code infrastructure in 30 seconds with automatic framework detection… The licence is MIT.

When your agent uses it

  • Working with React components
  • Suspense boundaries
  • React-specific TypeScript patterns

Example prompts

  • “/react”

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Conditional Hooks
  2. Missing Dependencies
  3. Mutating State

What it can do on your machine

Read from SKILL.md and the folder at commit d1b17ed. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

React loads about 2.5k tokens when it runs. Until then it costs about 67 tokens; SKILL.md has 255 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~67
When it runs · the whole SKILL.md, loaded when a task matches
~2.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from blencorp/claude-code-kit at commit d1b17ed, republished under its MIT licence (© blencorp). 255 words, ~2,469 tokens.

Download SKILL.mdSave it as .claude/skills/react/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
react
description
Core React 19 patterns including hooks, Suspense, lazy loading, component structure, TypeScript best practices, and performance optimization. Use when working with React components, hooks, lazy loading, Suspense boundaries, or React-specific TypeScript patterns.

React Core Patterns

Purpose

Essential React 19 patterns for building modern applications with hooks, Suspense, lazy loading, and TypeScript.

Note: React 19 (released December 2024) breaking changes:

  • forwardRef no longer needed - pass ref as a prop directly
  • propTypes removed (silently ignored)
  • New JSX transform required
  • React.FC type discouraged - use direct function components instead

When to Use This Skill

  • Creating React components
  • Using React hooks (useState, useEffect, useCallback, useMemo)
  • Implementing lazy loading and code splitting
  • Working with Suspense boundaries
  • React-specific TypeScript patterns
  • Performance optimization with React

Quick Start

Component Structure Template
typescript
import { useState, useCallback } from 'react';

interface Props {
  userId: string;
  onUpdate?: (data: UserData) => void;
}

interface UserData {
  name: string;
  email: string;
}

function UserProfile({ userId, onUpdate }: Props) {
  const [data, setData] = useState<UserData | null>(null);

  const handleUpdate = useCallback((newData: UserData) => {
    setData(newData);
    onUpdate?.(newData);
  }, [onUpdate]);

  return (
    <div>
      {/* Component content */}
    </div>
  );
}

export default UserProfile;
Component Checklist

Creating a React component? Follow this:

  • Use function components with typed props (not React.FC)
  • Define interfaces for Props and local state
  • Use useCallback for event handlers passed to children
  • Use useMemo for expensive computations
  • Lazy load if heavy component: lazy(() => import())
  • Wrap lazy components in <Suspense> with fallback
  • Default export at bottom
  • No conditional hooks (hooks must be called in same order)
  • Pass ref as a prop (no forwardRef needed in React 19)

Core Hooks Patterns

useState
typescript
// Simple state
const [count, setCount] = useState<number>(0);

// Object state
const [user, setUser] = useState<User | null>(null);

// Array state
const [items, setItems] = useState<Item[]>([]);

// Functional updates when depending on previous state
setCount(prev => prev + 1);
setItems(prev => [...prev, newItem]);
useCallback
typescript
// Wrap functions passed to child components
const handleClick = useCallback((id: string) => {
  console.log('Clicked:', id);
}, []); // Empty deps if no dependencies

// With dependencies
const handleUpdate = useCallback((data: FormData) => {
  apiCall(userId, data);
}, [userId]); // Re-create when userId changes
useMemo
typescript
// Expensive computation
const sortedItems = useMemo(() => {
  return items.sort((a, b) => a.score - b.score);
}, [items]);

// Derived state
const totalPrice = useMemo(() => {
  return cart.reduce((sum, item) => sum + item.price, 0);
}, [cart]);
useEffect
typescript
// Run once on mount
useEffect(() => {
  fetchData();
}, []);

// Run when dependency changes
useEffect(() => {
  if (userId) {
    loadUserData(userId);
  }
}, [userId]);

// Cleanup
useEffect(() => {
  const subscription = subscribe(userId);
  return () => subscription.unsubscribe();
}, [userId]);

Lazy Loading & Code Splitting

Basic Lazy Loading
typescript
import React, { Suspense } from 'react';

// Lazy load heavy component
const HeavyChart = React.lazy(() => import('./HeavyChart'));

function Dashboard() {
  return (
    <div>
      <h1>Dashboard</h1>
      <Suspense fallback={<div>Loading chart...</div>}>
        <HeavyChart />
      </Suspense>
    </div>
  );
}
Multiple Lazy Components
typescript
const AdminPanel = React.lazy(() => import('./AdminPanel'));
const UserSettings = React.lazy(() => import('./UserSettings'));
const Reports = React.lazy(() => import('./Reports'));

function App() {
  return (
    <Suspense fallback={<LoadingSpinner />}>
      <Routes>
        <Route path="/admin" element={<AdminPanel />} />
        <Route path="/settings" element={<UserSettings />} />
        <Route path="/reports" element={<Reports />} />
      </Routes>
    </Suspense>
  );
}
Feature-Based Code Splitting
typescript
// features/auth/index.tsx
export { default } from './AuthFeature';

// Lazy load entire feature
const AuthFeature = React.lazy(() => import('~/features/auth'));

<Suspense fallback={<FeatureLoader />}>
  <AuthFeature />
</Suspense>

Suspense Patterns

Suspense Boundaries
typescript
// Wrap data-fetching components
<Suspense fallback={<Skeleton />}>
  <UserProfile userId={id} />
</Suspense>

// Nested Suspense for granular loading
<Suspense fallback={<PageLoader />}>
  <Header />
  <Suspense fallback={<ContentSkeleton />}>
    <MainContent />
  </Suspense>
  <Footer />
</Suspense>
Error Boundaries with Suspense
typescript
import { ErrorBoundary } from 'react-error-boundary';

<ErrorBoundary fallback={<ErrorFallback />}>
  <Suspense fallback={<Loading />}>
    <DataComponent />
  </Suspense>
</ErrorBoundary>

TypeScript Patterns

Component Props
typescript
// Basic props
interface ButtonProps {
  label: string;
  onClick: () => void;
  disabled?: boolean;
}

// Props with children
interface CardProps {
  title: string;
  children: React.ReactNode;
}

// Props with specific child types
interface ListProps {
  children: React.ReactElement<ItemProps> | React.ReactElement<ItemProps>[];
}

// Props with event handlers
interface FormProps {
  onSubmit: (data: FormData) => void;
  onChange?: (field: string, value: unknown) => void;
}
Hooks TypeScript
typescript
// useState with type
const [user, setUser] = useState<User | null>(null);
const [items, setItems] = useState<Item[]>([]);

// useRef with type
const inputRef = useRef<HTMLInputElement>(null);
const timerRef = useRef<number | null>(null);

// Custom hook with return type
function useUser(id: string): { user: User | null; loading: boolean } {
  const [user, setUser] = useState<User | null>(null);
  const [loading, setLoading] = useState(true);

  // ... implementation

  return { user, loading };
}

Performance Optimization

React.memo
typescript
// Memoize component to prevent unnecessary re-renders
const UserCard = React.memo<UserCardProps>(({ user, onUpdate }) => {
  return (
    <div>
      <h3>{user.name}</h3>
      <button onClick={() => onUpdate(user.id)}>Update</button>
    </div>
  );
});

// Custom comparison function
const UserCard = React.memo(UserCardComponent, (prevProps, nextProps) => {
  return prevProps.user.id === nextProps.user.id;
});
Avoiding Re-renders
typescript
// ❌ Bad: Creates new function on every render
function Parent() {
  return <Child onClick={() => console.log('clicked')} />;
}

// ✅ Good: Stable function reference
function Parent() {
  const handleClick = useCallback(() => {
    console.log('clicked');
  }, []);

  return <Child onClick={handleClick} />;
}

Common Patterns

Conditional Rendering
typescript
// Ternary operator
{isLoading ? <Spinner /> : <Content />}

// Logical AND
{error && <ErrorMessage error={error} />}

// Nullish coalescing
{user ?? <GuestView />}

// Early return for loading states
function Component() {
  const { data } = useSomeHook();

  // ❌ Avoid early returns for loading - breaks hooks rules
  // Use Suspense instead

  return <div>{data.map(...)}</div>;
}
Lists and Keys
typescript
// Always use stable keys
{items.map(item => (
  <ItemCard key={item.id} item={item} />
))}

// Never use index as key if list can reorder
// ❌ Bad
{items.map((item, index) => (
  <ItemCard key={index} item={item} />
))}

File Organization

Feature-Based Structure
src/
├── features/
│   ├── auth/
│   │   ├── components/
│   │   ├── hooks/
│   │   ├── types/
│   │   └── index.tsx
│   └── posts/
│       ├── components/
│       ├── hooks/
│       ├── types/
│       └── index.tsx
├── components/  # Shared components
├── hooks/       # Shared hooks
└── types/       # Shared types
Component Co-location
features/posts/
├── components/
│   ├── PostCard.tsx
│   ├── PostList.tsx
│   └── PostForm.tsx
├── hooks/
│   ├── usePost.ts
│   └── usePosts.ts
├── types/
│   └── post.ts
└── index.tsx  # Public API

Common Mistakes to Avoid

1. Conditional Hooks
typescript
// ❌ Never do this
function Component({ condition }) {
  if (condition) {
    const [state, setState] = useState(0); // Breaks rules of hooks
  }
}

// ✅ Do this
function Component({ condition }) {
  const [state, setState] = useState(0);
  // Use state conditionally, not the hook
}
2. Missing Dependencies
typescript
// ❌ Bad: Missing dependency
useEffect(() => {
  fetchUser(userId);
}, []); // userId should be in deps

// ✅ Good: All dependencies listed
useEffect(() => {
  fetchUser(userId);
}, [userId]);
3. Mutating State
typescript
// ❌ Bad: Mutating state directly
const handleAdd = () => {
  items.push(newItem); // Don't mutate
  setItems(items);
};

// ✅ Good: Create new array
const handleAdd = () => {
  setItems([...items, newItem]);
};

Additional Resources

For more detailed patterns, see:

© blencorp, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files in cli/kits/react/skills/react of blencorp/claude-code-kit.

  • SKILL.md
  • resources/component-patterns.md
  • resources/hooks-patterns.md
  • resources/performance.md
  • resources/typescript-patterns.md
  • skill-rules-fragment.json

Open the folder on GitHubat commit d1b17ed

Compare with similar skills

React next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

React compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
React this skillblencorp/claude-code-kit106—~2.5kAutomated safety check: PassMIT
React Frontend Development Guidelinesdiet103/claude-code-infrastructure-showcase10k2 repos~2.9kAutomated safety check: PassMIT
React Best Practicesryokun6/ryos1.3k—~2kAutomated safety check: PassMIT
Senior Frontendalirezarezvani/claude-skills28k5 repos~3.9kAutomated safety check: PassMIT
React ExpertJeffallan/claude-skills12k—~1.4kAutomated safety check: PassMIT
React Best Practicespoteto/noodle420—~1.4kAutomated safety check: PassMIT

Similar skills

  • React Frontend Development Guidelines

    diet103/claude-code-infrastructure-showcase

    Guidelines for React 18 and TypeScript apps covering Suspense data fetching, lazy loading, feature folders, MUI v7 styling, TanStack Router and performance.

    10k GitHub starsUsed in 2 repos~2.9k tokens
    Frontend & DesignAuto-check passed
  • React performance optimization guidelines from Vercel Engineering (vercel-labs/agent-skills).

    1.3k GitHub stars~2k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Senior Frontend

    alirezarezvani/claude-skills

    Frontend development skill for React, Next.js, TypeScript, and Tailwind CSS applications.

    28k GitHub starsUsed in 5 repos~3.9k tokens
    Frontend & DesignAuto-check passed
  • React Expert

    Jeffallan/claude-skills

    Builds React 19 components in TypeScript with Server Components, useActionState forms, custom hooks and state libraries, checked with tsc and React Testing Library.

    12k GitHub stars~1.4k tokensUpdated 4 days ago
    Frontend & DesignAuto-check passed
  • React performance optimization guidelines. An agent skill from poteto/noodle.

    420 GitHub stars~1.4k tokensUpdated 6 mo ago
    Frontend & DesignAuto-check passed
  • Vercel React Best Practices

    gambitph/Stackable

    React performance optimization guidelines from Vercel Engineering.

    350 GitHub stars~2k tokensUpdated today
    Frontend & DesignAuto-check passed

More from blencorp/claude-code-kit

All 11 skills in this repo
  • Mui

    blencorp/claude-code-kit

    Material-UI v7 component library patterns including sx prop styling, theme integration, responsive design, and MUI-specific hooks.

    106 GitHub starsUsed in 2 repos~2.4k tokens
    Auto-check passed
  • Express

    blencorp/claude-code-kit

    Express.js framework patterns including routing, middleware, request/response handling, and Express-specific APIs.

    106 GitHub stars~2.7k tokensUpdated 10 mo ago
    Auto-check passed
  • Nextjs

    blencorp/claude-code-kit

    Next.js 15+ App Router development patterns including Server Components, Client Components, data fetching, layouts, and server actions.

    106 GitHub stars~2.6k tokensUpdated 10 mo ago
    Auto-check passed
  • Nodejs

    blencorp/claude-code-kit

    Core Node.js backend patterns for TypeScript applications including async/await error handling, middleware concepts, configuration management, testing strategies, and layered architecture principles.

    106 GitHub stars~2.6k tokensUpdated 10 mo ago
    Auto-check passed
  • Prisma

    blencorp/claude-code-kit

    Prisma ORM patterns including Prisma Client usage, queries, mutations, relations, transactions, and schema management.

    106 GitHub stars~2.7k tokensUpdated 10 mo ago
    Auto-check passed
  • Shadcn

    blencorp/claude-code-kit

    shadcn/ui component library patterns with Radix UI primitives and Tailwind CSS.

    106 GitHub stars~3.2k tokensUpdated 10 mo ago
    Auto-check passed

Works with

Questions about React

What does React do?

Core React 19 patterns including hooks, Suspense, lazy loading, component structure, TypeScript best practices, and performance optimization. React is an agent skill from blencorp/claude-code-kit. Core React 19 patterns including hooks, Suspense, lazy loading, component structure, TypeScript best practices, and performance optimization.

When should I use React?

React fits situations like: working with React components; suspense boundaries; React-specific TypeScript patterns.

How do I install React in Claude Code?

Run `npx skills add blencorp/claude-code-kit --skill react -a claude-code`. Or copy the skill folder (cli/kits/react/skills/react in blencorp/claude-code-kit) into .claude/skills/react in your project. Claude Code loads it when a task matches its description.

How do I install React in Codex?

Run `npx skills add blencorp/claude-code-kit --skill react -a codex`. Or copy the skill folder (cli/kits/react/skills/react in blencorp/claude-code-kit) into .agents/skills/react in your project. Codex loads it when a task matches its description.

Can I use React in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add blencorp/claude-code-kit --skill react -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/react, .gemini/skills/react, .github/skills/react and .opencode/skills/react in your project.

What does React need to run?

SKILL.md names no scripts, command-line tools or credentials: React is instructions for the agent only.

Does React access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is React safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does React use?

React is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does React use?

About 2.5k tokens (SKILL.md is roughly 9.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to React?

Skills that share tags, products or a category with React: React Frontend Development Guidelines (diet103/claude-code-infrastructure-showcase, 10k stars), React Best Practices (ryokun6/ryos, 1.3k stars), Senior Frontend (alirezarezvani/claude-skills, 28k stars) and React Expert (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains React?

blencorp (a GitHub organization) maintains it in blencorp/claude-code-kit, which has 106 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on November 28, 2025.

Source: blencorp/claude-code-kit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.