Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
spences10 avatar

Sveltekit Structure

  • 741 installs
  • 92 repo stars
  • Updated April 29, 2026
  • spences10/svelte-skills-kit

sveltekit-structure is a SvelteKit agent skill that gives developers instant guidance on file conventions, routing, layouts, error boundaries, and SSR patterns in Cursor or Claude Code.

About

sveltekit-structure is a Svelte Skills Kit reference for SvelteKit project layout, routing, layouts, error handling, pending UI, and hydration inside AI coding agents. The skill documents file types including +page.svelte for pages, +layout.svelte for wrappers, +error.svelte for error boundaries, and +server.ts for API endpoints, with route examples such as src/routes/about/+page.svelte and dynamic src/routes/posts/[id]/+page.svelte paths. Developers reach for sveltekit-structure when scaffolding routes, nesting layouts, wiring svelte:boundary error UI, or clarifying SSR behavior during feature work. Guidance stays aligned to SvelteKit file naming so agents generate valid route trees instead of generic SPA patterns.

  • Defines exact file types: +page.svelte, +layout.svelte, +error.svelte, +server.ts
  • Explains route-to-file mapping including dynamic segments like [id]
  • Details nested layout behavior that automatically wraps child routes
  • Includes ready-to-use +layout.svelte component example with slots
  • Links to four focused reference documents covering naming, patterns, and error handling

Sveltekit Structure by the numbers

  • 741 all-time installs (skills.sh)
  • +17 installs in the week ending Jul 27, 2026 (Skillselion tracking)
  • Ranked #469 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Security screen: CRITICAL risk (skills.sh audit)
  • Data as of Jul 31, 2026 (Skillselion catalog sync)
npx skills add https://github.com/spences10/svelte-skills-kit --skill sveltekit-structure

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs741
repo stars92
Security audit2 / 3 scanners passed
Last updatedApril 29, 2026
Repositoryspences10/svelte-skills-kit

How do SvelteKit routes and layout files work?

Get instant, accurate guidance on SvelteKit file conventions, routing, layouts, error boundaries, and SSR patterns while building with Cursor or Claude.

Who is it for?

Frontend developers building SvelteKit apps in Cursor or Claude Code who need accurate routing, layout, and SSR file-convention guidance.

Skip if: Teams using React, Next.js, or non-Svelte frameworks should skip sveltekit-structure because it only covers SvelteKit conventions.

When should I use this skill?

The user asks about SvelteKit routing, +page.svelte, +layout.svelte, +error.svelte, +server.ts, SSR, hydration, or svelte:boundary.

What you get

Correct SvelteKit route trees, layout hierarchies, error boundary files, API endpoints, and SSR-safe page structure.

  • Valid SvelteKit route file tree
  • Layout and error boundary files
  • SSR-aware page and endpoint structure

Files

SKILL.mdMarkdownGitHub ↗

SvelteKit Structure

Quick Start

File types: +page.svelte (page) | +layout.svelte (wrapper) | +error.svelte (error boundary) | +server.ts (API endpoint)

Routes: src/routes/about/+page.svelte/about | src/routes/posts/[id]/+page.svelte/posts/123

Layouts: Apply to all child routes. +layout.svelte at any level wraps descendants.

Example

src/routes/
├── +layout.svelte              # Root layout (all pages)
├── +page.svelte                # Homepage /
├── about/+page.svelte          # /about
└── dashboard/
    ├── +layout.svelte          # Dashboard layout (dashboard pages only)
    ├── +page.svelte            # /dashboard
    └── settings/+page.svelte   # /dashboard/settings
<!-- +layout.svelte -->
<script>
	let { children } = $props();
</script>

<nav><!-- Navigation --></nav>
<main>{@render children()}</main>
<footer><!-- Footer --></footer>

Reference Files

  • file-naming.md - File naming

conventions

  • layout-patterns.md - Nested layouts
  • error-handling.md - +error.svelte

placement

  • svelte-boundary.md -

Component-level error/pending

  • ssr-hydration.md - SSR and

browser-only code

Notes

  • Layouts: {@render children()} | Errors: +error.svelte _above_

failing route

  • Groups: (name) folders don't affect URL | Client-only: check

browser

  • Last verified: 2025-01-11

<!-- PROGRESSIVE DISCLOSURE GUIDELINES:

  • Keep this file ~50 lines total (max ~150 lines)
  • Use 1-2 code blocks only (recommend 1)
  • Keep description <200 chars for Level 1 efficiency
  • Move detailed docs to references/ for Level 3 loading
  • This is Level 2 - quick reference ONLY, not a manual

LLM WORKFLOW (when editing this file): 1. Write/edit SKILL.md 2. Format (if formatter available) 3. Run: npx skills add . --list 4. If the skill is not discovered, check SKILL.md frontmatter formatting 5. Validate again to confirm -->

Related skills

FAQ

Which SvelteKit files does sveltekit-structure cover?

sveltekit-structure covers +page.svelte pages, +layout.svelte wrappers, +error.svelte error boundaries, and +server.ts API endpoints, including nested routes and layout inheritance across child paths.

When should I load sveltekit-structure?

Load sveltekit-structure when building or debugging SvelteKit routing, layouts, error handling, pending UI, SSR, hydration, or svelte:boundary patterns inside Cursor or Claude Code.

Is Sveltekit Structure safe to install?

skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.