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

svelteSvelte 开发

Agent Skill

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

总安装

235

周安装

10

GitHub Stars

公开资料未说明

下载量

82
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/sjunepark/custom-skills --skill svelte

简介

svelte 用于辅助前端页面、组件、样式和交互逻辑的开发与维护,适合生成或审查相关代码。

  • 它支持 React、Next.js、Vue、Tailwind、CSS 等技术的组件结构整理和布局问题定位。
  • 使用时需结合项目现有设计系统、路由和构建方式,避免生成孤立片段;涉及页面改动时应配合本地预览和构建检查。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 确认具体用法。
  • 该技能适用于前端开发场景,但需人工核验其实际行为与项目需求是否匹配。

SKILL.md

Svelte

Work from current Svelte 5 idioms. Optimize for components and reactive state that stay easy to reason about as they grow.

Do not spend time explaining basic syntax unless the user asks. Focus on best practices, sharp edges, and the shortest correct implementation.

Scope

Use this skill when the problem is mostly inside components or shared reactive view logic.

  • Reach for this skill for runes, props, snippets, component APIs, context, styling, local state, shared client-side reactive objects, and reactivity debugging.
  • If the hard part is route boundaries, load, form actions, auth, cookies, SSR navigation behavior, or invalidation, switch to the sveltekit skill.

Workflow

  1. Establish the local style before changing code.
  • Inspect nearby components, shared UI primitives, and package.json.
  • Prefer the repo's current conventions in touched files unless the task is an explicit migration.
  • For new code, default to runes mode and current event syntax.
  1. Choose the ownership boundary before writing code.
  • Decide whether truth should live in props, component state, context, or a shared reactive module.
  • Keep leaf components presentational when possible.
  • Move persistence, networking, and app orchestration out of leaf UI components.
  1. Model data flow before polishing markup.
  • Prefer deriving state over synchronizing copies of state.
  • Treat props as live inputs, not initialization values.
  • Add effects only for real side effects outside Svelte.
  1. Keep SSR compatibility in mind even at component level.
  • Components in SvelteKit may render on the server first.
  • Avoid browser-only assumptions during render.
  • Prefer stable markup that can hydrate without surprises.

