markstream-nuxt
它能做什么
这个工具可以帮你在 Nuxt 3 或 4 项目中使用 'markstream-vue'。它能确保只能在浏览器中运行的代码部分被正确执行,即使网站是在服务器上构建的。
适用场景
- ✓在 Nuxt 3 或 4 中创建页面或组件时。
- ✓当你想实时显示 AI 生成的内容(流式传输)时。
- ✓将富文本文档或轻量级界面集成到你的 Nuxt 项目中时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/markstream-nuxt/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我怎样才能在我的 Nuxt 网站上以聊天的形式显示 AI 生成的文本?”
每周 5 个新技能,1 分钟读完。
工作原理
它通过将需要浏览器才能运行的代码分离出来,来配置 'markstream-vue' 与 Nuxt 协同工作。这是借助 Nuxt 的功能实现的,例如 `<ClientOnly>` 或动态导入。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Markstream Nuxt
Overview
Integrate markstream-vue into Nuxt while keeping hydration, browser-only peers, workers, and streaming behavior on the correct side of SSR boundaries.
When to Use
Use for Nuxt 3 or 4 pages, components, or plugins. Use markstream-vue for non-Nuxt Vue applications and markstream-install when the framework is not yet known.
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 Nuxt 3 or 4 and install only requested peers.
- Put browser-only peers behind
<ClientOnly>,.clientplugins, dynamic imports, or guarded initialization. - Import
markstream-vue/index.cssexplicitly from a client-safe shell or plugin. - Start with
content:mode="chat"for AI streams,docsfor rich documents, andminimalfor lightweight non-chat surfaces. - Keep smooth streaming in
automode for SSR; do not forcetrueon first-screen server content. - When a chat row completes, keep its mode stable, set
final, disable pacing/cursor, and enable fade only if desired. - Keep HTML safe and Mermaid strict. Put optional code, diagram, and worker runtimes behind client boundaries.
- Validate build/typecheck, hydration, and one incremental client update.
Example
<script setup lang="ts">
import MarkdownRender from 'markstream-vue'
import 'markstream-vue/index.css'
defineProps<{ markdown: string; done: boolean }>()
</script>
<template>
<MarkdownRender
mode="chat"
:content="markdown"
:final="done"
:fade="done"
:typewriter="!done"
:smooth-streaming="done ? false : 'auto'"
html-policy="safe"
/>
</template>
Limitations
- Browser-only peers cannot run during SSR.
- Hydration depends on correct host plugin/component boundaries.
- This skill does not configure deployment adapters.
Security & Safety Notes
Do not expose trusted HTML or loose Mermaid settings to untrusted model output. Review dependency and runtime-boundary changes.
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.
常见问题
什么是 SSR?
SSR(服务端渲染)指网站在服务器上组装好之后再发送到用户的浏览器。这有助于提升性能和 SEO。
什么是“hydration”(水合)?
水合是把浏览器中的 JavaScript 代码与服务器已渲染好的 HTML 连接起来的过程,从而让页面变得可交互。
什么是 browser-only peers(仅浏览器端依赖)?
这些代码部分只有在网站运行于用户浏览器中时才能工作,在服务器上无法运行。
详情
作者的原始描述
Integrate markstream-vue into Nuxt 3 or 4 with SSR-safe client boundaries, renderer modes, explicit CSS, and browser-only optional peers.
热度
- GitHub 星标
- 48k
- 排名
- #5171
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。