本文へ移動
cccskills
無料GitHub で公開日本語紹介

storybook

Storybookの表示例を本番のUI部品で作成・レビューし、表示用部品と業務ロジックを分け、操作デモの命名や配置、部品の組み合わせ方をそろえるスキル。

原文原文の説明を見る

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

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • 本番UI部品の固定データ表示例を作りたいとき
  • ダイアログや切り替え操作のデモ作成
  • 表示例を含む変更の部品分離レビュー
  • 複雑なデモの配置とメニュー分類

日本語での紹介

できること

Storybookで使う表示例を、本番のUI部品に基づいて作成・レビューするための規約を適用します。部品を、アプリのデータ取得などに依存しない Pure、デモ用の状態を持つ ShellDemo、業務ロジックにつながる Wired に分類します。通常は Pure に固定のデータを渡し、ダイアログの開閉などには小さな ShellDemo を用意します。

こんなときに便利

.stories.tsx を作るときや、その変更を含むプルリクエストのレビューに向いています。複雑なデモを別ファイルへ分ける判断、Shell Demos/ への分類、children を使った部品の組み合わせをそろえられます。本番部品を使わずに表示だけを作ったモックアップも、見直す対象として判別します。

使い方の例

「このPure部品に、固定データを使うStorybookの表示例を作って」 「ダイアログを開閉できる *ShellDemo を追加して」 「この .stories.tsx の変更が分類ルールに合っているか確認して」

注意点

React向けのStorybookと、資料に示されたプロジェクト固有の構成・命名規約を前提とします。Wired は表示例に含めず、アプリの状態などを供給する Provider に依存させません。記載の起動方法は Bun を使い、共有部品はポート6006、アプリ固有の表示例は6007で動かします。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(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 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

agent-browser

無料概要あり

Webページの移動やフォーム入力、クリックをエージェントに任せ、情報抽出や画面保存、操作前後の比較まで行います。ブラウザ作業の自動化やWebアプリの確認に使えるスキル。

  • フォーム入力やクリックを自動化したいとき
  • Webページのテキスト抽出
  • ページのスクリーンショット・PDF保存
humanlayer/humanlayer1.2万2026年10月23日 更新

asd-ste100

無料概要あり

曖昧で読みにくい英文を、語の意味をそろえた短い能動態の文へ書き直すスキル。指示文やツール説明を見直し、修正理由と変更前後を表で確認できます。

  • 別のエージェントへの英文指示の明確化
  • 英語のツール説明やエラー文の簡素化
  • 英語を母語としない読者向けの文章整理
humanlayer/humanlayer1.2万2026年10月23日 更新

better-github-skill

無料概要あり

GitHubのPRの状態、レビューの会話、CI失敗のログを専用スクリプトで収集し、変更の確認状況や未解決の指摘、失敗したジョブとステップを調べるスキル。

  • PRの状態をまとめて確認したいとき
  • 未解決のレビューの会話の確認
  • CIの失敗ジョブとステップの調査
humanlayer/humanlayer1.2万2026年10月23日 更新

bump-version

無料概要あり

リリース時に対象パッケージの基準バージョンを更新し、関連ファイルの同期と生成結果を検証して、コミットからPRブランチへのプッシュまで進めるスキル。

  • リリース用のバージョンを更新したいとき
  • 関連ファイルのバージョン表記の同期
  • プッシュ前の生成バージョン検証
humanlayer/humanlayer1.2万2026年10月23日 更新

calldiff

無料概要あり

Git のコミット間や作業中のコードで、関数の呼び出し構造の違いを確認します。呼び出しツリーの表示や、指定した関数へ至る経路の調査にも使えます。

  • 変更前後の関数呼び出しを比較したいとき
  • ブランチ間の呼び出し構造レビュー
  • 起点から目的の関数への経路調査
humanlayer/humanlayer1.2万2026年10月23日 更新

chrome-devtools-cli

無料概要あり

ターミナルからブラウザのクリックや入力、ページ移動を自動化し、通信やエラー、表示速度も調べられる、Chrome DevToolsのCLI操作を支援するスキル。

  • フォーム入力やページ移動の自動化
  • ページや要素の画面撮影
  • 通信内容やコンソールエラーの調査
humanlayer/humanlayer1.2万2026年10月23日 更新

humanlayer のスキルをすべて見る

このスキルの問題を報告する