From godmode
Guides Svelte/SvelteKit development covering runes reactivity vs legacy, stores, file-based routing, form actions, SSR strategies, and adapter configurations for platforms like Vercel.
How this skill is triggered — by the user, by Claude, or both
Slash command
/godmode:svelteThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- `/godmode:svelte`, "Svelte app", "SvelteKit"
/godmode:svelte, "Svelte app", "SvelteKit"cat package.json 2>/dev/null \
| grep -E '"svelte"|"@sveltejs/kit"'
ls svelte.config.js svelte.config.ts 2>/dev/null
Svelte version: <4 / 5>
Meta-framework: SvelteKit | standalone
Reactivity: Runes ($state) | Legacy ($:) | Mixed
State: Svelte stores | Runes | external
Routing: SvelteKit file-based | custom
CSS: Tailwind | UnoCSS | SCSS | scoped
IF starting fresh: "Need SSR? Use SvelteKit."
DECISION:
IF new project + Svelte 5: use Runes
IF existing Svelte 4: keep legacy unless migrating
IF mixed codebase: plan migration, don't stay mixed
| Factor | Runes (Svelte 5) | Legacy (4) |
|--------------|-----------------|-------------|
| Explicitness | $state (explicit)| let (implicit)|
| Computed | $derived (clear) | $: (ambiguous)|
| Side effects | $effect | $: (overloaded)|
| Props | $props() (typed) | export let |
| Granularity | Signal-based | Component |
Svelte 5: reactive classes (.svelte.ts)
Svelte 4: writable/readable/derived stores
Rules:
One store per domain (cart, auth, notifications)
Expose minimal API (subscribe + methods)
Derived stores for computed values
Server-safe (no client state in global scope)
src/routes/
├── +layout.svelte Root layout
├── +layout.server.ts Root data (session)
├── +page.svelte Home (/)
├── +page.server.ts Home data loader
├── auth/login/+page.svelte
├── dashboard/+layout.server.ts Auth guard
└── blog/[slug]/+page.server.ts Dynamic
Rules:
(name) for URL-free grouping| Route | Strategy | Reason |
|----------------|----------|----------------|
| / | Prerender | Static, fast |
| /about, /pricing| Prerender| Marketing, SEO |
| /blog/[slug] | SSR+cache| Dynamic, SEO |
| /dashboard/** | CSR | Auth-gated |
| /api/** | Server | API endpoints |
// Prerender: export const prerender = true;
// CSR only: export const ssr = false;
| Platform | Adapter |
|-----------|------------------------------|
| Vercel | @sveltejs/adapter-vercel |
| Cloudflare| @sveltejs/adapter-cloudflare |
| Node.js | @sveltejs/adapter-node |
| Static | @sveltejs/adapter-static |
# Run component tests
npx vitest run
# Run e2e tests
npx playwright test
# Check types
npx svelte-check --tsconfig ./tsconfig.json
Coverage target: >80% statements, >70% branches.
| Check | Status |
|------------------------------|--------|
| Svelte 5 runes used | PASS |
| TypeScript strict | PASS |
| Server load for data | PASS |
| Form actions for mutations | PASS |
| use:enhance on forms | PASS |
| No secrets in +page.ts | PASS |
| Each {#each} has unique key | PASS |
Log to .godmode/svelte.tsv:
timestamp\taction\tcomponents\troutes\tstores\ttests\tbuild
SVELTE: {action}. Components: {N}. Routes: {N}.
Reactivity: {runes|legacy}. Build: {status}.
KEEP if: svelte-check passes AND vite build succeeds
AND all existing tests pass
DISCARD if: type errors OR build failures
OR hydration mismatches. Revert immediately.
STOP when:
- svelte-check zero errors
- vite build completes
- No $: in Svelte 5 projects (runes only)
- No secrets in +page.ts files
npx claudepluginhub arbazkhan971/godmodeEnforces Svelte 5 best practices in SvelteKit: runes ($state, $derived, $effect), $props(), $bindable(), load functions, form actions, and SSR patterns to fix outdated Svelte 4 code.
Svelte runes-first reactivity and SvelteKit fullstack conventions. Invoke whenever task involves any interaction with Svelte code — writing, reviewing, refactoring, debugging, or understanding .svelte, .svelte.js, .svelte.ts files and SvelteKit projects.
Builds full-stack SvelteKit web apps with file-based routing, SSR, SSG, API routes, form actions, and load functions. Activates for +page.svelte, +layout.svelte, or Svelte full-stack queries.