Minimum Story Recipe
{item.name}
docs lane{item.note}
import { authoringChecklist, commonSlotNames, commonStateNames, cvaConventions } from "@ai-ui/ui"; import type { Meta, StoryObj } from "@storybook/react"; const docsCoverage = [ { name: "Playground", note: "One opinionated default example that shows the component in its most typical role." }, { name: "States", note: "Only when the component has meaningful disabled, invalid, checked, selected, or open-state behavior worth comparing." }, { name: "Anatomy", note: "Name the stable slots and public data attributes that designers and engineers can style against." }, { name: "Accessibility or Motion", note: "Choose the dimension that is most likely to be misunderstood by contributors and consumers." } ] as const; const docsWritingRules = [ "Use `docs.description.component` to explain when the component should be chosen, not to restate its name.", "Show real product language instead of lorem ipsum so states and hierarchy feel intentional.", "Keep examples narrow. One good scenario teaches more than six generic permutations.", "If a story exists only to explain slots or motion, say that directly in the story description." ] as const; function ComponentAuthoringGuide() { return (
AI UI / Docs Guide
This page turns the repo's component contract into a repeatable Storybook recipe. The goal is not maximum story count. The goal is a small set of stories that makes API, anatomy, and behavioral intent obvious to the next contributor.
{item.name}
docs lane{item.note}
{rule}
The docs should mirror the same public hooks that the components expose in source.
{item}
Docs should reinforce the variant surface that engineering already considers stable.
{item}
Anatomy stories should name only the slots a consumer can reasonably style or inspect in tests.
{`data-slot="${item.slot}"`}
slot
{item.guidance}
State stories should match the durable `data-*` surface, not one-off visual tweaks.
{`data-${item.state}`}
state
{item.guidance}
Ask if the docs tell a consumer when to choose the component.
If the answer is "not really", the component description is still too generic.
Ask if the anatomy story names the real public styling hooks.
If the story only explains visuals, it is not yet useful to another engineer.
Ask if the most failure-prone behavior is explicitly documented.
For overlays that usually means accessibility. For animated surfaces it may be motion.
Ask if the story count stayed disciplined.
The docs should feel intentional, not encyclopedic.