component-scaffold-generator
БесплатноБез исполняемых скриптовНе проверенGenerates clean React/Vue component skeletons with TypeScript types, prop variants, styling hooks, test files, Storybook stories, and usage documentation. Use…
от patricio0312rev★ 64 звезды на GitHubОб этом скилле
Component Scaffold Generator
Generate production-ready component skeletons with types, variants, tests, and documentation.
Core Workflow
- Gather requirements: Component name, framework (React/Vue), props needed
- Choose pattern: Determine if functional, compound, or polymorphic component
- Generate component: Create main component file with TypeScript types
- Add variants: Include common variants (size, color, state)
- Setup styling: Add styling approach (Tailwind, CSS Modules, styled-components)
- Create tests: Generate test file with basic coverage
- Add story: Create Storybook story with examples
- Document usage: Include JSDoc and usage examples
Component Patterns
Basic Functional Component (React)
// Button.tsx
import { forwardRef } from "react";
import { cn } from "@/lib/utils";
export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
variant?: "primary" | "secondary" | "ghost" | "destructive";
size?: "sm" | "md" | "lg";
isLoading?: boolean;
leftIcon?: React.ReactNode;
rightIcon?: React.ReactNode;
}
/**
* Button component with multiple variants and sizes
*
* @example
* ```tsx
* <Button variant="primary" size="md">
* Click me
* </Button>
* ```
*/
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
(
{
variant = "primary",
size = "md",
isLoading = false,
leftIcon,
rightIcon,
className,
children,
disabled,
...props
},
ref
) => {
return (
<button
ref={ref}
className={cn(
"inline-flex items-center justify-center rounded-md font-medium transition-colors",
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
"disabled:pointer-events-none disabled:opacity-50",
{
// Variants
"bg-blue-600 text-white hover:bg-blue-700": variant === "primary",
"bg-gray-200 text-gray-900 hover:bg-gray-300":
variant === "secondary",
"hover:bg-gray-100": variant === "ghost",
"bg-red-600 text-white hover:bg-red-700": variant === "destructive",
// Sizes
"h-8 px-3 text-sm": size === "sm",
"h-10 px-4 text-base": size === "md",
"h-12 px-6 text-lg": size === "lg",
},
className
)}
disabled={disabled || isLoading}
{...props}
>
{isLoading && (
<svg
className="mr-2 h-4 w-4 animate-spin"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
>
<circle
className="opacity-25"
cx="12"
cy="12"
r="10"
stroke="currentColor"
strokeWidth="4"
/>
<path
className="opacity-75"
fill="currentColor"
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
/>
</svg>
)}
{leftIcon && <span className="mr-2">{leftIcon}</span>}
{children}
{rightIcon && <span className="ml-2">{rightIcon}</span>}
</button>
);
}
);
Button.displayName = "Button";
Compound Component Pattern
// Card.tsx
import { createContext, useContext } from "react";
interface CardContextValue {
variant: "default" | "outlined" | "elevated";
}
const CardContext = createContext<CardContextValue | undefined>(undefined);
export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
variant?: "default" | "outlined" | "elevated";
}
export const Card = ({
variant = "default",
className,
children,
...props
}: CardProps) => {
return (
<CardContext.Provider value={{ variant }}>
<div className={cn("rounded-lg", className)} {...props}>
{children}
</div>
</CardContext.Provider>
);
};
export const CardHeader = ({
className,
...props
}: React.HTMLAttributes<HTMLDivElement>) => (
<div className={cn("p-6", className)} {...props} />
);
export const CardTitle = ({
className,
...props
}: React.HTMLAttributes<HTMLHeadingElement>) => (
<h3 className={cn("text-2xl font-semibold", className)} {...props} />
);
export const CardContent = ({
className,
...props
}: React.HTMLAttributes<HTMLDivElement>) => (
<div className={cn("p-6 pt-0", className)} {...props} />
);
export const CardFooter = ({
className,
...props
}: React.HTMLAttributes<HTMLDivElement>) => (
<div className={cn("flex items-center p-6 pt-0", className)} {...props} />
);
Test File Template
// Button.test.tsx
import { render, screen, fireEvent } from "@testing-library/react";
import { Button } from "./Button";
describe("Button", () => {
it("renders children correctly", () => {
render(<Button>Click me</Button>);
expect(
screen.getByRole("button",
Установить component-scaffold-generator в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл component-scaffold-generator?
Generates clean React/Vue component skeletons with TypeScript types, prop variants, styling hooks, test files, Storybook stories, and usage documentation. Use when users request "create a component", "scaffold component", "new React component", or "generate component boilerplate".
Как установить скилл component-scaffold-generator?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл component-scaffold-generator запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic