skills/svelte5-best-practices/SKILL.md
Svelte 5 runes, snippets, SvelteKit patterns, and modern best practices for TypeScript and component development. Use when writing, reviewing, or refactoring Svelte 5 components and SvelteKit applications. Triggers on: Svelte components, runes ($state, $derived, $effect, $props, $bindable, $inspect), snippets ({#snippet}, {@render}), event handling, SvelteKit data loading, form actions, Svelte 4 to Svelte 5 migration, store to rune migration, slots to snippets migration, TypeScript props typing, generic components, SSR state isolation, performance optimization, or component testing.
npx skillsauth add sikandarjodd/cnblocks svelte5-best-practicesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Topic | When to Use | Reference | | --------------- | --------------------------------------------------------- | ------------------------------------------- | | Runes | $state, $derived, $effect, $props, $bindable, $inspect | runes.md | | Snippets | Replacing slots, {#snippet}, {@render} | snippets.md | | Events | onclick handlers, callback props, context API | events.md | | TypeScript | Props typing, generic components | typescript.md | | Migration | Svelte 4 to 5, stores to runes | migration.md | | SvelteKit | Load functions, form actions, SSR, page typing | sveltekit.md | | Performance | Universal reactivity, avoiding over-reactivity, streaming | performance.md |
<script>
let count = $state(0); // Reactive state
let doubled = $derived(count * 2); // Computed value
</script>
<script>
let { name, count = 0 } = $props();
let { value = $bindable() } = $props(); // Two-way binding
</script>
<script>
let { children, header } = $props();
</script>
{@render header?.()}
{@render children()}
<!-- Svelte 5: use onclick, not on:click -->
<button onclick={() => count++}>Click</button>
<script>
let { onclick } = $props();
</script>
<button onclick={() => onclick?.({ data })}>Click</button>
let without $state - Variables are not reactive without $state()$effect for derived values - Use $derived insteadon:click syntax - Use onclick in Svelte 5createEventDispatcher - Use callback props instead<slot> - Use snippets with {@render}$bindable() - Required for bind: to workPromise.all for parallel requestsdevelopment
Svelte 5 runes, snippets, SvelteKit patterns, and modern best practices for TypeScript and component development. Use when writing, reviewing, or refactoring Svelte 5 components and SvelteKit applications. Triggers on: Svelte components, runes ($state, $derived, $effect, $props, $bindable, $inspect), snippets ({#snippet}, {@render}), event handling, SvelteKit data loading, form actions, Svelte 4 to Svelte 5 migration, store to rune migration, slots to snippets migration, TypeScript props typing, generic components, SSR state isolation, performance optimization, or component testing.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.