Assists with building full-stack web applications using SvelteKit. Use when creating Svelte apps with file-based routing, server-side rendering, form actions, or API endpoints. Trigger words: sveltekit, svelte, svelte routing, form actions, svelte hooks, svelte adapter, svelte load function.
SvelteKit is a full-stack framework built on Svelte's compiler-first approach, shipping minimal JavaScript with no virtual DOM runtime. It provides file-based routing for pages and API endpoints, server-side form actions with progressive enhancement, and deployment adapters for any hosting platform.
+page.svelte for pages, +layout.svelte for shared layouts, +server.ts for API endpoints, and route groups (name) for shared layouts without URL impact.+page.server.ts for server-only loading (database queries, secrets) and +page.ts for universal loading. Keep load() functions thin and move business logic to $lib/server/.+page.server.ts with fail() for validation errors and redirect() for success. Add use:enhance for progressive enhancement.GET, POST, PUT, DELETE handlers from +server.ts files, returning json(), text(), or error() responses.export const prerender = true for static pages (marketing, docs, blog), and export const ssr = false for client-only pages.src/hooks.server.ts with the handle function for auth, logging, and redirects, and sequence() to compose multiple hooks.adapter-auto for auto-detection, adapter-node for self-hosted, adapter-static for full SSG, or platform-specific adapters for Vercel, Cloudflare, or Netlify.User request: "Create a SvelteKit app with form-based task management"
Actions:
/tasks/+page.svelte) and detail (/tasks/[id]/+page.svelte)load() in +page.server.ts to fetch tasks from the databaseuse:enhance for no-JS fallbackOutput: A full-stack task management app with progressive enhancement and server-side validation.
User request: "Set up a SvelteKit site with static marketing pages and dynamic dashboard"
Actions:
export const prerender = true+page.server.ts for authenticated data loadingsrc/hooks.server.ts to protect dashboard routesadapter-vercel with edge functions for the dashboardOutput: A hybrid app with pre-rendered marketing pages and server-rendered authenticated dashboard.
+page.server.ts for data loading that touches databases or secrets; never expose credentials in +page.ts.use:enhance for progressive enhancement.export const prerender = true on marketing pages, docs, and blog posts.load() functions thin: fetch data and return it, move business logic to $lib/server/.(name) to share layouts without affecting URLs.data-sveltekit-preload-data="hover" on links for perceived-instant navigation.form prop in +page.svelte to display validation errors after failed actions.npx skills add TerminalSkills/sveltekit下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer