Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

svelteSvelte 开发

Agent Skill

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

总安装

753

周安装

32

GitHub Stars

10

下载量

264
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/oakoss/agent-skills --skill svelte

简介

svelte 用于辅助前端页面、组件和样式逻辑的开发与维护,适合生成或审查 React、Vue、Tailwind 等代码片段。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 中的前端开发协作场景。
  • 通过 GitHub 仓库安装,使用 npx skills add 等 --skill svelte 命令部署。
  • 需结合项目路由与构建流程,避免孤立输出;页面改动后应本地预览确认效果。
  • 建议核对设计系统与框架版本兼容性,确保代码集成稳定。

SKILL.md

Svelte

Overview

Svelte is a compiler-based UI framework that shifts work from runtime to build time, producing minimal JavaScript with no virtual DOM. Svelte 5 introduces runes for explicit, fine-grained reactivity. SvelteKit is the full-stack framework built on Svelte, providing file-based routing, server-side rendering, and deployment adapters.

When to use: Full-stack web apps, static sites, progressive enhancement, SSR/SSG, projects needing small bundle sizes, migration from Svelte 4 to 5.

When NOT to use: React/Vue ecosystem lock-in, projects requiring extensive third-party component libraries only available for other frameworks, teams with no Svelte experience on tight deadlines.

Quick Reference

PatternAPI / SyntaxKey Points
Reactive statelet count = $state(0)Replaces let reactivity from Svelte 4
Derived stateconst double = $derived(count * 2)Replaces $: reactive declarations
Complex derivationconst value = $derived.by(() => {...})Multi-statement derived computations
Side effects$effect(() => {...})Runs after DOM update, auto-tracks dependencies
Component propslet {name, age = 25} = $props()Replaces export let, supports defaults
Bindable propslet {value = $bindable()} = $props()Two-way binding with bind:value
Debug inspection$inspect(value)Dev-only logging, stripped in production
Snippets{#snippet name(params)}...{/snippet}Replaces slots, reusable template blocks
Render snippet{@render name(args)}Invoke a snippet with arguments
Event handling<button onclick={handler}>Properties replace on:click directive
Each blocks{#each items as item (item.id)}...{/each}Keyed iteration for efficient updates
Await blocks{#await promise}...{:then}...{:catch}...Inline async rendering
Server loadexport function load({params}) in +page.server.tsRuns server-side only, accesses DB/secrets
Universal loadexport function load({fetch}) in +page.tsRuns on server and client
Form actionsexport const actions in +page.server.tsProgressive enhancement with use:enhance
Layout+layout.svelte / +layout.server.tsShared UI and data across child routes
Server hookshandle() in src/hooks.server.tsRequest middleware, auth, redirects
Error page+error.sveltePer-route error boundaries
Adaptersadapter-auto, adapter-node, adapter-staticDeploy to Vercel, Node, static hosting
API routes+server.ts with GET, POST, etc.Standalone endpoints, not tied to pages
Page optionsexport const prerender = truePer-route SSR, CSR, prerender control
Shared state$state() in .svelte.ts modulesReplaces writable stores for cross-component state
Raw state$state.raw(data)Opts out of deep proxying for large datasets

Svelte 4 to 5 Migration

Svelte 4 (Legacy)Svelte 5 (Current)
let count = 0 (reactive)let count = $state(0)
$: double = count * 2const double = $derived(count * 2)
$: {sideEffect()}$effect(() => {sideEffect()})
export let namelet {name} = $props()
<slot />{#snippet children()}{/snippet} + {@render}
on:click={handler}onclick={handler}
createEventDispatcher()Callback props: let {onclick} = $props()
import {writable} from 'svelte/store'$state() in .svelte.ts modules
$store auto-subscriptionDirect value access from rune-based state

Common Mistakes

MistakeCorrect Pattern
Using $state on non-primitives without care$state deeply proxies objects; use $state.raw() for large read-only data
Destructuring $props() loses reactivityDestructure at declaration only: let {x} = $props()
Reading $effect dependencies conditionallyEnsure all tracked reads happen unconditionally
Returning cleanup from $effect incorrectlyReturn a function: $effect(() => {return () => cleanup()})
Mixing on:click and onclick in Svelte 5Use onclick exclusively in Svelte 5 components
Using stores in new Svelte 5 codeUse $state() in .svelte.ts modules for shared state
Forgetting (key) in {#each} blocksAlways key: {#each items as item (item.id)}
Exporting load from .svelte filesLoad functions belong in +page.ts or +page.server.ts
Not awaiting parent load in layoutsUse await parent() when child load depends on layout
Using goto() in server load functionsUse redirect(303, '/path') from @sveltejs/kit

Delegation

  • Pattern discovery: Use Explore agent
  • Code review: Delegate to code-reviewer agent
  • Build configuration: Delegate to Task agent
If the tailwind skill is available, delegate Tailwind CSS utility class patterns and configuration to it. If the vitest-testing skill is available, delegate Svelte component unit testing patterns to it. If the playwright skill is available, delegate end-to-end testing of SvelteKit routes and form actions to it. If the drizzle-orm skill is available, delegate database schema and query patterns used in SvelteKit server load functions to it. If the vite skill is available, delegate Vite build configuration and plugin setup to it.

References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.88%
按下载量换算89

Claude

31.62%
按下载量换算83

Cursor

16.39%
按下载量换算43

Gemini CLI

9.42%
按下载量换算25

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills