react-patterns

react-patterns is a skill for Claude Code from jezweb/claude-skills. It costs 110 tokens per session (2,304 once invoked), scanned A, original, MIT.

A collection of patterns for building React 19 interfaces with Vite and Cloudflare, focused on faster loading, fewer unnecessary updates, and reusable component structure.

In plain words
What is it for?
Use it when writing, reviewing, or refactoring React components and investigating performance problems.
Why use it?
It helps prevent slow pages caused by waiting for independent data requests, oversized bundles, or excessive re-rendering.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the frontend plugin — 9 skills, 7 commands shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/jezweb/claude-skills/react-patterns
Any agent
npx skills add jezweb/claude-skills --skill react-patterns
Clone the repo
git clone --depth 1 https://github.com/jezweb/claude-skills

Made for: Claude Code.

Or install frontend, the plugin that ships this one along with the rest of its 9 skills, 7 commands.

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/jezweb/claude-skills/react-patterns.svg)](https://agentmods.dev/skills/jezweb/claude-skills/react-patterns)
Your own site
<a href="https://agentmods.dev/skills/jezweb/claude-skills/react-patterns"><img src="https://agentmods.dev/badge/skills/jezweb/claude-skills/react-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 110 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,304 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00110 $0.02304
Opus 5 $0.00055 $0.01152
Sonnet 5 $0.00022 $0.00461
Haiku 4.5 $0.00011 $0.00230

Measured 3d ago against content hash 248d46037c16, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 3d ago.

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/frontend/skills/react-patterns/SKILL.md · 141 lines

How it starts

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

React Patterns

Performance and composition patterns for React 19 + Vite + Cloudflare Workers projects. Use as a checklist when writing new components, a review guide when auditing existing code, or a refactoring playbook when something feels slow or tangled.

Rules are ranked by impact. Fix CRITICAL issues before touching MEDIUM ones.

When to Apply

  • Writing new React components or pages
  • Reviewing code for performance issues
  • Refactoring components with too many props or re-renders
  • Debugging "why is this slow?" or "why does this re-render?"
  • Building reusable component libraries
  • Code review before merging

1. Eliminating Waterfalls (CRITICAL)

Sequential async calls where they could be parallel. The #1 performance killer.

Pattern Problem Fix
Await in sequence const a = await getA(); const b = await getB(); const [a, b] = await Promise.all([getA(), getB()]);
Fetch in child Parent renders, then child fetches, then grandchild fetches Hoist fetches to the highest common ancestor, pass data down
Suspense cascade Multiple Suspense boundaries that resolve sequentially One Suspense boundary wrapping all async siblings
Await before branch const data = await fetch(); if (condition) { use(data); } Move await inside the branch — don't fetch what you might not use
Import then render const Component = await import('./Heavy'); return <Component /> Use React.lazy() + <Suspense> — renders fallback instantly

How to find them: Search for await in components. Each await is a potential waterfall. If two awaits are independent, they should be parallel.

2. Bundle Size (CRITICAL)

Every KB the user downloads is a KB they wait for.

Pattern Problem Fix
Barrel imports import { Button } from '@/components' pulls the entire barrel file import { Button } from '@/components/ui/button' — direct import
No code splitting Heavy component loaded on every page React.lazy(() => import('./HeavyComponent')) + <Suspense>
Third-party at load Analytics/tracking loaded before the app renders Load after hydration: useEffect(() => { import('./analytics') }, [])
Full library import import _ from 'lodash' (70KB) import debounce from 'lodash/debounce' (1KB)
Lucide tree-shaking import * as Icons from 'lucide-react' (all icons) Explicit map: import { Home, Settings } from 'lucide-react'
Duplicate React Library bundles its own React → "Cannot read properties of null" resolve.dedupe: ['react', 'react-dom'] in vite.config.ts

Read the full file on GitHub · 141 lines

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. 3d ago First seen · 141 lines · 110 tokens per session scan A 248d46037c16

Subscribe to this mod's changes

react-patterns is a skill published in the GitHub repository jezweb/claude-skills (995 stars, last pushed 2mo ago), licensed MIT. It adds 110 tokens to every session and 2,304 once invoked, about $0.0006 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-03.

Related

Other skills, from other repositories

frontend-code-review

Trigger when the user requests a review of frontend files (e.g., .tsx, .ts, .js). Support both pending-change reviews and focused file reviews while applying the checklist rules.

sangrokjung/claude-forge · 42 tokens

generic-react-code-reviewer

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…

travisjneuman/.claude · 71 tokens

react-senior-code-review

Senior-level review of a React feature, by theSeniorDev — structure & boundaries, state & data flow, performance & rendering, types/forms/testability/a11y, and styling architecture & motion. Recommends design patterns by name when one fits. Produces prioritized findings (Critical → Nit) with file:line, why, and a…

the-senior-dev/senior-dev-skills · 127 tokens

frontend

Builds, styles, and polishes web UI and UX. Use for any frontend, page, component, styling, layout, animation, or visual-quality task, or when asked to make an interface look or feel a certain way.

code-yeongyu/oh-my-openagent · 49 tokens

animation-patterns

Framer Motion patterns, page transitions, skeleton loading, scroll-linked animations, and gesture-based interactions for React.

vibeeval/vibecosystem · 26 tokens

review-implementing

Process and implement code review feedback systematically. Use when user provides reviewer comments, PR feedback, code review notes, or asks to implement suggestions from reviews.

mhattingpete/claude-skills-marketplace · 35 tokens