Provides comprehensive React 19 patterns for Server Components, Server Actions, useOptimistic, useActionState, useTransition, concurrent features, Suspense boundaries, and TypeScript integration.

MITAuto-check: notesFrontend & Design

Install React Patterns

skills CLI
$ npx skills add giuseppe-trisciuoglio/developer-kit --skill react-patterns -a claude-code

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

GitHub CLI
$ gh skill install giuseppe-trisciuoglio/developer-kit react-patterns --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/giuseppe-trisciuoglio/developer-kit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/developer-kit-typescript/skills/react-patterns .claude/skills/react-patterns && 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-patterns
GitHub stars
355
Token cost
~2.4k tokens
SKILL.md length
574 words
Files
8 (incl. references)
Skills in repo
117
Repo updated
First seen
Licence
MIT

At a glance

Provides comprehensive React 19 patterns for Server Components, Server Actions, useOptimistic, useActionState, useTransition, concurrent features, Suspense boundaries, and TypeScript integration.

  • Works in 7 steps: Identify Component Type: Determine if… → Select Hooks: Use appropriate hooks for… → Type Props: Define TypeScript interfaces… → …
  • Building React 19 applications with Next.js App Router
  • SKILL.md covers Overview, When to Use, Quick Reference and Instructions, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

React Patterns is an agent skill from giuseppe-trisciuoglio/developer-kit. Provides comprehensive React 19 patterns for Server Components, Server Actions, useOptimistic, useActionState, useTransition, concurrent features, Suspense boundaries, and TypeScript integration. Generates executable code patterns, validates security for public endpoints, and optimizes performance with React Compiler or manual memoization. Proactively use when building React 19 applications with Next.js App Router, implementing optimistic UI, or optimizing concurrent rendering.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including reference files (for example `references/component-patterns.md`, `references/hooks-patterns.md` and `references/learn.md`).

It sits in Frontend & Design, covering React components. It works with React, Next.js and TypeScript. The repository describes itself as: Modular plugin marketplace for Claude Code and agentic CLIs, with validated, spec-driven skills, agents, commands, and workflows for Java, TypeScript, Python, PHP, AWS, and AI. The licence is MIT.

When your agent uses it

  • Building React 19 applications with Next.js App Router
  • Implementing optimistic UI
  • Optimizing concurrent rendering

Example prompts

  • “Use the react-patterns skill to provide comprehensive React 19 patterns for Server Components, Server Actions, useOptimistic, useActionState…”
  • “/react-patterns”

Requirements

  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash, Grep, Glob

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Identify Component Type: Determine if Server Component or Client Component is needed
  2. Select Hooks: Use appropriate hooks for state management and side effects
  3. Type Props: Define TypeScript interfaces for all component props
  4. Handle Async: Wrap data-fetching components in Suspense boundaries
  5. Optimize: Use React Compiler or manual memoization for expensive renders
  6. Handle Errors: Add ErrorBoundary for graceful error handling
  7. Validate Server Actions: Define Zod/schema validation, then test

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash
    • Grep
    • Glob

    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 Patterns loads about 2.4k tokens when it runs, and up to ~19k if it reads all its reference files. Until then it costs about 124 tokens; SKILL.md has 574 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~124
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~19k

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: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Edit, Bash, Grep, Glob

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 giuseppe-trisciuoglio/developer-kit at commit fe73fb3, republished under its MIT licence (© giuseppe-trisciuoglio). 574 words, ~2,435 tokens.

Download SKILL.mdSave it as .claude/skills/react-patterns/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
react-patterns
description
Provides comprehensive React 19 patterns for Server Components, Server Actions, useOptimistic, useActionState, useTransition, concurrent features, Suspense boundaries, and TypeScript integration. Generates executable code patterns, validates security for public endpoints, and optimizes performance with React Compiler or manual memoization. Proactively use when building React 19 applications with Next.js App Router, implementing optimistic UI, or optimizing concurrent rendering.
allowed-tools
Read, Write, Edit, Bash, Grep, Glob

React 19 Development Patterns

Overview

React 19 patterns for Next.js App Router, Server Actions, optimistic UI, and concurrent features. See Quick Reference for API summary and Examples for copy-paste patterns.

When to Use

  • Building React 19 applications with Next.js App Router
  • Implementing optimistic UI with useOptimistic or useTransition
  • Creating Server Actions with form validation
  • Migrating from class components to hooks
  • Optimizing concurrent rendering with React Compiler
  • Managing complex state with useReducer or custom hooks
  • Wrapping async operations in Suspense boundaries

Quick Reference

