writing-storybook-stories

Write and update Storybook stories for Vue components in ComfyUI_frontend.

2.0k|679|Updated Jun 13, 2024
One-click install
npx skills add https://github.com/Comfy-Org/ComfyUI_frontend --skill writing-storybook-stories
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-storybook-stories
Source: https://github.com/Comfy-Org/ComfyUI_frontend/tree/main/.claude/skills/writing-storybook-stories
Command: npx skills add https://github.com/Comfy-Org/ComfyUI_frontend --skill writing-storybook-stories

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing consistent Storybook stories for Vue components requires matching repo-specific conventions, title patterns, and typing helpers, which is error-prone when done manually.

Core Features & Use Cases

  • Convention Matching: Guides story creation by reading neighboring .stories.ts files and matching local title patterns such as Components/Input/SearchInput or Widgets/<WidgetName>.
  • Story Patterns: Provides templates for stateful v-model inputs, slot-driven content, and variant grids using @storybook/vue3-vite and ComponentPropsAndSlots typing.
  • Figma Mapping: Converts named Figma design states into prop-driven stories like Disabled, Loading, or AllVariants.
  • Use Case: When adding a new button component to src/components/ui/button/, use this Skill to generate a co-located Button.stories.ts file with autodocs tags, proper typing, and validation via pnpm storybook, pnpm typecheck, and pnpm lint.

Quick Start

Use the writing-storybook-stories skill to create a Storybook story for the SearchBox component following the repo conventions.

Frequently Asked Questions about writing-storybook-stories

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

FAQPage Schema
How do I write a Storybook story for a Vue 3 component?

Read the component source to understand its props, emits, and slots, then create a co-located `ComponentName.stories.ts` file using `@storybook/vue3-vite`. Match the nearest sibling story's title pattern and add `tags: ['autodocs']`.

How to handle v-model in Storybook stories for Vue components?

Use a stateful render function with `ref()` and `toRefs(args)` instead of mutating Storybook args directly. Bind the local ref with `v-model` in the template and pass other args as props.

What title naming convention should Storybook stories use?

Match the closest sibling story in the same folder tree rather than inventing a new pattern. In ComfyUI_frontend, common patterns include `Components/Button/Button`, `Components/Input/SearchInput`, and `Widgets/<WidgetName>`.

Can I map Figma design states to Storybook stories?

Yes, extract the named states from the Figma design first, then create explicit prop-driven stories such as `Disabled`, `Loading`, or `AllSizes`. Add an aggregate story like `AllVariants` when side-by-side comparison is useful.

Why should I avoid dark: Tailwind variants in Storybook story wrappers?

Hardcoded `dark:` variants break theme consistency across the app. Use semantic tokens such as `bg-base-background` and `bg-node-component-surface` so stories render correctly under the project's theming system.