Skip to content
Back to skills

Component Scaffold

ASecurity

Create a new React component with co-located test, story, and styles. Use when creating new UI components, when asked to scaffold/generate a component, or when building new pages.

  • 18 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 6, 2026
ai-agentstypescriptreacttesting

Security analysis

A100/100

Scanned November 6, 2026

npx -y skills add zakelfassi/skills-driven-development --skill component-scaffold --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Component Scaffold?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Component Scaffold
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/zakelfassi-component-scaffold/badge)](https://www.skillsdirectory.com/skills/zakelfassi-component-scaffold)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: component-scaffold
description: Create a new React component with co-located test, story, and styles. Use when creating new UI components, when asked to scaffold/generate a component, or when building new pages.
metadata:
  forged-by: claude-agent
  forged-from: session-2026-02-15
  forged-reason: "Scaffolded 4 components in one session — same file structure each time"
  usage-count: "18"
  last-used: "2026-02-27"
---

# Component Scaffold

Create a new React component following project conventions.

## Inputs
- Component name (PascalCase, e.g., `UserCard`)
- Component type: `page` | `feature` | `ui`
- Props (optional: list of prop names + types)

## Steps

1. **Determine the directory**
   - `page` → `src/pages/{ComponentName}/`
   - `feature` → `src/features/{feature-area}/components/{ComponentName}/`
   - `ui` → `src/components/ui/{ComponentName}/`

2. **Create the component file**
   ```
   {dir}/{ComponentName}.tsx
   ```
   - Functional component with TypeScript props interface
   - Export as named export (not default)

3. **Create the test file**
   ```
   {dir}/{ComponentName}.test.tsx
   ```
   - Import from Vitest + Testing Library
   - At minimum: renders without crashing + snapshot

4. **Create the story file**
   ```
   {dir}/{ComponentName}.stories.tsx
   ```
   - Default story + one variant per significant prop

5. **Create the barrel export**
   ```
   {dir}/index.ts
   ```
   - Re-export the component

## Conventions
- All components are functional (no class components)
- Props interfaces are named `{ComponentName}Props`
- Co-locate everything: component, test, story, styles in one directory
- Use Tailwind for styling (no CSS modules — see archived skill `css-module-setup`)

## Edge Cases
- **Component already exists:** Do not overwrite. Ask the user if they want to update or rename.
- **Nested feature components:** Use the feature area as a parent directory (e.g., `features/auth/components/LoginForm/`)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.