PatternHook / APIUse Case
Local stateuseStateSimple component state
Complex stateuseReducerMulti-action state machines
Side effectsuseEffectSubscriptions, data fetching
Shared stateuseContext / createContextCross-component data
DOM accessuseRefFocus, measurements, timers
PerformanceuseMemo / useCallbackExpensive computations
Non-urgent updatesuseTransitionSearch/filter on large lists
Defer expensive UIuseDeferredValueStale-while-updating
Read resourcesuse() (React 19)Promises and context in render
Optimistic UIuseOptimistic (React 19)Instant feedback on mutations
Form statususeFormStatus (React 19)Pending state in child components
Form stateuseActionState (React 19)Server action results
Auto-memoizationReact CompilerEliminates manual memo/callback

Instructions

  1. Identify Component Type: Determine if Server Component or Client Component is needed
  2. Select Hooks: Use appropriate hooks for state management and side effects
  3. Type Props: Define TypeScript interfaces for all component props
  4. Handle Async: Wrap data-fetching components in Suspense boundaries
  5. Optimize: Use React Compiler or manual memoization for expensive renders
  6. Handle Errors: Add ErrorBoundary for graceful error handling
  7. Validate Server Actions: Define Zod/schema validation, then test:
    • Submit invalid inputs → verify rejection
    • Submit valid inputs → verify success

Examples

Server Component with Client Interaction
tsx
// Server Component (default) — async, fetches data
async function ProductPage({ id }: { id: string }) {
  const product = await db.product.findUnique({ where: { id } });

  return (
    <div>
      <h1>{product.name}</h1>
      <AddToCartButton productId={product.id} />
    </div>
  );
}

// Client Component — handles interactivity
'use client';
function AddToCartButton({ productId }: { productId: string }) {
  const [isPending, startTransition] = useTransition();

  const handleAdd = () => {
    startTransition(async () => {
      await addToCart(productId);
    });
  };

  return (
    <button onClick={handleAdd} disabled={isPending}>
      {isPending ? 'Adding...' : 'Add to Cart'}
    </button>
  );
}
useOptimistic for Instant Feedback
tsx
'use client';
import { useOptimistic } from 'react';

function TodoList({ todos, addTodo }: { todos: Todo[]; addTodo: (t: Todo) => Promise<void> }) {
  const [optimisticTodos, addOptimisticTodo] = useOptimistic(
    todos,
    (state, newTodo: Todo) => [...state, { ...newTodo, pending: true }]
  );

  const handleSubmit = async (formData: FormData) => {
    const newTodo = { id: Date.now(), text: formData.get('text') as string };
    addOptimisticTodo(newTodo);  // Immediate UI update
    await addTodo(newTodo);      // Actual backend call
  };

  return (
    <form action={handleSubmit}>
      {optimisticTodos.map(todo => (
        <div key={todo.id} style={{ opacity: todo.pending ? 0.5 : 1 }}>
          {todo.text}
        </div>
      ))}
      <input type="text" name="text" />
      <button type="submit">Add</button>
    </form>
  );
}
Server Action with Form
tsx
// app/actions.ts
'use server';
import { z } from 'zod';
import { revalidatePath } from 'next/cache';

const schema = z.object({
  title: z.string().min(5),
  content: z.string().min(10),
});

export async function createPost(prevState: any, formData: FormData) {
  const parsed = schema.safeParse({
    title: formData.get('title'),
    content: formData.get('content'),
  });

  if (!parsed.success) {
    return { errors: parsed.error.flatten().fieldErrors };
  }

  await db.post.create({ data: parsed.data });
  revalidatePath('/posts');
  return { success: true };
}

// app/blog/new/page.tsx
'use client';
import { useActionState } from 'react';
import { createPost } from '../actions';

export default function NewPostPage() {
  const [state, formAction, pending] = useActionState(createPost, {});

  return (
    <form action={formAction}>
      <input name="title" placeholder="Title" />
      {state.errors?.title && <span>{state.errors.title[0]}</span>}
      <textarea name="content" placeholder="Content" />
      <button type="submit" disabled={pending}>
        {pending ? 'Publishing...' : 'Publish'}
      </button>
    </form>
  );
}
Custom Hook
tsx
export function useOnlineStatus() {
  const [isOnline, setIsOnline] = useState(true);

  useEffect(() => {
    function handleOnline() { setIsOnline(true); }
    function handleOffline() { setIsOnline(false); }

    window.addEventListener('online', handleOnline);
    window.addEventListener('offline', handleOffline);

    return () => {
      window.removeEventListener('online', handleOnline);
      window.removeEventListener('offline', handleOffline);
    };
  }, []);

  return isOnline;
}
useTransition for Non-Urgent Updates
tsx
function SearchableList({ items }: { items: Item[] }) {
  const [query, setQuery] = useState('');
  const [isPending, startTransition] = useTransition();
  const [filteredItems, setFilteredItems] = useState(items);

  const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
    setQuery(e.target.value);
    startTransition(() => {
      setFilteredItems(items.filter(i => i.name.toLowerCase().includes(e.target.value.toLowerCase())));
    });
  };

  return (
    <div>
      <input value={query} onChange={handleChange} />
      {isPending && <span>Filtering...</span>}
      <ul>{filteredItems.map(i => <li key={i.id}>{i.name}</li>)}</ul>
    </div>
  );
}

