Agent skill

Component Patterns

by revfactory in revfactory/harness-100

React/Next.js component design pattern library. An agent skill from revfactory/harness-100.

Apache-2.0Auto-check passedFrontend & Design

Install Component Patterns

skills CLI
$ npx skills add revfactory/harness-100 --skill component-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install revfactory/harness-100 component-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/revfactory/harness-100.git skills-src && mkdir -p .claude/skills && cp -r skills-src/en/16-fullstack-webapp/.claude/skills/component-patterns .claude/skills/component-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
component-patterns
GitHub stars
1.3k
Token cost
~1.5k tokens
SKILL.md length
447 words
Files
1
Skills in repo
464
Repo updated
First seen
Licence
Apache-2.0

At a glance

React/Next.js component design pattern library. An agent skill from revfactory/harness-100.

  • Works in 6 steps: Compound Components → Render Props / Children as Function → Custom Hooks (Extraction Pattern) → …
  • Requests like component patterns
  • SKILL.md covers Target Agent, Component Design Patterns, State Management Strategy… and Next.js App Router Folder…, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Component Patterns is an agent skill from revfactory/harness-100. React/Next.js component design pattern library. Provides Compound/Render Props/HOC/Custom Hooks patterns, state management strategies (Zustand/React Query/Context), and folder structure conventions as a frontend-dev extension skill. Use for requests like 'component patterns', 'React patterns', 'state management', 'folder structure', 'Custom Hook', 'component separation', and other frontend architecture design tasks. However, actual code implementation or backend logic is outside this skill's scope.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Frontend & Design, covering State management, File organization and Design patterns. It works with Next.js, React, TanStack and Zustand. The licence is Apache-2.0.

When your agent uses it

  • Requests like component patterns
  • State management
  • Folder structure
  • Component separation

Example prompts

  • “component patterns”
  • “React patterns”
  • “state management”
  • “/component-patterns”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Compound Components
  2. Render Props / Children as Function
  3. Custom Hooks (Extraction Pattern)
  4. Container/Presentational Separation
  5. Higher-Order Component (HOC)
  6. Headless Component

What it can do on your machine

Read from SKILL.md and the folder at commit 8e8d35c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Component Patterns loads about 1.5k tokens when it runs. Until then it costs about 131 tokens; SKILL.md has 447 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~131
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from revfactory/harness-100 at commit 8e8d35c, republished under its Apache-2.0 licence (© revfactory). 447 words, ~1,521 tokens.

