[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79E7XTY28ZXS04W0V613S0C":3,"skill-same:01M79E7XTY28ZXS04W0V613S0C":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M79E7XTY28ZXS04W0V613S0C","sveltekit-and-svelte5-runes",null,"Complete architecture patterns, state management with Svelte 5 Runes ($state, $derived, $effect, $props), SvelteKit SSR\u002Fstreaming pipelines, form actions, and production anti-patterns.","hamzabellouch\u002Fagent-skills","hamzabellouch","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F237856042?v=4","01M79BRYW7XAMK3YDWQEMTWGWS","Hamza Bellouch","01M79BRYWXQV3JK2TGVTX8GN2A",8,"MIT","https:\u002F\u002Fgithub.com\u002Fhamzabellouch\u002Fagent-skills\u002Fblob\u002Fmain\u002FProgramming\u002FFrontend\u002FModern_Frameworks\u002Fsveltekit-and-svelte5-runes\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: sveltekit-and-svelte5-runes\ndescription: Complete architecture patterns, state management with Svelte 5 Runes ($state, $derived, $effect, $props), SvelteKit SSR\u002Fstreaming pipelines, form actions, and production anti-patterns.\n---\n\n# SvelteKit & Svelte 5 Runes Architecture Guide\n\n## Core Architectural Principles\n\n### 1. Svelte 5 Runes Paradigm\n- **Fine-Grained Signals**: Svelte 5 replaces stores (`writable`, `readable`) and compiler-magic `$:` declarations with deep reactive primitives (Runes).\n- **Primitives**:\n  - `$state(initial)`: Deeply reactive state definition. Use `$state.raw(initial)` for non-reactive large structures (e.g., WebGL objects, large immutable arrays).\n  - `$derived(expression)`: Pure, memoized computational projections. Use `$derived.by(() => { ... })` for complex multi-statement computations.\n  - `$effect(() => { ... })`: Side-effect execution (DOM mutation, external sync). Must remain free of state mutations to prevent feedback loops.\n  - `$props()`: Component property declaration with TS interface support and default assignments.\n  - `$bindable()`: Explicit opt-in two-way data binding for props.\n- **Class-Based Reactive Stores**: Encapsulate domain logic inside standard ES classes utilizing `$state` and `$derived` properties, completely eliminating legacy store boilerplate.\n\n### 2. SvelteKit Data Flow & SSR Isolation\n- **Universal vs Server Load**:\n  - Use `+page.server.ts` for database access, secret keys, or direct server APIs.\n  - Use `+page.ts` for universal client\u002Fserver fetching or rendering logic.\n- **Streaming Async Data**: Return non-awaited promises in `+page.server.ts` to stream slow data dependencies using SvelteKit's built-in streaming support.\n- **Form Actions & Progressive Enhancement**: Always leverage SvelteKit Form Actions with `use:enhance` to ensure forms work seamlessly with or without JavaScript enabled.\n\n---\n\n## Production Code Examples\n\n### Example 1: Svelte 5 Class-Based Reactive State Store\n*Location: `src\u002Flib\u002Fstores\u002Fcart.svelte.ts`*\n\n```typescript\nexport interface CartItem {\n  id: string\n  name: string\n  price: number\n  quantity: number\n}\n\nexport class ShoppingCartStore {\n  \u002F\u002F Deeply reactive state array\n  items = $state\u003CCartItem[]>([])\n  discountCode = $state\u003Cstring | null>(null)\n  discountPercent = $state\u003Cnumber>(0)\n\n  \u002F\u002F Derived memoized values\n  itemCount = $derived(this.items.reduce((total, item) => total + item.quantity, 0))\n  \n  subtotal = $derived(\n    this.items.reduce((sum, item) => sum + item.price * item.quantity, 0)\n  )\n\n  tax = $derived.by(() => {\n    const taxableAmount = Math.max(0, this.subtotal * (1 - this.discountPercent))\n    return taxableAmount * 0.08 \u002F\u002F 8% sales tax\n  })\n\n  total = $derived(Math.max(0, this.subtotal * (1 - this.discountPercent)) + this.tax)\n\n  addItem(newItem: Omit\u003CCartItem, 'quantity'>) {\n    const existing = this.items.find(i => i.id === newItem.id)\n    if (existing) {\n      existing.quantity += 1\n    } else {\n      this.items.push({ ...newItem, quantity: 1 })\n    }\n  }\n\n  removeItem(id: string) {\n    this.items = this.items.filter(i => i.id !== id)\n  }\n\n  updateQuantity(id: string, quantity: number) {\n    const item = this.items.find(i => i.id === id)\n    if (item) {\n      if (quantity \u003C= 0) {\n        this.removeItem(id)\n      } else {\n        item.quantity = quantity\n      }\n    }\n  }\n\n  applyDiscount(code: string, percent: number) {\n    this.discountCode = code\n    this.discountPercent = percent \u002F 100\n  }\n\n  clear() {\n    this.items = []\n    this.discountCode = null\n    this.discountPercent = 0\n  }\n}\n\n\u002F\u002F Global or scoped instantiations\nexport const cartStore = new ShoppingCartStore()\n```\n\n### Example 2: SvelteKit Streaming Load Function & Page Component\n*Location: `src\u002Froutes\u002Fdashboard\u002F+page.server.ts`*\n\n```typescript\nimport type { PageServerLoad } from '.\u002F$types'\nimport { error } from '@sveltejs\u002Fkit'\n\nasync function fetchFastMetrics(userId: string) {\n  \u002F\u002F Simulating fast DB query (50ms)\n  return { userStatus: 'active', notificationsCount: 4 }\n}\n\nasync function fetchSlowAnalytics(userId: string) {\n  \u002F\u002F Simulating heavy analytical query (1500ms)\n  await new Promise((resolve) => setTimeout(resolve, 1500))\n  return {\n    monthlyRevenue: 14250.0,\n    activeSubscriptions: 342,\n    chartData: [10, 25, 45, 80, 120]\n  }\n}\n\nexport const load: PageServerLoad = async ({ locals, parent }) => {\n  const session = await locals.getSession()\n  if (!session?.user) {\n    throw error(401, 'Unauthorized access to dashboard metrics')\n  }\n\n  \u002F\u002F Await fast critical data for immediate initial SSR HTML response\n  const fastMetrics = await fetchFastMetrics(session.user.id)\n\n  \u002F\u002F DO NOT await slow analytical data — return promised stream\n  const slowAnalyticsPromise = fetchSlowAnalytics(session.user.id)\n\n  return {\n    user: session.user,\n    fastMetrics,\n    \u002F\u002F Streamed promise payload\n    streamed: {\n      analytics: slowAnalyticsPromise\n    }\n  }\n}\n```\n\n*Location: `src\u002Froutes\u002Fdashboard\u002F+page.svelte`*\n\n```svelte\n\u003Cscript lang=\"ts\">\n  import type { PageData } from '.\u002F$types'\n\n  \u002F\u002F Component props in Svelte 5 using $props rune\n  let { data }: { data: PageData } = $props()\n\n  \u002F\u002F Destructure reactive references\n  let fastMetrics = $derived(data.fastMetrics)\n\u003C\u002Fscript>\n\n\u003Cdiv class=\"dashboard\">\n  \u003Ch1>Welcome, {data.user.name}\u003C\u002Fh1>\n\n  \u003C!-- Instant SSR Content -->\n  \u003Csection class=\"summary-cards\">\n    \u003Cdiv class=\"card\">Status: {fastMetrics.userStatus}\u003C\u002Fdiv>\n    \u003Cdiv class=\"card\">Unread Notifications: {fastMetrics.notificationsCount}\u003C\u002Fdiv>\n  \u003C\u002Fsection>\n\n  \u003C!-- Streamed Content with Promise Resolution -->\n  \u003Csection class=\"analytics-section\">\n    \u003Ch2>Analytics Overview\u003C\u002Fh2>\n\n    {#await data.streamed.analytics}\n      \u003Cdiv class=\"loading-skeleton\">\n        \u003Cp>Loading deep analytics metrics...\u003C\u002Fp>\n      \u003C\u002Fdiv>\n    {:then analytics}\n      \u003Cdiv class=\"analytics-content\">\n        \u003Cp>Monthly Revenue: ${analytics.monthlyRevenue.toLocaleString()}\u003C\u002Fp>\n        \u003Cp>Active Subscriptions: {analytics.activeSubscriptions}\u003C\u002Fp>\n      \u003C\u002Fdiv>\n    {:catch err}\n      \u003Cdiv class=\"error-box\">\n        \u003Cp>Failed to load analytics: {err.message}\u003C\u002Fp>\n      \u003C\u002Fdiv>\n    {\u002Fawait}\n  \u003C\u002Fsection>\n\u003C\u002Fdiv>\n```\n\n### Example 3: Progressive Form Action with Action Directive\n*Location: `src\u002Froutes\u002Fcontact\u002F+page.server.ts`*\n\n```typescript\nimport { fail, type Actions } from '@sveltejs\u002Fkit'\n\nexport const actions: Actions = {\n  submitForm: async ({ request }) => {\n    const formData = await request.formData()\n    const email = formData.get('email')?.toString()\n    const message = formData.get('message')?.toString()\n\n    if (!email || !email.includes('@')) {\n      return fail(400, { email, message, error: 'Invalid email address' })\n    }\n\n    if (!message || message.length \u003C 10) {\n      return fail(400, { email, message, error: 'Message must be at least 10 characters long' })\n    }\n\n    \u002F\u002F Process submission...\n    return { success: true, messageId: 'msg_98127391' }\n  }\n}\n```\n\n*Location: `src\u002Froutes\u002Fcontact\u002F+page.svelte`*\n\n```svelte\n\u003Cscript lang=\"ts\">\n  import { enhance } from '$app\u002Fforms'\n  import type { ActionData } from '.\u002F$types'\n\n  let { form }: { form: ActionData } = $props()\n\n  let isSubmitting = $state(false)\n\u003C\u002Fscript>\n\n\u003Cform\n  method=\"POST\"\n  action=\"?\u002FsubmitForm\"\n  use:enhance={() => {\n    isSubmitting = true\n    return async ({ update }) => {\n      isSubmitting = false\n      await update()\n    }\n  }}\n>\n  \u003Clabel>\n    Email Address:\n    \u003Cinput type=\"email\" name=\"email\" value={form?.email ?? ''} required \u002F>\n  \u003C\u002Flabel>\n\n  \u003Clabel>\n    Your Message:\n    \u003Ctextarea name=\"message\" required>{form?.message ?? ''}\u003C\u002Ftextarea>\n  \u003C\u002Flabel>\n\n  {#if form?.error}\n    \u003Cp class=\"error-msg\">{form.error}\u003C\u002Fp>\n  {\u002Fif}\n\n  {#if form?.success}\n    \u003Cp class=\"success-msg\">Message sent successfully! Ref: {form.messageId}\u003C\u002Fp>\n  {\u002Fif}\n\n  \u003Cbutton type=\"submit\" disabled={isSubmitting}>\n    {isSubmitting ? 'Sending...' : 'Send Message'}\n  \u003C\u002Fbutton>\n\u003C\u002Fform>\n```\n\n---\n\n## Anti-Patterns & Common Pitfalls\n\n### ❌ Anti-Pattern 1: Mutating Derived State or Using `$effect` for Computed Values\n```svelte\n\u003Cscript lang=\"ts\">\n  let count = $state(0)\n  let double = $state(0)\n\n  \u002F\u002F BAD: Synchronizing derived state using $effect creates extra render ticks & bugs\n  $effect(() => {\n    double = count * 2\n  })\n\n  \u002F\u002F GOOD: Use $derived primitive for computational projections\n  let doubleDerived = $derived(count * 2)\n\u003C\u002Fscript>\n```\n\n### ❌ Anti-Pattern 2: Top-Level Request State Leaks in SvelteKit SSR\n```typescript\n\u002F\u002F BAD: Module-scoped state variable in +page.server.ts or server module\n\u002F\u002F Location: src\u002Flib\u002Fserver\u002FuserState.ts\nexport let currentUser: User | null = null \u002F\u002F SHARED ACROSS REQUESTS IN NODE.JS SSR MEMORY!\n\nexport const load = async ({ locals }) => {\n  currentUser = locals.user \u002F\u002F BUG: Request A overwrites Request B's user!\n}\n\n\u002F\u002F GOOD: Keep request-bound data strictly inside event locals or pass via return values\nexport const load = async ({ locals }) => {\n  return { user: locals.user }\n}\n```\n\n### ❌ Anti-Pattern 3: Mixing Legacy Svelte 4 Store Syntax with Runes Mode\n```svelte\n\u003Cscript lang=\"ts\">\n  import { writable } from 'svelte\u002Fstore'\n  \n  \u002F\u002F AVOID: Mixing old writable store with Svelte 5 runes creates unnecessary complexity\n  const countStore = writable(0)\n\n  \u002F\u002F GOOD: Native Svelte 5 $state\n  let count = $state(0)\n\u003C\u002Fscript>\n```\n","# SvelteKit & Svelte 5 Runes Architecture Guide\n\n## Core Architectural Principles\n\n### 1. Svelte 5 Runes Paradigm\n- **Fine-Grained Signals**: Svelte 5 replaces stores (`writable`, `readable`) and compiler-magic `$:` declarations with deep reactive primitives (Runes).\n- **Primitives**:\n  - `$state(initial)`: Deeply reactive state definition. Use `$state.raw(initial)` for non-reactive large structures (e.g., WebGL objects, large immutable arrays).\n  - `$derived(expression)`: Pure, memoized computational projections. Use `$derived.by(() => { ... })` for complex multi-statement computations.\n  - `$effect(() => { ... })`: Side-effect execution (DOM mutation, external sync). Must remain free of state mutations to prevent feedback loops.\n  - `$props()`: Component property declaration with TS interface support and default assignments.\n  - `$bindable()`: Explicit opt-in two-way data binding for props.\n- **Class-Based Reactive Stores**: Encapsulate domain logic inside standard ES classes utilizing `$state` and `$derived` properties, completely eliminating legacy store boilerplate.\n\n### 2. SvelteKit Data Flow & SSR Isolation\n- **Universal vs Server Load**:\n  - Use `+page.server.ts` for database access, secret keys, or direct server APIs.\n  - Use `+page.ts` for universal client\u002Fserver fetching or rendering logic.\n- **Streaming Async Data**: Return non-awaited promises in `+page.server.ts` to stream slow data dependencies using SvelteKit's built-in streaming support.\n- **Form Actions & Progressive Enhancement**: Always leverage SvelteKit Form Actions with `use:enhance` to ensure forms work seamlessly with or without JavaScript enabled.\n\n---\n\n## Production Code Examples\n\n### Example 1: Svelte 5 Class-Based Reactive State Store\n*Location: `src\u002Flib\u002Fstores\u002Fcart.svelte.ts`*\n\n```typescript\nexport interface CartItem {\n  id: string\n  name: string\n  price: number\n  quantity: number\n}\n\nexport class ShoppingCartStore {\n  \u002F\u002F Deeply reactive state array\n  items = $state\u003CCartItem[]>([])\n  discountCode = $state\u003Cstring | null>(null)\n  discountPercent = $state\u003Cnumber>(0)\n\n  \u002F\u002F Derived memoized values\n  itemCount = $derived(this.items.reduce((total, item) => total + item.quantity, 0))\n  \n  subtotal = $derived(\n    this.items.reduce((sum, item) => sum + item.price * item.quantity, 0)\n  )\n\n  tax = $derived.by(() => {\n    const taxableAmount = Math.max(0, this.subtotal * (1 - this.discountPercent))\n    return taxableAmount * 0.08 \u002F\u002F 8% sales tax\n  })\n\n  total = $derived(Math.max(0, this.subtotal * (1 - this.discountPercent)) + this.tax)\n\n  addItem(newItem: Omit\u003CCartItem, 'quantity'>) {\n    const existing = this.items.find(i => i.id === newItem.id)\n    if (existing) {\n      existing.quantity += 1\n    } else {\n      this.items.push({ ...newItem, quantity: 1 })\n    }\n  }\n\n  removeItem(id: string) {\n    this.items = this.items.filter(i => i.id !== id)\n  }\n\n  updateQuantity(id: string, quantity: number) {\n    const item = this.items.find(i => i.id === id)\n    if (item) {\n      if (quantity \u003C= 0) {\n        this.removeItem(id)\n      } else {\n        item.quantity = quantity\n      }\n    }\n  }\n\n  applyDiscount(code: string, percent: number) {\n    this.discountCode = code\n    this.discountPercent = percent \u002F 100\n  }\n\n  clear() {\n    this.items = []\n    this.discountCode = null\n    this.discountPercent = 0\n  }\n}\n\n\u002F\u002F Global or scoped instantiations\nexport const cartStore = new ShoppingCartStore()\n```\n\n### Example 2: SvelteKit Streaming Load Function & Page Component\n*Location: `src\u002Froutes\u002Fdashboard\u002F+page.server.ts`*\n\n```typescript\nimport type { PageServerLoad } from '.\u002F$types'\nimport { error } from '@sveltejs\u002Fkit'\n\nasync function fetchFastMetrics(userId: string) {\n  \u002F\u002F Simulating fast DB query (50ms)\n  return { userStatus: 'active', notificationsCount: 4 }\n}\n\nasync function fetchSlowAnalytics(userId: string) {\n  \u002F\u002F Simulating heavy analytical query (1500ms)\n  await new Promise((resolve) => setTimeout(resolve, 1500))\n  return {\n    monthlyRevenue: 14250.0,\n    activeSubscriptions: 342,\n    chartData: [10, 25, 45, 80, 120]\n  }\n}\n\nexport const load: PageServerLoad = async ({ locals, parent }) => {\n  const session = await locals.getSession()\n  if (!session?.user) {\n    throw error(401, 'Unauthorized access to dashboard metrics')\n  }\n\n  \u002F\u002F Await fast critical data for immediate initial SSR HTML response\n  const fastMetrics = await fetchFastMetrics(session.user.id)\n\n  \u002F\u002F DO NOT await slow analytical data — return promised stream\n  const slowAnalyticsPromise = fetchSlowAnalytics(session.user.id)\n\n  return {\n    user: session.user,\n    fastMetrics,\n    \u002F\u002F Streamed promise payload\n    streamed: {\n      analytics: slowAnalyticsPromise\n    }\n  }\n}\n```\n\n*Location: `src\u002Froutes\u002Fdashboard\u002F+page.svelte`*\n\n```svelte\n\u003Cscript lang=\"ts\">\n  import type { PageData } from '.\u002F$types'\n\n  \u002F\u002F Component props in Svelte 5 using $props rune\n  let { data }: { data: PageData } = $props()\n\n  \u002F\u002F Destructure reactive references\n  let fastMetrics = $derived(data.fastMetrics)\n\u003C\u002Fscript>\n\n\u003Cdiv class=\"dashboard\">\n  \u003Ch1>Welcome, {data.user.name}\u003C\u002Fh1>\n\n  \u003C!-- Instant SSR Content -->\n  \u003Csection class=\"summary-cards\">\n    \u003Cdiv class=\"card\">Status: {fastMetrics.userStatus}\u003C\u002Fdiv>\n    \u003Cdiv class=\"card\">Unread Notifications: {fastMetrics.notificationsCount}\u003C\u002Fdiv>\n  \u003C\u002Fsection>\n\n  \u003C!-- Streamed Content with Promise Resolution -->\n  \u003Csection class=\"analytics-section\">\n    \u003Ch2>Analytics Overview\u003C\u002Fh2>\n\n    {#await data.streamed.analytics}\n      \u003Cdiv class=\"loading-skeleton\">\n        \u003Cp>Loading deep analytics metrics...\u003C\u002Fp>\n      \u003C\u002Fdiv>\n    {:then analytics}\n      \u003Cdiv class=\"analytics-content\">\n        \u003Cp>Monthly Revenue: ${analytics.monthlyRevenue.toLocaleString()}\u003C\u002Fp>\n        \u003Cp>Active Subscriptions: {analytics.activeSubscriptions}\u003C\u002Fp>\n      \u003C\u002Fdiv>\n    {:catch err}\n      \u003Cdiv class=\"error-box\">\n        \u003Cp>Failed to load analytics: {err.message}\u003C\u002Fp>\n      \u003C\u002Fdiv>\n    {\u002Fawait}\n  \u003C\u002Fsection>\n\u003C\u002Fdiv>\n```\n\n### Example 3: Progressive Form Action with Action Directive\n*Location: `src\u002Froutes\u002Fcontact\u002F+page.server.ts`*\n\n```typescript\nimport { fail, type Actions } from '@sveltejs\u002Fkit'\n\nexport const actions: Actions = {\n  submitForm: async ({ request }) => {\n    const formData = await request.formData()\n    const email = formData.get('email')?.toString()\n    const message = formData.get('message')?.toString()\n\n    if (!email || !email.includes('@')) {\n      return fail(400, { email, message, error: 'Invalid email address' })\n    }\n\n    if (!message || message.length \u003C 10) {\n      return fail(400, { email, message, error: 'Message must be at least 10 characters long' })\n    }\n\n    \u002F\u002F Process submission...\n    return { success: true, messageId: 'msg_98127391' }\n  }\n}\n```\n\n*Location: `src\u002Froutes\u002Fcontact\u002F+page.svelte`*\n\n```svelte\n\u003Cscript lang=\"ts\">\n  import { enhance } from '$app\u002Fforms'\n  import type { ActionData } from '.\u002F$types'\n\n  let { form }: { form: ActionData } = $props()\n\n  let isSubmitting = $state(false)\n\u003C\u002Fscript>\n\n\u003Cform\n  method=\"POST\"\n  action=\"?\u002FsubmitForm\"\n  use:enhance={() => {\n    isSubmitting = true\n    return async ({ update }) => {\n      isSubmitting = false\n      await update()\n    }\n  }}\n>\n  \u003Clabel>\n    Email Address:\n    \u003Cinput type=\"email\" name=\"email\" value={form?.email ?? ''} required \u002F>\n  \u003C\u002Flabel>\n\n  \u003Clabel>\n    Your Message:\n    \u003Ctextarea name=\"message\" required>{form?.message ?? ''}\u003C\u002Ftextarea>\n  \u003C\u002Flabel>\n\n  {#if form?.error}\n    \u003Cp class=\"error-msg\">{form.error}\u003C\u002Fp>\n  {\u002Fif}\n\n  {#if form?.success}\n    \u003Cp class=\"success-msg\">Message sent successfully! Ref: {form.messageId}\u003C\u002Fp>\n  {\u002Fif}\n\n  \u003Cbutton type=\"submit\" disabled={isSubmitting}>\n    {isSubmitting ? 'Sending...' : 'Send Message'}\n  \u003C\u002Fbutton>\n\u003C\u002Fform>\n```\n\n---\n\n## Anti-Patterns & Common Pitfalls\n\n### ❌ Anti-Pattern 1: Mutating Derived State or Using `$effect` for Computed Values\n```svelte\n\u003Cscript lang=\"ts\">\n  let count = $state(0)\n  let double = $state(0)\n\n  \u002F\u002F BAD: Synchronizing derived state using $effect creates extra render ticks & bugs\n  $effect(() => {\n    double = count * 2\n  })\n\n  \u002F\u002F GOOD: Use $derived primitive for computational projections\n  let doubleDerived = $derived(count * 2)\n\u003C\u002Fscript>\n```\n\n### ❌ Anti-Pattern 2: Top-Level Request State Leaks in SvelteKit SSR\n```typescript\n\u002F\u002F BAD: Module-scoped state variable in +page.server.ts or server module\n\u002F\u002F Location: src\u002Flib\u002Fserver\u002FuserState.ts\nexport let currentUser: User | null = null \u002F\u002F SHARED ACROSS REQUESTS IN NODE.JS SSR MEMORY!\n\nexport const load = async ({ locals }) => {\n  currentUser = locals.user \u002F\u002F BUG: Request A overwrites Request B's user!\n}\n\n\u002F\u002F GOOD: Keep request-bound data strictly inside event locals or pass via return values\nexport const load = async ({ locals }) => {\n  return { user: locals.user }\n}\n```\n\n### ❌ Anti-Pattern 3: Mixing Legacy Svelte 4 Store Syntax with Runes Mode\n```svelte\n\u003Cscript lang=\"ts\">\n  import { writable } from 'svelte\u002Fstore'\n  \n  \u002F\u002F AVOID: Mixing old writable store with Svelte 5 runes creates unnecessary complexity\n  const countStore = writable(0)\n\n  \u002F\u002F GOOD: Native Svelte 5 $state\n  let count = $state(0)\n\u003C\u002Fscript>\n```\n",{"name":5,"description":7},"main","e905af21e5f1e1c3ca605e9656c3a7930360a84e","Programming\u002FFrontend\u002FModern_Frameworks\u002Fsveltekit-and-svelte5-runes",1,"https:\u002F\u002Fgithub.com\u002Fhamzabellouch\u002Fagent-skills","https:\u002F\u002Fhamzabellouch.github.io\u002F","https:\u002F\u002Fgithub.com\u002Fhamzabellouch","hamzabellouch.github.io","CEO & Founder of @tknoglobal | Researcher in Technology & Applied Sciences.","2026-10-17 03:20:19",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add hamzabellouch\u002Fagent-skills --skill sveltekit-and-svelte5-runes",{"tool":40,"command":41},"bunx","bunx skills add hamzabellouch\u002Fagent-skills --skill sveltekit-and-svelte5-runes",{"tool":43,"command":44},"pnpm","pnpm dlx skills add hamzabellouch\u002Fagent-skills --skill sveltekit-and-svelte5-runes","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhamzabellouch\u002Fagent-skills\u002Fblob\u002Fmain\u002FProgramming\u002FFrontend\u002FModern_Frameworks\u002Fsveltekit-and-svelte5-runes\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M79FHH2H815A9TAP6WNKH4Q8","security-audit","Comprehensive security guidance, source code audit, vulnerability assessment, and penetration test review for codebases, APIs, microservices, CLI tools, libraries, and LLM-backed applications. Triggers on requests to audit a codebase, conduct security reviews, find vulnerabilities or flaws, pen-test source code, or when the user asks in Arabic (فحص أمني، تدقيق الكود أمنياً، مراجعة الثغرات، فحص أمان المشروع). Supports Guidance mode (focused review) and Full Audit mode (deterministic 6-phase harness).","https:\u002F\u002Fgithub.com\u002Fhamzabellouch\u002Fagent-skills\u002Fblob\u002Fmain\u002FSecurity\u002FSecurity_Audit_and_Code_Review\u002Fsecurity-audit\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M79FHBGXVBY6VQ1X7ETAZMF1","malware-analysis-reversing","Production malware analysis workflows, reverse engineering methodologies, isolated sandbox triage, static\u002Fdynamic binary analysis, memory forensics, and YARA detection rule authoring.","https:\u002F\u002Fgithub.com\u002Fhamzabellouch\u002Fagent-skills\u002Fblob\u002Fmain\u002FSecurity\u002FOffensive_Security_and_Pentesting\u002Fmalware-analysis-reversing\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M79FH6EACDR801TZCE4R8SAC","application-security-pentesting","Production Application Security (AppSec) standards, OWASP Top 10 vulnerability remediation, SAST\u002FDAST pipeline integration, secure code review, threat modeling, and defensive security posture.","https:\u002F\u002Fgithub.com\u002Fhamzabellouch\u002Fagent-skills\u002Fblob\u002Fmain\u002FSecurity\u002FOffensive_Security_and_Pentesting\u002Fapplication-security-pentesting\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M79FH0VKVT44FK923K520ZQA","oauth2-oidc-security-flows","Implement enterprise OAuth 2.1 and OpenID Connect (OIDC) authorization code flow with Proof Key for Code Exchange (PKCE), state and nonce verification, refresh token rotation, token revocation, and centralized IdP federation (Keycloak, Auth0, Okta). Trigger when building secure authentication, single sign-on (SSO), or third-party delegated authorization.","https:\u002F\u002Fgithub.com\u002Fhamzabellouch\u002Fagent-skills\u002Fblob\u002Fmain\u002FSecurity\u002FIdentity_and_Access_Management_IAM\u002Foauth2-oidc-security-flows\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M79FGVVB3R4T88XXD8FRSV5B","jwt-session-management-hardening","Harden JWT-based authentication and session lifecycles using asymmetric signing (RS256\u002FEdDSA), JWKS rotation, strict claims validation, Redis-backed sliding window sessions, revocation lists, and secure HttpOnly cookie storage. Trigger when implementing token validation, session revocation, or hardening API authentication.","https:\u002F\u002Fgithub.com\u002Fhamzabellouch\u002Fagent-skills\u002Fblob\u002Fmain\u002FSecurity\u002FIdentity_and_Access_Management_IAM\u002Fjwt-session-management-hardening\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M79FGNCPZ85CVEY0B3NE4H3B","soc2-compliance-automation","Best practices for implementing SOC 2 Type II compliance controls, continuous evidence collection, infrastructure policy-as-code, and automated security monitoring. Use when automating Trust Services Criteria (Security, Availability, Confidentiality, Processing Integrity, Privacy), audit logging, IAM least privilege, or CI\u002FCD security gates.","https:\u002F\u002Fgithub.com\u002Fhamzabellouch\u002Fagent-skills\u002Fblob\u002Fmain\u002FSecurity\u002FGovernance_Compliance_and_Legal_Tech\u002Fsoc2-compliance-automation\u002FSKILL.md",[],[]]