Command Palette

Search for a command to run...

Назад к скиллам
скилл № 51997

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от 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):

  1. Fetch design specs (Figma MCP if a link is provided)
  2. Build the component with all states as props
  3. Write the Storybook story -- show all meaningful states in a single story view so the user can review at a glance
  4. Start Storybook (or reuse existing) and verify visuals in the browser
  5. 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, staticDirs for fonts/images from core/ui/public.
  • preview.tsx -- styled-components ThemeProvider with darkTheme, GlobalStyle for global styles. For core/ui, also wrap with I18nextProvider for translations.
  • package.json -- Add storybook and build-storybook scripts. Add @storybook/addon-docs, @storybook/react-vite, storybook as devDependencies.
  • knip.json -- Ensure **/*.{ts,tsx} in the package's project globs covers .stories.tsx files (already the case).
  • eslint.config.mjs -- eslint-plugin-storybook is already configured globally with storybook.configs['flat/recommended'].

Styling

This codebase uses styled-components (not Tailwind). All components use:

  • styled-components for component styling
  • darkTheme from @lib/ui/theme/darkTheme for theming
  • GlobalStyle from @lib/ui/css/GlobalStyle for global styles
  • getColor() helper for theme-aware colors
  • Layout primitives: HStack, VStack from @lib/ui/layout/Stack

Stateless Extraction Pattern

To make a component Storybook-friendly, extract a stateless version:

  1. Create form.tsx (or content.tsx) -- a pure component with props for all external data:

    value, onChange, onSubmit
    

    No hooks for persistent state, no route params, no auth context.

  2. Refactor the parent -- becomes a thin wrapper:

    <Modal title="...">
      <StatelessForm value={...} onChange={...} onSubmit={...} />
    </Modal>
    
  3. 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)}>
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

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), без исполняемых скриптов.

Похожие скиллы

Сравнить Storybook Component с