svelte-core-bestpractices

Provides best practices for modern Svelte code including reactivity, components, and performance optimization.

2|1|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/zajca/zfaktury --skill svelte-core-bestpractices
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: svelte-core-bestpractices
Source: https://github.com/zajca/zfaktury/tree/main/.agents/skills/svelte-core-bestpractices
Command: npx skills add https://github.com/zajca/zfaktury --skill svelte-core-bestpractices

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides guidance on writing efficient, robust, and modern Svelte code, helping developers avoid common pitfalls and leverage the latest features for optimal performance and maintainability.

Core Features & Use Cases

  • Reactivity Management: Learn to use $state, $derived, and $effect correctly for predictable updates.
  • Component Best Practices: Understand how to handle props, events, and styling effectively.
  • Use Case: When building a new Svelte component, consult this Skill to ensure you're using the most performant and idiomatic Svelte patterns for state management and rendering.

Quick Start

Apply the Svelte core best practices to refactor the provided Svelte component code.

Frequently Asked Questions about svelte-core-bestpractices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use Svelte runes like $state, $derived, and $effect for reactive state management?

Svelte runes like $state, $derived, and $effect manage reactivity by explicitly declaring reactive variables, computed values, and side effects for predictable component updates. Using them correctly ensures modern, efficient state handling and avoids common reactivity pitfalls.

What's the best way to structure Svelte components for performance and maintainability?

The best way to structure Svelte components for performance is applying best practices for component design, including effective props handling, event management, and scoped styling. This approach ensures optimal rendering performance and robust component composition in modern Svelte projects.

How does Svelte handle event handling and styling in modern component development?

Svelte handles event handling and styling through modern component patterns that leverage native DOM events and scoped CSS. Applying best practices ensures efficient event dispatching and maintainable styling, keeping component logic isolated and performant.

Can I refactor existing Svelte code to use modern reactivity patterns and runes?

You can refactor existing Svelte code to modern reactivity patterns by consulting best practices for state management and component design. This process transitions older code to use runes like $state and $derived, improving developer efficiency and application performance.

Why does my Svelte component update unpredictably when managing state?

Unpredictable Svelte component updates often occur when $state, $derived, and $effect are used incorrectly for reactive updates. Following established best practices for reactivity management ensures predictable state tracking and prevents unnecessary rendering cycles.