Borrowing it
Nothing to install: this file belongs to Piyush8296/claude-workspace. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Piyush8296/claude-workspace/main/.claude/skills/react-patterns/SKILL.mdgit clone --depth 1 https://github.com/Piyush8296/claude-workspaceWrote 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.
[](https://agentmods.dev/skills/piyush8296/claude-workspace/react-patterns)<a href="https://agentmods.dev/skills/piyush8296/claude-workspace/react-patterns"><img src="https://agentmods.dev/badge/skills/piyush8296/claude-workspace/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.
<a href="https://agentmods.dev/skills/piyush8296/claude-workspace/react-patterns"><img src="https://agentmods.dev/badge/skills/piyush8296/claude-workspace/react-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00034 | $0.01801 |
| Opus 5.5 | $0.00014 | $0.00720 |
| Sonnet 5.5 | $0.00007 | $0.00360 |
| Haiku 4.5 | $0.00003 | $0.00180 |
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.
How it starts
The opening of the file, as written. The whole thing — 269 lines — stays where its author put it; the contents beside it link to each section on GitHub.
React Patterns
Component Architecture
File Structure (Co-location)
src/components/UserCard/
UserCard.tsx # Component implementation
UserCard.test.tsx # Tests
UserCard.stories.tsx # Storybook (optional)
index.ts # Barrel export
Component Template
import { type ReactNode } from 'react';
interface UserCardProps {
/** User's display name */
name: string;
/** Optional avatar URL */
avatarUrl?: string;
/** Slot for action buttons */
actions?: ReactNode;
}
export function UserCard({ name, avatarUrl, actions }: UserCardProps) {
return (
<article className="flex items-center gap-4 rounded-lg border p-4">
<img
src={avatarUrl ?? '/default-avatar.png'}
alt={`${name}'s avatar`}
className="h-12 w-12 rounded-full object-cover"
/>
<div className="flex-1 min-w-0">
<h3 className="truncate font-medium">{name}</h3>
</div>
{actions && <div className="flex gap-2">{actions}</div>}
</article>
);
}
Conventions:
- Named export, never default
- Props interface in same file with JSDoc
- Semantic HTML (
<article>,<h3>, not<div>) - Composition via slot props (
actions,children,header) - Defensive defaults for optional props
Component Size Limits
- Max 250 lines per component file
- Max 50 lines per function
- If exceeding, extract sub-components or custom hooks
State Handling Order (Golden Rule)
Every component that fetches data MUST handle states in this exact order:
function UserList() {
const { data, isPending, error, refetch } = useUsers();
// 1. Error FIRST
if (error) {
return <ErrorState error={error} onRetry={refetch} />;
}
// 2. Loading ONLY when no data
if (isPending && !data) {
return <UserListSkeleton />;
}
// 3. Empty state
if (!data?.length) {
return (
<EmptyState
icon="users"
title="No users yet"
description="Invite your first team member"
action={{ label: 'Invite', onClick: openInviteModal }}
/>
);
}
// 4. Success
return (
<ul role="list" className="divide-y">
{data.map((user) => (
<li key={user.id}>
<UserCard user={user} />
</li>
))}
</ul>
);
}
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.
- 1mo ago First seen · 269 lines · 34 tokens per session scan A aba8fec04445
react-patterns is a skill published in the GitHub repository Piyush8296/claude-workspace (2 stars, last pushed 6mo ago), licensed MIT. It adds 34 tokens to every session and 1,801 once invoked, about $0.0001 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-31.
Other skills, from other repositories
generic-react-feature-developer
Guide feature development for React applications with architecture focus. Covers Zustand/Redux patterns, IndexedDB usage, component systems, lazy loading strategies, and seamless integration. Use when adding new features, refactoring existing code, or planning major changes.
generic-react-ux-designer
Professional UI/UX design expertise for React applications. Covers design thinking, user psychology (Hick's/Fitts's/Jakob's Law), visual hierarchy, interaction patterns, accessibility, performance-driven design, and design critique. Use when designing features, improving UX, solving user problems, or conducting design…
generic-react-design-system
Complete design system reference for React applications. Covers colors, typography, spacing, component patterns, glassmorphism effects, GPU-accelerated animations, and WCAG AA accessibility. Use when implementing UI, choosing colors, applying spacing, creating components, or ensuring brand consistency.
generic-react-code-reviewer
Review React/TypeScript code for bugs, security vulnerabilities, performance issues, accessibility gaps, and CLAUDE.md workflow compliance. Enforces TypeScript strict mode, GPU-accelerated animations, WCAG AA accessibility, bundle size limits, and surgical simplicity. Use when completing features, before commits, or…
react-ops
React development patterns, hooks, state management, Server Components, and performance optimization. Use for: react, hooks, useState, useEffect, jsx, tsx, server components, RSC, zustand, react query, component patterns, react testing library, error boundary, suspense, react 19.
nextjs-expert
Comprehensive Next.js expertise across App Router, server/client boundaries, data and caching patterns, and production operations. Use when building, debugging, or optimizing a Next.js app, deciding server vs client components, or resolving App Router gotchas.