Sveltekit
SvelteKit & Svelte 5 Migration, Best-Practice Audit with state persistence. Use when: "sveltekit-audit", "sveltekit upgrade", "svelte migration", "svelte check", "sveltekit version", "svelte 5 runes".From its SKILL.md
npx -y skills add claude-hangar/claude-hangar --skill sveltekitAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
13.0 KB, ~3.6k tokens by cl100k_base, as published. Nobody here has run it
/sveltekit-audit — SvelteKit & Svelte 5 Audit
Version-neutral skill for all SvelteKit projects. Automatically detects the installed version, compares with the latest available, and loads the matching checklist.
Complementary to /audit: This skill checks SvelteKit-specific version, migration, and best-practice topics. The generic /audit checks code quality, performance, security, a11y, etc.
Modes
Detect the mode from user input:
- start -> Mode 1 (Scan project, load checklist)
- continue -> Mode 2 (Process next areas/fixes)
- status -> Mode 3 (Show progress)
- refresh -> Mode 4 (Check for new SvelteKit/Svelte releases)
- auto -> Mode 5 (Fully autonomous run)
Mode 1: /sveltekit-audit start — Scan Project
Auto-Detection (in this order)
- package.json -> Svelte version, SvelteKit version, adapter, all
@sveltejs/*packages, Drizzle packages - svelte.config.js -> Adapter, preprocess, aliases, kit config
- vite.config.ts -> Vite plugins, server config, proxy
- Node version ->
node --version(SvelteKit 2 requires Node 18.13+) - Dockerfile -> Node version in base image, build commands
- src/routes/+page.svelte -> Routing structure, layouts, groups
- Drizzle schema ->
drizzle.config.ts,src/lib/server/db/schema.tsor similar - tsconfig.json -> TypeScript configuration, strict mode, Svelte extends
Version Logic
After detection:
- Read installed version from
package.json(Svelte + SvelteKit separately) - Check latest version:
npm view @sveltejs/kit versionandnpm view svelte version - Select matching checklist:
| Svelte | SvelteKit | Checklist | Scenario |
|---|---|---|---|
| 5.x | 2.x | versions/kit2-svelte5/ | Current stack, check best practices |
| 4.x | 1.x | Migration needed | SvelteKit 1->2 + Svelte 4->5 migration |
| 4.x | 2.x | Svelte 5 migration needed | SvelteKit 2 current, only Svelte 4->5 |
| 5.x | 1.x | SvelteKit 2 migration needed | Svelte 5 current, only Kit 1->2 |
IMPORTANT: For SvelteKit 1 or Svelte 4: First ask the user whether migration is desired.
- Ask user: "Check current version OR migrate to new version?"
- Load checklist and compare with project scan
- Document findings with
SKT-NNorBP-NNIDs + severity
Flow After Detection
- Display result table: Svelte version, SvelteKit version, Node, adapter, routing overview
- Load matching checklist (max 2 areas per session)
- Check each checkpoint against the project
- Save findings to
.sveltekit-audit-state.json - Display summary + prioritized list
- Session end: "Start next session with
/sveltekit-audit continue"
Mode 2: /sveltekit-audit continue — Resume
- Read
.sveltekit-audit-state.json - Generate smart recommendation:
IF open CRITICAL findings > 0: -> "Recommendation: Fix {N} CRITICAL findings first ({IDs})" IF open HIGH findings > 3: -> "Recommendation: Fix HIGH findings, then continue" ELSE IF areas open: -> "Recommendation: Next areas ({area names})" ELSE: -> "Recommendation: Fix remaining findings" - If areas open -> process next 2 areas
- If all areas done -> next 5 findings by priority
- Load fix templates (from
fix-templates.md) where applicable - Ask user: Follow recommendation? Choose different? Skip?
- Implement fixes -> verify -> update state
Mode 3: /sveltekit-audit status — Progress
- Read
.sveltekit-audit-state.json - Display table: Done/Open/Total per area + severity
- Next recommended action
Mode 4: /sveltekit-audit refresh — Check New Releases
npm view @sveltejs/kit versionandnpm view svelte version-> latest versions- If newer version than in state: context7 or WebSearch for release notes
- Show checklist delta:
Last checked: SvelteKit 2.15.0 / Svelte 5.10.0 Current: SvelteKit 2.17.0 / Svelte 5.12.0 New changes: N (Breaking, Features) -> Checklist update recommended - Inform user + recommendation (update yes/no, breaking changes)
- When major release detected -> automatically recommend new checklist
Mode 5: /sveltekit-audit auto — Autonomous Run
Fully autonomous SvelteKit audit without prompts.
Flow
- Auto-detection as in
start - All areas processed (no 2-area limitation)
- Document findings with fix templates from
fix-templates.md - Context management: When context runs low:
- Write state immediately
- Create task in
.tasks.jsonwith handoff note - "New session with
/sveltekit-audit continue"
- At end: Summary with prioritized fix list
Severity Order of Areas in Auto Mode
CRITICAL areas first:
ENV -> CFG -> CODE -> ROUT -> LOAD -> FORM -> SSR -> API -> HOOK -> ADPT -> STORE -> CSP -> TOOL -> DB -> AUTH -> PERF2
Check Priorities + Completeness Tracking
See
_shared/audit-patterns.md(MUST/SHOULD/CAN markers, completeness counting, layer status standard). Area with <100% MUST checks cannot be marked asdone.
State File .sveltekit-audit-state.json
Save in project root (gitignored).
{
"version": 2,
"created": "YYYY-MM-DD",
"lastUpdated": "YYYY-MM-DD",
"project": "Project Name",
"installedSvelteVersion": "5.10.0",
"installedKitVersion": "2.15.0",
"targetSvelteVersion": "5.12.0",
"targetKitVersion": "2.17.0",
"checklist": "kit2-svelte5",
"nodeVersion": "22.12.0",
"adapter": "@sveltejs/adapter-node",
"areas": {
"ENV": {
"status": "pending",
"session": null,
"findingsCount": 0,
"completeness": null,
"layers": { "source": "pending", "runtime": "pending" }
},
"CFG": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"CODE": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"ROUT": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"LOAD": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"FORM": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"SSR": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"API": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"HOOK": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"ADPT": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"STORE": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"TOOL": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"DB": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"AUTH": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"CSP": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"PERF2": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null }
},
"summary": {
"total": 0,
"critical": 0,
"high": 0,
"medium": 0,
"low": 0,
"fixed": 0,
"skipped": 0
},
"findings": [
{
"id": "SKT-01",
"area": "ENV",
"severity": "CRITICAL",
"title": "Short title",
"description": "What is the problem",
"location": "File or area",
"status": "open|fixed|skipped",
"fixedIn": "Session N | null",
"notes": ""
}
],
"history": [
{
"date": "YYYY-MM-DD",
"session": 1,
"areas": ["ENV", "CFG"],
"findingsAdded": 3,
"findingsFixed": 0
}
]
}
Areas
| Code | Area | Description |
|---|---|---|
| ENV | Environment | Node/runtime version, package manager |
| CFG | Configuration | svelte.config.js, vite.config.ts |
| CODE | Svelte 5 Code | Runes ($state, $derived, $effect), reactivity, component patterns |
| ROUT | Routing | +page, +layout, +server, +error, group-based routing |
| LOAD | Load Functions | +page.ts vs +page.server.ts, universal vs server load |
| FORM | Form Actions | Progressive enhancement, use:enhance |
| SSR | SSR/CSR/Prerendering | SSR config, adapter, environment variables |
| API | API Routes | +server.ts, endpoint security, input validation |
| HOOK | SvelteKit Hooks | handle, handleError, handleFetch (hooks.server.ts) |
| ADPT | Adapter | @sveltejs/adapter-node, adapter-auto, configuration |
| STORE | State Management | Svelte 5 Runes vs legacy stores, Context API |
| TOOL | Dev Tooling | svelte-check, prettier-plugin-svelte, eslint-plugin-svelte |
| DB | Database | Drizzle integration, schema, migrations, server-only |
| AUTH | Auth Patterns | Session, cookies, protected routes via hooks |
| CSP | Content Security Policy | Trusted Types directives, CSP configuration |
| PERF2 | Performance & Bundling | Treeshaking, code splitting, bundle optimization |
Rules
- Context protection: Max 2 areas OR 5 fixes per session. At limit: save state, recommend
/sveltekit-audit continue. - Write state immediately: Update
.sveltekit-audit-state.jsonafter every area and every fix. - No auto-fix: Document findings, then ask user whether to fix.
- Read version files: Only read files from the relevant
versions/directory. Don't load all. - Severity rules:
- CRITICAL: Build breaks, runtime errors, security issues
- HIGH: Deprecation warning, functional limitation
- MEDIUM: Best practice deviation, performance
- LOW: Optional, nice-to-have, new features
- Finding prefix:
SKT-NN(SvelteKit-specific),BP-NN(Best Practice). - Fix templates: Load matching template from
fix-templates.mdfor findings. - npm view: Run
npm view @sveltejs/kit versionandnpm view svelte versionbefore any version statement. Never from memory. - context7: Use for SvelteKit/Svelte documentation when available.
Session Strategy
| Session | Content | Context Protection |
|---|---|---|
| 1 | start -> Detection + 2 areas (CRITICAL first) | Max 2 areas |
| 2 | continue -> next 2 areas | Max 2 areas |
| 3+ | continue -> Fixes (max 5/session) | Fix -> Test -> Next |
Smart Next Steps
After completing the SvelteKit audit, recommend relevant follow-up skills:
| Condition | Recommendation | Reason |
|---|---|---|
| No .audit-state.json present | /audit start | Check website quality (SEO, a11y, performance, privacy) |
| No .project-audit-state.json present | /project-audit start | Check code/CI/CD quality |
| DB area with findings | /db-audit start | Deep-dive into Drizzle schema + migration |
| AUTH area with findings | /auth-audit start | Deep-dive into auth patterns + security |
| Migration findings fixed | /lighthouse-quick | Verify performance after migration |
| UI/Design work needed | /design-system | Curated palettes, fonts, styles, UX rules (CSV databases) |
| Frontend polish desired | /polish scan | Rate 6 design dimensions, then improve |
| All areas done | /lesson-learned session | Extract learnings from audit |
Design Integration: When building or modifying UI components in SvelteKit projects, always consult /design-system first. It provides industry-matched palettes, font pairings, UX rules, and wow effects from curated CSV databases. The design-system is stack-agnostic — it provides design decisions, SvelteKit provides the code patterns.
Output after last area: "Next steps:" + 2-3 most relevant recommendations.
Version Directory Structure
Each directory under versions/ contains:
| File | Content |
|---|---|
checklist.md | Checkpoints with IDs, severity, description |
Currently available:
versions/kit2-svelte5/— Best practices for SvelteKit 2 + Svelte 5 (51 checkpoints)
Additionally:
fix-templates.md— Quick-fix templates for common SvelteKit findings
What ships with it: 8 files
48.8 KB alongside SKILL.md
lenses/
- form-actions-csrf.md4.6 KB
- README.md1.4 KB
- runes-migration.md4.1 KB
- server-load-security.md3.8 KB
versions/
- kit2-svelte5/checklist.md15.8 KB
- CLAUDE.md.snippet2.3 KB
- fix-templates.md15.6 KB
- README.md1.2 KB