React Component Patterns

React Component Patterns is a skill for Claude Code, Codex from AmariahAK/atlarix-skills. It costs 3 tokens per session (1,354 once invoked), scanned A, original, Apache-2.0.

A set of guidelines for building React user-interface components. React is a JavaScript library for creating interactive screens; these guidelines cover component structure, types, composition, state, and performance.

In plain words
What is it for?
Use it when creating or refactoring React components in a production application.
Why use it?
It helps avoid components with unclear inputs, unnecessary abstractions, and inconsistent ways of managing data and behavior.

Skill for Claude CodeCodex

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

Good fit Use it when creating or refactoring React components in a production application.

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

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 Component Patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/amariahak/atlarix-skills/react.svg)](https://agentmods.dev/skills/amariahak/atlarix-skills/react)
Your own site
<a href="https://agentmods.dev/skills/amariahak/atlarix-skills/react"><img src="https://agentmods.dev/badge/skills/amariahak/atlarix-skills/react.svg" alt="Measured on agentmods" height="20"></a>
Per session 3 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,354 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.00003 $0.01354
Opus 5 $0.00002 $0.00677
Sonnet 5 $0.00001 $0.00271
Haiku 4.5 $0.00000 $0.00135

Measured 4d ago against content hash f5457ed20215, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

React Component 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 4d 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/SKILL.md · 174 lines

How it starts

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

React Component Patterns

When to use this skill

Use this skill when you’re building or refactoring React components in a production app and want consistent patterns for typing, composition, state, and performance without introducing premature abstraction.

Core patterns

Functional components only

  • Prefer function components with named exports.
  • Keep props explicit and stable (avoid ...rest unless you’re building a wrapper that truly forwards).

Example:

export interface ButtonProps {
  variant?: "primary" | "secondary";
  disabled?: boolean;
  onClick?: () => void;
  children: React.ReactNode;
}

export function Button({ variant = "primary", disabled, onClick, children }: ButtonProps) {
  return (
    <button data-variant={variant} disabled={disabled} onClick={onClick}>
      {children}
    </button>
  );
}

Prop typing with interfaces (and when to use type)

  • Use interface for public component props (extends well, readable in IDEs).
  • Use type for unions, helpers, and composition.
  • Prefer narrow props over “god props”.

Patterns:

  • interface XProps { ... }
  • type Variant = "a" | "b"
  • type Props = XProps & { ... } when combining.

Controlled inputs (default for forms)

Controlled inputs make state explicit and testable.

Pattern:

  • Keep the source of truth in parent.
  • Child receives value + onChange(next).
export interface TextFieldProps {
  value: string;
  onChange: (next: string) => void;
  label?: string;
}

export function TextField({ value, onChange, label }: TextFieldProps) {
  return (
    <label>
      {label}
      <input value={value} onChange={(e) => onChange(e.target.value)} />
    </label>
  );
}

Component file structure (predictable + scalable)

For components/Foo/:

  • Foo.tsx (component)
  • Foo.test.tsx (tests)
  • Foo.stories.tsx (storybook if used)
  • types.ts (shared types) only if it grows

Avoid:

  • gigantic index.ts barrels that hide imports
  • “utils.ts dumping ground”

Read the full file on GitHub · 174 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. 4d ago First seen · 174 lines · 3 tokens per session scan A f5457ed20215

Subscribe to this mod's changes

React Component Patterns is a skill published in the GitHub repository AmariahAK/atlarix-skills (2 stars, last pushed yesterday), licensed Apache-2.0. It adds 3 tokens to every session and 1,354 once invoked, about $0.0000 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

react-hooks-composition

Advanced React hooks composition patterns - SWR integration, debounced search, memoized contexts, state machines, and performance optimization.

bobmatnyc/claude-mpm-skills · 29 tokens

react-development

Comprehensive React development with hooks, components, state management, context, effects, and performance optimization based on official React documentation.

manutej/luxor-claude-marketplace · 27 tokens

magic-ui

Use this skill when users want to add, customize, or troubleshoot Magic UI components in React/Next.js projects. It covers component selection, shadcn registry installation (@magicui/), integration patterns, and practical quality checks for accessibility and maintainability.

magicuidesign/magicui · 56 tokens

react-hooks-best-practices

Provides React patterns for hooks, effects, refs, and component design. Covers escape hatches, anti-patterns, and correct effect usage. Use when reading or writing React components with hooks or effects.

majiayu000/spellbook · 47 tokens

react-best-practices

React and Next.js performance playbook distilled from Vercel Engineering guidance. Use when building, reviewing, or refactoring React/Next.js code for waterfalls, bundle size, rendering cost, and client/server data flow.

majiayu000/spellbook · 50 tokens

webmcp-add-tool

Scaffolds a new WebMCP tool component using useMcpTool with Zod schema, handler, annotations, and wires it into the WebMCPProvider tree. Use when the user wants to expose functionality as an MCP tool, make something callable by AI, add a new tool, or create an AI-accessible action.

agentcathq/webmcp-react · 73 tokens