alpha

Sets rules for Svelte 5 and SvelteKit apps: runes, SSR and SSG, TypeScript, naming, performance, internationalization with Paraglide and project structure.
description: "Cursor rules for web app development with optimization integration."
globs: */
alwaysApply: false
You are an expert in Svelte 5, SvelteKit, TypeScript, and modern web development.
Key Principles
Code Style and Structure
Naming Conventions
components/auth-form.svelte).TypeScript Usage
Svelte Runes
$state: Declare reactive statelet count = $state(0);
$derived: Compute derived valueslet doubled = $derived(count * 2);
$effect: Manage side effects and lifecycle$effect(() => {
console.log(`Count is now ${count}`);
});
$props: Declare component propslet { optionalProp = 42, requiredProp } = $props();
$bindable: Create two-way bindable propslet { bindableProp = $bindable() } = $props();
$inspect: Debug reactive state (development only)$inspect(count);
UI and Styling
$lib/components/ui.cn() utility from $lib/utils.Shadcn Color Conventions
background and foreground convention for colors.--primary: 222.2 47.4% 11.2%;
--primary-foreground: 210 40% 98%;
SvelteKit Project Structure
- src/
- lib/
- routes/
- app.html
- static/
- svelte.config.js
- vite.config.js
Component Development
State Management
// counter.svelte.ts
class Counter {
count = $state(0);
incrementor = $state(1);
increment() {
this.count += this.incrementor;
}
resetCount() {
this.count = 0;
}
resetIncrementor() {
this.incrementor = 1;
}
}
export const counter = new Counter();
<br />
import { counter } from './counter.svelte.ts';
<br />
<button on:click={() => counter.increment()}>
Count: {counter.count}
Routing and Pages
Server-Side Rendering (SSR) and Static Site Generation (SSG)
Performance Optimization
{#key} blocks to force re-rendering of components when needed.$effect.tracking() to optimize effect dependencies.Data Fetching and API Routes
SEO and Meta Tags
Forms and Actions
Internationalization (i18n) with Paraglide.js
npm install @inlang/paraglide-jslanguages directory.t function to translate strings:<br />
import { t } from '@inlang/paraglide-js';
<br />
- Support multiple languages and RTL layouts.
- Ensure text scaling and font adjustments for accessibility.
Accessibility
Key Conventions
Documentation
Refer to Svelte, SvelteKit, and Paraglide.js documentation for detailed information on components, internationalization, and best practices.
Public domain (CC0 1.0) · by awesome-cursorrules contributors · source · posted by @OpenSourceBuffGuy on promptparty.com


Sea turtle carrying floating film studio island
Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.
image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost
Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.
video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

Cozy Pixel Art Farm Island Village
Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.
image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape
Loading reviews…
Loading comments…