본문으로 건너뛰기
cccskills
무료GitHub에 공개

storybook

Create and review Storybook examples using real production UI components. Separate display components from business logic, add local interaction demos when needed, and apply consistent rules for component composition, demo names, file placement, and navigation groups.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

ACTIVATE when creating storybook stories, reviewing PRs with .stories.tsx files, or planning Storybook-related work with rpi:* skills.

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Creating static Storybook examples for production UI components
  • Adding dialog and toggle interaction demos
  • Reviewing component boundaries in .stories.tsx pull requests
  • Organizing complex demos and their navigation groups

포함된 파일(1)

  • SKILL.md6.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Storybook Component Taxonomy

This skill defines the three-tier component taxonomy for Storybook stories and the patterns to follow.

Component Taxonomy

TypeDefinitionIn Storybook?
PureStateless or low-state production component with no app stores, queries, routing, or providersYes — default
ShellDemoStorybook-only wrapper that composes real components to demonstrate interactivity, layouts, or stateYes — sparingly
WiredProduction component connected to business logic, hotkeys, stores, queriesNo

Pure/Wired Production Pattern

Wired* is the only prefix for connected production components. Connected* is retired repo-wide. A Wired component owns queries, stores, routing, hotkeys, and business logic, then composes Pure shells and leaves. Storybook interaction wrappers are always named *ShellDemo, never Wired*.

Avoid prop-forwarding pure intermediates. A Pure layout component exposes literal children; the Wired layer fills those slots with Wired leaves, and each Wired leaf renders its Pure leaf with a flat, one-hop interface. The canonical production/story pairs are:

  • KanbanBoard / WiredKanbanCard
  • the shell kit in packages/ui/src/components/sidebar/ / WiredSidebarTaskTree, WiredTaskRow, and WiredSessionRow
  • ArtifactCommentPanel / WiredCommentThread, using keyed children and NEW_COMMENT_KEY

Stories use the same Pure shells as production and fill their slots with Pure leaves. They are provider-free. Never render or wrap a Wired component in a story.

Pure composition has one seam: literal children. Do not add named ReactNode props, component props, or render props for Storybook convenience. When a shell must associate caller content with its own layout records, use keyed children, following ArtifactCommentPanel.

Anti-Pattern: Mock-ups

Mock-up — defines fake inline UI instead of importing real production components. These create noise and mislead developers about what's real vs. prototype. DELETE mock-ups; do not convert them.

Smell test: The story file defines JSX/markup inline instead of importing a component from a production path like ../components/ or @humanlayer/ui.

Story Patterns

1. Pure Story — Static Args (Default)

The preferred form. Import the real Pure component and pass static data via args.

// packages/ui/src/components/session-label-badge.stories.tsx
import type { Meta, StoryObj } from "@storybook/react"
import { SessionLabelBadge } from "./session-label-badge"

const meta = {
  title: "Components/SessionLabelBadge",
  component: SessionLabelBadge,
} satisfies Meta<typeof SessionLabelBadge>

export default meta
type Story = StoryObj<typeof meta>

export const Default: Story = {
  args: { label: "bug-fix", color: "blue" },
}

2. ShellDemo — Inline Wrapper for Interactivity

For Pure components needing demo-only interactivity (dialogs, toggles), define a small provider-free *ShellDemo inside the .stories.tsx. The ShellDemo owns local state; the real Pure component is imported from production.

// packages/ui/src/components/bypass-permissions-dialog.stories.tsx
const BypassPermissionsDialogShellDemo = ({ sessionCount }: { sessionCount?: number }) => {
  const [open, setOpen] = useState(false)
  return (
    <>
      <Button onClick={() => setOpen(true)}>Open Bypass Dialog</Button>
      <BypassPermissionsDialog
        open={open}
        onOpenChange={setOpen}
        onConfirm={(minutes) => console.log("Confirmed with timeout:", minutes)}
        sessionCount={sessionCount}
      />
    </>
  )
}

export const Default: Story = {
  render: () => <BypassPermissionsDialogShellDemo />,
}

3. ShellDemo — Companion File for Complex Composition