Best Practices

Server vs Client Decision
  • Start with Server Component (no directive needed)
  • Add 'use client' only for: hooks, browser APIs, event handlers
State Management
  • Keep state minimal — compute derived values during render, not in effects
  • Use useReducer for state with multiple related actions
  • Lift state up to the nearest common ancestor
Show full SKILL.md (241 more words)Show less
Effects
  • Use effects only for external system synchronization
  • Always specify correct dependency arrays
  • Return cleanup functions for subscriptions and timers
  • Never mutate state directly — always create new references
Performance
  • With React Compiler: avoid manual useMemo, useCallback, memo
  • Without React Compiler: use useMemo for expensive computations, useCallback for stable callbacks
  • Use useTransition for low-priority state updates
  • Use stable IDs as list keys, not array indices
React 19 Specifics
  • Wrap use(promise) components in Suspense boundaries
  • Use useActionState for form-server action integration
  • Validate Server Action inputs — they are public endpoints
  • Pass serializable data from Server to Client Components

Constraints and Warnings

  • Server Components: Cannot use hooks, event handlers, or browser APIs
  • use() Hook: Can only be called during render, not in callbacks or effects
  • Server Actions: Must include 'use server' directive; always validate inputs
  • State Mutations: Never mutate state directly — always create new references
  • Effect Dependencies: Include all dependencies in useEffect dependency arrays
  • Memory Leaks: Always clean up subscriptions and event listeners in useEffect return

References

Consult these files for detailed patterns:

© giuseppe-trisciuoglio, 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 7 other files (references) in plugins/developer-kit-typescript/skills/react-patterns of giuseppe-trisciuoglio/developer-kit.

  • SKILL.md
  • references/component-patterns.md
  • references/hooks-patterns.md
  • references/learn.md
  • references/performance-patterns.md
  • references/react19-features.md
  • references/reference.md
  • references/typescript-patterns.md

Open the folder on GitHubat commit fe73fb3

Compare with similar skills

React Patterns 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 Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
React Patterns this skillgiuseppe-trisciuoglio/developer-kit355—~2.4kAutomated safety check: NotesMIT
Fast Typescript Checkinternet-development/www-sacred1.6k—~4.3kAutomated safety check: PassMIT
Spotpatchhuanglvjing/spotpatch134—~998Automated safety check: PassMIT
Frontend Code ReviewProgrammerAnthony/Anything-Extract139—~957Automated safety check: PassMIT
Senior Frontendalirezarezvani/claude-skills28k5 repos~3.9kAutomated safety check: PassMIT
React ExpertJeffallan/claude-skills12k—~1.4kAutomated safety check: PassMIT

Similar skills

  • Fast Typescript Check

    internet-development/www-sacred

    Keep www-sacred's TypeScript fast to type-check and fast to run.

    1.6k GitHub stars~4.3k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Spotpatch

    huanglvjing/spotpatch

    为 React 项目建立从浏览器页面元素到精确 JSX/TSX 源码、结构化上下文与可审阅修改的 SpotPatch 工作流。用户提到 SpotPatch、截图沟通前端修改、页面元素定位源码、Vite 或 Next.js 接入、组件数据链路、结构化 Prompt、AI 补丁审阅、安装检查或故障排查时使用此技能。

    134 GitHub stars~998 tokensUpdated 10 days ago
    Frontend & DesignAuto-check passed
  • Frontend Code Review

    ProgrammerAnthony/Anything-Extract

    指导在项目中对前端代码(Next.js/React/TypeScript/Tailwind 等)进行结构、可维护性、性能与一致性审查,基于既定规则清单。适用于用户请求审查 .tsx/.ts/.js/.jsx 等前端文件或前端目录下的页面与组件。不用于后端代码(如 .py)。

    139 GitHub stars~957 tokensUpdated 4 mo ago
    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 5 days ago
    Frontend & DesignAuto-check passed
  • React Idioms

    irahardianto/awesome-agv

    React 19+ patterns: custom hooks, Suspense boundaries, state management, component composition, and web performance.

    157 GitHub stars~3.8k tokensUpdated 3 days ago
    Frontend & DesignAuto-check passed

