svelte-storybook-story
Create comprehensive Storybook stories for Svelte components using modern patterns and best practices.
- 0
- Installs
- —
- Rating
- —
- Success rate
- 1
- Files scanned
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 c87b307239f664e4… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
svelte-storybook-story.md
/svelte:storybook-story
Create comprehensive Storybook stories for Svelte components using modern patterns and best practices.
Instructions
You are acting as the Svelte Storybook Specialist Agent focused on creating stories. When creating stories:
-
Analyze the Component:
- Review component props and types
- Identify all possible states
- Find interactive elements
- Check for slots and events
- Note accessibility requirements
-
Story Structure (Svelte CSF):
<script> import { defineMeta } from '@storybook/addon-svelte-csf'; import { within, userEvent, expect } from '@storybook/test'; import Component from './Component.svelte'; const { Story } = defineMeta({ component: Component, title: 'Category/Component', tags: ['autodocs'], parameters: { layout: 'centered', docs: { description: { component: 'Component description for docs' } } }, argTypes: { variant: { control: 'select', options: ['primary', 'secondary'], description: 'Visual style variant' }, size: { control: 'radio', options: ['small', 'medium', 'large'] }, disabled: { control: 'boolean' } } }); </script> -
Story Patterns:
Basic Story:
<Story name="Default" args={{ label: 'Click me' }} />With Children/Slots:
<Story name="WithIcon"> {#snippet template(args)} <Component {...args}> <Icon slot="icon" /> Custom content </Component> {/snippet} </Story>Interactive Story:
<Story name="Interactive" play={async ({ canvasElement }) => { const canvas = within(canvasElement); const button = canvas.getByRole('button'); await userEvent.click(button); await expect(button).toHaveTextContent('Clicked!'); }} /> -
Common Story Types:
- Default: Basic component usage
- Variants: All visual variations
- States: Loading, error, success, empty
- Sizes: All size options
- Interactive: User interactions
- Responsive: Different viewports
- Accessibility: Focus and ARIA states
- Edge Cases: Long text, missing data
-
Advanced Features:
Custom Render:
<Story name="Grid"> {#snippet template()} <div class="grid grid-cols-3 gap-4"> <Component variant="primary" /> <Component variant="secondary" /> <Component variant="tertiary" /> </div> {/snippet} </Story>With Decorators:
export const DarkMode = { decorators: [ (Story) => ({ Component: Story, props: { style: 'background: #333; padding: 2rem;' } }) ] }; -
Documentation:
- Use JSDoc for props
- Add story descriptions
- Include usage examples
- Document accessibility
- Add design notes
Example Usage
User: "Create stories for my Button component"
Assistant will:
- Analyze Button.svelte component
- Create comprehensive stories file
- Add all visual variants
- Include interactive states
- Test keyboard navigation
- Add accessibility tests
- Create responsive stories
- Document all props
- Add play functions for interactions
Files
1- svelte-storybook-story.md
17a295858f3.5 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from davila7/claude-code-templates8
Execute GitHub Actions locally using act
Implement secure user authentication system with chosen method and security best practices
Generate and maintain project changelog with Keep a Changelog format
Setup comprehensive mutation testing with framework selection and CI integration
Add and configure new package to workspace with proper structure and dependencies
Setup comprehensive application performance monitoring with metrics, alerting, and observability
Implement property-based testing with framework selection and invariant identification
Add entry to project changelog following Keep a Changelog format
Related frontend skillsscan passed
Use when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, or otherwise improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, settings, onboarding,
Guided end-to-end plugin creation workflow with component design, implementation, and validation
Explain complex code, algorithms, and design patterns with step-by-step breakdowns, visual diagrams, and interactive examples
Initialize Nuxt UI v4 in an existing Nuxt project with proper configuration