sveltekit
Skill275 starsChanged 34 days agoApache-2.0View on GitHub
Expert guidance for SvelteKit development with TypeScript, Tailwind CSS, SSR/SSG, and performance optimization best practices
6 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- G1Joshi/Agent-Skillstheir own version, first seen Oct 13, 2026
- epicenter-md/epicentertheir own version, first seen Oct 8, 2026
- EpicenterHQ/epicentertheir own version, first seen Oct 8, 2026
- authdog/agent-skillstheir own version, first seen Sep 18, 2026
- Adhamxon/claude-code-skillsedited, first seen Jul 30, 2026
- joshuadavidthomas/agent-skillstheir own version, first seen May 9, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- Adhamxon/claude-code-skills★ 210% same
Wrote their own version · 5
- epicenter-md/epicenter★ 4.8ksame name
- EpicenterHQ/epicenter★ 4.8ksame name
- joshuadavidthomas/agent-skills★ 49same name
- G1Joshi/Agent-Skills★ 15same name
- authdog/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository264 other files it gives its agents.
- accessibility-a11ySkill
- alpine-jsSkill
- analytics-data-analysisSkill
- android-developmentSkill
- angular-developmentSkill
- angularSkill
- anime-jsSkill
- anthropic-claude-developmentSkill
- api-developmentSkill
- apollo-graphqlSkill
- aspnet-coreSkill
- astroSkill
- auth0-authenticationSkill
- autogen-developmentSkill
- automl-hyperparameter-optimizationSkill
- aws-developmentSkill
- azureSkill
- backend-developmentSkill
- bash-scriptingSkill
- beautifulsoup-parsingSkill
- bitbucket-workflowSkill
- blazorSkill
- blender-python-addonSkill
- blockchainSkill
- bootstrapSkill
- business-central-developmentSkill
- cheerio-parsingSkill
- chrome-extension-developmentSkill
- ci-cd-best-practicesSkill
- clean-architectureSkill
- clean-codeSkill
- clerk-authenticationSkill
- cloudflare-developmentSkill
- computer-vision-opencvSkill
- convexSkill
- cppSkill
- c-sharpSkill
- cssSkill
- cypressSkill
- data-analysis-jupyterSkill
- data-analystSkill
- data-jupyter-pythonSkill
- deep-learning-pythonSkill
- deep-learning-pytorchSkill
- deep-learningSkill
- deno-typescriptSkill
- design-systemsSkill
- devopsSkill
- django-pythonSkill
- django-rest-api-developmentSkill
- dockerSkill
- dotnetSkill
- drizzle-ormSkill
- drupal-developmentSkill
- elasticsearch-best-practicesSkill
- electron-developmentSkill
- elixirSkill
- embedded-stm32Skill
- esbuild-bundlerSkill
- ethereumSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 7 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Write concise, technical SvelteKit code with accurate TypeScript examples
- Distinctive: line 16
Use functional and declarative programming patterns.
- Distinctive: line 17
Prefer iteration and modularization over code duplication
- Distinctive: line 18
Use descriptive variable names with auxiliary verbs (isLoading, hasError)
- Very specific: line 285
Use {#key} blocks for component recreation
- Very specific: line 287
Use $effect.pre for DOM measurements
- Distinctive: line 307
Use semantic HTML elements
- Distinctive: line 308
Add ARIA labels where needed
- Distinctive: line 310
Test with screen readers
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SvelteKit Development
You are an expert in SvelteKit, TypeScript, Tailwind CSS, and modern web application development.
Key Principles
- Write concise, technical SvelteKit code with accurate TypeScript examples
- Use functional and declarative programming patterns; avoid classes
- Prefer iteration and modularization over code duplication
- Use descriptive variable names with auxiliary verbs (isLoading, hasError)
- Structure files: component logic, markup, styles, helpers, types
Project Structure
src/
├── lib/
│ ├── components/ # Reusable Svelte components
│ ├── server/ # Server-only utilities
│ ├── stores/ # Svelte stores
│ └── utils/ # Shared utilities
├── routes/
│ ├── +layout.svelte # Root layout
│ ├── +page.svelte # Home page
│ └── api/ # API routes
├── app.html # HTML template
└── app.css # Global stylesComponent Development
Script Setup with TypeScript
<script lang="ts">
import { onMount } from 'svelte';
import type { PageData } from './$types';
export let data: PageData;
let count = 0;
$: doubled = count * 2;
function increment() {
count += 1;
}
</script>Props and Events
<script lang="ts">
import { createEventDispatcher } from 'svelte';
export let title: string;
export let disabled = false;
const dispatch = createEventDispatcher<{
submit: { value: string };
}>();
function handleSubmit() {
dispatch('submit', { value: title });
}
</script>Routing
File-Based Routes
routes/
├── +page.svelte # /
├── about/+page.svelte # /about
├── blog/
│ ├── +page.svelte # /blog
│ └── [slug]/
│ └── +page.svelte # /blog/:slugDynamic Routes
<!-- routes/blog/[slug]/+page.svelte -->
<script lang="ts">
import type { PageData } from './$types';
export let data: PageData;
</script>
<h1>{data.post.title}</h1>Load Functions
// +page.server.ts
import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async ({ params, fetch }) => {
const response = await fetch(`/api/posts/${params.slug}`);
const post = await response.json();
return { post };
};SSR and SSG
Server-Side Rendering
// +page.server.ts
export const ssr = true;
export const csr = true;
export const load: PageServerLoad = async ({ locals }) => {
return {
user: locals.user
};
};Static Generation
// +page.ts
export const prerender = true;
export async function load() {
return {
// Static data
};
}Prerendering Dynamic Routes
// +page.server.ts
export const prerender = true;
export async function entries() {
const posts = await getPosts();
return posts.map((post) => ({ slug: post.slug }));
}Form Actions
// +page.server.ts
import type { Actions } from './$types';
export const actions: Actions = {
default: async ({ request, cookies }) => {
const data = await request.formData();
const email = data.get('email');
// Validate and process
if (!email) {
return { success: false, error: 'Email required' };
}
return { success: true };
}
};<!-- +page.svelte -->
<script lang="ts">
import { enhance } from '$app/forms';
import type { ActionData } from './$types';
export let form: ActionData;
</script>
<form method="POST" use:enhance>
<input name="email" type="email" />
<button type="submit">Subscribe</button>
{#if form?.error}
<p class="error">{form.error}</p>
{/if}
</form>State Management
Svelte Stores
// lib/stores/counter.ts
import { writable, derived } from 'svelte/store';
export const count = writable(0);
export const doubled = derived(count, ($count) => $count * 2);
export function increment() {
count.update((n) => n + 1);
}Page Store
<script lang="ts">
import { page } from '$app/stores';
$: currentPath = $page.url.pathname;
$: params = $page.params;
</script>API Routes
// routes/api/posts/+server.ts
import { json } from '@sveltejs/kit';
import type { RequestHandler } from './$types';
export const GET: RequestHandler = async ({ url }) => {
const limit = url.searchParams.get('limit') ?? '10';
const posts = await getPosts(Number(limit));
return json(posts);
};
export const POST: RequestHandler = async ({ request }) => {
const body = await request.json();
const post = await createPost(body);
return json(post, { status: 201 });
};Styling with Tailwind
<div class="flex flex-col gap-4 p-6">
<h1 class="text-2xl font-bold text-gray-900 dark:text-white">
{title}
</h1>
<p class="text-gray-600 dark:text-gray-300">
{description}
</p>
</div>
<style>
/* Scoped styles when needed */
:global(.prose) {
@apply max-w-none;
}
</style>Error Handling
<!-- +error.svelte -->
<script lang="ts">
import { page } from '$app/stores';
</script>
<h1>{$page.status}</h1>
<p>{$page.error?.message}</p>// +page.server.ts
import { error } from '@sveltejs/kit';
export const load: PageServerLoad = async ({ params }) => {
const post = await getPost(params.slug);
if (!post) {
throw error(404, 'Post not found');
}
return { post };
};Performance Optimization
- Use
{#key}blocks for component recreation - Implement lazy loading with dynamic imports
- Use
$effect.prefor DOM measurements - Optimize images with
@sveltejs/enhanced-img - Prefetch links with
data-sveltekit-preload-data
Testing
// Component testing with Vitest
import { render, screen } from '@testing-library/svelte';
import { expect, test } from 'vitest';
import Button from './Button.svelte';
test('renders button with text', () => {
render(Button, { props: { label: 'Click me' } });
expect(screen.getByRole('button')).toHaveTextContent('Click me');
});Accessibility
- Use semantic HTML elements
- Add ARIA labels where needed
- Ensure keyboard navigation
- Test with screen readers
- Maintain focus management
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

