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。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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.
- Confirm Svelte 5 and acceptance of a beta package.
- Install only requested peers; import package CSS after resets and KaTeX CSS only for math.
- Start with
<MarkdownRender {content} />and smooth streamingauto. - For live chat disable fade and opt into the cursor; on completion set
final, disable pacing/cursor, and enable fade only if desired. - Use
nodesonly for worker-owned parsing or shared AST state. - Use
$props()and callbacks. Configure KaTeX or Mermaid workers only when requested. - Prefer renderer-local
customComponents; use scoped registration only when sharing is intentional. - 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.
热度
- GitHub 星标
- 48k
- 排名
- #5173
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。