markstream-install
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMarkstream Install
Markstream 安装
Use this skill when the task is "add markstream to an app" or "fix a broken markstream install".
Read references/scenarios.md before making dependency choices.
当任务为“为应用添加markstream”或“修复损坏的markstream安装”时,使用本技能。
在选择依赖前,请阅读references/scenarios.md。
Workflow
工作流程
- Detect the target framework and CSS stack.
- Check , app entry files, Tailwind or UnoCSS config, and whether the repo is SSR or streaming-focused.
package.json - Choose the package that matches the host app: ,
markstream-vue,markstream-vue2, ormarkstream-react.markstream-angular
- Check
- Install the smallest peer set that matches the requested features.
- Add peers only for features the user actually needs: Monaco, Mermaid, D2, KaTeX, or Shiki.
- Do not install every optional peer by default.
- Fix CSS order.
- Put reset styles before Markstream styles.
- In Tailwind or UnoCSS projects, place inside
markstream-*/index.css.@layer components - Import when math is enabled.
katex/dist/katex.min.css
- Add the smallest working render example.
- Use for static or low-frequency rendering.
content - Use plus
nodeswhen the app receives streaming updates.final
- Use
- Keep customization scoped.
- If the task requires overrides, prefer /
customIdplus scopedcustom-id.setCustomComponents(...)
- If the task requires overrides, prefer
- Validate.
- Run the smallest relevant build, typecheck, test, or docs build command.
- Report which peers were installed, where CSS lives, and whether the repo should later adopt .
nodes
- 检测目标框架与CSS栈。
- 检查、应用入口文件、Tailwind或UnoCSS配置,以及仓库是否以SSR或流式渲染为重点。
package.json - 选择与宿主应用匹配的包:、
markstream-vue、markstream-vue2或markstream-react。markstream-angular
- 检查
- 安装与所需功能匹配的最小化peer依赖集。
- 仅添加用户实际需要的功能对应的peer依赖:Monaco、Mermaid、D2、KaTeX或Shiki。
- 默认不要安装所有可选peer依赖。
- 修复CSS顺序。
- 将重置样式放在Markstream样式之前。
- 在Tailwind或UnoCSS项目中,将放在
markstream-*/index.css内。@layer components - 当启用数学公式功能时,导入。
katex/dist/katex.min.css
- 添加最简可用的渲染示例。
- 对于静态或低频率渲染场景,使用。
content - 当应用接收流式更新时,使用搭配
nodes。final
- 对于静态或低频率渲染场景,使用
- 保持定制化范围可控。
- 如果任务需要覆盖默认配置,优先使用/
customId搭配作用域化的custom-id。setCustomComponents(...)
- 如果任务需要覆盖默认配置,优先使用
- 验证。
- 运行最相关的最小化构建、类型检查、测试或文档构建命令。
- 报告已安装的peer依赖、CSS文件位置,以及仓库后续是否应采用方案。
nodes
Default Decisions
默认决策
- Prefer the minimal peer set over "install everything".
- Prefer unless the app is clearly SSE, chat, token-streaming, or worker-preparsed.
content - Treat CSS order as a first-class part of installation, not a later cleanup.
- When the request includes SSR, explicitly gate browser-only peers behind client-only boundaries.
- 优先选择最小化peer依赖集,而非“安装全部”。
- 优先使用,除非应用明确是SSE、聊天、token流式传输或预解析worker场景。
content - 将CSS顺序视为安装过程的核心环节,而非后续清理工作。
- 当需求包含SSR时,明确将仅浏览器端的peer依赖放在客户端专属边界内。
Useful Doc Targets
实用文档参考
docs/guide/installation.mddocs/guide/usage.mddocs/guide/troubleshooting.mddocs/guide/component-overrides.md
docs/guide/installation.mddocs/guide/usage.mddocs/guide/troubleshooting.mddocs/guide/component-overrides.md