creating-components — community creating-components, nuclear-xrd, NuclearPlayer, community, ai agent skill, ide skills, agent automation, AI agent skills, Claude Code, Cursor, Windsurf

v1.0.0
GitHub

About this Skill

Perfect for Frontend Agents needing structured React component creation with class-variance-authority. Use when creating new UI components in packages/ui. Covers component structure, tests, stories, and what to avoid.

NuclearPlayer NuclearPlayer
[0]
[0]
Updated: 3/12/2026

Quality Score

Top 5%
33
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
> npx killer-skills add NuclearPlayer/nuclear-xrd/creating-components
Supports 19+ Platforms
Cursor
Windsurf
VS Code
Trae
Claude
OpenClaw
+12 more

Agent Capability Analysis

The creating-components skill by NuclearPlayer is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance.

Ideal Agent Persona

Perfect for Frontend Agents needing structured React component creation with class-variance-authority.

Core Value

Empowers agents to build and export reusable UI components using React and class-variance-authority, providing a standardized approach to component development with Vitest snapshots and TypeScript.

Capabilities Granted for creating-components

Building reusable UI components
Exporting components for cross-project usage
Implementing consistent component testing with Vitest

! Prerequisites & Limits

  • Requires React and class-variance-authority setup
  • TypeScript configuration necessary
Project
SKILL.md
3.9 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8

# Tags

[No tags]
SKILL.md
Readonly

Creating UI Components

Component Structure

packages/ui/src/components/MyComponent/
├── MyComponent.tsx      # Implementation
├── MyComponent.test.tsx # Tests
├── index.ts             # Re-exports
└── __snapshots__/       # Vitest snapshots (auto-generated)

After creating, export from packages/ui/src/components/index.ts.

Implementation Pattern

tsx
1import { cva, VariantProps } from 'class-variance-authority'; 2import { ComponentProps, FC } from 'react'; 3import { cn } from '../../utils'; 4 5const variants = cva('base-classes', { 6 variants: { /* ... */ }, 7 defaultVariants: { /* ... */ }, 8}); 9 10type MyComponentProps = ComponentProps<'div'> & VariantProps<typeof variants>; 11 12export const MyComponent: FC<MyComponentProps> = ({ 13 className, 14 variant, 15 ...props 16}) => ( 17 <div className={cn(variants({ variant, className }))} {...props} /> 18);

Tests

What to test:

  • Snapshots (1-2 covering key variants)
  • User interactions
  • Behavior (callbacks called with correct args)

What NOT to test:

  • CSS classes, attributes (use snapshots instead)
  • Internal state
  • Things TypeScript already enforces

Consolidate tests. One test can cover multiple related assertions. An exception to that is snapshot tests - one snapshot per variant/state.

Stories

Create packages/storybook/src/MyComponent.stories.tsx.

One story can show multiple related variants. For example, it's wasteful to create a story for each variant of a button. Put them all together in one place. Don't create separate stories for each variant:

tsx
1import { Meta, StoryObj } from '@storybook/react-vite'; 2import { useState } from 'react'; 3import { MyComponent } from '@nuclearplayer/ui'; 4 5const meta = { 6 title: 'Components/MyComponent', 7 component: MyComponent, 8 tags: ['autodocs'], 9} satisfies Meta<typeof MyComponent>; 10 11export default meta; 12type Story = StoryObj<typeof MyComponent>; 13 14export const AllVariants: Story = { 15 render: () => { 16 const [state, setState] = useState(initialState); 17 return ( 18 <div className="flex flex-col gap-4"> 19 {/* Show all variants, states, interactions */} 20 </div> 21 ); 22 }, 23};

This isn't an iron rule, sometimes it will make more sense to have separate stories.

Don't run storybook build checks.

Avoiding Duplication

Before creating a new component, check if an existing one can be extended.

Pattern: Discriminated unions for mode variants

Example: Instead of creating SingleSelect and MultiSelect components:

tsx
1type Props = 2 | { multiple?: false; selected: string; onChange: (id: string) => void } 3 | { multiple: true; selected: string[]; onChange: (ids: string[]) => void };

TypeScript enforces correct types based on the multiple prop.

Classes for customization

Where it's likely that a component will need custom styling, expose a className prop.

If there are many parts that may need styling, consider exposing a classes prop with specific class names for each part. Define a type for the classes prop. Refer to packages/ui/src/components/TrackTable/types.ts for an example.

Strings

All user-facing strings go through i18n - no hardcoded UI text. If a new component in the ui package needs labels and other kinds of localized text, it should accept a labels prop with the relevant strings. The prop should have its own type defined. Refer to packages/ui/src/components/QueueItem/types.ts for an example.

Accessibility

We don't care about that. If there's an opportunity to handle that easily, do it, but don't go out of your way.

Checklist

  • Component in packages/ui/src/components/MyComponent/
  • Exported from packages/ui/src/components/index.ts
  • Tests cover behavior, not implementation
  • Tests consolidated (not one per variant)
  • One story showing all variants
  • No CSS class assertions in tests
  • No duplicate component when extending existing one works

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is creating-components?

Perfect for Frontend Agents needing structured React component creation with class-variance-authority. Use when creating new UI components in packages/ui. Covers component structure, tests, stories, and what to avoid.

How do I install creating-components?

Run the command: npx killer-skills add NuclearPlayer/nuclear-xrd/creating-components. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for creating-components?

Key use cases include: Building reusable UI components, Exporting components for cross-project usage, Implementing consistent component testing with Vitest.

Which IDEs are compatible with creating-components?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for creating-components?

Requires React and class-variance-authority setup. TypeScript configuration necessary.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add NuclearPlayer/nuclear-xrd/creating-components. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use creating-components immediately in the current project.

Related Skills

Looking for an alternative to creating-components or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

Generate customizable widget plugins for the prompts.chat feed system

149.6k
0
Design

flags

Logo of vercel
vercel

The React Framework

138.4k
0
Browser

pr-review

Logo of pytorch
pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration

98.6k
0
AI

antd-commit-msg

Logo of ant-design
ant-design

Generate a single-line commit message for ant-design by reading the projects git staged area and recent commit style. Use when the user asks for a commit message, says msg, commit msg, 写提交信息, or wants

97.8k
0
Design