working-with-storybook
Runs, writes and debugs PostHog Storybook stories and their visual review snapshots. Use when you start Storybook to look at a change, write or change a…
от PostHog★ 41 278 звёзд на GitHub
Установить working-with-storybook в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Working with Storybook
The Storybook docs live next to the setup, in common/storybook/README.md and its docs/ folder.
This skill does not repeat them. Read the one the task needs:
| Task | Read |
|---|---|
| Start Storybook, open a story by URL, run the snapshot runner locally | README |
| Write a story, or set its feature flags, date, URL, layout, theme or tags | Writing stories |
| Mock API responses, plan features, the current user, team or preflight | Mocking data |
Pick testOptions, fix a timeout, an empty render or a flake, understand baselines |
Snapshots |
| Write a story that loads data, measures itself or uses timers | Deterministic stories |
| Find out why visual review blocks a PR, approve, tolerate or quarantine a snapshot | triaging-visual-review-runs |
Render a story to check a change
Start Storybook in the background with only the stories you need:
STORYBOOK_STORIES=<dir or story file> pnpm storybook. Never edit thestorieslist incommon/storybook/.storybook/main.ts.Wait for the index, then find the story ID:
until curl -sf http://localhost:6006/index.json >/dev/null; do sleep 1; done curl -s http://localhost:6006/index.json | jq -r '.entries | keys[]'Load
http://localhost:6006/iframe.html?viewMode=story&id=<story-id>&globals=theme:<light|dark>in a headless browser. The first load after a start compiles the dependencies and can take a few minutes, so give it a page load timeout of a few minutes.Take screenshots with a Playwright script kept outside the repo, for example in your scratch directory. Use
deviceScaleFactor: 2, so a screenshot in a PR doesn't look soft.Check the light and dark themes, and the narrow widths the root
AGENTS.mdasks for. Compare before and after.
A story you write only for this check or for a PR screenshot is scratch. Keep it out of the commit.
Before you commit a story
- Read Writing stories first when the story sets feature flags. The wrong way passes in jest and fails only in visual review.
- Each committed story shows a state no other story shows, because each one adds two baselines that every later change must approve again.
- Don't commit images from a local snapshot run. CI takes the snapshots, and visual review commits the baseline hashes.
Visual review in this repo
triaging-visual-review-runs is published to every PostHog user, so it says nothing about this repo's CI. Use it together with these facts:
- Branch protection requires the
Visual regression tests passandPlaywright tests passjob checks. - A PR run renders only the stories its diff can affect. The
run-ci-frontendlabel asks for every story, from the next push on. Snapshots has the details. - A fork PR has no Visual Review run. Each Storybook shard compares its screenshots with
frontend/snapshots.ymlin theVerify snapshots against the baseline offlinestep, and a mismatch failsVisual regression tests pass. Triage it with the fork section of the triaging skill. Pull requests from forks explains the fallback, andrecreating-fork-prsmoves a reviewed fork PR in-repo. - To find the story file behind a snapshot, search for its title, for example
rg "title: 'Scenes-App/Settings/User'" frontend products.
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл working-with-storybook?
Runs, writes and debugs PostHog Storybook stories and their visual review snapshots. Use when you start Storybook to look at a change, write or change a `*.stories.tsx` file, set feature flags, the date, the URL, mocks or `testOptions` for a story, or fix a story that times out, renders nothing or flakes in visual review, including the offline baseline check on a fork PR. Points to the Storybook docs in `common/storybook/` and adds the steps an agent follows to render and screenshot a story. Trigger terms: storybook, story, stories, pnpm storybook, STORYBOOK_STORIES, featureFlags, testOptions, mswDecorator, mockDate, visual review, snapshot, flaky story, Visual regression tests pass.
Как установить скилл working-with-storybook?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл working-with-storybook запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…