Storybook Component
End-to-end workflow for UI component development with Storybook. Use when building or refining UI components, implementing Figma designs, extracting stateless…
от vultisig★ 22 звезды на GitHub
Установить Storybook Component в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Storybook Component Workflow
Full workflow for Figma-to-Storybook UI development: design inspection, stateless extraction, story writing, browser verification, and design diff resolution.
Dev Server Reference
Check the terminals folder before starting any server -- reuse existing sessions.
| Context | Port | Start Command |
|---|---|---|
lib/ui Storybook |
6006 | yarn workspace @lib/ui storybook |
core/ui Storybook |
6007 | yarn workspace @core/ui storybook |
Never start a server if one is already running. Reuse existing browser tabs.
Workflow Order
For any UI component work (especially from Figma):
- Fetch design specs (Figma MCP if a link is provided)
- Build the component with all states as props
- Write the Storybook story -- show all meaningful states in a single story view so the user can review at a glance
- Start Storybook (or reuse existing) and verify visuals in the browser
- Integrate into the app
Build and verify in Storybook before integrating into the app. Storybook is the agent's primary UI verification environment -- it's fast, isolated, and doesn't require authentication or navigation.
For app-level verification after integration: use judgment. If the target view is easy to reach (no auth, simple navigation), verify it yourself. If it requires authentication, multi-step navigation, or device pairing, tell the user the integration is done and ask them to verify in the app.
Storybook Location Decision
| Component depends on | Story goes in |
|---|---|
Only @lib/ui + @lib/utils |
lib/ui/ (next to the component) |
@core/ui, @core/config, @core/chain, or other @core/* |
core/ui/ (next to the component) |
Both packages have Storybook fully configured. Use the existing setup.
Storybook Setup Reference
Both lib/ui and core/ui already have complete Storybook configurations. If a new package needs Storybook, follow the core/ui/.storybook/ pattern:
main.ts-- Vite framework via@storybook/react-vite,staticDirsfor fonts/images fromcore/ui/public.preview.tsx--styled-componentsThemeProviderwithdarkTheme,GlobalStylefor global styles. Forcore/ui, also wrap withI18nextProviderfor translations.package.json-- Addstorybookandbuild-storybookscripts. Add@storybook/addon-docs,@storybook/react-vite,storybookas devDependencies.knip.json-- Ensure**/*.{ts,tsx}in the package's project globs covers.stories.tsxfiles (already the case).eslint.config.mjs--eslint-plugin-storybookis already configured globally withstorybook.configs['flat/recommended'].
Styling
This codebase uses styled-components (not Tailwind). All components use:
styled-componentsfor component stylingdarkThemefrom@lib/ui/theme/darkThemefor themingGlobalStylefrom@lib/ui/css/GlobalStylefor global stylesgetColor()helper for theme-aware colors- Layout primitives:
HStack,VStackfrom@lib/ui/layout/Stack
Stateless Extraction Pattern
To make a component Storybook-friendly, extract a stateless version:
Create
form.tsx(orcontent.tsx) -- a pure component with props for all external data:value, onChange, onSubmitNo hooks for persistent state, no route params, no auth context.
Refactor the parent -- becomes a thin wrapper:
<Modal title="..."> <StatelessForm value={...} onChange={...} onSubmit={...} /> </Modal>Do not export the stateless component from the package index unless it has external consumers. Stories import directly from the file.
Story Structure
import type { Meta, StoryObj } from '@storybook/react-vite'
import { MyComponent } from '.'
const meta: Meta<typeof MyComponent> = {
title: 'Category/ComponentName',
component: MyComponent,
tags: ['autodocs'],
parameters: { layout: 'centered' },
}
export default meta
type Story = StoryObj<typeof MyComponent>
export const Default: Story = {
args: {
// default props
},
}
Interactive stories with local state
When a story needs local state (e.g., modals that open/close), use a render function:
import { Button } from '@lib/ui/buttons/Button'
import { Modal } from '@lib/ui/modal'
import type { Meta, StoryObj } from '@storybook/react-vite'
import { useState } from 'react'
// Use untyped Meta when render functions use wrapper components
const meta = {
title: 'Category/ComponentName',
} satisfies Meta
export default meta
type Story = StoryObj
function Interactive({ initial }: { initial?: ValueType }) {
const [value, setValue] = useState<ValueType | undefined>(initial)
const [open, setOpen] = useState(false)
return (
<>
<Button kind="primary" onClick={() => setOpen(true)}>
Open
</Button>
{open && (
<Modal title="..." onClose={() => setOpen(false)}>
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Storybook Component?
End-to-end workflow for UI component development with Storybook. Use when building or refining UI components, implementing Figma designs, extracting stateless components for stories, writing Storybook stories, or verifying visual accuracy in the browser.
Как установить скилл Storybook Component?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Storybook Component запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…