react-patterns

react-patterns is a skill for Claude Code, Codex from shahtuyakov/claude-setup. It costs 52 tokens per session (804 once invoked), scanned A, original, MIT.

A set of guidance for building web interfaces with React and Next.js using TypeScript. React is a JavaScript library for user interfaces, while Next.js adds features for complete web applications.

In plain words
What is it for?
It covers project structure, components, state management, data fetching, forms, client-side authentication, and choosing between Next.js and Vite-based React projects.
Why use it?
It helps organize interface code and make consistent choices for pages, reusable components, data loading, forms, application state, and sign-in features.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It covers project structure, components, state management, data fetching, forms, client-side authentication, and choosing between Next.js and Vite-based React projects.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shahtuyakov/claude-setup/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 shahtuyakov/claude-setup --skill react-patterns
Clone the repo
git clone --depth 1 https://github.com/shahtuyakov/claude-setup

Made for: Claude Code, Codex.

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/shahtuyakov/claude-setup/react-patterns/github.svg)](https://agentmods.dev/skills/shahtuyakov/claude-setup/react-patterns)
Your own site
<a href="https://agentmods.dev/skills/shahtuyakov/claude-setup/react-patterns"><img src="https://agentmods.dev/badge/skills/shahtuyakov/claude-setup/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/shahtuyakov/claude-setup/react-patterns"><img src="https://agentmods.dev/badge/skills/shahtuyakov/claude-setup/react-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 804 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.00052 $0.00804
Opus 5.5 $0.00021 $0.00322
Sonnet 5.5 $0.00010 $0.00161
Haiku 4.5 $0.00005 $0.00080

Measured 1mo ago against content hash db118cdcbe40, 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 · 119 lines

How it starts

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

React Patterns

Modern React and Next.js patterns with TypeScript.

Framework Selection

Setup Best For Use When
Next.js App Router Full-stack, SSR/SSG SEO matters, need server components
Next.js Pages Router Simpler SSR Legacy project, simpler mental model
Vite + React SPA, client-only No SSR needed, fastest dev experience
Create React App Legacy Avoid for new projects

Reference Files

Topic Load Use When
Project structure references/project-structure.md Setting up or organizing code
Components references/components.md Building UI components
State management references/state-management.md Managing app/component state
Data fetching references/data-fetching.md API calls, server data
Forms references/forms.md Form handling and validation
Auth (client) references/auth-client.md Client-side authentication

Quick Start Patterns

Next.js App Router Page

// app/users/page.tsx
import { getUsers } from '@/lib/api';
import { UserList } from '@/components/users/UserList';

export default async function UsersPage() {
  const users = await getUsers();

  return (
    <main className="container mx-auto py-8">
      <h1 className="text-2xl font-bold mb-6">Users</h1>
      <UserList users={users} />
    </main>
  );
}

Client Component

'use client';

import { useState } from 'react';

interface CounterProps {
  initialCount?: number;
}

export function Counter({ initialCount = 0 }: CounterProps) {
  const [count, setCount] = useState(initialCount);

  return (
    <button onClick={() => setCount(c => c + 1)}>
      Count: {count}
    </button>
  );
}

API Route (App Router)

// app/api/users/route.ts
import { NextResponse } from 'next/server';

export async function GET() {
  const users = await db.user.findMany();
  return NextResponse.json(users);
}

export async function POST(request: Request) {
  const body = await request.json();
  const user = await db.user.create({ data: body });
  return NextResponse.json(user, { status: 201 });
}

Read the full file on GitHub · 119 lines

Files

What ships with it

6 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. 1mo ago First seen · 119 lines · 52 tokens per session scan A db118cdcbe40

Subscribe to this mod's changes

react-patterns is a skill published in the GitHub repository shahtuyakov/claude-setup (13 stars, last pushed 9mo ago), licensed MIT. It adds 52 tokens to every session and 804 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

prism-component

Implement a reusable, accessible, typed component from a design spec. Use when asked to "create a component", "build a widget", "implement this design", or "reusable UI element".

tonone-ai/tonone · 43 tokens

skill-extract

Reverse-engineer design systems, tokens, and components from live products or screenshots.

nyldn/claude-octopus · 19 tokens

react-expert

Use when working in a React 19 / Next.js 15 codebase - .tsx/.jsx files, next.config.ts, app/ router directories, "use client"/"use server" directives, package.json with react or next dependencies. Builds and refactors Server/Client Components, server actions and forms, Suspense/streaming UIs, and TanStack Query or…

Aarvion-AI/stackwise-skills · 134 tokens

remix-expert

Use when working in a React Router 7 / Remix v2 framework-mode codebase with app/routes, loaders and actions, react-router.config.ts, useLoaderData / useActionData, Form, useNavigation, Outlet, or ErrorBoundary. Builds and refactors route modules, server data loading, mutations, pending UI, nested routing, and…

Aarvion-AI/stackwise-skills · 109 tokens

senior-frontend

Frontend development skill for React, Next.js, TypeScript, and Tailwind CSS applications. Use when building React components, optimizing Next.js performance, analyzing bundle sizes, scaffolding frontend projects, implementing accessibility, or reviewing frontend code quality.

composio-community/awesome-claude-plugins · 52 tokens

artifacts-builder

Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.

composio-community/awesome-claude-plugins · 63 tokens