Windsurf Cascade AI (.windsurfrules) for SvelteKit 2, Svelte 5 Runes & Tailwind v4
Stops Windsurf and Cursor from writing deprecated Svelte 4 syntax (let:, export let, $: reactive declarations). Enforces modern Svelte 5 Runes and typesafe form actions.
Parametric Customizer & Compiler Live Tool
Adjust the variables below. The prompt code and API payload update dynamically in real time.
Specifies backend data source.
Configures typesafe form handling.
# WINDSURF CASCADE RULES FOR SVELTEKIT 2 & SVELTE 5 RUNES
You are an Expert Frontend & Fullstack Architect specialized in SvelteKit 2, Svelte 5, and modern TypeScript.
### CRITICAL SVELTE 5 SYNTAX ENFORCEMENT:
- **FORBIDDEN (Svelte 4 Deprecated)**: Never write `let count = 0;`, `export let data;`, `$: doubled = count * 2;`, or `let:item`.
- **MANDATORY (Svelte 5 Runes)**:
- Reactive state: `let count = $state(0);`
- Derived state: `let doubled = $derived(count * 2);`
- Side effects: `$effect(() => { ... });` (use ONLY for external DOM sync, not internal state mutations)
- Component Props: `let { data, title = 'Default' } = $props();`
- Two-way binding: `$bindable()` for child props
### SVELTEKIT 2 APP ARCHITECTURE:
1. **Server vs. Client Separation**:
- Data loading: Use `+page.server.ts` or `+layout.server.ts` with strict `PageServerLoad` types.
- Form Actions: Handle mutations via SvelteKit Form Actions with `superforms` and Zod validation.
- Progressive Enhancement: Always wrap forms in `use:enhance` for seamless client-side submission without page reloads.
2. **Styling & CSS Architecture**:
- Framework: Tailwind CSS v4 using modern `@theme` CSS variables.
- Encapsulation: Prefer Tailwind utility classes; keep `<style>` tags minimal.
3. **Error Boundaries & Routing**:
- Handle errors gracefully with `+error.svelte` boundaries.
- Use typed routing parameters with `params` validation matches. The AI-powered IDE with deep Cascade flow reasoning.
Leonardo Phoenix & Flux: Generate photorealistic studio assets with 150 daily free credits. Zero setup required.
π 3-Step Production Execution Blueprint
How senior engineers and top creators calibrate, customize, and verify this prompt formula in production.
Target Engine Calibration
Drop this prompt into your project root as `.cursorrules` or load it into Claude 3.5 Sonnet / DeepSeek-R1 system instructions.
Dynamic Parameterization
Adjust the dynamic variables (framework, database, and client state) to match your active codebase architecture.
Sanity & Boundary Check
Run a verification query asking the model to declare its architectural constraints before it generates the first line of code.
βοΈ Recommended API Hyperparameter Calibration
Verified 2026 SettingsCALIBRATION INSIGHT: Low temperature ensures deterministic syntax, accurate AST parsing, and zero hallucinated API methods.
πΈ Real Sample Outputs & Verified Results
Visual evidence and benchmark responses generated using this exact prompt formula.
π¬ Prompt Engineering Anatomy
Why this prompt consistently delivers high-tier results: technical parameter breakdown.
Svelte 5 Runes ($state, $derived, $props) Svelte 5 replaced compile-time magic labels ($:) with explicit universal reactive primitives called Runes, allowing reactive logic inside pure .svelte.ts utility files.
SvelteKit 2 Dynamic redirect() & error() SvelteKit 2 throws redirects and errors as native exceptions rather than returning objects, streamlining auth guards inside hooks.server.ts.
β οΈ Critical Anti-Patterns & Execution Traps
The top 3 engineering mistakes to avoid when deploying this category of prompt into production.
Context Window Flooding
Pasting 50 unminified files into the prompt degrades attention, causing the LLM to ignore core TypeScript rules.
Missing Delimiter Isolation
Letting user instructions mix directly with system rules triggers instruction drift and hallucinations.
Over-Relying on Outdated Paradigms
Allowing the model to use deprecated React 18 patterns (e.g. useEffect for data fetching) creates security vulnerabilities.
π¬ Frequently Asked Questions
Troubleshooting common edge cases, model incompatibilities, and best practices.
Can I use this in Cursor as well as Windsurf?
Yes! Save this as `.cursorrules` for Cursor, or `.windsurfrules` for Windsurf. Both editors respect these exact guidelines.
Does Svelte 5 support TypeScript natively?
Yes, Svelte 5 has first-class TypeScript inference for $props(), $state(), and generic components.
π οΈ Recommended Companion Micro-Tools
Complementary client-side tools designed to test, sanitize, or choreograph outputs from this prompt.
Vibe Coding Prompt Architect (.cursorrules Studio)
Generate production-grade .cursorrules, .windsurfrules, and CLAUDE.md for Next.js 15, FastAPI, and Go with zero-hallucination guardrails.
Launch Tool β‘System Prompt Security Auditor & Jailbreak Scanner
Scan LLM instructions for prompt injection, persona hijacking, and instruction leaks. Score defense 0-100 and auto-harden in 0ms.
Launch Tool β‘Token & API Cost Calculator
Calculate live token counts & cost comparisons across GPT-4o, Claude 3.5, and DeepSeek-R1 with prompt caching discounts.
Launch Tool β‘Cursor AI & Claude 3.5 Sonnet Pro Bundle
Supercharge your workflow with instant codebase indexing, multi-file edits, and automated system rules.
Explore Related AI Coding & Rulesets Prompts View all β
Claude 3.5 Sonnet Senior Staff Full-Stack Refactoring Architect
Specialized prompt framework for Claude 3.5 Sonnet and Claude 3.7. Transforms messy legacy codebases into modular, testable, high-performance systems with automated regression tests.
cursorCursor AI (.cursorrules) for Next.js 15, React 19 & Tailwind CSS
Stops Cursor from writing outdated Next.js 13 patterns, Pages Router syntax, or deprecated React hooks. Enforces strict TypeScript, Server Actions, and modular clean architecture.
deepseekDeepSeek-R1 Autonomous Deep Research & Synthesis Engine
DeepSeek-R1 chain-of-thought framework designed to force deep reflection, counterfactual auditing, and hypothesis testing before producing production-ready research reports.