BACK TO TEMPLATES
rulesany

SvelteKit App Rules

Production AGENTS.md for Svelte 5 and SvelteKit projects covering runes, server load functions, and svelte-check.

When to use this

Place this template in SvelteKit applications to enforce Svelte 5 runes ($state, $derived, $effect), server actions, and type-checked routing.

The template

# AGENTS.md

## Project Context

SvelteKit web application using Svelte 5, TypeScript, Tailwind CSS, and Vite.

## Commands

- `npm run dev` start SvelteKit dev server
- `npx svelte-check` run Svelte type checking tool
- `npm run test` run Vitest test runner

Run `npx svelte-check` and verify zero errors before committing code.

## Conventions

- Use Svelte 5 reactivity runes (`$state()`, `$derived()`, `$props()`).
- Data loading must be handled in `+page.server.ts` or `+layout.server.ts`.
- Form submissions must use SvelteKit Form Actions with type safety.

## Restrictions

- Do not perform sensitive data operations or API key calls in client-side `.svelte` scripts.
- Do not mix legacy `export let prop` syntax with Svelte 5 `$props()`.

## Approval Required

- Adding new npm packages or Svelte adapters.
- Modifying `hooks.server.ts` authentication logic.

Customization Guide

Update adapter configuration and testing setup for your SvelteKit project deployment target.

Last verified 2026-07-26