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

markstream-install

它能做什么

这个工具可以帮你在编程项目中安装并配置 Markstream 组件。它能让你的网站动态显示格式化文本(例如 Markdown),类似聊天界面的效果。

适用场景

  • ✓添加一个能实时显示正在输入文字的聊天功能时。
  • ✓在 Vue、React、Svelte 或 Angular 项目中安装 Markstream 时。
  • ✓修复文本显示问题或服务器兼容性问题时。

技能链接

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

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“在我的项目中为 React 安装 Markstream。”

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

工作原理

工具会先检查你的项目使用的是哪种技术(比如 React 或 Vue),然后安装对应的 Markstream 版本,并设置好样式,使文本即使是一段一段到达,也能正确显示。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Markstream Install

Overview

Integrate the correct Markstream streaming Markdown renderer into an existing frontend application. This skill selects the framework package, installs only requested optional peers, preserves safe HTML and Mermaid defaults, and handles CSS, streaming state, and SSR boundaries.

Read references/scenarios.md before selecting packages or optional 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 missing Markstream styles, an incorrect framework package, or an SSR failure;
  • replace another Markdown renderer with Markstream;
  • choose between static content, built-in smooth streaming, or externally parsed AST input.

How It Works

1. Inspect the host application

Before changing dependencies, inspect:

  • the framework and version in package.json;
  • the existing package-manager lockfile;
  • whether the application uses SSR;
  • reset, Tailwind, UnoCSS, or design-system styles;
  • required optional features such as highlighted code, Monaco, Mermaid, D2, or KaTeX.

Do not select markstream-vue merely because the source repository has Vue in its name. Choose the framework-specific package from the scenario table.

2. Install the smallest dependency set

Before installing or changing source files, preview the exact dependency and code changes and obtain explicit user approval. Do not switch package managers or replace an existing renderer implicitly.

Install exactly one framework package and preserve the repository's package manager. 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

For Vue 2.6, also install and register @vue/composition-api. Vue 2.7 has a built-in Composition API and must not install that plugin.

3. Wire styles in the correct order

Import application resets before Markstream styles. Import package CSS explicitly instead of relying on component imports to inject it.

For Tailwind or UnoCSS, put the matching package stylesheet in a component layer:

@import 'markstream-vue/index.css' layer(components);

When math rendering is enabled, also import:

@import 'katex/dist/katex.min.css';

Vue CLI 4 and other Webpack 4-based Vue 2 projects do not understand package export maps. Use the published file path in those projects:

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 application to maintain an AST.

Use nodes plus final only when a worker, shared AST store, custom transform, or another application layer already owns parsing.

5. Handle framework boundaries

  • In Nuxt, keep browser-only optional peers behind client boundaries.
  • In Next.js, use root markstream-react inside a 'use client' component for live SSE or WebSocket streams.
  • Use markstream-react/next for SSR-first HTML with hydration and markstream-react/server for server-only rendering.
  • Use markstream-svelte only with Svelte 5.
  • Confirm the host meets the current markstream-angular version requirement.
  • In Vue 3, use mode="chat" for AI chat, mode="docs" for rich documents, and mode="minimal" for lightweight non-chat surfaces.

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

Run the smallest relevant build, typecheck, or test command. Confirm:

  1. the selected package matches the framework;
  2. only requested optional peers were added;
  3. styles load after resets;
  4. SSR pages do not evaluate browser-only peers on the server;
  5. static content and at least one incremental update render correctly.

Report the selected package, added peers, CSS location, streaming input choice, and validation command.

Examples

Vue 3 streaming chat

<MarkdownRender
  mode="chat"
  :content="markdown"

…
常见问题

什么是 Markdown?

Markdown 是一种简单的文本格式化方式,通过特殊符号来实现,例如用星号表示加粗。它在文档和聊天中被广泛使用。

“streaming”是什么意思?

Streaming(流式传输)指内容被逐步发送并显示,而不是一次性全部呈现。可以想象一下你边看视频边加载的情形。

什么是 optional peers(可选的对等依赖)?

这些是 Markstream 可以使用的额外功能,例如代码高亮或图表。工具只会安装你真正需要的那些。

详情

作者的原始描述

Install and configure Markstream streaming Markdown renderers for Vue, React, Svelte, Angular, Nuxt, Next.js, and Vue 2 applications.

repo: sickn33/agentic-awesome-skills

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能