Module Migration to Target Architecture

VerifiedCaution

Migrates a complete module to the target architecture from `docs/ARCHITECTURE.md` across six phases (analysis, structure, types, services, state, components) with approval gates. Helps when systematically refactoring SvelteKit modules, whether upgrading Svelte 4 to 5, JavaScript to TypeScript, or SvelteKit 1 to 2.

Sby Skills Guide Bot
DevelopmentIntermediate
906/2/2026
Claude Code
#migration#svelte#sveltekit#architecture#typescript

Recommended for

Our review

Migrates a complete module to a target architecture following a 6-phase process with validation and approval gates in between.

Strengths

  • Structured and repeatable process with clear phases
  • Validation after each phase (build, svelte-check, tests)
  • Comprehensive coverage from analysis to final review

Limitations

  • Requires the target architecture to be defined in docs/ARCHITECTURE.md
  • Does not handle external dependencies or complex integrations
  • Approval phases can slow down automated execution
When to use it

Use this skill when you need to migrate an entire module (files, types, services, state, components) to a new architecture.

When not to use it

Do not use it for small changes or partial refactors, as the process is designed for a complete and systematic migration.

Security analysis

Caution
Quality score85/100

The skill uses Bash for standard development validation steps. There is no instruction to run destructive or exfiltrating commands, and each phase requires user approval, mitigating risk. However, the presence of Bash execution warrants caution.

Findings
  • Uses Bash tool, which could execute arbitrary commands, though here it is limited to running build/lint/test commands like svelte-check, npm run build, npm test.
  • The skill is user-invocable and takes an external argument (module path) without validation, but the commands are predefined.

Examples

Migrate a user module
Migrate the user module at src/lib/modules/user to the target architecture defined in docs/ARCHITECTURE.md.
Migrate a payment module
Run the migration skill for the payment module located in src/lib/modules/payment.

name: migration-migrate-module description: "Use when a complete module needs migration to the target architecture - runs 6 phases with approval gates." user-invocable: true argument-hint: "[module-path]" allowed-tools: Read, Write, Edit, Bash, Glob, Grep

Migrate an entire module to the target architecture from docs/ARCHITECTURE.md.

Module/Path: $ARGUMENTS

Steps

Use @migrator to coordinate the full migration in phases:

  1. Phase 0 -- Analysis: Map the module (files, Svelte 4 vs 5 patterns, JS vs TS, SvelteKit 1 vs 2 patterns, dependencies)
  2. Phase 1 -- Structure: Create src/lib/modules/[name]/ and route files, move existing files
  3. Phase 2 -- Types: Create .types.ts + .contracts.ts + adapter
  4. Phase 3 -- Services: Migrate to pure service (no try/catch, native fetch)
  5. Phase 4 -- State: Server state -> SvelteKit load functions, Client state -> Svelte stores
  6. Phase 5 -- Components: Svelte 4 -> 5 runes + composition (see conversion table)
  7. Phase 6 -- Review: Validate conformance, check for remaining legacy patterns

Validate build/svelte-check/tests after each phase. Ask for approval before each phase.

Related skills