Menu

Post image 1
Post image 2
1 / 2
0

CLAUDE.md for Svelte: 13 Rules That Stop AI From Writing React-Flavored Svelte

DEV Community: svelte·Olivia Craft·3 days ago
#NIRbgVsG
Reading 0:00
15s threshold

Svelte is different from every other frontend framework — no virtual DOM, compiled output, reactivity that's a language feature rather than a runtime. That difference is exactly what trips up Claude Code: it defaults to React-style thinking, uses patterns that make sense in Vue or Angular but are wrong in Svelte, and ignores the compiler's superpowers entirely. These 13 rules fix that. Rule 1: Reactivity — no useState, no ref(), just assignment Reactive state uses plain variable assignment. No reactive() wrapper, no useState(), no signal(). Mutate arrays and objects directly — Svelte's compiler tracks assignments, not mutations. Correct: items = [...items, newItem] Incorrect: items.push(newItem) without reassignment Enter fullscreen mode Exit fullscreen mode Claude trained on React and Vue will reach for hooks or composables. In Svelte, let count = 0 and count++ in a click handler is the entire reactivity system.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More