Configure Gemini for Svelte 5 and SvelteKit 2: runes-based components, typed load functions, form actions without throw, and stores only where they fit.
GEMINI.md. Downloaded files need to be placed in that repository path.## Gemini Svelte Developer
Applies to: **/*
You are an expert Svelte and SvelteKit developer. Check package.json: this guidance targets Svelte 5 (runes) and SvelteKit 2.
## Svelte components
```svelte
<script lang="ts">
let { name }: { name: string } = $props();
let count = $state(0);
let doubled = $derived(count * 2);
</script>
<h1>Hello {name}!</h1>
<p>Count: {count} (doubled: {doubled})</p>
<button type="button" onclick={() => count++}>Increment</button>
```
- Runes replace `export let` (`$props`), `$:` (`$derived` / `$effect`) and `on:click` (`onclick`). Do not mix runes with legacy syntax in one component.
## SvelteKit load functions
```ts
// src/routes/items/[id]/+page.server.ts
import { error } from '@sveltejs/kit';
import type { PageServerLoad } from './$types';
import { db } from '$lib/server/db';
export const load: PageServerLoad = async ({ params }) => {
const item = await db.item.find(params.id);
if (!item) error(404, 'Not found');
return { item };
};
```
- In SvelteKit 2, `error()` and `redirect()` throw by themselves; do not write `throw error(...)`.
## Form actions
```ts
// src/routes/items/new/+page.server.ts
import { fail, redirect } from '@sveltejs/kit';
import type { Actions } from './$types';
import { db } from '$lib/server/db';
export const actions = {
default: async ({ request }) => {
const data = await request.formData();
const title = data.get('title');
if (typeof title !== 'string' || title.trim() === '') {
return fail(400, { title, missing: true });
}
await db.item.create({ title: title.trim() });
redirect(303, '/items');
},
} satisfies Actions;
```
## Shared state
- Use `.svelte.ts` modules exporting `$state` objects for shared client state. Use stores (`writable`, `derived` from `svelte/store`) for external event sources or code shared with Svelte 4.
```ts
import { writable, derived } from 'svelte/store';
export const count = writable(0);
export const doubled = derived(count, ($count) => $count * 2);
```
- Never keep per-user data in module-level state in SvelteKit: on the server it is shared across requests.
Cursor rules for Tailwind CSS v4: automatic class sorting, mobile-first breakpoints, CVA variants with merging, class-based dark mode via @custom-variant, and CSS-first @theme configuration.
Cursor rules for React with TypeScript: typed function components, React 19 ref-as-prop, hooks discipline, state ownership, error boundaries and measured performance work.
CLAUDE.md rules for React 19 with TypeScript covering typed components, derived state, compiler-aware memoization, useId-based accessibility and review checks.
Gemini
frontend
Illustrative input and expected result. This example is a verification guide, not a recorded model run.
Content reviewed .
A Svelte 5 + SvelteKit 2 project's components still use export let and on:click, and server files use throw error(404) without importing error.
Convert src/routes/items/[id]/+page.svelte and +page.server.ts to current Svelte 5 / SvelteKit 2 syntax.
The component uses $props, $state, $derived and onclick; the load function imports error from @sveltejs/kit, is typed with PageServerLoad, and calls error(404, ...) without throw; the action validates FormData and returns fail(400, ...).
Gemini CLI loads instructional context from GEMINI.md files: a global ~/.gemini/GEMINI.md, files in your workspace directories and their parents, and files discovered in subfolders as the agent works. The file name is configurable, so a project can tell Gemini CLI to read AGENTS.md instead of, or alongside, GEMINI.md. The rules in this directory are written as plain system instructions, so the same text can also be used as a system instruction in Gemini API or Google AI Studio requests.
GEMINI.mdStarting point, not a tested configuration for your repository. GEMINI.md has no file-scoping front matter; add this as a section, or place a GEMINI.md in the relevant subfolder. Review the instructions, adapt the file paths and run your project's existing checks.
## Gemini Svelte Developer
Applies to: **/*
You are an expert Svelte and SvelteKit developer. Check package.json: this guidance targets Svelte 5 (runes) and SvelteKit 2.
## Svelte components
```svelte
<script lang="ts">
let { name }: { name: string } = $props();
let count = $state(0);
let doubled = $derived(count * 2);
</script>
<h1>Hello {name}!</h1>
<p>Count: {count} (doubled: {doubled})</p>
<button type="button" onclick={() => count++}>Increment</button>
```
- Runes replace `export let` (`$props`), `$:` (`$derived` / `$effect`) and `on:click` (`onclick`). Do not mix runes with legacy syntax in one component.
## SvelteKit load functions
```ts
// src/routes/items/[id]/+page.server.ts
import { error } from '@sveltejs/kit';
import type { PageServerLoad } from './$types';
import { db } from '$lib/server/db';
export const load: PageServerLoad = async ({ params }) => {
const item = await db.item.find(params.id);
if (!item) error(404, 'Not found');
return { item };
};
```
- In SvelteKit 2, `error()` and `redirect()` throw by themselves; do not write `throw error(...)`.
## Form actions
```ts
// src/routes/items/new/+page.server.ts
import { fail, redirect } from '@sveltejs/kit';
import type { Actions } from './$types';
import { db } from '$lib/server/db';
export const actions = {
default: async ({ request }) => {
const data = await request.formData();
const title = data.get('title');
if (typeof title !== 'string' || title.trim() === '') {
return fail(400, { title, missing: true });
}
await db.item.create({ title: title.trim() });
redirect(303, '/items');
},
} satisfies Actions;
```
## Shared state
- Use `.svelte.ts` modules exporting `$state` objects for shared client state. Use stores (`writable`, `derived` from `svelte/store`) for external event sources or code shared with Svelte 4.
```ts
import { writable, derived } from 'svelte/store';
export const count = writable(0);
export const doubled = derived(count, ($count) => $count * 2);
```
- Never keep per-user data in module-level state in SvelteKit: on the server it is shared across requests.
Ask for a small change to one matching file. Check the tool's loaded context or instruction view, inspect the diff for the requested convention, and run the relevant build or test. A well-formatted file does not guarantee the model follows every instruction.
The Gemini CLI documentation states that Gemini CLI was replaced by Antigravity CLI on June 18, 2026 for unpaid-tier and Google One users. Check which CLI your account uses; Antigravity rules are covered on the Antigravity page. Gemini CLI does not need a separate AGENTS.md mechanism: its context file name is configurable through context.fileName in settings.json (the docs show ["AGENTS.md", "CONTEXT.md", "GEMINI.md"]). Without that setting it looks for GEMINI.md.
Documentation checked 2026-11-05: Gemini CLI docs: GEMINI.md context filesGemini CLI docs: System prompt override
Cursor rules for Tailwind CSS v4: automatic class sorting, mobile-first breakpoints, CVA variants with merging, class-based dark mode via @custom-variant, and CSS-first @theme configuration.
Cursor rules for React with TypeScript: typed function components, React 19 ref-as-prop, hooks discipline, state ownership, error boundaries and measured performance work.
CLAUDE.md rules for React 19 with TypeScript covering typed components, derived state, compiler-aware memoization, useId-based accessibility and review checks.