component-stories

Enforces Storybook story conventions for React and React Native component stories.

23|5|Updated Apr 3, 2025
One-click install
npx skills add https://github.com/LedgerHQ/lumen --skill component-stories-ledgerhq
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: component-stories
Source: https://github.com/LedgerHQ/lumen/tree/main/.claude/skills/component-stories
Command: npx skills add https://github.com/LedgerHQ/lumen --skill component-stories-ledgerhq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Storybook stories across a design system often drift into inconsistent naming, layout, and docs configurations, making documentation harder to navigate and review. This Skill standardizes how *.stories.tsx files are written so every story follows the same conventions. ## Core Features & Use Cases - Meta Typing Rules: Enforces satisfies Meta<typeof Component> and StoryObj<typeof Component> typing patterns. - Layout and Docs Configuration: Requires centered layout, light background, and dynamic docs source for stories with interactive controls. - Naming Conventions: Standardizes export names such as Base, {Property}Showcase, With{Feature}, and ResponsivenessShowcase. - Use Case: When adding a new Button story to a design system, the Skill ensures it uses a Base export with centered layout, dynamic docs source, and no redundant argTypes. ## Quick Start Ask the assistant to create or review a Storybook story for a component and it will apply these story conventions automatically.

Frequently Asked Questions about component-stories

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a Storybook story with controls in React?▼

Define a Base story with args and a render function so Controls appear in docs, and set docs.source.type to dynamic in the meta parameters. Use satisfies Meta<typeof Component> and StoryObj<typeof Component> for typing.

What naming convention should Storybook story exports use?▼

Use Base for the default story, {Property}Showcase for property variations, With{Feature} for feature stories, and ResponsivenessShowcase for truncation behavior. All names use PascalCase and avoid generic names like Default or Demo.

Should I use dynamic or code docs source type in Storybook?▼

Use type dynamic when the story exposes args and Controls so the code snippet updates with control changes. Use type code only for static showcase stories with a hand-written source.code block.

When should I add manual argTypes in Storybook?▼

Add manual argTypes only for overrides that react-docgen-typescript cannot infer, such as actions, select mappings, or hidden props. Do not duplicate argTypes for plain unions, booleans, or strings already described in types.ts.

Why use satisfies Meta instead of a Meta type annotation?▼

Using satisfies Meta<typeof Component> preserves the inferred type of the meta object while still checking it against Meta. Typing StoryObj with typeof meta instead of typeof Component would make args required on every story.