i am trying to use the ai assistant to help me with coding my svelte project. the…
- User
i am trying to use the ai assistant to help me with coding my svelte project. the problem is that the AI model is mainly trained with Svelte 4, while my project is in Svelte 5 (RC) which is not released yet. even though the when i ask in each prompt to use Svelte 5 (with runes and it's new features) it does work but i have to tell it every time. can you go through the Svelte 5 release notes and blog posts and give me an accurate system prompt for Zed's AI assistant?
- Assistant
Certainly! I'll help you craft a comprehensive system prompt for Zed's AI assistant that focuses on Svelte 5 and its new features like runes. Below, I'll provide a summary of the key updates in Svelte 5, and then create an accurate system prompt based on that information.
Summary of Svelte 5 New Features
-
Runes for Reactivity:
- Introduction of Runes: Svelte 5 replaces the
$:reactive statements with runes, which are reactive functions that manage state and side effects more elegantly. - Usage: Runes are functions that return values and can be used within the component markup. They enable more predictable and testable reactive code.
- Built-in Runes: Common runes include
useState,useEffect,useContext, etc.
- Introduction of Runes: Svelte 5 replaces the
-
Enhanced State Management:
- Immutable Stores: Emphasis on immutability in state management for better predictability.
- Improved Store APIs: More intuitive APIs for creating and subscribing to stores.
-
Simplified Syntax and Composition:
- Component Composition: Improved ways to compose components and pass data between them.
- Events and Props: Streamlined handling of events and properties with less boilerplate.
-
TypeScript Enhancements:
- Stronger Typing: Better TypeScript support with improved type inference and error detection.
- Type-Safe Runes: Runes come with TypeScript definitions to ensure type safety.
-
Performance Improvements:
- Compiler Optimizations: Faster compile times and smaller bundle sizes.
- Runtime Efficiency: More efficient updates and rendering.
-
New Lifecycle Hooks:
- Additional Hooks: Introduction of new lifecycle hooks for greater control over component lifecycles.
-
Updated Tooling and Integration:
- SvelteKit Compatibility: Full support for SvelteKit and seamless integration with modern tooling.
- Better Debugging: Enhanced debugging capabilities and error messages.
System Prompt for Zed's AI Assistant
You are an AI assistant specialized in Svelte 5 (Release Candidate) and its new features. Your role is to help users with their Svelte 5 projects by providing accurate information, code examples, and guidance based on Svelte 5's latest syntax and best practices. Specifically, you should:
- Use Svelte 5 conventions in all explanations and code samples.
- Incorporate runes for reactivity and state management instead of the older reactive statements.
- Provide examples using the new immutable stores and enhanced store APIs.
- Utilize simplified syntax for component composition, events, and props.
- Emphasize TypeScript support with proper typing in code snippets.
- Highlight performance improvements and how to leverage them.
- Mention new lifecycle hooks when relevant.
- Ensure compatibility with SvelteKit and modern tooling in recommendations.
- Avoid referencing deprecated features from previous Svelte versions.
Assume the user is working exclusively with Svelte 5, and tailor your responses to reflect the latest documentation and best practices as of October 2023.
By using this system prompt, Zed's AI assistant will consistently provide you with guidance that's aligned with Svelte 5, without needing to be reminded in each prompt. The assistant will focus on the new features and ensure that all code samples and explanations are up-to-date with the latest version.
Optional Customization:
If you have specific areas you want the assistant to focus on, such as Runes or TypeScript integration, you can modify the prompt to emphasize those aspects even more.
Let me know if you need any further assistance or adjustments to the prompt!
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.