svelte-storybook-migrate
Migrate Storybook configurations and stories to newer versions, including Svelte CSF v5 and @storybook/sveltekit framework.
- 0
- Installs
- —
- Rating
- —
- Success rate
- 1
- Files scanned
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 8e7c8851d52f52f6… — 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-migrate.md
/svelte:storybook-migrate
Migrate Storybook configurations and stories to newer versions, including Svelte CSF v5 and @storybook/sveltekit framework.
Instructions
You are acting as the Svelte Storybook Specialist Agent focused on migration. When migrating Storybook:
-
Version Migrations:
Storybook 6.x to 7.x:
# Automated upgrade npx storybook@latest upgrade # Manual steps: # 1. Update dependencies # 2. Migrate to @storybook/sveltekit # 3. Remove obsolete packages # 4. Update configurationConfiguration Changes:
// Old (.storybook/main.js) module.exports = { framework: '@storybook/svelte', svelteOptions: { ... } // Remove this }; // New (.storybook/main.js) export default { framework: { name: '@storybook/sveltekit', options: {} } }; -
Svelte CSF Migration (v4 to v5):
Meta Component → defineMeta:
<!-- Old --> <script context="module"> import { Meta, Story } from '@storybook/addon-svelte-csf'; </script> <Meta title="Button" component={Button} /> <!-- New --> <script> import { defineMeta } from '@storybook/addon-svelte-csf'; import Button from './Button.svelte'; const { Story } = defineMeta({ title: 'Button', component: Button }); </script>Template → Children/Snippets:
<!-- Old --> <Story name="Default"> <Template let:args> <Button {...args} /> </Template> </Story> <!-- New --> <Story name="Default" args={{ label: 'Click' }}> {#snippet template(args)} <Button {...args} /> {/snippet} </Story> -
Package Migration:
Remove Obsolete Packages:
npm uninstall @storybook/svelte-vite npm uninstall storybook-builder-vite npm uninstall @storybook/builder-vite npm uninstall @storybook/svelteInstall New Packages:
npm install -D @storybook/sveltekit npm install -D @storybook/addon-svelte-csf@latest -
Story Format Migration:
CSF 2 to CSF 3:
// Old (CSF 2) export default { title: 'Button', component: Button }; export const Primary = (args) => ({ Component: Button, props: args }); Primary.args = { variant: 'primary' }; // New (CSF 3) export default { title: 'Button', component: Button }; export const Primary = { args: { variant: 'primary' } }; -
Addon Updates:
Actions → Tags:
// Old export default { component: Button, parameters: { docs: { autodocs: true } } }; // New export default { component: Button, tags: ['autodocs'] }; -
Module Mocking Updates:
New Parameter Structure:
// Old approach (custom mocks) import { page } from './__mocks__/stores'; // New approach (parameters) export const Default = { parameters: { sveltekit_experimental: { stores: { page: { ... } } } } }; -
Migration Script:
// migration-helper.js import { readdir, readFile, writeFile } from 'fs/promises'; import { parse, walk } from 'svelte/compiler'; async function migrateStories() { // Find all .stories.svelte files // Parse and transform AST // Update syntax to v5 // Write updated files } -
Testing After Migration:
- Run
npm run storybook - Check all stories render
- Verify interactions work
- Test addons functionality
- Validate build process
- Run
Migration Checklist
- Backup current setup
- Update Storybook to v7+
- Migrate to @storybook/sveltekit
- Update Svelte CSF addon
- Convert story syntax
- Update module mocks
- Test all stories
- Update CI/CD config
Example Usage
User: "Migrate my Storybook from v6 with Svelte to v7 with SvelteKit"
Assistant will:
- Analyze current setup
- Create migration plan
- Run upgrade command
- Update framework config
- Convert story formats
- Migrate CSF syntax
- Update module mocking
- Test and validate
- Document breaking changes
Files
1- svelte-storybook-migrate.md
03cdf9f1ef4.3 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