react-component-scaffold

A generator for new React components, with related tests, Storybook stories, styles, and an export file when the project uses them. React is a JavaScript library for building user interfaces, and Storybook is a tool for developing UI components separately.

In plain words
What is it for?
Use it when starting a React component from scratch. It can create typed props, accessibility attributes, loading or error states, tests, stories, CSS Modules, or styled-components based on the project.
Why use it?
Creating the same supporting files by hand is repetitive and can lead to inconsistent project structure. This skill creates the component files together according to the project's setup.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/luqiang-code/claude-code-skills/react-component-scaffold
Any agent
npx skills add luqiang-code/claude-code-skills --skill react-component-scaffold
Clone the repo
git clone --depth 1 https://github.com/luqiang-code/claude-code-skills

Made for: Claude Code, Codex.

Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 660 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00041 $0.00660
Opus 5 $0.00020 $0.00330
Sonnet 5 $0.00008 $0.00132
Haiku 4.5 $0.00004 $0.00066

Measured 2d ago against content hash e48f20aaa22f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

react-component-scaffold 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 2d 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.

community-skills/react-component-scaffold/SKILL.md · 103 lines

How it starts

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

React Component Scaffold

Scaffold React components with tests, stories, and styles in one shot.

When to Use

  • Creating a new React component from scratch
  • User says "create a component", "scaffold a component"
  • Need consistent component file structure across a project

When NOT to Use

  • Modifying existing components
  • Non-React component files
  • The project has a code generator already (e.g., Plop, Hygen)

Workflow

  1. Ask user: component name, props (if known), and which optional files to generate
  2. Detect or ask: JavaScript or TypeScript, CSS Modules or styled-components
  3. Generate files:
ComponentName/
├── ComponentName.tsx          # Component with typed props
├── ComponentName.test.tsx     # Basic render + interaction tests
├── ComponentName.stories.tsx  # Storybook story (if project uses Storybook)
├── ComponentName.module.css   # CSS Module (if using CSS Modules)
└── index.ts                   # Barrel export
  1. Write the component with:
    • Typed props interface
    • Default exports
    • Accessibility attributes (aria-label, role)
    • Loading/empty/error states if data-dependent

Component Template

import { type FC } from 'react';
import styles from './Button.module.css';

interface ButtonProps {
  /** Button label text */
  children: string;
  /** Visual variant */
  variant?: 'primary' | 'secondary' | 'danger';
  /** Disabled state */
  disabled?: boolean;
  /** Click handler */
  onClick?: () => void;
}

export const Button: FC<ButtonProps> = ({
  children,
  variant = 'primary',
  disabled = false,
  onClick,
}) => {
  return (
    <button
      className={`${styles.button} ${styles[variant]}`}
      disabled={disabled}
      onClick={onClick}
      type="button"
    >
      {children}
    </button>
  );
};

Key Principles

  • One component per folder — co-locate all related files
  • Always include a barrel export (index.ts)
  • Props interface should be exported (for consumers)
  • Add JSDoc comments for each prop
  • Use type="button" on buttons to prevent form submission

Read the full file on GitHub · 103 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. 2d ago First seen · 103 lines · 41 tokens per session scan A e48f20aaa22f

Subscribe to this mod's changes

react-component-scaffold is a skill published in the GitHub repository luqiang-code/claude-code-skills (2 stars, last pushed 3mo ago), licensed MIT. It adds 41 tokens to every session and 660 once invoked, about $0.0002 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-08-31.