sveltekit-best-practices

sveltekit-best-practices is a skill for Claude Code from ofershap/sveltekit-best-practices. It costs 36 tokens per session (1,986 once invoked), scanned A, original, MIT.

A set of coding guidelines for SvelteKit and Svelte 5 applications. SvelteKit is a framework for building web applications with Svelte, and Svelte 5 runes are its newer syntax for managing changing state and effects.

In plain words
What is it for?
Use it when writing or reviewing SvelteKit or Svelte 5 code. It covers runes, load functions, form actions, server-side rendering, and modern Svelte practices.
Why use it?
Coding agents may produce older Svelte 4 patterns that do not match Svelte 5. The guidelines steer implementation toward the newer state, data-loading, form, and server-rendering patterns.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the sveltekit-best-practices plugin — 1 skill, 1 command shipped together

Good fit Use it when writing or reviewing SvelteKit or Svelte 5 code. It covers runes, load functions, form actions, server-side rendering, and modern Svelte practices.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ofershap/sveltekit-best-practices/sveltekit-best-practices
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ofershap/sveltekit-best-practices --skill sveltekit-best-practices
Clone the repo
git clone --depth 1 https://github.com/ofershap/sveltekit-best-practices

Made for: Claude Code.

Or install sveltekit-best-practices, the plugin that ships this one along with the rest of its 1 skill, 1 command.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sveltekit-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/ofershap/sveltekit-best-practices/sveltekit-best-practices/github.svg)](https://agentmods.dev/skills/ofershap/sveltekit-best-practices/sveltekit-best-practices)
Your own site
<a href="https://agentmods.dev/skills/ofershap/sveltekit-best-practices/sveltekit-best-practices"><img src="https://agentmods.dev/badge/skills/ofershap/sveltekit-best-practices/sveltekit-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sveltekit-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/ofershap/sveltekit-best-practices/sveltekit-best-practices"><img src="https://agentmods.dev/badge/skills/ofershap/sveltekit-best-practices/sveltekit-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,986 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00036 $0.01986
Opus 5 $0.00018 $0.00993
Sonnet 5 $0.00007 $0.00397
Haiku 4.5 $0.00004 $0.00199

Measured 12d ago against content hash e253de105ac8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

sveltekit-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/sveltekit-best-practices/SKILL.md · 334 lines

How it starts

The opening of the file, as written. The whole thing — 334 lines — stays where its author put it; the contents beside it link to each section on GitHub.

When to use

Use this skill when working with SvelteKit or Svelte 5 code. AI agents are trained on Svelte 4 patterns and frequently generate outdated code using stores, reactive declarations, and export let. This skill enforces Svelte 5 runes, load functions, and form actions.

Critical Rules

1. Use Svelte 5 runes - never Svelte 4 stores or reactive declarations

Wrong (agents do this):

<script>
  import { writable, derived } from 'svelte/store';
  let count = writable(0);
  $: doubled = $count * 2;
  $: if (count > 5) alert('too high');
</script>
<p>{$count}</p>

Correct:

<script>
  let count = $state(0);
  let doubled = $derived(count * 2);
  $effect(() => {
    if (count > 5) alert('too high');
  });
</script>
<p>{count}</p>

Why: Svelte 5 runes ($state, $derived, $effect) replace stores and $: syntax. Agents default to Svelte 4 patterns.

2. Use $state for reactive state - not let with reactive assignments

Wrong:

<script>
  let count = 0;
  count = count + 1;
</script>

Correct:

<script>
  let count = $state(0);
  count = count + 1;
</script>

Why: In Svelte 5, reactivity is opt-in via $state. Plain let is not reactive.

3. Use $derived for computed values - not $: reactive declarations

Wrong:

<script>
  let firstName = $state('John');
  let lastName = $state('Doe');
  $: fullName = `${firstName} ${lastName}`;
</script>

Correct:

<script>
  let firstName = $state('John');
  let lastName = $state('Doe');
  let fullName = $derived(`${firstName} ${lastName}`);
</script>

Why: $: is Svelte 4. Svelte 5 uses $derived for derivations.

4. Use $effect for side effects - not $: reactive statements

Wrong:

<script>
  let count = $state(0);
  $: if (count > 5) console.log('count is high');
</script>

Correct:

<script>
  let count = $state(0);
  $effect(() => {
    if (count > 5) console.log('count is high');
  });
</script>

Read the full file on GitHub · 334 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 334 lines · 36 tokens per session scan A e253de105ac8

Subscribe to this mod's changes

sveltekit-best-practices is a skill published in the GitHub repository ofershap/sveltekit-best-practices (13 stars, last pushed 6mo ago), licensed MIT. It adds 36 tokens to every session and 1,986 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.