component-patterns

component-patterns is a skill for Claude Code from armanzeroeight/fastagent-plugins. It costs 41 tokens per session (2,947 once invoked), scanned A, original, MIT.

A guide to structuring reusable React components, including ways to share behavior and compose smaller components into flexible interfaces.

In plain words
What is it for?
Use it when building or refactoring React components and choosing between composition, custom hooks, render props, higher-order components, and compound components.
Why use it?
It helps avoid components that are difficult to reuse, extend, or maintain as an application grows.

Skill for Claude Code

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

Part of the react-toolkit plugin — 2 skills shipped together

Good fit Use it when building or refactoring React components and choosing between composition, custom hooks, render props, higher-order components, and compound components.

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

Made for: Claude Code.

Or install react-toolkit, the plugin that ships this one along with the rest of its 2 skills.

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 component-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/armanzeroeight/fastagent-plugins/component-patterns/github.svg)](https://agentmods.dev/skills/armanzeroeight/fastagent-plugins/component-patterns)
Your own site
<a href="https://agentmods.dev/skills/armanzeroeight/fastagent-plugins/component-patterns"><img src="https://agentmods.dev/badge/skills/armanzeroeight/fastagent-plugins/component-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 component-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/armanzeroeight/fastagent-plugins/component-patterns"><img src="https://agentmods.dev/badge/skills/armanzeroeight/fastagent-plugins/component-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,947 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00041 $0.02947
Opus 5.5 $0.00016 $0.01179
Sonnet 5.5 $0.00008 $0.00589
Haiku 4.5 $0.00004 $0.00295

Measured 1mo ago against content hash e36d8dfa6d60, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

component-patterns scanned grade A with 1 finding 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

fetch(url)
plugins/react-toolkit/skills/component-patterns/SKILL.md · 524 lines

How it starts

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

Component Patterns

Implement React component patterns for building reusable, maintainable components.

Quick Start

Use composition for most cases, custom hooks for shared logic, and compound components for flexible APIs.

Instructions

Composition Pattern

The default pattern for building flexible components.

Basic composition:

function Card({ children }) {
  return <div className="card">{children}</div>;
}

function CardHeader({ children }) {
  return <div className="card-header">{children}</div>;
}

function CardBody({ children }) {
  return <div className="card-body">{children}</div>;
}

// Usage
<Card>
  <CardHeader>Title</CardHeader>
  <CardBody>Content</CardBody>
</Card>

With props:

interface ButtonProps {
  variant?: 'primary' | 'secondary';
  size?: 'sm' | 'md' | 'lg';
  children: React.ReactNode;
}

function Button({ variant = 'primary', size = 'md', children }: ButtonProps) {
  return (
    <button className={`btn btn-${variant} btn-${size}`}>
      {children}
    </button>
  );
}

Custom Hooks Pattern

Extract and reuse stateful logic across components.

Basic custom hook:

function useToggle(initialValue = false) {
  const [value, setValue] = useState(initialValue);
  
  const toggle = useCallback(() => {
    setValue(v => !v);
  }, []);
  
  return [value, toggle] as const;
}

// Usage
function Component() {
  const [isOpen, toggleOpen] = useToggle();
  return <button onClick={toggleOpen}>{isOpen ? 'Close' : 'Open'}</button>;
}

Data fetching hook:

function useFetch<T>(url: string) {
  const [data, setData] = useState<T | null>(null);
  const [loading, setLoading] = useState(true);
  const [error, setError] = useState<Error | null>(null);
  
  useEffect(() => {
    fetch(url)
      .then(res => res.json())
      .then(setData)
      .catch(setError)
      .finally(() => setLoading(false));
  }, [url]);
  
  return { data, loading, error };
}

Form hook:

function useForm<T>(initialValues: T) {
  const [values, setValues] = useState(initialValues);
  
  const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
    setValues(prev => ({
      ...prev,
      [e.target.name]: e.target.value
    }));
  };
  
  const reset = () => setValues(initialValues);
  
  return { values, handleChange, reset };
}

Read the full file on GitHub · 524 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 · 524 lines · 41 tokens per session scan A e36d8dfa6d60

Subscribe to this mod's changes

component-patterns is a skill published in the GitHub repository armanzeroeight/fastagent-plugins (29 stars, last pushed 3mo ago), licensed MIT. It adds 41 tokens to every session and 2,947 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). 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

implementing-command-palettes

Use when building Cmd+K command palettes in React - covers keyboard navigation with arrow keys, keeping selected items in view with scrollIntoView, filtering with shortcut matching, and preventing infinite re-renders from reference instability.

AgentWorkforce/relay · 48 tokens

agentos-ui-ux

Design, review, or implement AgentOS UI and UX work using the project’s operator-console visual system. Use for React/Tailwind pages, cards, dialogs, mobile layouts, theme work, navigation, forms, empty/loading/error states, and UI consistency reviews in AgentOS.

SapienXai/AgentOS · 62 tokens

ionic-react

Guides the agent through Ionic Framework development with React — project structure, React-specific Ionic components, IonReactRouter and navigation patterns, Ionic lifecycle hooks (useIonViewWillEnter, useIonViewDidEnter, useIonViewWillLeave, useIonViewDidLeave), state management integration, and React-specific best…

capawesome-team/skills · 132 tokens

capacitor-react

Guides the agent through Capacitor app development with React — project structure, hooks for native features, state management patterns, using Capacitor plugins in React components, and React-specific best practices. Do not use for Ionic Framework with React (use ionic-react), migrating or upgrading Capacitor apps or…

capawesome-team/skills · 70 tokens

rn-best-practices

This skill should be used when writing or reviewing React Native / Expo code — before writing list rendering, animations, data fetching, component APIs, navigation, or image/media UI — and when asked to "review best practices", "check performance", "optimize renders", "review list rendering", "check animation…

Lykhoyda/rn-dev-agent · 98 tokens

guizang-ppt-skill

A skill for creating presentation decks as single HTML files that users can move through horizontally in a browser. It provides templates with WebGL backgrounds, chapter title screens, large data displays, and image grids, in either an editorial or Swiss-style visual direction.

proma-ai/Proma · 161 tokens