react-patterns

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

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/shahtuyakov/claude-setup/react-patterns
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.

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. 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 $0.00052 $0.00804
Opus 5 $0.00026 $0.00402
Sonnet 5 $0.00010 $0.00161
Haiku 4.5 $0.00005 $0.00080

Measured 2d ago against content hash db118cdcbe40, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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. 2d 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 8mo ago), licensed MIT. It adds 52 tokens to every session and 804 once invoked, about $0.0003 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-08-30.

Related

Other skills, from other repositories

frontend

React / Next.js UI, state, accessibility.

sipyourdrink-ltd/bernstein · 12 tokens

database-engineer

SQLite database expertise for migrations, multi-tenant patterns, transactional safety, FTS5 virtual tables, and schema evolution. Use this skill for ANY work involving schema changes, data migrations, INSERT/UPSERT semantics, FTS5 rebuilds, transaction rollback design, multi-tenant data isolation, or SQLite…

Vinix24/vnx-orchestration · 121 tokens

intelligence-engineer

VNX-specific domain expertise for the intelligence system, central state databases, and dispatch lifecycle. Use when working on qualityintelligence.db / runtimecoordination.db / dispatchtracker.db, codesnippets FTS5, snippetmetadata linkage, successpatterns / antipatterns, T0 state projection (t0state.json)…

Vinix24/vnx-orchestration · 175 tokens

fabric-reference

Read-only runbook for how the VNX fabric actually works — state resolution, the single-entry dispatch door, gate invocation, the horizon planning layer, the plan-gate panel, and the hard gotchas that repeatedly bite (PATH-break, dual-CLI, codex-cert, classifier-protected actions). Use when you need to look up a fabric…

Vinix24/vnx-orchestration · 116 tokens

featureplan-kickoff

VNX feature-execution kickoff preflight. USE THIS when starting or resuming a feature or track from its plan: checking worktree/queue/staging health, finding the first promoteable dispatch, and handing off to @t0-orchestrator. Reads the feature's track + plan doc from Horizon's tracks DB (vnx horizon, alias vnx…

Vinix24/vnx-orchestration · 99 tokens

monitoring-specialist

System monitoring, alerting, and observability implementation.

Vinix24/vnx-orchestration · 15 tokens