SvelteKit guides · AI assistant rules · tests

SvelteKit guides and AI assistant rules, measured on production builds.

For SvelteKit developers and tech leads. I measure the patterns that look fine in development and break under real traffic, then ship each fix as a guide, a rule file your AI assistant reads, and a test your repo runs.

Free now
4 checklists · 4 MIT demo repos
Soon
Guides from €19 (base price (bazna cijena) on 16.10.2026: €19) · Measured Rules · Team licence for up to 10 developers

Example: module-level $state passes review, then shows users each other's data. 0 of 150 pages wrong one request at a time, 594 of 600 with 10 in flight. SvelteKit 3.0.1 · Svelte 5.57.1 · production build · 9 Oct 2026 · by Lean Pilar, Svelte tech lead

/leak/module-state · module-level $state
594 / 600 responses showed another user's name
● 10 requests in flight, production build, 9 Oct 2026 · SvelteKit 3.0.1 · Svelte 5.57.1 · node build One tile per request. Counts measured; tile order illustrative.
Why not just ask AI?

Your assistant writes the common pattern. Often that's the one that breaks under load.

I use one every day. It writes what it has seen most, usually code that works when one person clicks through the app. The pack gives it the rule in the format it reads, and gives you the test that fails when the rule is broken.

01

Measured on production builds

Every number comes from node build or a production preview, never the dev server. The date, the versions and the script sit next to it.

02

Tests you run in your own repo

Each rule names a test. The drop-in tests run against your app, so you check the fix instead of trusting it. Mine included.

03

Re-tested on new releases

Svelte and SvelteKit change often. When they do, I rerun the demos and update the rules. The Measured Rules tier is planned with 12 months of updates.

What I haven't measured: how often assistants write these bugs. What I have measured: what the bugs do once they ship, and which fix holds.

How I know

Production build → a script you can rerun → a rule with a test

  1. Step 1

    Run it like production

    A small demo app, written from scratch for the topic, built and served by node build. Here, 20 other users load the same dashboard while I load it as User you. JavaScript is off, so this is the server HTML.

    127.0.0.1:4321/leak/module-state
    Demo dashboard, requested as User you, rendered 'Signed in as User u015'
    module-level $state: request from User you, page says User u015
    127.0.0.1:4321/safe/props
    Demo dashboard, requested as User you, rendered 'Signed in as User you'
    load data as props: request from User you, page says User you
  2. Step 2

    Count, and write it down

    A script keeps N requests in flight and counts every page that shows the wrong user. The raw results go in a JSON file with the date, versions and machine. The site, the guide and the video quote that file.

    results/measure.json
    {
      "env": {
        "date": "2026-10-09T08:51:27.058Z",
        "svelte": "5.57.1", "kit": "3.0.1",
        "server": "node build (adapter-node), production build, localhost"
      },
      "routes": {
        "/leak/module-state": [ …
          {
            "concurrency": 10,
            "requests": 600,
            "otherUser": 594,
            "otherUserPerRound": [198, 197, 199],
            "examples": ["User u000 saw \"User u010\"", …]
          }, …
    
    demos/02-ssr-state-leak/results/measure.json · excerpt
  3. Step 3

    Turn the fix into a rule and a test

    Every rule gets a test in the demo. A rule without a passing test doesn't ship. The same tests come with the pack, so you can run them against your app.

    Before anything is published it gets a fresh technical review and a separate IP review; fixes get a second fresh review. The full process. When a measurement proves me wrong, it goes on the corrections page.

    demos/02-ssr-state-leak
    $ bun run test:pack
    PASS T1 (rule 1) … module-level $state leaks between concurrent requests  {"otherUser":"198/200"}
    PASS T4 (rule 6) the same code shows no leak when requests arrive one at a time  {"otherUser":"0/50"}
    PASS T7 (rule 2) load data passed as props: no leak at 50 and 200 concurrent users  {"otherUser":"0/400",…}
    PASS T14 (rule 4) a server helper using getRequestEvent() reads the right request, …  {"otherUser":"0/400"}
    …
    16/16 passed
    
    results/pack-tests.log · 28 Sep 2026 · excerpt
What you get

A guide to read, rules for your assistant, tests for your repo

Guide cover: Per-User State During SSRGuide page: chapter 1, One object, every requestGuide page: the result table, 594 of 600 at 10 in flight
Guide draft, Per-user state during SSR: cover, chapter 1, the results. 16 pages, 3 chapters.
  • The guide (PDF). Three chapters per topic: what happens and why, the safe patterns side by side, and how to find it in your codebase.
  • Measured Rules. The same rules as a Claude skill, a Cursor rule, Copilot instructions and AGENTS.md. The first two rules are free in the public demo READMEs.
  • Tests and checks. Drop-in tests or scripts for your repo, an audit prompt and a PR checklist.
  • Updates. Re-tested on new Svelte and SvelteKit releases, with a changelog of what changed.
Measured Rules: SSR state · pack contents
dist/
├─ AGENTS.md
├─ claude/sveltekit-ssr-state/SKILL.md
├─ cursor/sveltekit-ssr-state.mdc
├─ copilot/sveltekit-ssr-state.instructions.md
├─ extras/
│  ├─ tests/concurrent-users.mjs
│  ├─ prompts/audit.md
│  └─ pr-checklist.md
├─ CHANGELOG.md
└─ README.md
products/02-ssr-state-leak/pack/dist · v0.2 draft
Planned prices, per topic
  • €19 Guide (PDF) Base price (bazna cijena) on 16.10.2026: €19
  • €39 Guide + Measured Rules Base price (bazna cijena) on 16.10.2026: €39
  • €199 Team, up to 10 developers Base price (bazna cijena) on 16.10.2026: €199

Season 1 bundle: all four topics, Guide + Measured Rules for €99 (base price (bazna cijena) on 16.10.2026: €99). Or pick any three topics for the price of two.

Sales open soon. The waitlist hears first. Prices in euro, VAT included. A business can enter its VAT ID at checkout; reverse charge then applies where the law allows.

Who measures this

Hi, I'm Lean Pilar.

I'm a Svelte tech lead with software architect training, based in Poreč, Croatia. I've built for the web for more than ten years, and I've used SvelteKit since before 1.0, back when a route was still a file like about.svelte instead of +page.svelte. I work as an independent contractor. I've led the frontend of large tourism and hospitality websites with heavy traffic: a national tourism portal in Vue, hotel and camping websites in Svelte, one of them a monorepo built so code could be shared between sites. Today I also design frontend architecture for new SvelteKit platforms. Before that, from 2016 to 2018, I built an in-house web shop with warehouse management in Angular: the shop, the admin, the API and the database. I started with WordPress and PHP.

I've reviewed a lot of code that looked right and broke under real traffic. Most advice I found had no numbers behind it, so I started measuring before deciding. This site is those measurements, cleaned up so you can rerun them.

Every topic starts with a small demo app I write from scratch. No client code, no client data. When a measurement proves me wrong, that goes in the guide too: in the lazy CMS sections topic I believed one broken CMS section could never take down the page. The test returned a 500 for the whole page, <svelte:boundary> or not.

In winter I teach snowboarding. I've been an instructor for ten years, and we also organise camps for children without parental care.

Free now · guides soon

Get the four free checklists

One page per topic, every check backed by a measurement: section renderer, ssr state, sveltekit defaults and big lists in svelte 5 state.

  1. 1Enter your email. You land on our mailing-list page.
  2. 2Open the confirmation email from hello@measuredfrontend.com and click the link.
  3. 3The confirmation page lists the four PDFs. About one minute in total.

After that: one email when the guides open, and a short note when a new measurement is published. Unsubscribe in one click. No confirmation, no emails: the address is deleted within 30 days.

Double opt-in: nothing is sent until you click the link in that email.

FAQ

Questions

Why pay when my AI assistant is free?

Keep using it; I do. An assistant writes the common pattern, and the common pattern is often the one that passes review and fails under load, like a module-level store for the current user. I haven't measured how often assistants write it. I measured what it does once it ships: 594 of 600 pages with the wrong name at 10 requests in flight. You get that measurement, a rule file your assistant reads, a test that fails in your repo when the rule is broken, and a rerun when Svelte changes.

When can I buy it?

Sales open soon. The waitlist hears first: the four checklists as soon as you confirm your address, a short note when a new measurement is published, and one email when the guides open.

What is free?

The four one-page checklists, the demo apps with their measure scripts and tests (MIT, all four public on GitHub), the first rules of each pack in the demo READMEs, and every number on this site. The guide explains the why and the edge cases; Measured Rules make your assistant use the fix and give you the test.

What happens after I enter my email?

You land on the mailing-list page, get one confirmation email from hello@measuredfrontend.com, click the link, and the confirmation page lists the four PDFs. No confirmation, no emails, and the address is deleted within 30 days.

Will the numbers be the same on my machine?

Not exactly. Absolute times come from one machine (Windows 11, i9-13900KF) and are labelled with versions and dates. The pass and fail results, and the ratios, are what carry over. Every demo has the script, so you can rerun it on yours.

Which versions did you test?

Season 1: measured on SvelteKit 2.70 between 27 and 30 September 2026 and re-tested on SvelteKit 3.0.1 on 9 October 2026 (Svelte 5.57, Node 26). Each topic page lists its exact versions. Each update says what was re-tested and on which versions.

What did you get wrong so far?

4 things, all published with the test that caught them: the <svelte:boundary> claim in the lazy CMS sections topic, an early hydration-delay claim, the vite preview streaming claim in the SvelteKit defaults topic, and the heap numbers of a probe in the $state.raw topic. The list, with dates, is on the corrections page.

Can my whole team use it?

Yes, with the Team licence: up to 10 developers of one company, and you can commit the rules to all of your company's repos.