storybook-stories

Enforce co-located CSF 3 Storybook stories with stable IDs for Playwright tests.

1|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/matthewharwood/dean-stack --skill storybook-stories-matthewharwood
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: storybook-stories
Source: https://github.com/matthewharwood/dean-stack/tree/main/.claude/skills/storybook-stories
Command: npx skills add https://github.com/matthewharwood/dean-stack --skill storybook-stories-matthewharwood

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Authoring and enforcing Storybook stories that live alongside components, ensuring every UI piece has a co-located story that Playwright can target deterministically.

Core Features & Use Cases

  • Co-located stories: each component ships with its own stories.tsx following the CSF 3 Meta and StoryObj pattern, with typed args and argTypes.
  • Pillar alignment: enforces the Storybook-first approach and the predictable story ID contract used by Playwright tests.
  • Test integration: makes Playwright tests mount the precise story URL to validate UI behavior.

Quick Start

Create a component file and a co-located stories.tsx, export a Meta with CSF3 structure, and ensure at least one StoryObj is exported to enable tests.

Frequently Asked Questions about storybook-stories

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

FAQPage Schema
How do I co-locate Storybook stories with components using CSF 3?

To co-locate Storybook stories with components using CSF 3, create a *.stories.tsx file alongside your component and export a Meta object with typed args and argTypes, plus at least one StoryObj export to enable deterministic UI testing.

Why do my Playwright component tests fail to find stable story IDs?

Playwright component tests fail to find stable story IDs when stories are not co-located with components. Enforcing a Storybook-first workflow with co-located *.stories.tsx files and CSF 3 exports ensures predictable story ID contracts for tests.

What is the Storybook-first workflow for component testing?

The Storybook-first workflow for component testing requires authoring co-located stories using the CSF 3 Meta and StoryObj pattern. This enforces a predictable story ID contract that Playwright tests can mount deterministically via precise story URLs.

Does Playwright work with co-located CSF 3 stories for UI validation?

Yes, Playwright works with co-located CSF 3 stories by mounting the precise story URL exported from the component's *.stories.tsx file. This setup validates UI behavior deterministically by targeting stable story IDs generated through co-location.

How to structure a *.stories.tsx file for predictable story discovery?

To structure a *.stories.tsx file for predictable story discovery, export a CSF 3 Meta object defining the component configuration with typed args and argTypes. Include at least one StoryObj export to establish the stable story ID contract required for Playwright tests.

Can I use Storybook stories without co-location for Playwright tests?

Using Storybook stories without co-location breaks the predictable story ID contract needed for Playwright tests. Co-locating *.stories.tsx files with components ensures consistent discovery across the codebase and validates UI behavior through stable story URLs.