AgentLint Verified 100/100Verified Framework Starter (TypeScript corpus)

    SvelteKit (Svelte 5) CLAUDE.md & AGENTS.md Template

    Svelte 5 runes ($state, $derived), svelte-check type safety, and server-only $env/static/private guards.

    # SvelteKit Project — Svelte 5 Harness
    
    SvelteKit + Svelte 5 + TypeScript web application verified with `svelte-check`, Vitest, and ESLint.
    
    ## Commands
    
    - Install: `pnpm install --frozen-lockfile`
    - Fast single test: `npx vitest run src/lib/server/billing.test.ts`
    - Full unit suite: `pnpm test`
    - Typecheck & lint: `pnpm exec svelte-check --tsconfig ./tsconfig.json && pnpm lint`
    - Production build: `pnpm build`
    
    ## Rules
    
    - Don't mix Svelte 4 `export let` or `$:` syntax into Svelte 5 runes components. Instead use `$props()`, `$state()`, and `$derived()`. Because mixing reactive paradigms breaks runes mode compilation.
    - Don't import database clients or `$env/static/private` inside universal `+page.ts` or `.svelte` files. Instead place secret logic inside `+page.server.ts` or `src/lib/server/`. Because universal modules bundle into client JavaScript.
    - Don't skip `svelte-check` after editing `+page.server.ts` load return types. Because generated `./$types` catches route contract breaks before build.
    - When editing form actions or hooks, read `docs/sveltekit-hooks.md` first.
    
    ## Continuity & Safety
    
    - Keep `.env*`, `.svelte-kit/`, and `CLAUDE.local.md` in `.gitignore`.
    - Record passing `svelte-check` and Vitest outputs in `HANDOFF.md`.

    Most Adopted SvelteKit (Svelte 5) Rules Across Real Open-Source Repos

    Adoption benchmarks measured in the parent language cohort of our 4,533-repo harness study, paired with framework-specific invariants:

    tailwindcsstooling

    Tailwind CSS styling (measured in 1,533 TypeScript corpus repos)

    38.8%595 repos
    unit-teststesting

    Server loader and component tests (1,533 TS corpus repos)

    37.6%577 repos
    eslinttooling

    ESLint + eslint-plugin-svelte (1,533 TS corpus repos)

    36.9%565 repos
    vitesttesting

    Vitest for fast unit testing (1,533 TS corpus repos)

    32.6%499 repos
    Essential Commands (Checks W1 & W7)
    install
    pnpm install --frozen-lockfile
    fastTest
    npx vitest run src/lib/server/auth.test.ts
    fullTest
    pnpm test
    lint
    pnpm exec svelte-check --tsconfig ./tsconfig.json && pnpm lint
    build
    pnpm build
    Common SvelteKit (Svelte 5) Agent Pitfalls
    • 01Agents mix legacy Svelte 4 $: reactive statements and export let props into Svelte 5 runes components.
    • 02Importing $env/static/private or database clients inside universal +page.ts files leaks server code into browser bundles.
    • 03Skipping svelte-check misses typed $props() and route PageData mismatches.

    More Verified Stack Templates