Przejdź do treści
Biblioteka skilli
Programowanie · Przegląd i audyt

svelte-optimizer

/svelte-optimizer

Audytuje i optymalizuje strony SvelteKit i biblioteki Svelte 5: ładowanie danych, runes, hydratację, rozmiar paczek i adaptery, z pomiarami przed i po.

Licencja
MIT
Ostatnia zmiana repozytorium
04.11.2026

Ocena i bezpieczeństwo

85/ 100Klasa: dobry
Format20 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
12
Skrypty
1
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 04.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co sprawdzić przed instalacją
  • 1 skrypt w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: scripts/audit.py

Co robi i kiedy

Audytuje i optymalizuje strony SvelteKit i biblioteki Svelte 5: ładowanie danych, runes, hydratację, rozmiar paczek i adaptery, z pomiarami przed i po.

Oryginalny opis (EN)

Audit and optimize SvelteKit sites and Svelte component libraries (SvelteKit 3.1 / 2.x, Svelte 5 runes, Vite 8, React-free; adapter-node/static/vercel/cloudflare) for load waterfalls and over-fetching, runes and effect misuse, SSR vs prerender vs SPA choices, hydration and Core Web Vitals, bundle size and preloading, adapter/deploy cold starts, and safety, with real before/after measurement. Always produces a written findings report and a fix plan for approval before touching code. Use this whenever the user mentions a slow SvelteKit site, load functions or +page.server, invalidate/refreshAll,

Jak działa

  1. Workflow
  2. Principles
Sekcje z nagłówków SKILL.md, w oryginale · 64 linii, 809 słów
Podgląd SKILL.md
---
name: svelte-optimizer
description: Audit and optimize SvelteKit sites and Svelte component libraries (SvelteKit 3.1 / 2.x, Svelte 5 runes, Vite 8, React-free; adapter-node/static/vercel/cloudflare) for load waterfalls and over-fetching, runes and effect misuse, SSR vs prerender vs SPA choices, hydration and Core Web Vitals, bundle size and preloading, adapter/deploy cold starts, and safety, with real before/after measurement. Always produces a written findings report and a fix plan for approval before touching code. Use this whenever the user mentions a slow SvelteKit site, load functions or +page.server, invalidate/refreshAll, $state/$derived/$effect, runes migration, SSR/prerender/SPA, hydration mismatch, bundle size, adapter-node/static/cloudflare, SvelteKit 2 to 3, svelte-check, or "optimize my Svelte app" -- even if they never say "audit" or "optimize".
---

# Svelte Optimizer

Audit a Svelte/SvelteKit codebase, report what is slow or fragile and why, agree a plan with the user, then fix it. Order: evidence, approval, edits. Svelte's compiler gives fine-grained updates for free, so the wins are usually data loading, rendering mode, bundle shape and asset delivery; runes/effects and load semantics change behavior, so nothing is edited before approval.

## Workflow

### 1. Scope (quick)

- Find the root (`package.json` with `@sveltejs/kit` and/or `svelte`). Record: SvelteKit major (3.1 current, 2.x legacy), Svelte major (5 runes, 4 legacy), adapter, Vite/vite-plugin-svelte versions, Node runtime, TypeScript, rendering mode (SSR/prerender/SPA), and whether remote functions are enabled (experimental).
- Run `python <skill-dir>/scripts/audit.py <project-root>` -- static scan of `package.json`, `vite.config.*`, `src/routes`, `src/hooks.*`, `src/env.*` and `.svelte/.ts` sources for legacy stores/config, load waterfalls, secrets in universal load, effect fetching, SSR/build mismatches, XSS and bundle risks, with file:line evidence. Use `--json` to post-process.
- Classify the pain: slow first load (SSR/bundle/assets), slow navigation (load/preload), slow mutations (form actions/endpoints), hydration/CLS, deploy cold start, or code health/migration. Ask which hurts if unclear.
- Read `references/tooling.md` once: what can be measured here (production build, preview, Lighthouse, network, svelte-check).

### 2. Audit

The script finds cheap leads; you find the rest by reading. Read `package.json`, `vite.config.*`, `src/app.html`, `src/routes/+layout.*`, the 3-5 routes the user cares about, and their load/action/endpoint files. Load only what applies:

| Area                                                          | Reference                        |
| ------------------------------------------------------------- | -------------------------------- |
| Runes, state/derived/effect, snippets, legacy syntax           | `references/runes-reactivity.md` |
| Routing, load, form actions, hooks, errors, params             | `references/kit-routing-load.md` |
| SSR/CSR, prerender, SPA, hydration, page options               | `references/ssr-prerender.md`    |
| Load dependencies, invalidation, HTTP caching, streaming       | `references/data-caching.md`     |
| Bundle, preloading, images/fonts, adapters, build output       | `references/bundle-assets.md`    |
| XSS, env, CSRF/auth, server-only modules, types/tests, v3      | `references/safety-quality.md`   |
| Production measurement and honest reporting                   | `references/tooling.md`          |

**Measure, never guess.** Run `vite build` and the production preview (`vite preview` or the adapter's server), then measure that. Dev mode and HMR are not evidence. Check per-route JS, load timing, SSR HTML/TTFB, hydration warnings and LCP/CLS.

Mark each finding **Confirmed** (build output, network/profiler, code evidence) or **Suspected** (needs measuring).

### 3. Report

Fill `assets/report-template.md`, save it as `SVELTE_OPTIMIZATION_REPORT.md` in the project root, and show the user. Five-line summary, findings table by impact/effort, then per-finding detail (evidence, why it hurts, fix, risk, behavior impact). Group near-duplicates.

### 4. Plan -- then stop for approval

Use plan mode: `EnterPlanMode` (load with ToolSearch if deferred), write the plan, present with `ExitPlanMode`; if unavailable show it in chat and wait for an explicit "go". Structure:

1. **Quick wins** -- move effect/onMount fetching into `load`, parallelize independent awaits, add `depends`, fix keyed each, preload links, prerender static routes, preload the LCP image/font, lazy-load heavy widgets. Low risk.
2. **Structural** -- choose server vs universal load, stream non-critical data, batch N+1 queries, add form actions with `use:enhance`, move secrets into server-only modules, restructure layouts to avoid duplicate loads, adopt `$derived` instead of sync effects. Name each behavior change.
3. **Heavy** -- SvelteKit 2 to 3 (config into Vite, `#lib`, `$app/state`, adapters), Svelte 4 to 5 runes migration, adapter/SPA/prerender change, remote functions (experimental). Separately approved.
   Each step: files touched, expected effect, how to verify, how to roll back.

### 5. Fix

Only approved items, in small groups. After each: `svelte-check`, lint, tests, `vite build`. A break must trace to one change. Do not mix a SvelteKit/Svelte major upgrade with optimization edits. If an approved change moves data/secret handling across the server/client boundary, changes SSG/SSR output, or alters a form action, stop and ask.

### 6. Verify and wrap up

Re-measure the same routes and scenario: route JS, SSR TTFB/HTML, load duration, navigation requests/time, LCP/INP/CLS, and form-action latency. State plainly what could not be measured. End with deferred items and one suggested next step.

## Principles

- **Load is the data boundary.** `onMount`/`$effect` fetching causes waterfalls and empty SSR HTML; use `+page.ts`/`+page.server.ts`.
- **Server load for secrets, universal load for shareable data.** Universal `load` runs in the browser; `process.env`/DB clients belong in `+page.server.ts`, hooks, or `src/lib/server`.
- **Runes replace sync, not logic.** `$derived` for computed values; `$effect` only for external side effects. An effect that writes state is usually a derived value.
- **Prerender what can be static.** SvelteKit makes static output fast; SPA mode adds round trips before the first pixel.
- **Preload is already there; use it.** SvelteKit preloads code and data on link intent by default in new apps; verify it is not disabled and that slow data is streamed.
- **Bundle less.** Dynamic-import heavy widgets, per-icon imports, and avoid shipping server-only/admin code to the browser.
- **Caching is correctness first.** Never cache per-user load data in a shared layer; state the freshness and invalidation rule.
- **Docs move.** SvelteKit 3 (Oct 2026) moved config into Vite, removed `$app/stores` and `$lib`; Svelte 4 runes advice is stale. Check the installed versions.
Pliki w paczce (12)
  • LICENSE 1 KB
  • README.md 1 KB
  • SKILL.md 7 KB
  • assets/report-template.md 2 KB
  • references/bundle-assets.md 4 KB
  • references/data-caching.md 4 KB
  • references/kit-routing-load.md 5 KB
  • references/runes-reactivity.md 5 KB
  • references/safety-quality.md 6 KB
  • references/ssr-prerender.md 4 KB
  • references/tooling.md 3 KB
  • scripts/audit.py 23 KB

Wersje

W bazie nie ma innych skilli o nazwie svelte-optimizer.

Migawka bazy z 13.11.2026 · wersja paczki 6526f6966583 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100svelte
    Pomaga pisać aplikacje w Svelte 5 i SvelteKit 2: runes, routing, load functions, SSR i migrację z Svelte 4.
  • 100sveltekit
    Stanowi bazę wiedzy o SvelteKit: routing, funkcje load, runes Svelte 5 i dobre praktyki dla aplikacji SSR i SSG.
  • 100svelte
    Pomaga budować, przeglądać i naprawiać kod Svelte 5 i SvelteKit: runes, routing plikowy, funkcje load, form actions, remote functions, SSR/CSR, adaptery oraz migrację ze Svelte 4.
  • 100svelte
    Stosuje konwencje runes i SvelteKit przy pisaniu, przeglądzie i debugowaniu komponentów Svelte oraz modułów .svelte.ts.
  • 100svelte5-development
    Prowadzi budowę aplikacji webowych w Svelte 5 z runes, routingiem SvelteKit, form actions i wzorcami komponentów.
  • 100svelte-stinger
    Wspiera pracę ze Svelte 5: runes, snippety, cykl życia, uniwersalna reaktywność, load, actions i remote functions w SvelteKit 2 oraz migracja ze Svelte 4.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.