When a ShellDemo needs significant local state or composes multiple real Pure components, put it in storybook/*.tsx. Keep the .stories.tsx thin. ShellDemos remain provider-free; if a component requires app providers, story the Pure shells and leaves below that boundary instead.

// storybook/session-table.tsx — ShellDemo companion
export const SessionTableShellDemo: FC<SessionTableShellDemoProps> = (props) => {
  const [selectedId, setSelectedId] = useState<string>()
  return <SessionTable {...props} selectedId={selectedId} onSelect={setSelectedId} />
}

// storybook/session-table.stories.tsx — thin
const meta: Meta<typeof SessionTableShellDemo> = {
  title: "Shell Demos/SessionTable",
  component: SessionTableShellDemo,
}
export const Default: Story = { args: {} }

4. ShellDemo — Page Layout Composition (Rare)

For demonstrating page layouts or how multiple real components sit together. Use sparingly.

import { SidebarShell, TaskRow } from "@humanlayer/ui"

export const WithTask: Story = {
  render: () => (
    <SidebarShell>
      <ul><TaskRow {...taskRowProps}>Pure session rows go here</TaskRow></ul>
    </SidebarShell>
  ),
}

KanbanBoard.stories.tsx, the sidebar stories, and the artifact-comment-panel stories are the canonical slot-composition examples. Their shells are production components, their slot contents are Pure leaves, and none requires an app provider.

ShellDemo Nav Group

All ShellDemos must use the Shell Demos/ top-level nav group prefix in their title to visually separate them from Pure component stories:

const meta = {
  title: "Shell Demos/SessionTable", // NOT "Components/SessionTable"
  component: SessionTableDemo,
}

Quick Checklist

Before creating or approving a story:

  1. Does the story import a real production component? If no → DELETE or fix
  2. Does the story render only Pure components and stay provider-free? If no → move down to the Pure boundary
  3. Does composition use only literal children (keyed when matching layout records)? If no → fix the production seam
  4. Does the demo add local interaction state? Name it *ShellDemo; complex state → companion file in .../storybook/
  5. Is the title correct? ShellDemos → Shell Demos/...; Pure → Components/... or existing group

Locations

  • packages/ui/src/ — shared component library stories (port 6006)
  • apps/riptide-ui/src/ — app-specific stories (port 6007)
  • apps/riptide-ui/storybook/ companion directories for complex ShellDemo wrappers
  • packages/ui/storybook/ companion directories for complex ShellDemo wrappers

Running Storybook

cd packages/ui && bun --bun run storybook    # port 6006
cd apps/riptide-ui && bun --bun run storybook # port 6007

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Automate website navigation, form entry, and clicks through a browser command line tool. Extract page text, capture screenshots, and compare page states to check interactions or test web app behavior across screen sizes.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Automate form entry and button clicks
  • Extract text from web pages
  • Save page screenshots and PDFs
humanlayer/humanlayer1.2만2026년 10월 23일 업데이트

Rewrite dense or ambiguous English into short, direct sentences using principles from ASD-STE100, a standard for clear technical English. It preserves facts and conditions, identifies writing issues, and shows the original and revised text side by side.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Clarifying English instructions for another agent
  • Simplifying English tool descriptions and error messages
  • Making English easier for non-native readers
humanlayer/humanlayer1.2만2026년 10월 23일 업데이트

Inspect GitHub pull requests, read review conversations, and investigate failed automated checks with dedicated scripts. Get consolidated status reports, unresolved discussion threads, and failing job or step logs, with full logs saved for further inspection.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Checking pull request status in one report
  • Reading unresolved review conversations
  • Investigating failed CI jobs and steps
humanlayer/humanlayer1.2만2026년 10월 23일 업데이트

Update release base versions for supported packages, keep matching version fields in sync, and verify generated versions. The workflow covers committing and pushing the changes, with guidance for release steps after merging.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Prepare a package version update for release
  • Synchronize version fields across related files
  • Verify generated versions before pushing
humanlayer/humanlayer1.2만2026년 10월 23일 업데이트

calldiff

무료

Compare function call structures across Git commits, branches, or working files to support code review. Display call trees and trace paths from an entry function to a target function, with support for 22 languages.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Compare function calls before and after a change
  • Review call structure changes between branches
  • Trace paths from an entry function to a target
humanlayer/humanlayer1.2만2026년 10월 23일 업데이트

Automate browser tasks from the terminal using the chrome-devtools-mcp CLI. Inspect page elements, click and fill forms, navigate tabs, capture screenshots, and investigate network requests, console messages, performance, and memory through shell commands.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Automating form input and page navigation
  • Capturing page or element screenshots
  • Investigating network requests and console errors
humanlayer/humanlayer1.2만2026년 10월 23일 업데이트

humanlayer의 스킬 모두 보기

이 스킬의 문제 신고