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

sveltekitSvelteKit 控制

Agent Skill

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

总安装

282

周安装

12

GitHub Stars

公开资料未说明

下载量

99
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

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

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

SKILL.md

SvelteKit

Work from current SvelteKit idioms. Optimize for route and data flows that stay correct under SSR, hydration, navigation, and progressive enhancement.

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

Scope

Use this skill when the hard part is app-level or route-level behavior.

  • Reach for this skill for load, actions, +server.*, hooks, cookies, auth, SSR or hydration behavior, invalidation, route state, and server/client boundaries.
  • If the task is mostly about component internals, runes, snippets, local state, or styling, use the svelte skill.

Workflow

  1. Establish the local style before changing code.
  • Inspect package.json, svelte.config.*, the route tree, hooks, and nearby route files.
  • Prefer the repo's existing conventions in touched files unless the task is an explicit migration.
  • For new code, default to current SvelteKit APIs and typed route files.
  1. Choose the server/client boundary before writing code.
  • Put server-only work in +page.server.*, +layout.server.*, +server.*, hooks, or $lib/server/*.
  • Put reusable view logic in components or $lib, not route files.
  • Keep route flow obvious: params/url/cookies/locals -> load/action -> typed props -> component.
  1. Solve data flow before UI details.
  • Decide where truth should live: URL, server data, component state, snapshots, context, or a shared reactive object.
  • Prefer deriving state over synchronizing copies.
  • Be explicit about whether data should rerun automatically or only after targeted invalidation.
  1. Be explicit about navigation and SSR behavior.
  • Check whether code runs on the server, in the browser, or both.
  • Check whether state should survive reloads, deep links, back/forward, or only the current render.
  • Check whether the route component is reused across navigation and whether anything should reset explicitly.

Route and Load 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 so cookies, auth, SSR inlining, and internal request shortcuts work correctly.
  • Prefer returning typed, already-shaped data from load instead of pushing reshaping work into every consumer.
  • Minimize serialized data. Anything returned from server load becomes part of the SSR payload and may be visible to the client.
  • Use generated $types helpers like PageProps, LayoutProps, and route-specific load/action types.
  • Use page.data when parent layouts need child data, but do not create hidden coupling casually.
  • Use parent() deliberately. Call other independent async work first to avoid accidental waterfalls.
  • Use depends() and targeted invalidation when automatic reruns are insufficient. Do not scatter invalidateAll() as a default refresh strategy.
  • Do not store request-specific data in shared modules. Mutable module state can leak across users on the server.

Actions, Forms, 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 with fail(...) rather than throwing generic errors for expected bad input.
  • Use method="GET" plus URL params for idempotent filter and search forms.
  • Use use:enhance for progressive enhancement, not to replace the native form flow with a custom client-side mutation system.
  • Reach for applyAction or custom enhance callbacks only when the default enhanced flow is insufficient.
  • Use +server.* endpoints for API-style interactions, webhooks, non-form clients, or cases where the action model is awkward.
  • After setting or deleting auth cookies in an action, update event.locals as well when later load logic depends on it. handle runs before the action and does not rerun before the post-action load.
  • When a cookie should be site-wide, set an explicit path: '/'.

Auth and Request Boundaries

  • Prefer hooks for broad auth gates that should run before protected loads.
  • Prefer route-specific checks in +page.server.* for page-specific protection.
  • Be careful with auth checks in +layout.server.*: child pages only reliably benefit when they call await parent() before protected work.
  • Keep secrets, trusted headers, and raw cookies on the server side.
  • Do not read auth state in client code when the server can decide once and return the result as page data.

State Placement

  • Put SSR-relevant or shareable state in the URL when it should survive reloads, deep links, and server rendering.
  • Keep disposable UI state in the component if losing it on reload is fine.
  • Use snapshots when ephemeral UI state should survive history navigation without becoming URL or server state.
  • 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 a remount.

SSR and Hydration Gotchas

  • Guard browser-only APIs such as window, document, storage, observers, and media APIs behind onMount or a browser check.
  • Hydration mismatches usually come from non-deterministic rendering: browser-only branches during SSR, time or randomness during render, locale differences, or data that changes between SSR and hydration.
  • Prefer stable SSR markup that upgrades in the browser over branching into incompatible markup.
  • Critical interactions should still work before hydration when possible. Prefer real links and forms for important user actions, or render clear disabled/loading affordances for JS-only controls.
  • Universal load runs on the server for SSR and then again in the browser for hydration. Do not put server-only assumptions there.
  • Large or over-broad server load returns can bloat HTML, slow hydration, and expose data you never render. Shape the data to what the route actually needs.

Navigation and Invalidation

  • Use links and forms in ways that let the router help you. Avoid imperative navigation when href or a native form already expresses the flow.
  • Use goto only when navigation is genuinely imperative.
  • Invalidate the narrowest dependency you can after mutations.
  • Do not use invalidateAll() as a reflex when one dependency or URL key would do.
  • Remember that rerunning a load updates props but does not recreate the component. Use afterNavigate, derived state, or {#key...} when reset semantics matter.

Performance and Review Heuristics

  • Watch for oversized layout loads that fetch data unrelated to most children.
  • Watch for route-level waterfalls caused by avoidable sequential awaits or unnecessary await parent() ordering.
  • Watch for over-fetching in server load that inflates SSR payloads with data the page never renders.
  • Watch for hidden auth or cookie bugs caused by putting trusted logic in universal load or client code.
  • Watch for over-centralized state that makes route behavior harder to reason about than URL or page data would.

Debugging Checklist

  • If data is stale, check which load owns it, what dependencies it tracks, whether depends() or invalidation is missing, and whether the code is universal or server-only.
  • If state unexpectedly persists across navigation, remember that layouts and pages 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 behaves differently with and without JavaScript, compare native action behavior against custom use:enhance logic.
  • If auth behaves inconsistently, verify that protected reads happen on the server and that event.locals is updated after cookie writes.
  • If cookies appear inconsistent across routes, verify path, domain expectations, and whether the code is running in an action, endpoint, or server load.
  • If hydration feels slow or flaky, inspect SSR payload size and look for data returned from load that the page does not actually use.

Migration and Compatibility

  • For older code, prefer local consistency plus small targeted improvements over mixing too many old and new patterns in one file.
  • Use current names and helpers on compatible versions, such as $app/state over older store-based access and PageProps/LayoutProps where available.
  • Keep version-sensitive features behind compatibility checks. Some features depend on specific Svelte or SvelteKit versions or config options.

Official References

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

  • https://svelte.dev/docs/kit/load
  • https://svelte.dev/docs/kit/form-actions
  • https://svelte.dev/docs/kit/state-management
  • https://svelte.dev/tutorial/kit/invalidation

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

35.96%
按下载量换算36

Claude

28.19%
按下载量换算28

Cursor

20.13%
按下载量换算20

Gemini CLI

8.89%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

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

安装前确认

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

来源信息

继续浏览同类 Skills