Core Svelte Patterns

  • Use runes-first patterns in new code: $state, $derived, $props, snippets, and current event attributes such as onclick={...}.
  • Use $state only for values that truly need reactivity. Keep plain variables plain.
  • Prefer $state.raw for large objects or arrays that are usually replaced wholesale rather than mutated in place.
  • Prefer $derived for computed values. Use $derived.by(...) when the derivation needs multiple statements.
  • Remember that objects or arrays returned from $derived are not made deeply reactive.
  • Treat $effect as an escape hatch for DOM APIs, timers, analytics, imperative libraries, or external subscriptions.
  • Do not use $effect to keep one piece of state in sync with another when a clearer source of truth exists.
  • Prefer event handlers, function bindings, {@attach...}, or createSubscriber(...) before reaching for an effect.
  • Use $inspect and $inspect.trace(...) to debug reactive churn instead of leaving logging effects in place.
  • Treat props as live values. Derive from them instead of snapshotting them into local variables that silently drift.
  • Avoid copying props into mutable local state unless the component intentionally forks from the parent value.
  • Prefer snippets and explicit children rendering over legacy slot patterns in new code.
  • Top-level snippets can also be referenced from <script> when that is clearer than creating a tiny helper component.
  • Use <svelte:window> and <svelte:document> for global listeners instead of wiring them up manually in onMount or $effect.
  • Prefer keyed {#each} blocks for stable identity. Do not use array index as the key.
  • Avoid destructuring each-block items when the template mutates them.
  • Prefer CSS custom properties and style:--token={value} for JS-to-CSS handoff and parent-controlled styling.
  • Reach for :global(...) only when styling third-party output or a boundary you do not control.
  • Prefer createContext over ad hoc setContext/getContext pairs when context is the right tool.
  • Do not default to stores for local sharing. In Svelte 5, a reactive object or class with $state fields is often simpler.
  • Keep stores for cases where the store contract matters: async streams, external subscriptions, or ecosystem integrations.

Component Design Best Practices

  • Keep presentational components narrow: props in, callbacks out, minimal ownership of app state.
  • Prefer explicit props and callback props over "smart" components with many optional behaviors.
  • In new Svelte 5-style code, prefer callback props over createEventDispatcher.
  • Prefer a few well-named props over catch-all config objects unless the object is a real domain shape.
  • When a component exposes many booleans or variant combinations, split it or redesign the API around clearer modes.
  • Keep render helpers close when they are tiny; extract components only when they create a real boundary.
  • Put async loading, auth checks, and persistence in higher-level modules rather than leaf UI components.

Common Gotchas

  • Component setup runs once. If a value should update when props or state change, make it reactive with $derived instead of computing it once in plain script.
  • Do not use $effect to mirror state. If you write x from y in an effect, you probably want a derived value or a different source of truth.
  • Passing a primitive from $state(...) to a function passes the current value, not a live reference. Pass an updater or a container object when mutation must flow back.
  • Reactive churn often comes from depending on a whole object when only one stable field matters. Extract the stable field into its own $derived before building downstream derived state.
  • Deeply reactive $state is convenient, but proxying large graphs has a cost. Prefer smaller state shapes or $state.raw when mutation granularity is not needed.
  • Mutating a property on an object returned from $derived affects the original object only if that original object is already reactive upstream. Do not assume $derived deepens reactivity.
  • Browser-only APIs such as window, document, storage, observers, and media APIs must be guarded behind onMount or an explicit browser check when SSR is in play.

Review Heuristics

  • Remove unnecessary effects before trying micro-optimizations.
  • Prefer derived values close to their source over wide mutable state that forces synchronization.
  • Watch for components that both orchestrate data flow and render complex UI; split responsibilities before the file turns into a control tower.
  • Watch for props copied into state, boolean-heavy APIs, and styling approaches that force parent components to reach through implementation details.
  • When debugging reruns, ask what the smallest real dependency is rather than subscribing to a whole object graph.

Debugging Checklist

  • If UI is stale, verify the value is $state or $derived rather than a one-time plain variable.
  • If updates are looping or hard to follow, remove syncing effects and re-establish one source of truth.
  • If something reruns more often than expected, add $inspect.trace(...) to the relevant $derived.by(...) or $effect.
  • If child state drifts from parent props, stop snapshotting props into local mutable variables.
  • If shared reactive state resets or recreates too often, check whether downstream logic depends on an unstable object instead of a stable field.
  • If hydration fails, compare SSR markup with browser-only branches, time/randomness, and locale-sensitive formatting.

Migration and Compatibility

  • For existing pre-runes code, do not churn files into modern syntax unless the task is migration or the touched code becomes materially clearer.
  • When touching legacy code, prefer local consistency plus small targeted improvements over mixing paradigms inside one file.
  • Prefer modern replacements in new code: runes over $: and export let, snippets over slots, current event attributes over on:click, direct component references over <svelte:component>, and reactive classes or objects over stores when sharing local reactive state.
  • Use promise-in-template features such as await expressions only when the project is on a compatible Svelte version and has the relevant experimental option enabled.

Official References

Consult the current Svelte docs when behavior matters or seems version-sensitive:

  • https://svelte.dev/docs/svelte/best-practices
  • https://svelte.dev/docs/svelte/$state
  • https://svelte.dev/docs/svelte/$derived
  • https://svelte.dev/docs/svelte/$effect
  • https://svelte.dev/docs/svelte/$props

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.54%
按下载量换算30

Claude

27.7%
按下载量换算23

Cursor

18.06%
按下载量换算15

Gemini CLI

8.53%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

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

安装前确认

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

来源信息

继续浏览同类 Skills