← Zurück zu Prism
AgentPrism
3. Interactive
Komponentenwerkstätten und Storybook
Zeigt relevante Zustände in vorhandener Vorschau mit denselben Grundlagen wie die Produktionsoberfläche.
storybook-component-workbenches
Entdecke, wie der Skill hilftWann ist der Skill hilfreich?
Nutze diesen Skill für isolierte Komponentenprüfung ohne komplexe Backendzustände.
Wobei hilft er dir?
- Nutzt vorhandene Werkstatt, Themen, Schriften und Übersetzungsanbieter.
- Deckt Laden, Deaktivierung, Fehler, Leere und lange Inhalte ab.
- Verbindet Komponenten zu realistischen Interaktionen.
Das könntest du fragen
Ergänze Dialogvorschauen mit Serverfehlern, langen deutschen Texten, schmalem Layout und Tastaturbedienung. Prüfe Tastaturinteraktion in jedem Vorschauzustand. Ein Serverfehler erhält Eingaben, fokussiert das richtige Element und bleibt auf Telefonbreite lesbar.
Ausführliche Dokumentation
Hier findest du die ursprüngliche Anleitung, Beispiele und Prüfschritte des Skills in ihrer Originalsprache.
Weniger anzeigen
Storybook & Component Workbenches
An isolated component workbench (Storybook, Histoire, Ladle or the project's built-in UI preview harness) lets developers and designers develop, inspect and test every component state without having to reproduce complex backend states inside the full application.
1. Adapt to the Project's Existing Workbench First
- Check
package.jsonand the repository structure to see what component workbench or preview route already exists. - Do not install Storybook or a new workbench framework unprompted on a project that does not use one; introduce a new tool only when explicitly requested or agreed with the architect.
- When a workbench is present, ensure its global decorators load the exact same CSS reset, design tokens, font faces, icon sets and i18n provider as the production application so stories never render differently from real screens.
2. Writing High-Value Stories (State Coverage Over Boilerplate)
Organize stories around the states and edge cases that matter to consumers and reviewers:
Default/Playground: interactive controls (args/argTypes) for exploring primary variants and sizes.- All Variants & Sizes Grid: a single story rendering the matrix of
variant x sizeside-by-side in both light and dark themes so visual consistency and alignment can be scanned at a glance. - Interactive States: explicit stories for
Loading,Disabled,ReadOnly,InvalidWithError,EmptyStateandSelected. - Content Stress Tests:
LongTextAndOverflow: 120-character titles, unbroken URLs, German/Hungarian translations and multi-line wrapping.NarrowViewport: configured with a320px–375pxviewport parameter to verify responsive reflow.
- Composition Stories: realistic combinations (
DialogWithFormValidation,DataTableWithEmptyFilter,CardGridWithSkeletons) that verify how primitives work together.
3. Interactive play Functions & Automated Checks
Turn static stories into executable behavioral and accessibility tests:
- Interaction tests (
playfunction):- Use
@storybook/test(within(canvasElement),userEvent,expect) to simulate keyboard navigation (userEvent.tab(),userEvent.keyboard('{Enter}')), open popovers/dialogs, trigger form validation errors, and assert DOM states.
- Use
- Accessibility addon (
@storybook/addon-a11y):- Run
axe-coreautomatically against every rendered story (including after theplayfunction opens an overlay or triggers an error state).
- Run
- Remember the boundary of isolated stories: a story passing in isolation does not prove that the component integrates cleanly with real application routing, server data or parent layout constraints — always verify on representative application screens as well.
Enthaltene Dateien 1
SKILL.md
