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

svelte-sveltekitSvelte SvelteKit 搜索

Agent Skill

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

总安装

367

周安装

15

GitHub Stars

公开资料未说明

下载量

118
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

Svelte SvelteKit 搜索技能查找框架资源。

  • 适合 SvelteKit 项目问题解决。
  • 可结合官方文档和社区方案使用。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • 安装前建议验证资源时效性。svelte-sveltekit 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 注意版本升级带来的 API 变化。

SKILL.md

Svelte + SvelteKit

Work from current Svelte 5 and current SvelteKit idioms. Optimize for code that is easy to reason about under SSR, hydration, and navigation.

Do not spend time explaining basic syntax unless the user asks. Focus on architectural choices, caveats, and the shortest correct implementation.

Workflow

  1. Establish the local style before changing code.
  • Inspect package.json, svelte.config.*, route layout, and nearby components.
  • Prefer the repo's existing conventions in touched files unless the task is an explicit migration.
  • For new code, default to runes mode and current SvelteKit APIs.
  1. Choose the right boundary before writing code.
  • Put server-only work in +page.server.*, +layout.server.*, +server.*, hooks, or $lib/server/*.
  • Put reusable view logic in components, not route files.
  • Keep route data flow obvious: params -> load/action -> typed props -> component.
  1. Solve data flow first, then UI details.
  • Decide where truth should live: URL, server data, component state, context, or a shared reactive object.
  • Prefer deriving state over synchronizing copies of state.
  • Add effects only for external side effects such as DOM APIs, timers, subscriptions, analytics, or imperative libraries.
  1. Be explicit about SSR and navigation behavior.
  • Check whether code runs on the server, in the browser, or both.
  • Check whether state should survive navigation, reload, back/forward, or SSR.
  • Check whether data should rerun automatically or only after explicit invalidation.

Core Svelte Idioms

  • Use runes-first patterns in new code: $state, $derived, $props, snippets, and current event syntax.
  • Use $state only for values that must participate in reactivity. Keep plain variables plain, and prefer $state.raw for large objects or arrays that are replaced wholesale rather than mutated in place.
  • Prefer $derived for computed values. Do not use $effect to keep one piece of state in sync with another unless there is no better source of truth.
  • Use $derived.by(...) when the computation needs multiple statements. Remember that derived objects and arrays are returned as-is rather than made deeply reactive.
  • Treat $effect as an escape hatch for external systems, not a general state-management tool.
  • Do not update state inside $effect unless you are bridging to something outside Svelte. Prefer direct event handlers, function bindings, {@attach...}, or createSubscriber(...) before reaching for an effect.
  • Use $inspect and $inspect.trace(...) when debugging reactivity instead of leaving logging effects in place.
  • Treat props as live inputs. Derive from them instead of snapshotting them into local variables that will silently drift when the parent changes.
  • Avoid copying props into local mutable state unless the component intentionally forks from the parent value.
  • Prefer explicit component APIs over "smart" components with many optional behaviors.
  • Keep components narrow. Move data loading, auth, and persistence out of leaf UI components.
  • Prefer snippets and explicit children rendering over legacy slot patterns in new code.
  • Top-level snippets can also be referenced from <script>, which is often clearer than splitting tiny render helpers into separate components.
  • Prefer onclick={...} and other current event attributes. Use <svelte:window> or <svelte:document> for global listeners instead of wiring them up 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 JS-to-CSS handoff with style:--token={value} and CSS custom properties when component state or parents need to influence styling.
  • Prefer CSS custom properties to let parents influence child presentation. 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 is actually useful: async streams, external subscriptions, or existing ecosystem integrations.

Component Design

  • Keep presentational components pure: props in, events/callbacks out, minimal ownership of app state.
  • Put side-effectful orchestration in route components, layout components, or focused controller modules.
  • Avoid "prop drilling fixes" that introduce global state too early. Use context when the ownership is local to a subtree.
  • Prefer a small number of 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, consider splitting it or introducing a clearer discriminated API.

SvelteKit Data and Mutation Rules

  • Use +page.server.* or +layout.server.* when code needs secrets, direct database access, cookies, or trusted request context.
  • Use universal load only when the logic is safe on both server and client and rerunning in the browser is acceptable.
  • Keep load side-effect free. Fetch, read, and derive there; mutate in actions, endpoints, or other server handlers.
  • Use the fetch provided by SvelteKit inside load instead of a generic client so cookies and auth flow correctly on the server.
  • Use parent() deliberately. Avoid creating fragile hidden coupling across nested loads.
  • Use depends() and targeted invalidation only when automatic reruns are insufficient. Do not scatter invalidateAll() as a general refresh button.
  • Prefer returning typed, already-shaped data from load instead of pushing reshaping work into every consumer.
  • Use generated $types helpers like PageProps, LayoutProps, and route-specific load/action types.

Forms, Actions, and Endpoints

  • Prefer form actions for user-driven mutations that naturally come from a page form.
  • Keep actions close to the route that owns the UI and validation unless multiple routes truly share the mutation.
  • Return validation errors through action results rather than throwing generic errors for expected bad input.
  • Use use:enhance for progressive enhancement, not to reinvent client-side mutation handling from scratch.
  • Use +server.* endpoints for API-style interactions, webhooks, non-form clients, or cases where the route action model is awkward.
  • Do not hide straightforward form workflows behind custom fetch wrappers if the native action flow already fits.
  • For idempotent filter/search forms, prefer GET plus URL params over POST.

State Placement

  • Put SSR-relevant or shareable state in the URL when it should survive reloads, deep links, or server rendering.
  • Keep disposable UI state in the component if losing it on reload is fine.
  • Use snapshots when ephemeral state should survive history navigation without becoming URL or server state.
  • Do not put request-specific server state in shared modules. In SvelteKit, mutable module state can leak across requests.
  • If state is shared only within one rendered subtree, prefer context over module-level singletons.
  • Remember that route components are often preserved across navigation. If a value should reset on route change, key the subtree or derive it from page.url instead of assuming remounts.

SSR and Hydration Caveats

  • Guard browser-only APIs such as window, document, storage, observers, and media APIs behind onMount or a browser check.
  • Do not read auth, cookies, or secrets in client code when the server can decide once and send the result as page data.
  • Hydration mismatches usually come from non-deterministic rendering:

- browser-only branches rendered on the server - time/randomness during render - locale differences between server and client - data that changes between SSR and hydration

  • Prefer rendering stable placeholders from SSR and upgrading in the browser rather than branching into incompatible markup.

Navigation and Invalidation

  • Use links and forms in ways that let the router help you. Avoid manual navigation code when a declarative href or form submission is enough.
  • Lean on SvelteKit preload behavior for perceived performance before inventing custom prefetch logic.
  • Use goto when navigation is truly imperative, not as a replacement for normal links.
  • When data goes stale after a mutation, invalidate the narrowest dependency you can.
  • If UI state should not survive a route change, key the relevant subtree explicitly instead of manually resetting many variables.

Performance and Review Heuristics

  • Remove unnecessary effects before trying micro-optimizations.
  • Prefer derived values close to their source over widely shared mutable state that forces synchronization.
  • Watch for oversized layout loads that fetch data unrelated to most children.
  • Watch for route-level waterfalls created by avoidable sequential awaits.
  • Watch for over-centralized stores that make simple features depend on global mutation.
  • Watch for components that both fetch data and render complex UI; split ownership before the file turns into a control tower.

Debugging Checklist

  • If data is unexpectedly stale, check load rerun conditions, depends(), invalidation, and whether the code is in universal or server load.
  • If state unexpectedly persists across navigation, remember that components may be reused. Key the subtree or derive from route state.
  • If state unexpectedly resets, verify whether it belongs in component state, URL params, snapshots, or server data.
  • If a form mutation behaves differently with and without JavaScript, compare native action behavior against custom use:enhance logic.
  • If auth behaves inconsistently, verify that protected reads happen in server-only code and that cookies are read or written in the right boundary.
  • If hydration fails, compare SSR markup assumptions against browser-only logic and non-deterministic rendering.

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 mixed paradigms inside one file.
  • If introducing a modern pattern into an older area, explain the tradeoff in comments or the summary only when it is not obvious from the diff.
  • Prefer modern replacements in new code: runes over $: and export let, snippets over slots, direct component references over <svelte:component>, and classes with $state fields 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 framework 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
  • https://svelte.dev/docs/kit/load
  • https://svelte.dev/docs/kit/form-actions
  • https://svelte.dev/docs/kit/state-management

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.77%
按下载量换算41

Claude

29.42%
按下载量换算35

Cursor

17.57%
按下载量换算21

Gemini CLI

8.89%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

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

安装前确认

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

来源信息

继续浏览同类 Skills