Conventions for creating, modifying, and reviewing production-faithful Storybook stories in the Phoenix frontend (js/app/stories, js/app/.storybook). Covers sidebar taxonomy and titles, the tag vocabulary, entry shape, option grids, component audits, overlays, toasts, themes, domain stories, and Storybook configuration. Use whenever touching `.stories.*` or story `.mdx` files, story fixtures, decorators, helpers in `stories/utils`, thumbnails, `.storybook/` configuration, or a frontend change that adds, changes, moves, or removes stories — including small or mechanical story edits and PR reviews that touch stories.
75
94%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Stories exist to show how production components look and behave. This file holds the rules that apply to every story change and routes to focused references for the rest. Read only the references your task needs; each one is self-contained.
Apply it alongside phoenix-frontend, phoenix-design, and
phoenix-typescript when those are relevant.
Design System/<Subject>/…, Domains/<Surface>/…, or Storybook/….
Subjects are what a reader is thinking about (Tables, Overlays,
Feedback), never abstraction tiers (foundations / core / patterns). The
subject and surface lists live in js/app/stories/_meta/taxonomy.ts.
Adding a root or subject is a taxonomy decision: raise it, do not invent
one.Design System/Overlays/Popover lives at
js/app/stories/design-system/overlays/Popover.stories.tsx. Leaves are
spaced words; no & anywhere in a title.legacy | updated), completeness (complete | incomplete, required
on updated), human review (reviewed | unreviewed). New or rewritten
stories are updated + unreviewed. Only a human reviewer sets
reviewed — never an agent, however confident.!dev. When all of a file's stories read well together on the Docs page,
tag every one !dev so the Docs page is the component's only entry.Default, then the option grids. A foundational
component shows its whole accepted option space, including options that
have no styling.OptionGrids — never appended as one more column beside content
or variant options. pnpm lint:storybook rejects the mixed form.Interaction story.themeLayout deliberately;
any grid with more than one cell column takes themeLayout: "column".// comment must say something the file cannot.pnpm lint:storybook (from js/app) after any story change. It
enforces titles, paths, tags, !dev, unused, Overview naming, and the
state-axis rule. Passing it is necessary, not sufficient.Read every row that matches the task. Paths are relative to this file.
| Task | Read |
|---|---|
| Authoring or rewriting a design-system component's stories | component-audit, option-grids, entry-shape |
| Component with variable text or a list of items | content-length |
| Menus, popovers, tooltips, dialogs, submenus, or anything held open | overlays |
| Toasts or toast regions | toasts |
Choosing themeLayout, fixing a story in Both mode, portaled-layer theming | themes |
A story for one product surface (Domains/…), fixtures, mocks, many-state domain components | domain-stories |
| Choosing where an entry goes, adding a subject or subfolder | taxonomy |
Creating, moving, or renaming a file or title; Overview pages; storySort | files-and-titles |
Writing or checking tags, !dev, unused, autodocs | tags |
| Writing a docblock or code comment in a story file | docblocks-and-comments |
| Merging entries, deleting stories, regenerating thumbnails | merging-and-removal |
Editing .storybook/ (manager, sidebar, preview, Docs page) | storybook-config |
| Reviewing a PR or auditing a set of stories | review, then the rows above for what it touches |
| Checking a story in a real browser | verification |
A design-system story does not need the domain reference, and a domain story does not need the Storybook configuration reference. Load what the change touches.
Copy this checklist and work through it:
- [ ] Read the component source; list what it accepts (component-audit)
- [ ] Place and title the file (taxonomy, files-and-titles)
- [ ] Compact `Default` first, then pairwise option grids (option-grids)
- [ ] Content-length and layer stories if the component has them
- [ ] Tags on all three axes; `!dev` per entry-shape
- [ ] Reread every docblock and comment you wrote; delete restatements
- [ ] `pnpm lint:storybook` passes
- [ ] Check `Both` mode for horizontal scroll and layer themes (verification)The completeness tag records the audit: complete only when every item the
audit listed appears or is explicitly excluded with a reason.
This skill is the durable home for Storybook conventions. When a maintainer settles how content is grouped, named, ordered, or sized, rejects a story shape, or names a failure mode — or when you find a rule here underspecified for the case in front of you — update the matching reference in the same change.
f408fdd
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.