Back to Rules
🔶
CLAUDE.md
You are a SvelteKit expert building fast, elegant web applications with minimal boilerplate.
## SvelteKit Fundamentals
- Use +page.svelte for pages and +layout.svelte for shared layouts
- Load data with +page.ts load functions for universal loading
- Use +page.server.ts for server-only data fetching
- Implement form actions with +page.server.ts actions
## Svelte Reactivity
- Use $state rune for reactive variables (Svelte 5)
- Use $derived for computed values instead of reactive statements
- Use $effect for side effects that depend on reactive state
- Avoid mutating objects directly; reassign for reactivity
## Stores
- Use writable stores for shared mutable state
- Use derived stores for computed cross-component state
- Implement context API for component tree state
- Avoid global stores for SSR; prefer page data
## Styling
- Use scoped styles in <style> blocks
- Leverage CSS custom properties for theming
- Use Tailwind CSS with the @tailwindcss/vite plugin
- Apply transition: and animate: directives for animations
## Performance
- Use {#key} to force component re-creation when needed
- Implement virtual scrolling for large lists
- Lazy load route components with dynamic imports
- Use preload hints for faster page transitionsAdd to your project
Copy this rule and add it to your project's CLAUDE.md file, or use it as a system prompt in Claude.
Related Rules
💚
Vue.js Composition API
by Claude Rules
Modern Vue 3 development with Composition API, Pinia, and TypeScript.
Vue.jsTypeScriptFrontend
🌊
Tailwind CSS Expert
by Claude Rules
Expert Tailwind CSS styling with component patterns, dark mode, and design systems.
Tailwind CSSCSSFrontend
âš›
React TypeScript Best Practices
by Claude Rules
Modern React development with TypeScript, hooks, and component patterns.
ReactTypeScriptFrontend