markstream-install
它能做什么
这个工具可以帮你安装和配置 Markstream。Markstream 是一个程序,能够在使用 Vue、React、Svelte 等技术构建的网站和应用中展示格式化文本(比如 AI 聊天中的内容)。它会确保只安装必要的部分,从而保障安全。
适用场景
- ✓在 AI 聊天中添加格式化文本显示功能。
- ✓在 Vue、React、Svelte 等项目中安装 Markstream。
- ✓修复 Markstream 的安装或样式问题。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/markstream-install/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“在 Nuxt 项目中为 Vue 3 安装 Markstream,并支持代码高亮和数学公式。”
每周 5 个新技能,1 分钟读完。
工作原理
这个工具会先检查你的项目使用的是哪种技术(Vue、React 等),以及你需要哪些额外功能。然后,它会安装对应的 Markstream 包,并配置样式和显示模式。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Markstream Install
Integrate the appropriate Markstream package into an existing application without installing unnecessary optional dependencies or weakening its security defaults.
Read references/scenarios.md before choosing packages or peers.
When to Use
Use this skill when the user asks to:
- add streaming Markdown rendering to an AI chat or document interface;
- install Markstream in Vue, Nuxt, React, Next.js, Svelte, Angular, or Vue 2;
- repair a broken Markstream installation, missing styles, or SSR failure;
- replace another Markdown renderer with Markstream;
- choose between static, smooth-streaming, and externally parsed AST input.
Workflow
1. Inspect the host application
Before changing dependencies, inspect:
- the framework and version in
package.json; - the package manager lockfile;
- whether the application uses SSR;
- reset, Tailwind, UnoCSS, or design-system styles;
- required optional features: code highlighting, enhanced File/Diff surfaces, Monaco, Mermaid, D2, infographic blocks, or KaTeX.
Do not assume the Vue package is correct merely because the source repository is named markstream-vue. Select the framework-specific package from the scenario table.
2. Install the smallest dependency set
Install exactly one framework package. Add optional peers only when the requested UI uses their feature.
Examples:
npm install markstream-vue
npm install markstream-react
npm install markstream-svelte
npm install markstream-angular
npm install markstream-vue2
Preserve the repository's existing package manager. Do not install every optional peer preemptively.
3. Wire styles in the correct order
Import application resets before Markstream styles. Import package CSS explicitly; do not rely on component imports to inject it.
For Tailwind or UnoCSS, use the relevant package subpath in a component layer:
@import 'markstream-vue/index.css' layer(components);
Use the matching package name for React, Svelte, Angular, or Vue 2. If math rendering is enabled, also import:
@import 'katex/dist/katex.min.css';
Vue CLI 4 and other Webpack 4-based Vue 2 applications cannot resolve package export maps. In those projects, import the published file directly:
import 'markstream-vue2/dist/index.css'
4. Add the smallest working renderer
Prefer content for static documents and most streaming chat interfaces. Markstream's built-in smooth streaming can pace irregular token delivery without requiring the host to maintain an AST.
For Vue 3 chat surfaces, start with:
<MarkdownRender
mode="chat"
:content="markdown"
:final="false"
smooth-streaming="auto"
:fade="false"
typewriter
/>
For completed chat history, keep the same renderer mode and switch pacing off:
<MarkdownRender
mode="chat"
:content="markdown"
:final="true"
:smooth-streaming="false"
:fade="true"
:typewriter="false"
/>
In React, Svelte, and Angular, use the equivalent camelCase or framework binding syntax. Keep smoothStreaming="auto", fade=false, and typewriter=true while streaming; use smoothStreaming=false and typewriter=false for completed history.
Use nodes plus final only when a worker, shared AST store, custom transform, or another application layer already owns parsing.
5. Handle framework-specific boundaries
- In Nuxt, keep browser-only optional peers behind client boundaries.
- In Next.js, use the root
markstream-reactentry inside a'use client'component for live SSE or WebSocket streams. Usemarkstream-react/nextfor SSR-first HTML with hydration, ormarkstream-react/serverfor server-only rendering. - Use
markstream-svelteonly with Svelte 5. - Confirm the Angular application meets the current
markstream-angularversion requirement. - In Vue 3, use
mode="chat"for AI chat,mode="docs"for rich documents, andmode="minimal"for lightweight non-chat surfaces. - For long Vue 3 conversations or an existing message virtualizer, consult the Markstream performance guide before adding a second virtualizer.
6. Preserve safe defaults
HTML policy defaults to safe, and Mermaid uses strict mode. Do not broaden either setting unless the user explicitly identifies a trusted legacy surface that requires it. Scope any exception to that surface.
7. Validate
…
常见问题
什么是 Markstream?
Markstream 是一个库,可以在网页应用中高效地展示格式化文本,比如由人工智能生成的内容。
为什么需要为我的框架(Vue、React 等)选择特定的包?
每个框架都有自己的特点。安装正确的包可以确保 Markstream 与你的项目技术完美配合,不会产生冲突,也不会带来不必要的依赖。
什么是“可选依赖”?
这些是 Markstream 可能提供的额外功能,比如代码高亮或公式支持。这个工具只会安装你明确需要的部分,让项目更轻量,也更安全。
详情
作者的原始描述
Install and configure Markstream streaming Markdown renderers for Vue, React, Svelte, Angular, Nuxt, and Vue 2 applications. Use for package selection, minimal peer dependencies, CSS order, SSR boundaries, streaming mode, and renderer setup.
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7276
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。