Download SKILL.mdSave it as .claude/skills/component-patterns/SKILL.md (or your agent's skills folder).
name
component-patterns
description
React/Next.js component design pattern library. Provides Compound/Render Props/HOC/Custom Hooks patterns, state management strategies (Zustand/React Query/Context), and folder structure conventions as a frontend-dev extension skill. Use for requests like 'component patterns', 'React patterns', 'state management', 'folder structure', 'Custom Hook', 'component separation', and other frontend architecture design tasks. However, actual code implementation or backend logic is outside this skill's scope.

Component Patterns — React/Next.js Component Design Patterns

A reference for component patterns, state management strategies, and project structure that the frontend-dev agent uses during frontend development.

Target Agent

frontend-dev — Applies this skill's patterns directly to component design and state management.

Component Design Patterns

1. Compound Components

A pattern where parent and child share implicit state.

Suited for: Tab, Accordion, Dropdown, Select, and other composite UI Structure: <Select> + <Select.Trigger> + <Select.Option> Key Concept: State sharing via Context, flexible composition through children

2. Render Props / Children as Function

Delegates rendering logic externally.

Suited for: Data fetching wrappers, mouse/scroll tracking Structure: <DataLoader render={(data) => <UI data={data} />} /> Note: Prefer Hook pattern when it can replace this

3. Custom Hooks (Extraction Pattern)

Extracts state logic into reusable Hooks.

Suited for: Form management, API calls, localStorage, debounce Naming: use prefix required — useForm, useDebounce, useAuth

4. Container/Presentational Separation

Separates data logic (Container) from UI presentation (Presentational).

Suited for: Large-scale apps, when testability is needed Container: Data fetch, state management, event handlers Presentational: Renders only from props, functionally pure

5. Higher-Order Component (HOC)

Wraps a component to add functionality.

Suited for: Auth guards, layout wrappers, error boundaries Naming: with prefix — withAuth, withLayout Note: Prefer Hook/Context when they can replace this

6. Headless Component

Provides behavior/state without UI.

Suited for: Sharing logic independent of design system Examples: headless useCombobox, useDialog, useTable

State Management Strategy Selection Guide

State TypeRecommended ToolRationale
UI Local StateuseState, useReducerComponent-internal
Server StateReact Query (TanStack Query)Caching, refetch, optimistic updates
Global Client StateZustandConcise, minimal boilerplate
Complex Global StateZustand + ImmerImmutability convenience
URL Statenuqs / useSearchParamsFilters, pagination
Form StateReact Hook Form + ZodIntegrated validation
Theme/LanguageContext + ProviderLow change frequency
Show full SKILL.md (168 more words)Show less
State Placement Decision Flow
Should this state be restorable from URL? → URL state
Is it server data? → React Query
Is it shared across multiple components? → Zustand
Is it internal to one component? → useState
Does it have complex transition logic? → useReducer

Next.js App Router Folder Structure

src/
├── app/                    # Next.js App Router
│   ├── (auth)/             # Auth-related route group
│   │   ├── login/page.tsx
│   │   └── register/page.tsx
│   ├── (main)/             # Main route group
│   │   ├── dashboard/page.tsx
│   │   └── settings/page.tsx
│   ├── api/                # API Routes
│   │   └── [...]/route.ts
│   ├── layout.tsx          # Root layout
│   └── page.tsx            # Home
├── components/
│   ├── ui/                 # General UI (Button, Input, Modal)
│   └── features/           # Feature-specific components
│       ├── auth/
│       └── dashboard/
├── hooks/                  # Custom Hooks
├── lib/                    # Utilities, config
│   ├── api.ts              # API client
│   ├── auth.ts             # Auth utilities
│   └── utils.ts
├── stores/                 # Zustand stores
├── types/                  # TypeScript types
└── styles/                 # Global styles

Component File Conventions

ItemRule
File NamePascalCase: UserProfile.tsx
Directorykebab-case: user-profile/
IndexRe-export via index.ts
TestUserProfile.test.tsx in same directory
StoryUserProfile.stories.tsx in same directory
TypesSame file or separate types.ts

Performance Optimization Patterns

PatternWhenTool
MemoizationExpensive computation, frequent re-rendersuseMemo, React.memo
Lazy LoadingInitial bundle sizeReact.lazy, next/dynamic
Virtualization1000+ item lists@tanstack/react-virtual
Image OptimizationImage loadingnext/image
Code SplittingPer-route splittingApp Router automatic
Optimistic UpdatesImmediate feedbackReact Query onMutate
DebounceSearch, inputuseDeferredValue or custom hook

Error Handling Patterns

Hierarchical Error Boundaries
RootErrorBoundary (global)
  └── LayoutErrorBoundary (per section)
      └── ComponentErrorFallback (individual)
API Error Handling
HTTP StatusClient Handling
401Auto logout + redirect
403Unauthorized UI
404Not Found page
422Per-field form error display
429Retry + wait notice
500Generic error UI + retry button

Accessibility (a11y) Checklist

  • Alt text on all images
  • Keyboard navigation (Tab, Enter, Escape)
  • ARIA labels (aria-label, role)
  • Color contrast 4.5:1 or above
  • Visible focus indicator
  • Screen reader testing
  • Semantic HTML (button, nav, main, section)

© revfactory, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in en/16-fullstack-webapp/.claude/skills/component-patterns of revfactory/harness-100.

Open the folder on GitHubat commit 8e8d35c

Compare with similar skills

Component Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Component Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Component Patterns this skillrevfactory/harness-1001.3k—~1.5kAutomated safety check: PassApache-2.0
Moai Ref React Patternsmodu-ai/moai-adk1.2k—~1.8kAutomated safety check: PassApache-2.0
React ExpertJeffallan/claude-skills12k—~1.4kAutomated safety check: PassMIT
Nextjs15 Initbear2u/my-skills933—~2.4kAutomated safety check: PassNone
Opik Frontend Patternscomet-ml/opik22k—~1.1kAutomated safety check: PassApache-2.0
State Managementemanueleielo/deepagents-open-lovable111—~1.7kAutomated safety check: PassNone

Similar skills

  • Moai Ref React Patterns

    modu-ai/moai-adk

    React/Next.js component design patterns, state management strategies, and project structure reference for frontend development.

    1.2k GitHub stars~1.8k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • React Expert

    Jeffallan/claude-skills

    Builds React 19 components in TypeScript with Server Components, useActionState forms, custom hooks and state libraries, checked with tsc and React Testing Library.

    12k GitHub stars~1.4k tokensUpdated 4 days ago
    Frontend & DesignAuto-check passed
  • Nextjs15 Init

    bear2u/my-skills

    A skill your agent uses when user wants to create a new Next.js 15 project (Todo/Blog/Dashboard/E-commerce/Custom domain) with App Router, ShadCN, Zustand, Tanstack Query, and modern Next.js stack

    933 GitHub stars~2.4k tokensUpdated 3 mo ago
    Frontend & DesignAuto-check passed
  • Sets the conventions for the Opik React frontend: TanStack Query for data, Zustand for shared state, one-way layer imports and a fix for Google Translate crashes.

    22k GitHub stars~1.1k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • State Management

    emanueleielo/deepagents-open-lovable

    State management patterns - Zustand, Jotai, Context. An agent skill from emanueleielo/deepagents-open-lovable.

    111 GitHub stars~1.7k tokensUpdated 2 days ago
    Frontend & DesignAuto-check passed
  • React Web

    alinaqi/maggy

    React web development with hooks, React Query, Zustand. An agent skill from alinaqi/maggy.

    707 GitHub stars~3.6k tokensUpdated 13 days ago
    Frontend & DesignAuto-check passed

More from revfactory/harness-100

All 464 skills in this repo
  • Anti Bot Analyzer

    revfactory/harness-100

    A skill for analyzing website anti-bot defense mechanisms and developing legitimate evasion strategies.

    1.3k GitHub stars~1.1k tokensUpdated 6 mo ago
    Auto-check passed
  • API Error Design Patterns

    revfactory/harness-100

    Reference for designing how an API reports failures: structured error codes, response shapes, client-friendly messages, an error catalog and retry or fallback advice.

    1.3k GitHub stars~1.6k tokensUpdated 6 mo ago
    Auto-check passed
  • API Security Checklist

    revfactory/harness-100

    Walks a backend-dev agent through OWASP API Top 10 checks, authentication and authorization patterns, and defense code during API design.

    1.3k GitHub stars~1.7k tokensUpdated 6 mo ago
    Auto-check passed
  • Arg Parser Generator

    revfactory/harness-100

    Methodology for systematically designing and generating CLI tool argument parser structures.

    1.3k GitHub stars~1.2k tokensUpdated 6 mo ago
    Auto-check passed
  • Audience Segmentation

    revfactory/harness-100

    Audience segmentation skill used by the analyst and curator agents.

    1.3k GitHub stars~1.3k tokensUpdated 6 mo ago
    Auto-check passed
  • Audio Storytelling

    revfactory/harness-100

    Audio storytelling skill used by the podcast scriptwriter and show note editor.

    1.3k GitHub stars~1.6k tokensUpdated 6 mo ago
    Auto-check passed

Questions about Component Patterns

What does Component Patterns do?

React/Next.js component design pattern library. An agent skill from revfactory/harness-100. Component Patterns is an agent skill from revfactory/harness-100.js component design pattern library.

When should I use Component Patterns?

Component Patterns fits situations like: requests like component patterns; state management; folder structure; component separation.

How do I install Component Patterns in Claude Code?

Run `npx skills add revfactory/harness-100 --skill component-patterns -a claude-code`. Or copy the skill folder (en/16-fullstack-webapp/.claude/skills/component-patterns in revfactory/harness-100) into .claude/skills/component-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Component Patterns in Codex?

Run `npx skills add revfactory/harness-100 --skill component-patterns -a codex`. Or copy the skill folder (en/16-fullstack-webapp/.claude/skills/component-patterns in revfactory/harness-100) into .agents/skills/component-patterns in your project. Codex loads it when a task matches its description.

Can I use Component Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add revfactory/harness-100 --skill component-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/component-patterns, .gemini/skills/component-patterns, .github/skills/component-patterns and .opencode/skills/component-patterns in your project.

What does Component Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Component Patterns is instructions for the agent only.

Does Component Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Component Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Component Patterns use?

Component Patterns is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Component Patterns use?

About 1.5k tokens (SKILL.md is roughly 6.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Component Patterns?

Skills that share tags, products or a category with Component Patterns: Moai Ref React Patterns (modu-ai/moai-adk, 1.2k stars), React Expert (Jeffallan/claude-skills, 12k stars), Nextjs15 Init (bear2u/my-skills, 933 stars) and Opik Frontend Patterns (comet-ml/opik, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Component Patterns?

revfactory (a GitHub user) maintains it in revfactory/harness-100, which has 1,290 GitHub stars. The repository holds 464 skills in this directory. The repository was last updated on March 22, 2026.

Source: revfactory/harness-100 on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.