/frontend-react:storybook-storiesfrom frontend-react
Use this skill whenever writing, adding, or asking about a Storybook story for a React/UI component — including "add a story for X", "write a .stories file", questions about which states/variants a story should cover (default, empty, error, loading, disabled), how to show a component's skeleton alongside it in a story, what mock data a story should use, or whether a just-finished component needs a story at all. Also use right after creating any new React component to decide whether a story is warranted: on the first component in a project, explain Storybook and ask the user yes/no, record the choice in CLAUDE.md, then honor it for every component after. Do NOT use for general code review, component file placement, hooks, i18n, or repo/CI setup scripts.
Ships in frontend-react. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A story is the cheapest way for a human to see a component in isolation, but not every project wants them. This skill makes that a deliberate, remembered, per-project decision instead of a guess made fresh every time.
In: writing or adding a Storybook story for a React component, or deciding whether a just-finished component needs one.
Out: the CLAUDE.md Storybook preference honoured (explained + asked + recorded on the first
component), and where yes a colocated story covering the key states — including the error state —
driven by controls, its mock a separate *.mock.ts under a stories/ folder. The checkable
expectations are in evals/rubric.json.
Look in the project's CLAUDE.md for a line recording the Storybook choice:
Storybook stories: yes → go to Step 3 (write the story).Storybook stories: no → STOP. Do not write a story. Say nothing further about it.Do NOT re-ask if the line already exists — the whole point is to ask once.
First detect whether Storybook is even set up: a storybook dependency or script in
package.json, or a .storybook/ directory.
Explain Storybook to the user in their own language, briefly — something like:
Storybook is an isolated workbench for UI components. Each component renders on its own page (a "story") outside the app — no routing, auth, or backend needed. It's used to build, document, visually review, and test components in isolation, and it gives a browsable catalog so the next person finds an existing component instead of rebuilding it. Stories live next to the component as
<Component>.stories.tsx.
Then ask plainly: "Do you want me to create a Storybook story alongside each new component in this project?" (yes / no).
npx storybook@latest init and ask whether to set it up now.Record their answer as a single, stable line in the project's CLAUDE.md so this skill
finds it next time — add or update:
Storybook stories: yes
(or no). Put it where the project keeps conventions/invariants; one line, exact
wording, so Step 1 can read it deterministically.
Then act on the answer (Step 3 if yes; otherwise stop).
get-storybook-story-instructions
first and treat it as the source of truth for imports and patterns.stories/ folder inside the component's folder (STRICT). Keep the
story AND its data together there, e.g.
…/<component-folder>/stories/<Component>.stories.tsx.stories/<Component>.mock.ts exporting <componentName>StorybookMock, and
import it into the story. NEVER import the app's runtime or domain mock-data (that
nails a generic component to one concrete use). Keep the values abstract and neutral
("Metric — rising"), not domain-specific ("Revenue") — the component is generic, so
its fixtures stay generic.ErrorBoundary renders is one of the component's states, so the story exercises it
too (throw an enveloped error into the boundary and show the fallback tile). Not
redundant duplicates. Use realistic or mock props.argTypes select / radio /
boolean (options as lists), so a reviewer flips every state from the Controls
panel in ONE controllable story. Prefer this over many near-identical exports — one
component, every state reachable by a prop (that's the payoff of prop-/BEM-state-driven
components). Add a named export only for a state worth pinning as its own entry point.
(If a state is produced by throwing into an ErrorBoundary, give the boundary
key={arg} so flipping the control remounts it — react-error-boundary latches on the
first caught error otherwise.)<Component>Skeleton): don't give the
skeleton its own story file — treat it as a state. In each story/case render the
real component with its skeleton stacked directly below it (normal on top), so
the two compare at a glance; a shared decorator across the states keeps it DRY. See
the react_skeleton-components skill.preview-stories, or the
iframe.html?id=… URL) so the user can eyeball the result.CLAUDE.md's recorded Storybook stories: preference was read; on the first component Storybook was
explained, the user asked, and yes/no recorded in CLAUDE.md.yes: a colocated story covers the key states — including the error/ErrorBoundary state — driven
by select/radio/boolean controls (one controllable story, not per-state duplicates), the
preview URL was surfaced, and the story + its mock live in a stories/ folder with data in a
separate *.mock.ts (never inline, no app/domain mock-data).no: story creation was skipped silently.evals/rubric.json.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
8 skills in this plugin
/component-placementComponent Placement — search first, then decide whereEntry point BEFORE creating ANY React component, in any React codebase — search for an existing one first, decide placement (primitive / feature / layout / page-local), then route to the matching per-type skill. Framework-agnostic: governs component ARCHITECTURE, not any specific UI or styling library. Activate whenever about to add, scaffold, or hand-roll a component, panel, card, widget, or control./component-structureComponent Structure — BEM + SCSS + rem + i18nUse when creating, editing, restructuring, or reviewing a React frontend component — including its folder layout and file organization (tsx/scss/index), where a component or sub-component should live, BEM class naming, SCSS styling, rem sizing, i18n of user-visible strings, barrel exports, and replacing inline JS style/hover handlers (e.g. onMouseEnter toggling classes) with CSS. Covers "this component file is in the wrong place — fix the structure", moving a flat .tsx into its own folder, and any question about how a component's files, styles, or markup should be organized./feature-componentsFeature Components — domain blocks built from primitivesRules for FEATURE components in a React codebase — domain-coupled blocks that compose primitives and hold business logic/data. Activate when building or editing a domain feature (a panel/table/editor tied to your business data), or adding a new domain area. Framework-agnostic. Reached via frontend-react:component-placement./hooks-registryReact Hooks Registry & ReuseUse when about to add, hand-roll, rename, move, or remove a custom React `use*` hook./layout-componentsLayout Components — the frame around every pageRules for LAYOUT / app-chrome components in a React codebase — the shell, top bar, sidebar, command palette, and global overlays that frame every page. Activate when editing or adding app chrome. Framework-agnostic. Reached via frontend-react:component-placement./skeleton-componentsSkeleton Components — decide first, then colocateWhen building or editing a React component that renders asynchronously-loaded data, decide whether it needs a loading skeleton — and if so, build a separate skeleton component colocated next to it from the shared Skeleton primitive. Activate whenever a component gains a loading state, shows a blank/"Loading…" gap, or you are reviewing async data UI.npx claudepluginhub aquivalabs/bladeforge --plugin frontend-react