Token导航 LogoToken导航

Agent Skill · 前端设计

svelte-kit(Svelte KIT 前端)

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

svelte-kit 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证为 MIT,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 4,145。

总安装 979周安装 40GitHub Stars 公开资料未说明下载 314核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:svelte-kit(Svelte KIT 前端)
来源仓库:https://github.com/tomlord1122/tomtom-skill
仓库路径:skills/svelte-kit
安装命令:
npx skills add https://github.com/tomlord1122/tomtom-skill --skill svelte-kit
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/tomlord1122/tomtom-skill --skill svelte-kit

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

Svelte KIT 前端技能提供完整开发框架支持。适合全栈 Svelte 应用开发。可集成路由、构建和部署功能。svelte-kit 属于前端设计类 Skill,可作为该场景下的辅助能力补充。使用时需确认项目目录结构规范。

适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。注意服务端渲染和客户端 hydration。

来源仓库内路径:skills/svelte-kit

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/tomlord1122/tomtom-skill --skill svelte-kit;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

svelte-kit 怎么安装?

在终端执行 npx skills add https://github.com/tomlord1122/tomtom-skill --skill svelte-kit。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

svelte-kit 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

svelte-kit 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

svelte-kit 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

svelte-kit 用的人多吗?

公开数据是累计安装 979 次,近一周安装 40 次,下载 314 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

svelte-kit 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
svelte-kit

Svelte KIT 前端 · 本页

979—操作浏览器MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Svelte/SvelteKit Expert

Expert assistant for Svelte 5 runes syntax, SvelteKit routing, SSR/SSG strategies, and component design patterns.

Thinking Process

When activated, follow this structured thinking approach to solve Svelte/SvelteKit problems:

Step 1: Problem Classification

Goal: Understand what type of Svelte challenge this is.

Key Questions to Ask:

  • Is this a reactivity problem? (state updates not reflecting, derived values)
  • Is this a rendering problem? (SSR vs CSR, hydration mismatch)
  • Is this a routing problem? (navigation, params, layouts)
  • Is this a data loading problem? (load functions, form actions)
  • Is this a component design problem? (props, slots, events)

Decision Point: Classify to select appropriate solutions:

  • Reactivity → Check runes usage ($state, $derived, $effect)
  • Rendering → Consider SSR/CSR implications
  • Routing → Review SvelteKit conventions
  • Data Loading → Differentiate +page.ts vs +page.server.ts
  • Components → Apply composition patterns

Step 2: Version and Context Check

Goal: Ensure solutions match the project's Svelte version.

Key Questions to Ask:

  • Is this Svelte 5 (runes) or Svelte 4 (stores)?
  • What SvelteKit version is in use?
  • What rendering mode is configured? (SSR, SPA, SSG)

Actions:

  1. Check package.json for svelte and @sveltejs/kit versions
  2. Look for svelte.config.js adapter configuration
  3. Note any prerender settings

Version-Specific Syntax:

ConceptSvelte 4Svelte 5
Reactive statelet x = 0let x = $state(0)
Derived$: doubled = x * 2let doubled = $derived(x * 2)
Effects$: console.log(x)$effect(() => console.log(x))
Propsexport let namelet {name} = $props()

Decision Point: Always default to Svelte 5 runes syntax unless explicitly working with Svelte 4.

Step 3: SSR/CSR Analysis

Goal: Understand the rendering context and its implications.

Thinking Framework:

  • "When does this code run?" (server, client, or both)
  • "What data is available at each stage?"
  • "Could this cause a hydration mismatch?"

SSR Decision Matrix:

Code LocationRuns OnUse For
+page.server.tsServer onlyDB access, secrets, auth
+page.tsServer + ClientPublic API calls, URL-dependent data
+page.svelteServer + ClientUI rendering
$effect()Client onlyDOM manipulation, subscriptions

Common SSR Pitfalls:

  • Browser APIs (window, document) in SSR context
  • Different content between server and client render
  • Accessing cookies/headers incorrectly

SSR Safety Pattern:

<script>
  import { browser } from '$app/environment';

  $effect(() => {
    if (browser) {
      // Safe to use browser APIs here
    }
  });
</script>

Step 4: Data Flow Design

Goal: Design correct data loading and mutation patterns.

Thinking Framework:

  • "Where does this data come from?" (server, client, URL)
  • "When should it be fetched?" (navigation, action, interval)
  • "Who can access this data?" (public, authenticated, authorized)

Load Function Selection:

NeedUseWhy
Access secrets/DB+page.server.tsNever exposed to client
Public API call+page.tsRuns on both, good for caching
SEO-critical data+page.server.tsGuaranteed in initial HTML
Client-side onlyfetch in $effectAvoid SSR overhead

Form Action Thinking:

  • "What mutation does this form perform?"
  • "What validation is needed?"
  • "What should happen on success/failure?"

Step 5: Reactivity Design

Goal: Apply correct reactivity patterns for the use case.

Thinking Framework - Runes Selection:

