sveltekit-and-svelte5-runes

sveltekit-and-svelte5-runes is a skill for Claude Code, Codex from hamzabellouch/agent-skills. It costs 53 tokens per session (2,362 once invoked), scanned A, original, MIT.

An architecture guide for SvelteKit and Svelte 5 applications, including their newer reactive state features and server-rendered data flow. It also covers common design mistakes.

In plain words
What is it for?
Use it when designing or reviewing Svelte and SvelteKit projects, especially applications with server rendering, forms, or TypeScript components.
Why use it?
It helps developers choose consistent ways to manage state, load data, handle forms, and keep server-side data isolated.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when designing or reviewing Svelte and SvelteKit projects, especially applications with server rendering, forms, or TypeScript components.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hamzabellouch/agent-skills/sveltekit-and-svelte5-runes
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 hamzabellouch/agent-skills --skill sveltekit-and-svelte5-runes
Clone the repo
git clone --depth 1 https://github.com/hamzabellouch/agent-skills

Made for: Claude Code, Codex.

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-and-svelte5-runes

README.md
[![agentmods](https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/sveltekit-and-svelte5-runes/github.svg)](https://agentmods.dev/skills/hamzabellouch/agent-skills/sveltekit-and-svelte5-runes)
Your own site
<a href="https://agentmods.dev/skills/hamzabellouch/agent-skills/sveltekit-and-svelte5-runes"><img src="https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/sveltekit-and-svelte5-runes/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-and-svelte5-runes

Your own site · 80×15
<a href="https://agentmods.dev/skills/hamzabellouch/agent-skills/sveltekit-and-svelte5-runes"><img src="https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/sveltekit-and-svelte5-runes.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,362 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.00053 $0.02362
Opus 5 $0.00026 $0.01181
Sonnet 5 $0.00011 $0.00472
Haiku 4.5 $0.00005 $0.00236

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

Security

Grade A, and why

sveltekit-and-svelte5-runes 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 8d 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.

Advanced Frontend Frameworks/sveltekit-and-svelte5-runes/SKILL.md · 312 lines

How it starts

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

SvelteKit & Svelte 5 Runes Architecture Guide

Core Architectural Principles

1. Svelte 5 Runes Paradigm

  • Fine-Grained Signals: Svelte 5 replaces stores (writable, readable) and compiler-magic $: declarations with deep reactive primitives (Runes).
  • Primitives:
    • $state(initial): Deeply reactive state definition. Use $state.raw(initial) for non-reactive large structures (e.g., WebGL objects, large immutable arrays).
    • $derived(expression): Pure, memoized computational projections. Use $derived.by(() => { ... }) for complex multi-statement computations.
    • $effect(() => { ... }): Side-effect execution (DOM mutation, external sync). Must remain free of state mutations to prevent feedback loops.
    • $props(): Component property declaration with TS interface support and default assignments.
    • $bindable(): Explicit opt-in two-way data binding for props.
  • Class-Based Reactive Stores: Encapsulate domain logic inside standard ES classes utilizing $state and $derived properties, completely eliminating legacy store boilerplate.

2. SvelteKit Data Flow & SSR Isolation

  • Universal vs Server Load:
    • Use +page.server.ts for database access, secret keys, or direct server APIs.
    • Use +page.ts for universal client/server fetching or rendering logic.
  • Streaming Async Data: Return non-awaited promises in +page.server.ts to stream slow data dependencies using SvelteKit's built-in streaming support.
  • Form Actions & Progressive Enhancement: Always leverage SvelteKit Form Actions with use:enhance to ensure forms work seamlessly with or without JavaScript enabled.

Production Code Examples

Example 1: Svelte 5 Class-Based Reactive State Store

Location: src/lib/stores/cart.svelte.ts

export interface CartItem {
  id: string
  name: string
  price: number
  quantity: number
}

export class ShoppingCartStore {
  // Deeply reactive state array
  items = $state<CartItem[]>([])
  discountCode = $state<string | null>(null)
  discountPercent = $state<number>(0)

  // Derived memoized values
  itemCount = $derived(this.items.reduce((total, item) => total + item.quantity, 0))
  
  subtotal = $derived(
    this.items.reduce((sum, item) => sum + item.price * item.quantity, 0)
  )

  tax = $derived.by(() => {
    const taxableAmount = Math.max(0, this.subtotal * (1 - this.discountPercent))
    return taxableAmount * 0.08 // 8% sales tax
  })

  total = $derived(Math.max(0, this.subtotal * (1 - this.discountPercent)) + this.tax)

  addItem(newItem: Omit<CartItem, 'quantity'>) {
    const existing = this.items.find(i => i.id === newItem.id)
    if (existing) {
      existing.quantity += 1
    } else {
      this.items.push({ ...newItem, quantity: 1 })
    }
  }

  removeItem(id: string) {
    this.items = this.items.filter(i => i.id !== id)
  }

  updateQuantity(id: string, quantity: number) {
    const item = this.items.find(i => i.id === id)
    if (item) {
      if (quantity <= 0) {
        this.removeItem(id)
      } else {
        item.quantity = quantity
      }
    }
  }

  applyDiscount(code: string, percent: number) {
    this.discountCode = code
    this.discountPercent = percent / 100
  }

  clear() {
    this.items = []
    this.discountCode = null
    this.discountPercent = 0
  }
}

// Global or scoped instantiations
export const cartStore = new ShoppingCartStore()

Read the full file on GitHub · 312 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. 8d ago First seen · 312 lines · 53 tokens per session scan A 9920284be4f5

Subscribe to this mod's changes

sveltekit-and-svelte5-runes is a skill published in the GitHub repository hamzabellouch/agent-skills (4 stars, last pushed 1mo ago), licensed MIT. It adds 53 tokens to every session and 2,362 once invoked, about $0.0003 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-09-03.