sveltekit-svelte5-tailwind-skill by claude-skills/sveltekit-svelte5-tailwind-skill
npx skills add https://github.com/claude-skills/sveltekit-svelte5-tailwind-skill --skill sveltekit-svelte5-tailwind-skill此技能为使用 SvelteKit 2 + Svelte 5 + Tailwind CSS v4 技术栈构建现代 Web 应用程序提供全面指导。
SvelteKit 2 是一个现代化的全栈框架,具有:
Svelte 5 引入了新的响应式系统,包括:
$state()、$derived()、$effect()、$props()Tailwind CSS v4 提供:
此技能解决的集成挑战:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
关键:研究优先的方法论
当用户要求您使用此技术栈构建某些功能时:
为何这很重要:
工作流程:
此技能包含两个可搜索的文档集合:
17 个精选指南,针对特定的集成挑战:
7 个改编的文档指南,涵盖完整的 API:
重要:实施前务必先搜索!
此技能使用 5 阶段搜索流程进行高效的文档查找:
查找所有文档索引:
find . -name "index.jsonl" -type f
预期输出:
./references/index.jsonl (17 个问题导向指南)./docs/index.jsonl (7 个综合参考)抽样每个集合以了解其范围:
Read references/index.jsonl with offset: 1, limit: 5
Read docs/index.jsonl with offset: 1, limit: 5
确定哪些集合与您的查询相关。
为您选择的集合读取完整的索引文件:
Read references/index.jsonl # 用于操作指南和故障排除
Read docs/index.jsonl # 用于 API 参考和配置
分析摘要以确定 3-4 个最相关的文件:
对于设置问题 → references/getting-started.md, references/project-setup.md 对于符文问题 → references/svelte5-runes.md, docs/svelte5-api-reference.md 对于表单问题 → references/forms-and-actions.md, docs/integration-patterns.md 对于样式问题 → references/styling-with-tailwind.md, docs/tailwind-configuration.md 对于 SSR 问题 → references/server-rendering.md, docs/advanced-ssr.md 对于部署问题 → references/deployment-guide.md, docs/adapters-reference.md 对于错误问题 → references/common-issues.md, references/troubleshooting.md
考虑:
对于您的 3-4 个候选文件,读取它们的 sections.jsonl 条目:
Read references/sections.jsonl with offset: {index}, limit: 1
Read docs/sections.jsonl with offset: {index}, limit: 1
重要: index.jsonl 中的索引号 = sections.jsonl 中的行号
分析章节摘要以确定哪些章节涉及您的查询。
仅阅读相关章节:
Read references/getting-started.md with offset: 45, limit: 89
Read docs/svelte5-api-reference.md with offset: 120, limit: 65
使用 sections.jsonl 数据中的偏移量和限制进行精确阅读。
整合来自多个来源的信息:
文件引用示例:
参见:references/svelte5-runes.md:156-245 (服务器端约束)
参见:docs/advanced-ssr.md:89-134 (SSR 加载函数)
有关完整的搜索方法及示例,请参阅 references/documentation-search-system.md
如需完整演练,请搜索 references/getting-started.md
基本设置命令:
# 1. 创建 SvelteKit 项目
npm create svelte@latest my-app
cd my-app
npm install
# 2. 添加 Tailwind v4
npm install -D tailwindcss@next @tailwindcss/vite@next
# 3. 配置 Vite (vite.config.js)
import { sveltekit } from '@sveltejs/kit/vite';
import tailwindcss from '@tailwindcss/vite';
export default {
plugins: [
tailwindcss(), // 必须在 sveltekit() 之前
sveltekit()
]
};
# 4. 创建 app.css
@import "tailwindcss";
# 5. 在根布局中导入 (src/routes/+layout.svelte)
<script>
import '../app.css';
</script>
<slot />
# 6. 验证
npm run dev
关键配置:
@next 标签设置和配置 → 搜索:references/getting-started.md, references/project-setup.md → 关键章节:安装、Vite 配置、目录结构
Svelte 5 符文与 SSR
→ 搜索:references/svelte5-runes.md
→ 关键:服务器端约束 章节 - $state() 在 SSR 中不起作用!
表单与渐进增强 → 搜索:references/forms-and-actions.md → 关键模式:为符文兼容性使用手动 enhance()
样式化组件 → 搜索:references/styling-with-tailwind.md, references/styling-patterns.md → 关键主题:动态类、深色模式、组件模式
数据加载 → 搜索:references/data-loading.md, docs/advanced-ssr.md → 关键模式:将 load() 数据传递给符文状态
部署 → 搜索:references/deployment-guide.md, docs/adapters-reference.md → 平台特定:Vercel、Cloudflare、Node、静态部署
故障排除错误 → 首先搜索:references/common-issues.md (快速修复) → 然后:references/troubleshooting.md (系统化调试)
生产环境中 CSS 未加载
→ 搜索:references/common-issues.md 中的 CSS 加载问题 章节
→ 快速检查:Vite 插件顺序、CSS 导入位置
符文导致 SSR 错误
→ 搜索:references/svelte5-runes.md 中的 服务器端约束 章节
→ 快速修复:不要在 SSR 组件中使用 $state() 或 $effect()
表单提交时状态丢失
→ 搜索:references/forms-and-actions.md 中的 处理 use:enhance 响应性 章节
→ 快速修复:使用手动 enhance() 回调
HMR 中断
→ 搜索:references/common-issues.md 中的 热模块重载问题 章节
→ 快速修复:检查 Vite 插件顺序和文件监视设置
Tailwind 类不起作用
→ 搜索:references/styling-with-tailwind.md 中的 内容检测与清除 章节
→ 快速修复:检查配置中的内容路径,使用完整的类名
有关系统化故障排除,请参阅 references/troubleshooting.md
服务器 + 客户端组件拆分
<!-- +page.svelte (SSR 安全) -->
<script>
export let data;
</script>
<ClientCounter initialCount={data.count} />
<!-- ClientCounter.svelte (仅客户端符文) -->
<script>
let { initialCount } = $props();
let count = $state(initialCount);
</script>
支持渐进增强的表单
<script>
import { enhance } from '$app/forms';
let { form } = $props();
let submitting = $state(false);
</script>
<form method="POST" use:enhance={() => {
submitting = true;
return async ({ result, update }) => {
submitting = false;
await update();
};
}}>
<!-- 表单字段 -->
</form>
条件性 Tailwind 类
<script>
let active = $state(false);
</script>
<!-- ✅ 良好:完整的类名 -->
<div class:bg-blue-500={active} class:bg-gray-200={!active}>
按钮
</div>
<!-- ❌ 不佳:动态类部分 -->
<div class="bg-{active ? 'blue' : 'gray'}-500">
按钮
</div>
有关完整模式,请搜索 docs/integration-patterns.md
搜索 references/best-practices.md 以获取关于以下方面的全面指导:
在 SvelteKit 中从 Svelte 4 迁移到 Svelte 5 → 搜索:references/migration-svelte4-to-5.md → 关键主题:从存储 (Stores) 到符文 (Runes),从响应式语句到 $derived,从插槽 (Slots) 到片段 (Snippets)
从 Tailwind v3 迁移到 v4 → 搜索:references/tailwind-v4-migration.md → 关键主题:CSS 优先配置、Vite 插件、语法变更
搜索 references/performance-optimization.md 以获取:
此技能涵盖:
所有代码示例和模式均使用这些版本进行测试。
sveltekit-svelte5-tailwind-skill/
├── SKILL.md # 此文件
├── references/ # 问题导向指南 (17 个文件)
│ ├── index.jsonl # 搜索索引
│ ├── sections.jsonl # 章节详情
│ ├── index.meta.json # 集合元数据
│ ├── documentation-search-system.md # 完整的搜索方法
│ ├── getting-started.md
│ ├── project-setup.md
│ ├── svelte5-runes.md
│ ├── forms-and-actions.md
│ ├── styling-with-tailwind.md
│ ├── server-rendering.md
│ ├── data-loading.md
│ ├── deployment-guide.md
│ ├── routing-patterns.md
│ ├── styling-patterns.md
│ ├── best-practices.md
│ ├── performance-optimization.md
│ ├── migration-svelte4-to-5.md
│ ├── tailwind-v4-migration.md
│ ├── common-issues.md
│ └── troubleshooting.md
├── docs/ # 综合参考 (7 个文件)
│ ├── index.jsonl # 搜索索引
│ ├── sections.jsonl # 章节详情
│ ├── index.meta.json # 集合元数据
│ ├── sveltekit-configuration.md
│ ├── svelte5-api-reference.md
│ ├── tailwind-configuration.md
│ ├── adapters-reference.md
│ ├── advanced-routing.md
│ ├── advanced-ssr.md
│ └── integration-patterns.md
├── provenance.jsonl # 来源归属
└── skill.manifest.json # 技能元数据
此技能使用 仅作者 分发模式:
adapted_from) 中注明来源实施前务必先搜索文档! 研究优先的方法可以防止常见错误,并确保您遵循集成最佳实践。
对于每个问题,从阶段 0(发现索引)开始,并完成 5 阶段搜索流程。
每周安装数
160
仓库
GitHub 星标数
24
首次出现
2026 年 1 月 25 日
安全审计
安装于
opencode128
gemini-cli126
codex122
github-copilot119
cursor119
kimi-cli113
This skill provides comprehensive guidance for building modern web applications with the SvelteKit 2 + Svelte 5 + Tailwind CSS v4 stack.
SvelteKit 2 is a modern full-stack framework with:
Svelte 5 introduces a new reactivity system with:
$state(), $derived(), $effect(), $props()Tailwind CSS v4 offers:
Integration challenges this skill addresses:
CRITICAL: Research-First Methodology
When a user asks you to build something with this stack:
Research first - Search the documentation to understand:
Then execute - Implement the solution using the knowledge gained from documentation
Why this matters:
Workflow:
This skill includes two searchable documentation collections:
17 curated guides addressing specific integration challenges:
7 adapted documentation guides covering complete APIs:
IMPORTANT: Always search before implementing!
This skill uses a 5-stage search process for efficient documentation lookup:
Find all documentation indexes:
find . -name "index.jsonl" -type f
Expected output:
./references/index.jsonl (17 problem-focused guides)./docs/index.jsonl (7 comprehensive references)Sample each collection to understand its scope:
Read references/index.jsonl with offset: 1, limit: 5
Read docs/index.jsonl with offset: 1, limit: 5
Determine which collection(s) are relevant to your query.
Read the complete index file(s) for your chosen collection(s):
Read references/index.jsonl # For how-to guides and troubleshooting
Read docs/index.jsonl # For API reference and configuration
Analyze the summaries to identify 3-4 most relevant files:
For setup questions → references/getting-started.md, references/project-setup.md For runes questions → references/svelte5-runes.md, docs/svelte5-api-reference.md For forms questions → references/forms-and-actions.md, docs/integration-patterns.md For styling questions → references/styling-with-tailwind.md, docs/tailwind-configuration.md For SSR questions → references/server-rendering.md, docs/advanced-ssr.md For deployment → references/deployment-guide.md, docs/adapters-reference.md For errors → references/common-issues.md, references/troubleshooting.md
Consider:
For your 3-4 candidates, read their sections.jsonl entries:
Read references/sections.jsonl with offset: {index}, limit: 1
Read docs/sections.jsonl with offset: {index}, limit: 1
Important: Index number from index.jsonl = line number in sections.jsonl
Analyze the section summaries to identify which sections address your query.
Read only the relevant sections:
Read references/getting-started.md with offset: 45, limit: 89
Read docs/svelte5-api-reference.md with offset: 120, limit: 65
Use the offset and limit from the sections.jsonl data for precise reading.
Combine information from multiple sources:
Example file references:
See: references/svelte5-runes.md:156-245 (Server-Side Constraints)
See: docs/advanced-ssr.md:89-134 (SSR Load Functions)
For complete search methodology with examples, see references/documentation-search-system.md
For a complete walkthrough, search references/getting-started.md
Basic setup commands:
# 1. Create SvelteKit project
npm create svelte@latest my-app
cd my-app
npm install
# 2. Add Tailwind v4
npm install -D tailwindcss@next @tailwindcss/vite@next
# 3. Configure Vite (vite.config.js)
import { sveltekit } from '@sveltejs/kit/vite';
import tailwindcss from '@tailwindcss/vite';
export default {
plugins: [
tailwindcss(), // MUST be before sveltekit()
sveltekit()
]
};
# 4. Create app.css
@import "tailwindcss";
# 5. Import in root layout (src/routes/+layout.svelte)
<script>
import '../app.css';
</script>
<slot />
# 6. Verify
npm run dev
Critical configuration:
@next tag for Tailwind v4 packagesSetup and Configuration → Search: references/getting-started.md, references/project-setup.md → Key sections: Installation, Vite Configuration, Directory Structure
Svelte 5 Runes with SSR → Search: references/svelte5-runes.md → Critical: "Server-Side Constraints" section - $state() doesn't work in SSR!
Forms and Progressive Enhancement → Search: references/forms-and-actions.md → Key pattern: Manual enhance() for rune compatibility
Styling Components → Search: references/styling-with-tailwind.md, references/styling-patterns.md → Key topics: Dynamic classes, dark mode, component patterns
Data Loading → Search: references/data-loading.md, docs/advanced-ssr.md → Key pattern: Passing load() data to rune state
Deployment → Search: references/deployment-guide.md, docs/adapters-reference.md → Platform-specific: Vercel, Cloudflare, Node, static
Troubleshooting Errors → Search: references/common-issues.md first (quick fixes) → Then: references/troubleshooting.md (systematic debugging)
CSS not loading in production → Search: references/common-issues.md section "CSS Loading Issues" → Quick check: Vite plugin order, CSS import location
Runes causing SSR errors → Search: references/svelte5-runes.md section "Server-Side Constraints" → Quick fix: Don't use $state() or $effect() in SSR components
Form losing state on submit → Search: references/forms-and-actions.md section "Handling use:enhance Reactivity" → Quick fix: Use manual enhance() callback
HMR breaking → Search: references/common-issues.md section "Hot Module Reload Problems" → Quick fix: Check Vite plugin order and file watch settings
Tailwind classes not working → Search: references/styling-with-tailwind.md section "Content Detection and Purging" → Quick fix: Check content paths in config, use full class names
For systematic troubleshooting, see references/troubleshooting.md
Server + Client Component Split
<!-- +page.svelte (SSR-safe) -->
<script>
export let data;
</script>
<ClientCounter initialCount={data.count} />
<!-- ClientCounter.svelte (client-only runes) -->
<script>
let { initialCount } = $props();
let count = $state(initialCount);
</script>
Form with Progressive Enhancement
<script>
import { enhance } from '$app/forms';
let { form } = $props();
let submitting = $state(false);
</script>
<form method="POST" use:enhance={() => {
submitting = true;
return async ({ result, update }) => {
submitting = false;
await update();
};
}}>
<!-- form fields -->
</form>
Conditional Tailwind Classes
<script>
let active = $state(false);
</script>
<!-- ✅ GOOD: Full class names -->
<div class:bg-blue-500={active} class:bg-gray-200={!active}>
Button
</div>
<!-- ❌ BAD: Dynamic class parts -->
<div class="bg-{active ? 'blue' : 'gray'}-500">
Button
</div>
For complete patterns, search docs/integration-patterns.md
Search references/best-practices.md for comprehensive guidance on:
Migrating from Svelte 4 to Svelte 5 in SvelteKit → Search: references/migration-svelte4-to-5.md → Key topics: Stores to runes, reactive statements to $derived, slots to snippets
Migrating from Tailwind v3 to v4 → Search: references/tailwind-v4-migration.md → Key topics: CSS-first config, Vite plugin, syntax changes
Search references/performance-optimization.md for:
This skill covers:
All code examples and patterns are tested with these versions.
sveltekit-svelte5-tailwind-skill/
├── SKILL.md # This file
├── references/ # Problem-focused guides (17 files)
│ ├── index.jsonl # Search index
│ ├── sections.jsonl # Section details
│ ├── index.meta.json # Collection metadata
│ ├── documentation-search-system.md # Complete search methodology
│ ├── getting-started.md
│ ├── project-setup.md
│ ├── svelte5-runes.md
│ ├── forms-and-actions.md
│ ├── styling-with-tailwind.md
│ ├── server-rendering.md
│ ├── data-loading.md
│ ├── deployment-guide.md
│ ├── routing-patterns.md
│ ├── styling-patterns.md
│ ├── best-practices.md
│ ├── performance-optimization.md
│ ├── migration-svelte4-to-5.md
│ ├── tailwind-v4-migration.md
│ ├── common-issues.md
│ └── troubleshooting.md
├── docs/ # Comprehensive references (7 files)
│ ├── index.jsonl # Search index
│ ├── sections.jsonl # Section details
│ ├── index.meta.json # Collection metadata
│ ├── sveltekit-configuration.md
│ ├── svelte5-api-reference.md
│ ├── tailwind-configuration.md
│ ├── adapters-reference.md
│ ├── advanced-routing.md
│ ├── advanced-ssr.md
│ └── integration-patterns.md
├── provenance.jsonl # Source attribution
└── skill.manifest.json # Skill metadata
This skill uses author-only distribution:
adapted_from)Always search documentation before implementing! The research-first approach prevents common mistakes and ensures you follow integration best practices.
Start with Stage 0 (discover indexes) and work through the 5-stage search process for every question.
Weekly Installs
160
Repository
GitHub Stars
24
First Seen
Jan 25, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode128
gemini-cli126
codex122
github-copilot119
cursor119
kimi-cli113
Flutter应用架构设计指南:分层结构、数据层实现与最佳实践
4,100 周安装