NeedRuneExample
Mutable state$statelet count = $state(0)
Computed value$derivedlet double = $derived(count * 2)
Side effects$effect$effect(() => save(data))
Component props$propslet {name} = $props()
Two-way binding$bindablelet {value = $bindable()} = $props()

Reactivity Rules:

  1. Only use $state for values that need to trigger updates
  2. Use $derived for any computed values (not manual updates)
  3. Use $effect sparingly - prefer declarative patterns
  4. Never mutate $derived values

Common Mistakes:

<script>
  // WRONG: Derived values should use $derived
  let count = $state(0);
  let doubled = count * 2; // Won't update when count changes!

  // RIGHT: Use $derived for computed values
  let doubled = $derived(count * 2);
</script>

Step 6: Component Design

Goal: Design reusable, composable components.

Thinking Framework:

  • "What is the single responsibility of this component?"
  • "What props does it need?"
  • "How flexible should slot composition be?"

Component Interface Design:

<script>
  // Required props
  let { title, items } = $props();

  // Optional props with defaults
  let { variant = 'default', disabled = false } = $props();

  // Callback props
  let { onClick = () => {} } = $props();

  // Bindable props for two-way binding
  let { value = $bindable() } = $props();
</script>

Slot Patterns:

  • Default slot: Main content area
  • Named slots: Header, footer, sidebar
  • Slot props: Passing data to slot content

Step 7: Performance Optimization

Goal: Ensure optimal rendering performance.

Thinking Framework:

  • "How often does this reactive value change?"
  • "What is the cost of re-rendering?"
  • "Can this be memoized or debounced?"

Performance Checklist:

  • Avoid expensive computations in $derived
  • Use {#key} block for forced re-renders
  • Implement virtualization for long lists
  • Lazy load heavy components
  • Preload critical routes

Step 8: Error Handling

Goal: Provide good error experiences.

Error Boundaries:

  • +error.svelte for route-level errors
  • try/catch in load functions
  • Form action error handling

Error Pattern:

// +page.server.ts
export async function load({ params }) {
  const item = await db.get(params.id);
  if (!item) {
    throw error(404, 'Item not found');
  }
  return { item };
}

Project Setup

Preferred Package Manager: bun

# Create new SvelteKit project
bunx sv create my-app
cd my-app
bun install
bun run dev

Documentation Resources

Context7 Library ID: /websites/svelte_dev (5523 snippets, Score: 91)

Official llms.txt Resources:

  • https://svelte.dev/docs/llms - Documentation index
  • https://svelte.dev/docs/llms-full.txt - Complete documentation
  • https://svelte.dev/docs/llms-small.txt - Compressed (~120KB)

Quick Reference

Svelte 5 Runes

<script>
  // Reactive state
  let count = $state(0);

  // Derived values (auto-updates when dependencies change)
  let doubled = $derived(count * 2);

  // Side effects
  $effect(() => {
    console.log(`Count is now ${count}`);
  });

  // Props with defaults
  let { name = 'World', onClick } = $props();

  // Bindable props (two-way binding)
  let { value = $bindable() } = $props();
</script>

SvelteKit Routing

src/routes/
├── +page.svelte          # /
├── +page.server.ts       # Server load function
├── +layout.svelte        # Root layout
├── about/+page.svelte    # /about
├── blog/
│   ├── +page.svelte      # /blog
│   └── [slug]/
│       ├── +page.svelte  # /blog/:slug
│       └── +page.ts      # Universal load
└── api/posts/+server.ts  # API endpoint

Load Functions

// +page.server.ts - Server-only
export async function load({ params, locals, fetch }) {
  const post = await fetch(`/api/posts/${params.slug}`);
  return { post: await post.json() };
}

// +page.ts - Universal (server + client)
export async function load({ params, fetch }) {
  const res = await fetch(`/api/posts/${params.slug}`);
  return { post: await res.json() };
}

Form Actions

// +page.server.ts
export const actions = {
  default: async ({ request }) => {
    const data = await request.formData();
    const email = data.get('email');
    return { success: true };
  },
  delete: async ({ params }) => {
    // Handle delete
  }
};

Present Results to User

When answering Svelte/SvelteKit questions:

  • Provide complete, runnable code examples
  • Use Svelte 5 runes syntax by default
  • Explain the difference between server and universal load functions
  • Note any breaking changes between SvelteKit versions
  • Include TypeScript types when applicable

Troubleshooting

"Cannot use $state outside of component"

  • Runes only work inside .svelte files or .svelte.ts files

"Hydration mismatch"

  • Ensure server and client render the same content initially
  • Check for browser-only code running during SSR

"Load function not running"

  • Verify file naming: +page.ts or +page.server.ts
  • Check if load function is properly exported

平台分布

Claude Code

29.14%
按下载量换算91

OpenCode

20.73%
按下载量换算65

Antigravity

17.14%
按下载量换算54

Cursor

12.74%
按下载量换算40

Gemini CLI

7.75%
按下载量换算24

windsurf

3.24%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills