Claude Code Plugins

Community-maintained marketplace

Feedback
0
0

Guidance for SvelteKit 2 apps: routing, load functions, form actions, endpoints, invalidation, and project CLI/tests. Use when changing `+page/+layout` files (server/universal), adding actions/endpoints, or adjusting app routing/data flows; pair with `svelte5` for component-level work.

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name sveltekit2
description Guidance for SvelteKit 2 apps: routing, load functions, form actions, endpoints, invalidation, and project CLI/tests. Use when changing `+page/+layout` files (server/universal), adding actions/endpoints, or adjusting app routing/data flows; pair with `svelte5` for component-level work.

SvelteKit 2

Overview

Use this skill for SvelteKit-specific concerns: file-based routing, load functions, actions, endpoints, invalidation, and app-level testing/CLI. For component internals (runes, props, events, styling/accessibility), load the companion svelte5 skill alongside this one.

Quick start

  • Check repo conventions: .github/AGENTS.md, .github/AGENTS-SVELTE.md, .github/AGENTS-SVELTE-JSDocs.md (and .github/AGENTS-SEO-GEO.md for SEO tasks).
  • Choose file type intentionally: +page/+layout (UI), +page.server (server-only data/actions), +page (universal load), +server (API endpoint).
  • Validate inputs in loads/actions/endpoints; use fail(status, data) for validation errors, error for exceptional cases. Sanitize any HTML before @html.
  • Wire error handling early: throw via error/redirect, provide +error.svelte routes, and wrap risky components with <svelte:boundary> or shared ErrorBoundaries for graceful fallbacks.
  • Hydration: prefer event.fetch inside loads; return serializable data; after mutations use invalidate or action results instead of ad-hoc client fetches.
  • Testing/builds: rely on repo scripts; see references for commands. When component logic changes, also use svelte5 patterns.

Workflow

  1. Map route boundaries: what data is needed server-only vs shared, which mutations/actions exist, and which components consume it (svelte5 covers component detail).
  2. Implement load functions following references/kit-patterns.md: pick universal vs server load, handle error states explicitly, avoid leaking secrets to the client.
  3. Add form actions for mutations with validation and friendly failures via fail; wire use:enhance for progressive enhancement when desired.
  4. Build endpoints with explicit method exports, validation, and json/Response returns; set headers/cache deliberately.
  5. Post-mutation: refresh UI via invalidate/invalidateAll or returned action data; avoid redundant fetches in components.
  6. Run checks from references/testing-and-cli.md (lint/format/build/tests). Add Playwright when routing or user journeys change.

Cross-skill guidance

  • For component APIs, runes, events, snippets, styling, and accessibility, load svelte5 with this skill.

References

  • references/kit-patterns.md — project setup, hooks/locals/context, load functions, actions/remote functions, advanced routing, forms, adapters, CSP, and performance patterns.
  • references/testing-and-cli.md — CLI commands (lint/build/test) and Vitest/Playwright tips for this repo.