跳到正文
Skillpedia
网站与界面(前端)48k · #5173

markstream-svelte

它能做什么

这个工具可以帮你在 Svelte 5 或 SvelteKit 项目中添加 Markstream 组件。它能高效地显示带有格式的内容(比如带有特殊标记的文本),并带有流畅的动画效果,看起来就像有人正在一个字一个字地打出来。

适用场景

  • ✓在用 Svelte 5 或 SvelteKit 开始新项目的时候。
  • ✓当你想显示逐步出现的格式化内容(即流式输出)时。
  • ✓如果你需要“workers”(后台工作线程)这类进阶功能,用来在后台处理任务。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/markstream-svelte/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/markstream-svelte/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“帮我在我的 Svelte 5 项目中集成 Markstream,用来显示文章。”

每周 5 个新技能,1 分钟读完。

工作原理

它的原理是把一个专门的组件(Markstream)接入你的 Svelte 代码中。你用它来定义内容的显示方式,包括动画效果和安全选项。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Markstream Svelte

Overview

Integrate Markstream using Svelte 5 runes and SvelteKit-safe browser boundaries.

When to Use

Use for Svelte 5 or SvelteKit package setup, streaming state, workers, or scoped custom components. Svelte 4 is unsupported.

Workflow

Inspect the existing package manager, installed package version and project conventions. A requested scoped integration already authorizes routine source/dependency edits; seek approval only for a material scope expansion or unresolved beta/alpha adoption decision.

  1. Confirm Svelte 5 and acceptance of a beta package.
  2. Install only requested peers; import package CSS after resets and KaTeX CSS only for math.
  3. Start with <MarkdownRender {content} /> and smooth streaming auto.
  4. For live chat disable fade and opt into the cursor; on completion set final, disable pacing/cursor, and enable fade only if desired.
  5. Use nodes only for worker-owned parsing or shared AST state.
  6. Use $props() and callbacks. Configure KaTeX or Mermaid workers only when requested.
  7. Prefer renderer-local customComponents; use scoped registration only when sharing is intentional.
  8. Keep browser-only workers behind SvelteKit client boundaries; validate with svelte-check, build, or e2e.

Example

<script lang="ts">
  import MarkdownRender from 'markstream-svelte'
  import 'markstream-svelte/index.css'

  let { content, isDone }: { content: string; isDone: boolean } = $props()
</script>

<MarkdownRender
  {content}
  final={isDone}
  fade={isDone}
  typewriter={!isDone}
  smoothStreaming={isDone ? false : 'auto'}
  htmlPolicy="safe"
/>

Limitations

  • Svelte 4 is unsupported and the package is beta.
  • Workers and heavy peers require client-side bundler support.
  • This skill does not migrate unrelated Svelte architecture.

Security & Safety Notes

Keep safe HTML and strict Mermaid defaults. Review dependencies and never run browser-only peers during SSR.

Verify props, export paths and peer ranges against the installed package, not a mutable upstream main. Test partial and completed streams, malformed/untrusted Markdown, links and image URLs, cancellation and reduced motion. Safe HTML and strict diagrams reduce exposure but do not alone enforce URL/network privacy or application component permissions.

常见问题

我的项目用的是 Svelte 4,能用吗?

不能。这个工具只支持 Svelte 5 或 SvelteKit,而且目前还处于测试(beta)阶段。

什么是“workers”?

它们就像一些小帮手,在后台处理信息,这样就不会让主界面卡住。

直接显示网上的内容安全吗?

有一定的安全保障。它提供了安全设置,可以安全地处理 HTML 内容和图表,但最好还是自己先检查一下。

详情

作者的原始描述

Integrate the beta markstream-svelte renderer into Svelte 5 or SvelteKit with runes, explicit CSS, smooth streaming, workers, and SSR-safe boundaries.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#5173
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能