react-patterns

react-patterns is a skill for Claude Code from komluk/scaffolding. It costs 51 tokens per session (1,374 once invoked), scanned A, original, MIT.

A set of standards for building and reviewing React user-interface components and hooks with TypeScript. React is a JavaScript library for creating interfaces, while TypeScript adds type checking to JavaScript.

In plain words
What is it for?
Use it when creating React components or custom hooks, choosing between local and shared state, improving performance, or reviewing React code.
Why use it?
It gives components a consistent structure and helps avoid unclear responsibilities, unsafe props, misplaced hooks, and unsuitable state choices.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the scaffolding plugin — 39 skills, 9 commands, 13 agents shipped together

Good fit Use it when creating React components or custom hooks, choosing between local and shared state, improving performance, or reviewing React code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/komluk/scaffolding/react-patterns
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.

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

Made for: Claude Code.

Or install scaffolding, the plugin that ships this one along with the rest of its 39 skills, 9 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/komluk/scaffolding/react-patterns/github.svg)](https://agentmods.dev/skills/komluk/scaffolding/react-patterns)
Your own site
<a href="https://agentmods.dev/skills/komluk/scaffolding/react-patterns"><img src="https://agentmods.dev/badge/skills/komluk/scaffolding/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/komluk/scaffolding/react-patterns"><img src="https://agentmods.dev/badge/skills/komluk/scaffolding/react-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,374 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.
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.00051 $0.01374
Opus 5.5 $0.00020 $0.00550
Sonnet 5.5 $0.00010 $0.00275
Haiku 4.5 $0.00005 $0.00137

Measured 1mo ago against content hash 3eb94133981e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

skills/react-patterns/SKILL.md · 197 lines

How it starts

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

React Patterns Skill

React + TypeScript standards and best practices.

When to Apply

  • Creating new React components
  • Implementing custom hooks
  • State management decisions
  • Performance optimization
  • Code review for React code

Component Standards

Component Structure Rules

Rule Description
Functional only Use function components, no class components
TypeScript props Define Props interface for all components
Single responsibility One component = one purpose
Max 200 lines Split larger components into sub-components

Component Organization

Section Order
1. Imports Types first, then libraries, then local
2. Props interface Define before component
3. Hooks All hooks at top of function
4. Handlers Event handlers after hooks
5. Effects useEffect after handlers
6. Return JSX at the end

Hook Standards

Built-in Hooks Usage

Hook Use When Avoid When
useState Local component state Shared state (use Zustand)
useEffect Side effects, subscriptions Derived state (use useMemo)
useMemo Expensive calculations Simple values
useCallback Callbacks passed to children Inline handlers
useRef DOM refs, mutable values State that triggers renders

Custom Hook Guidelines

Guideline Description
Prefix with use useFeatureName, useDataFetching
Return object { data, loading, error }
Single responsibility One hook = one purpose
Reusable Extract when logic repeats 2+ times

TypeScript Requirements

Type Import Rules

Rule Example
Use import type import type { Props } from './types'
Use export type export type { ButtonProps }
Centralize types All types in types/index.ts
No any Use unknown or proper types

Props Typing Standards

Standard Description
Interface for props interface Props { ... }
Optional with ? title?: string
Children explicit children: React.ReactNode
Events typed onClick: (e: React.MouseEvent) => void

Read the full file on GitHub · 197 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. 1mo ago First seen · 197 lines · 51 tokens per session scan A 3eb94133981e

Subscribe to this mod's changes

react-patterns is a skill published in the GitHub repository komluk/scaffolding (15 stars, last pushed yesterday), licensed MIT. It adds 51 tokens to every session and 1,374 once invoked, about $0.0002 per session on Opus 5.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-08-30.

Related

Other skills, from other repositories

frontend-ai-guide

Applies React/TypeScript-specific technical decision criteria, anti-pattern detection, debugging, and frontend quality gates. Use when reviewing components, hooks, browser behavior, or frontend implementation completeness.

shinpr/claude-code-workflows · 41 tokens

typescript-rules

React/TypeScript frontend development rules including type safety, component design, state management, and error handling. Use when implementing React components, TypeScript code, or frontend features.

shinpr/claude-code-workflows · 39 tokens

tanstack-form-composition

Migrate a React @tanstack/react-form codebase from the prop-drilled useForm + erased-form-type pattern to the official createFormHook composition API (useAppForm / withForm / field.X). Use when a project threads a form object (often cast to an any-erased type like ReactFormExtendedApi ) through field-wrapper…

suxrobGM/jobpilot · 158 tokens

react-frontend

React, TypeScript, and Next.js patterns for frontend development. Use when building React components, managing state, fetching data, optimizing performance, or working with Next.js App Router. Covers React 18-19, hooks, Server Components, and type-safe patterns.

iliaal/whetstone · 57 tokens

async-state-type

Avoid contradictory state types for async data fetching. Use Suspense or discriminated unions instead. Use when writing or reviewing async data fetching code in React/TypeScript.

ncaq/konoka · 37 tokens

stitch-nextjs-components

Converts a Stitch screen, a local HTML file, or a URL into production-ready Next.js 15 App Router components — Server vs Client split, dark mode via CSS variables, TypeScript strict, ARIA, and responsive mobile-first layout. Only the Stitch route needs an API key.

gabelul/stitch-kit · 64 tokens