react-patterns

react-patterns is a skill for Claude Code from giuseppe-trisciuoglio/developer-kit. It costs 87 tokens per session (2,269 once invoked), scanned A, original, MIT.

A pattern guide for modern React applications, including server components, server actions, forms, asynchronous updates, Suspense, and TypeScript. React is a library for building interactive user interfaces.

In plain words
What is it for?
Use it to build optimistic interfaces, validate forms, manage local or shared state, migrate class components, and handle asynchronous work.
Why use it?
It helps select suitable React features for state, loading, forms, and background updates while avoiding common implementation mistakes.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { createPost } from '../actions';.

Part of the developer-kit-typescript plugin — 25 skills, 3 commands, 13 agents shipped together

Good fit Use it to build optimistic interfaces, validate forms, manage local or shared state, migrate class components, and handle asynchronous work.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/giuseppe-trisciuoglio/developer-kit
agentmods
npx agentmods add skills/giuseppe-trisciuoglio/developer-kit/react-patterns

Made for: Claude Code.

Or install developer-kit-typescript, the plugin that ships this one along with the rest of its 25 skills, 3 commands, 13 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for react-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/giuseppe-trisciuoglio/developer-kit/react-patterns/github.svg)](https://agentmods.dev/skills/giuseppe-trisciuoglio/developer-kit/react-patterns)
Your own site
<a href="https://agentmods.dev/skills/giuseppe-trisciuoglio/developer-kit/react-patterns"><img src="https://agentmods.dev/badge/skills/giuseppe-trisciuoglio/developer-kit/react-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for react-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/giuseppe-trisciuoglio/developer-kit/react-patterns"><img src="https://agentmods.dev/badge/skills/giuseppe-trisciuoglio/developer-kit/react-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,269 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 26 Mar 2026
  • Snyk pass 26 Mar 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00087 $0.02269
Opus 5 $0.00044 $0.01135
Sonnet 5 $0.00017 $0.00454
Haiku 4.5 $0.00009 $0.00227

Measured today against content hash 4ed1d0462d12, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

react-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/developer-kit-typescript/skills/react-patterns/SKILL.md · 272 lines

How it starts

The opening of the file, as written. The whole thing — 272 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

Pattern Hook / API Use Case
Local state useState Simple component state
Complex state useReducer Multi-action state machines
Side effects useEffect Subscriptions, data fetching
Shared state useContext / createContext Cross-component data
DOM access useRef Focus, measurements, timers
Performance useMemo / useCallback Expensive computations
Non-urgent updates useTransition Search/filter on large lists
Defer expensive UI useDeferredValue Stale-while-updating
Read resources use() (React 19) Promises and context in render
Optimistic UI useOptimistic (React 19) Instant feedback on mutations
Form status useFormStatus (React 19) Pending state in child components
Form state useActionState (React 19) Server action results
Auto-memoization React Compiler Eliminates 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

Read the full file on GitHub · 272 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 272 lines · 87 tokens per session scan A 4ed1d0462d12

Subscribe to this mod's changes

react-patterns is a skill published in the GitHub repository giuseppe-trisciuoglio/developer-kit (343 stars, last pushed today), licensed MIT. It adds 87 tokens to every session and 2,269 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-10.

Related

Other skills, from other repositories

nextjs-on-cloudflare

Build, migrate, and deploy Next.js apps on Cloudflare Workers with vinext. Use when starting a Next.js project on Cloudflare, moving an existing app to Workers, choosing between vinext and OpenNext, or setting up vinext for Workers. For setup, migration, or deployment, install vinext's upstream skills with npx skills…

cloudflare/skills · 96 tokens

airflow-plugins

Builds Airflow 3.1+ plugins that embed FastAPI apps, custom UI pages, React components, middleware, macros, and operator links directly into the Airflow UI. Use when building anything custom inside Airflow 3.1+ that involves Python and a browser-facing interface - creating an Airflow plugin, adding a custom UI page or…

astronomer/agents · 147 tokens

loom-react

Modern client-side React development patterns.

cosmix/loom · 10 tokens

aksel-builder

Expert builder for Aksel, the Nav / @navikt design system — React components, design tokens, layout primitives, theming (light/dark), icons, CSS, the Tailwind preset, version migrations, Figma-to-code. Triggers — Aksel, "using/with aksel", Nav/Navikt, "designsystemet", "design system", @navikt/ds- (e.g.…

navikt/copilot · 181 tokens

deploy-to-vercel

Deploy a Next.js application to Vercel. Covers project linking, environment variables, preview deployments, custom domains, and production deployment configuration. Use when deploying a Next.js app for the first time, setting up preview deployments for pull requests, configuring custom domains, or managing environment…

pjt222/agent-almanac · 69 tokens

billing-sdk

Guide for building billing UI with BillingSDK - the open-source React component library for pricing tables, subscription management, usage meters, invoice history, and customer portal flows wired to Dodo Payments.

dodopayments/skills · 41 tokens