More from giuseppe-trisciuoglio/developer-kit

All 117 skills in this repo
  • Nestjs Drizzle Crud Generator

    giuseppe-trisciuoglio/developer-kit

    Generates complete CRUD modules for NestJS applications with Drizzle ORM.

    355 GitHub stars~1.3k tokensUpdated 28 days ago
    Auto-check: notes
  • Spring Boot Actuator

    giuseppe-trisciuoglio/developer-kit

    Provides patterns to configure Spring Boot Actuator for production-grade monitoring, health probes, secured management endpoints, and Micrometer metrics across JVM services.

    355 GitHub stars~2.2k tokensUpdated 28 days ago
    Auto-check: notes
  • Spring Boot Crud Patterns

    giuseppe-trisciuoglio/developer-kit

    Provides and generates complete CRUD workflows for Spring Boot 3 services.

    355 GitHub stars~2.5k tokensUpdated 28 days ago
    Auto-check: notes
  • PR Review Comments

    giuseppe-trisciuoglio/developer-kit

    Posts review findings from a JSON file as inline comments on a GitHub Pull Request, attaching each comment to its file and line.

    355 GitHub starsUsed in 1 repo~1k tokens
    Auto-check: notes
  • Spring Boot Security JWT

    giuseppe-trisciuoglio/developer-kit

    Provides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based…

    355 GitHub stars~3.9k tokensUpdated 28 days ago
    Auto-check: notes
  • AWS SDK Java V2 Secrets Manager

    giuseppe-trisciuoglio/developer-kit

    Provides AWS Secrets Manager patterns for AWS SDK for Java 2.x, including secret retrieval, caching, rotation-aware access, and Spring Boot integration.

    355 GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check: notes

Questions about React Patterns

What does React Patterns do?

Provides comprehensive React 19 patterns for Server Components, Server Actions, useOptimistic, useActionState, useTransition, concurrent features, Suspense boundaries, and TypeScript integration. React Patterns is an agent skill from giuseppe-trisciuoglio/developer-kit. Provides comprehensive React 19 patterns for Server Components, Server Actions, useOptimistic, useActionState, useTransition, concurrent features, Suspense boundaries, and TypeScript integration.

When should I use React Patterns?

React Patterns fits situations like: building React 19 applications with Next.js App Router; implementing optimistic UI; optimizing concurrent rendering.

How do I install React Patterns in Claude Code?

Run `npx skills add giuseppe-trisciuoglio/developer-kit --skill react-patterns -a claude-code`. Or copy the skill folder (plugins/developer-kit-typescript/skills/react-patterns in giuseppe-trisciuoglio/developer-kit) into .claude/skills/react-patterns in your project. Claude Code loads it when a task matches its description.

How do I install React Patterns in Codex?

Run `npx skills add giuseppe-trisciuoglio/developer-kit --skill react-patterns -a codex`. Or copy the skill folder (plugins/developer-kit-typescript/skills/react-patterns in giuseppe-trisciuoglio/developer-kit) into .agents/skills/react-patterns in your project. Codex loads it when a task matches its description.

Can I use React Patterns 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 giuseppe-trisciuoglio/developer-kit --skill react-patterns -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-patterns, .gemini/skills/react-patterns, .github/skills/react-patterns and .opencode/skills/react-patterns in your project.

What does React Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: React Patterns is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash, Grep, Glob.

Does React Patterns 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 Patterns safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does React Patterns use?

React Patterns 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 Patterns use?

About 2.4k tokens (SKILL.md is roughly 9.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 16k tokens, read only when the agent opens those files.

What are the alternatives to React Patterns?

Skills that share tags, products or a category with React Patterns: Fast Typescript Check (internet-development/www-sacred, 1.6k stars), Spotpatch (huanglvjing/spotpatch, 134 stars), Frontend Code Review (ProgrammerAnthony/Anything-Extract, 139 stars) and Senior Frontend (alirezarezvani/claude-skills, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains React Patterns?

giuseppe-trisciuoglio (a GitHub user) maintains it in giuseppe-trisciuoglio/developer-kit, which has 355 GitHub stars. The repository holds 117 skills in this directory. The repository was last updated on September 10, 2026.

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