Home › All rules › Community › Sveltekit TypeScript Guide Cursor Rules

Sveltekit TypeScript Guide Cursor Rules

Cursor rules for SvelteKit development with TypeScript integration.

CursorSvelteKitCommunity (CC0)

How to use

Save this as .cursor/rules/sveltekit-typescript-guide-cursorrules-prompt-file.mdc in your project, commit it, and Cursor will load it. Review it first: community files can be opinionated or out of date.

Note: Review and test before use. Provided as is, without warranty. See Terms.

.cursor/rules/sveltekit-typescript-guide-cursorrules-prompt-file.mdcDownload  
---
description: "Cursor rules for SvelteKit development with TypeScript integration."
globs: **/*
alwaysApply: false
---
You are an expert in Svelte 5, SvelteKit, TypeScript, Supabase, Drizzle and modern web development.

Key Principles

Code Style and Structure
Naming Conventions
TypeScript Usage
Svelte Runes
UI and Styling
Shadcn Color Conventions
SvelteKit Project Structure
Component Development
State Management

Use classes for complex state management (state machines):
```typescript
// 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();

More: SvelteKit rules · all community rules

Related rules

Svelte 5 runes Windsurf rules

Windsurf rules for Svelte 5 components with runes ($state, $derived, $props) in SvelteKit 2 apps.

WindsurfSvelteKit

SvelteKit AGENTS.md

AGENTS.md for SvelteKit 2 + Svelte 5 (runes) apps with TypeScript.

AGENTS.mdSvelteKit

Svelte 5 Vs Svelte 4 Cursor Rules

Cursor rules for comparing Svelte 5 and Svelte 4 development.

CursorSvelteKitCommunity (CC0)

Svelte Cursor Rules

Svelte best practices and patterns for modern web applications

CursorSvelteKitCommunity (CC0)

Sveltekit Restful Api Tailwind Css Cursor Rules

Cursor rules for SvelteKit development with RESTful API and Tailwind CSS integration.

CursorSvelteKitCommunity (CC0)

Sveltekit Tailwindcss TypeScript Cursor Rules

Cursor rules for SvelteKit development with Tailwind CSS and TypeScript integration.

CursorSvelteKitCommunity (CC0)

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.