From react-rules-plugin
Storybook開発ルール。CSF3.0形式、Meta/StoryObj型定義、Story種類(Default/AllProps/EdgeCases + UI状態)、argTypes/controls/play/decoratorsの規約を定義。Storybook作成時に参照。
How this skill is triggered — by the user, by Claude, or both
Slash command
/react-rules-plugin:storybookThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
StorybookのStory作成規約を定義するスキル。
StorybookのStory作成規約を定義するスキル。
ComponentName.stories.tsxMeta<typeof Component> と StoryObj<typeof Component>title は設定しない(自動生成)。
最低限、以下を用意する。
| Story | 内容 |
|---|---|
| Default | 基本的な使用例 |
| AllProps | 主要propsを網羅した状態 |
| EdgeCases | 境界値・特殊状態 |
| Loading | 読み込み中状態(該当時) |
| Empty | 空状態(該当時) |
| Error | エラー表示状態(該当時) |
args にデフォルト値を集約し、Story差分は最小化するargTypes で controls の公開範囲を明示する
control: false を指定fn() でモックし、実処理を持ち込まないplay はUI操作の確認(クリック・入力・フォーカス)までに限定するplay を書く場合は、ユーザー視点のアサーションを優先するimport type { Meta, StoryObj } from "@storybook/react";
import { fn } from "@storybook/test";
import { Button } from "./Button";
const meta: Meta<typeof Button> = {
component: Button,
args: { onClick: fn() },
};
export default meta;
type Story = StoryObj<typeof Button>;
export const Default: Story = {
args: { label: "Click me" },
};
play 内で不安定な待機(過剰な setTimeout 依存)を行わないnpx claudepluginhub dio0550/d-market-react --plugin react-rules-pluginCreates or modifies Storybook stories in CSF3 format for React components, showcasing variations with TypeScript type safety and ensuring builds succeed.
Generates CSF3 Storybook stories for components (React, Vue, shadcn/ui) with variant coverage and state matrices. Invoke when creating component stories.
Documents components with Storybook using CSF 3.0, controls, and MDX. Use when creating component catalogs, interactive examples, visual testing setups, or design system documentation sites.