Index of every page on this site: llms.txt
All skills
spences10 avatar

/sveltekit-structure

@5fe4989
Run it yourself

SvelteKit structure guidance. Use for routing, layouts, error handling, SSR, or svelte:boundary. Covers file naming, nested layouts, error boundaries, pending UI, and hydration.

Use this Skill: https://skilld.dev/gh/spences10/svelte-skills-kit/sveltekit-structure

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesfile-naming.md

≈900 tokens on demand. Your agent reads this file only when SKILL.md points to it.

File Naming Conventions

Core Files

File Purpose Runs Example
+page.svelte Page component Client & Server (SSR) /routes/about/+page.svelte → /about
+page.ts Universal load Client & Server Data for +page.svelte
+page.server.ts Server load & actions Server only DB queries, form actions
+layout.svelte Layout wrapper Client & Server Wraps child routes
+layout.ts Layout universal load Client & Server Data for +layout.svelte
+layout.server.ts Layout server load Server only Auth, user data
+error.svelte Error boundary Client & Server Shown when error thrown
+server.ts API endpoint Server only /routes/api/users/+server.ts → /api/users

Route Parameters

Pattern Matches Example
[id] Single param /posts/[id]/+page.svelte → /posts/123
[slug] Single param /blog/[slug]/+page.svelte → /blog/hello-world
[[optional]] Optional param /search/[[query]]/+page.svelte → /search or /search/svelte
[...rest] Rest params /docs/[...path]/+page.svelte → /docs/a/b/c

Route Groups

Pattern Purpose URL
(group) Group routes (no URL impact) /(app)/dashboard/+page.svelte → /dashboard
(marketing) Separate layouts Different layout for marketing pages

Special Files

  • hooks.server.ts - Server hooks (handle function, runs on every request)
  • hooks.client.ts - Client hooks (runs in browser)
  • app.html - HTML template
  • service-worker.ts - Service worker
  • params/*.ts - Param validators

Common Patterns

src/routes/
├── +layout.svelte              # Root layout
├── +layout.ts                  # Root data
├── +page.svelte                # Homepage
├── +error.svelte               # Root error boundary
│
├── (app)/                      # App routes (grouped)
│   ├── +layout.svelte          # App layout (auth required)
│   ├── dashboard/+page.svelte  # /dashboard
│   └── settings/+page.svelte   # /settings
│
├── (marketing)/                # Marketing routes (grouped)
│   ├── +layout.svelte          # Marketing layout
│   ├── about/+page.svelte      # /about
│   └── pricing/+page.svelte    # /pricing
│
├── blog/
│   ├── +page.svelte            # /blog (list)
│   └── [slug]/
│       ├── +page.svelte        # /blog/post-title
│       └── +page.server.ts     # Load post data
│
└── api/
    └── posts/
        └── +server.ts          # API: GET/POST /api/posts

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning2mo5 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill provides documentation and structural guidance for SvelteKit projects. It includes a workflow command instruction for validating the skill files, but contains no malicious patterns, prompt injections, or unauthorized resource access.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

  • Runlayer9mo

    7/7 files flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 5fe4989. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 7 months ago

README badge

README badge for spences10/svelte-skills-kit/sveltekit-structure