react-patterns

react-patterns is a skill for Claude Code, Codex from nth5693/gemini-kit. It costs 0 tokens per session (474 once invoked), scanned A, original, MIT.

Practical guidance for organising React applications, a JavaScript library for building user interfaces. It covers components, hooks, state management, and performance techniques.

In plain words
What is it for?
Use it when designing React components, writing custom hooks, choosing a state-management approach, and reducing unnecessary rendering with memoisation.
Why use it?
It helps developers choose clear ways to compose interface parts and manage changing data. It also explains where local, shared, server, and global state can fit.

Skill for Claude CodeCodex

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

Good fit Use it when designing React components, writing custom hooks, choosing a state-management approach, and reducing unnecessary rendering with memoisation.

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

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/nth5693/gemini-kit/react-patterns/github.svg)](https://agentmods.dev/skills/nth5693/gemini-kit/react-patterns)
Your own site
<a href="https://agentmods.dev/skills/nth5693/gemini-kit/react-patterns"><img src="https://agentmods.dev/badge/skills/nth5693/gemini-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/nth5693/gemini-kit/react-patterns"><img src="https://agentmods.dev/badge/skills/nth5693/gemini-kit/react-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 474 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.00000 $0.00474
Opus 5.5 $0.00000 $0.00190
Sonnet 5.5 $0.00000 $0.00095
Haiku 4.5 $0.00000 $0.00047

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

What it actually says

React Patterns Skill

Overview

Modern React patterns, hooks, and state management principles.

Core Principles

1. Component Composition

  • Prefer composition over inheritance
  • Use children prop for flexibility
  • Create compound components for related UI

2. Hooks Best Practices

// Custom hook pattern
function useUser(userId: string) {
  const [user, setUser] = useState<User | null>(null);
  const [loading, setLoading] = useState(true);
  const [error, setError] = useState<Error | null>(null);

  useEffect(() => {
    fetchUser(userId)
      .then(setUser)
      .catch(setError)
      .finally(() => setLoading(false));
  }, [userId]);

  return { user, loading, error };
}

3. State Management

  • Local state: useState for component-level
  • Shared state: Context + useReducer
  • Server state: React Query, SWR
  • Global state: Zustand, Jotai

4. Performance Patterns

// Memoization
const MemoizedComponent = React.memo(({ data }) => {
  return <div>{data.name}</div>;
});

// useMemo for expensive computations
const sortedItems = useMemo(() => {
  return items.sort((a, b) => a.name.localeCompare(b.name));
}, [items]);

// useCallback for stable references
const handleClick = useCallback(() => {
  doSomething(id);
}, [id]);

5. Error Boundaries

class ErrorBoundary extends React.Component {
  state = { hasError: false };

  static getDerivedStateFromError(error) {
    return { hasError: true };
  }

  componentDidCatch(error, errorInfo) {
    logError(error, errorInfo);
  }

  render() {
    if (this.state.hasError) {
      return <FallbackUI />;
    }
    return this.props.children;
  }
}

Anti-Patterns to Avoid

  • ❌ Prop drilling (use Context instead)
  • ❌ Mutating state directly
  • ❌ Missing dependency arrays
  • ❌ Over-using useEffect
  • ❌ Inline function definitions in render
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 · 84 lines · 0 tokens per session scan A 1ea58787a6b7

Subscribe to this mod's changes

react-patterns is a skill published in the GitHub repository nth5693/gemini-kit (372 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 474 tokens. 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

vercel-react-view-transitions

Guide for implementing smooth, native-feeling animations using React's View Transition API ( component, addTransitionType, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter/exit of components…

fcakyon/claude-codex-settings · 127 tokens

vercel-react-native-skills

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

fcakyon/claude-codex-settings · 57 tokens

lov-install-tanstack-query

Initialize or refactor a frontend project to use TanStack Query as the unified server-state layer. Use when the user asks to install TanStack Query, initialize query infrastructure, migrate ad hoc fetch/invoke/useEffect request state, standardize query keys, or make app network requests share one cache model. Also…

lovstudio/skills · 110 tokens

lov-kill-emoji

A UI cleanup tool that replaces unsuitable emoji in visible interface elements with matching icons or short text. It checks the surrounding meaning before changing anything.

lovstudio/skills · 48 tokens

lov-video-chapter-design

Refine chapter boundaries, titles, colors, typography, placement, and progress behavior in the bundled React video chapter editor. Use when the user wants to preview, debug, beautify, or customize a video chapter progress bar.

lovstudio/skills · 51 tokens

vercel-composition-patterns

React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.

fcakyon/claude-codex-settings · 58 tokens