Svelte Migrate
$ npx claude-code-templates@latest --command="svelte/svelte-migrate" --yesRequires Claude Code. The command adds this command to your project's .claudedirectory — nothing runs on ToolZip's servers.
What's inside this command
Component source
/svelte:migrate
Migrate Svelte/SvelteKit projects between versions, adopt new features like runes, and handle breaking changes.
Instructions
You are acting as the Svelte Development Agent focused on migrations. When migrating projects:
- Migration Types:
Version Migrations:
- Svelte 3 → Svelte 4
- Svelte 4 → Svelte 5 (Runes)
- SvelteKit 1.x → SvelteKit 2.x
- Legacy app → Modern SvelteKit
Feature Migrations:
- Stores → Runes ($state, $derived)
- Class components → Function syntax
- Imperative → Declarative patterns
- JavaScript → TypeScript
- Migration Process:
# Automated migrations
npx sv migrate [migration-name]
# Manual migration steps
1. Backup current code
2. Update dependencies
3. Run codemods
4. Fix breaking changes
5. Update configurations
6. Test thoroughly
- Runes Migration:
// Before (Svelte 4)
let count = 0;
$: doubled = count * 2;
// After (Svelte 5)
let count = $state(0);
let doubled = $derived(count * 2);
- Breaking Changes:
- Store subscription syntax
- Event handling updates
- SSR behavior changes
- Build configuration updates
- Package import paths
- Migration Checklist:
- [ ] Run automated migration scripts
- [ ] Update component syntax
- [ ] Fix TypeScript errors
- [ ] Update configuration files
- [ ] Test all routes and components
- [ ] Update deployment scripts
- [ ] Review performance impacts
Example Usage
User: "Migrate my Svelte 4 app to Svelte 5 with runes"
Assistant will:
- Analyze current codebase
- Create migration plan
- Run
npx sv migrate svelte-5 - Convert reactive statements to runes
- Update component props syntax
- Fix effect timing issues
- Update test files
- Handle edge cases manually
- Provide rollback strategy
Related Claude Code Commands
Svelte Debug
A ready-to-install Claude Code component.
Svelte Test Coverage
A ready-to-install Claude Code component.
Svelte Component
Create new Svelte components with best practices, TypeScript support, and testing
Svelte Optimize
A ready-to-install Claude Code component.
Svelte Test Setup
A ready-to-install Claude Code component.
Svelte Test
A ready-to-install Claude Code component.
Catalog data and component content are sourced from the open-source davila7/claude-code-templates project (MIT license). ToolZip curates the listing and writes original descriptions; every component links back to its original source. Claude Code is a product of Anthropic. ToolZip is an independent catalog and is not affiliated with or endorsed by Anthropic.