Install Markstream renderer into any frontend framework
Installs and configures Markstream streaming Markdown renderers for Vue, React, Svelte, Angular, and Next.js AI chat and document interfaces with SSR support.
Why it matters
Integrate the correct Markstream streaming Markdown renderer into an existing frontend application, selecting the right framework package, configuring styles and SSR boundaries, and installing only the optional dependencies needed for the requested features.
Outcomes
What it gets done
Inspect the host application to identify framework version, package manager, SSR usage, and styling system
Install the framework-specific Markstream package and minimal optional peers with user approval
Wire CSS imports in the correct order relative to resets and utility frameworks
Configure streaming mode, SSR boundaries, and safe HTML/Mermaid defaults for the target framework
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-markstream-install | bash Overview
Markstream Install
Markstream Install integrates the correct framework-specific Markstream streaming Markdown renderer into your frontend application, selecting the right package for Vue, Nuxt, React, Next.js, Svelte, Angular, or Vue 2, installing only requested optional peers, preserving safe HTML and Mermaid defaults, and handling CSS ordering, streaming state, and SSR boundaries. Use this skill when you need to add streaming Markdown rendering to an AI chat or document interface, install Markstream in a specific framework, repair missing styles or incorrect package selection, replace another Markdown renderer with Markstream, or choose between static content, built-in smooth streaming, or externally parsed AST input. Do not use it to design application-specific visual styling or chat architecture.
What it does
Markstream Install integrates the correct framework-specific Markstream streaming Markdown renderer into your frontend application. It selects the right package for Vue, Nuxt, React, Next.js, Svelte, Angular, or Vue 2, installs only the optional peers you need (code highlighting, Mermaid, KaTeX), preserves safe HTML and Mermaid defaults, and handles CSS ordering, streaming state, and SSR boundaries.
When to use - and when NOT to
Use this skill when you need to add streaming Markdown rendering to an AI chat or document interface, install Markstream in a specific framework, repair missing styles or incorrect package selection, replace another Markdown renderer with Markstream, or choose between static content, built-in smooth streaming, or externally parsed AST input.
Do NOT use this skill to design application-specific visual styling or chat architecture - it focuses solely on correct Markstream integration. Do not use it if you need a competing virtualizer, as Markstream should coordinate with existing outer message virtualizers instead of adding its own.
Inputs and outputs
You provide your framework and version from package.json, existing package-manager lockfile, SSR requirements, current style system (reset, Tailwind, UnoCSS, or design-system), and required optional features like highlighted code, Monaco, Mermaid, D2, or KaTeX. The skill inspects your application, previews exact dependency and code changes for your approval, then installs the minimal dependency set and wires styles in the correct order.
You receive the correctly installed framework package, only the requested optional peers, properly ordered CSS imports, the smallest working renderer configuration, and validation that the selected package matches your framework, styles load after resets, SSR pages do not evaluate browser-only peers on the server, and both static content and incremental updates render correctly.
Integrations
Markstream Install supports Vue 3 (markstream-vue), Vue 2 (markstream-vue2), React (markstream-react with root, /next, and /server entries), Next.js (with SSR-first HTML hydration and server-only rendering), Nuxt (with client-boundary handling for browser-only peers), Svelte 5 (markstream-svelte), and Angular (markstream-angular with version requirement validation).
Optional peer integrations include KaTeX for math rendering and Mermaid for diagrams in strict mode. Style system integrations include Tailwind and UnoCSS via component layer imports.
Who it's for
This skill is for frontend developers building AI chat interfaces or document viewers who need streaming Markdown rendering with framework-specific SSR support. It is for teams replacing existing Markdown renderers with Markstream, developers debugging missing styles or SSR failures, and engineers who need to minimize bundle size by installing only required optional peers instead of every integration.
Example installation commands:
npm install markstream-vue
npm install markstream-react
npm install markstream-svelte
npm install markstream-angular
npm install markstream-vue2
Example Vue 3 streaming chat configuration:
<MarkdownRender
mode="chat"
:content="markdown"
:final="false"
smooth-streaming="auto"
:fade="false"
typewriter
/>
For Tailwind or UnoCSS projects, styles are imported in a component layer:
@import 'markstream-vue/index.css' layer(components);
The skill handles the transition from streaming to completed content and validates that both static content and incremental updates render correctly.
Source README
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-reactinside a'use client'component for live SSE or WebSocket streams. - Use
markstream-react/nextfor SSR-first HTML with hydration andmarkstream-react/serverfor server-only rendering. - Use
markstream-svelteonly with Svelte 5. - Confirm the host 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.
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:
- the selected package matches the framework;
- only requested optional peers were added;
- styles load after resets;
- SSR pages do not evaluate browser-only peers on the server;
- 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"
:final="false"
smooth-streaming="auto"
:fade="false"
typewriter
/>
Vue 3 completed chat history
<MarkdownRender
mode="chat"
:content="markdown"
:final="true"
:smooth-streaming="false"
:fade="true"
:typewriter="false"
/>
Setting final=true tells the parser that the document is complete; disabling pacing alone does not finalize trailing constructs.
Best Practices
- Install the minimal peer set instead of every optional integration.
- Keep the renderer mode stable when a chat message transitions from streaming to history.
- Let an existing outer message virtualizer own mounted rows; coordinate Markstream height metrics instead of adding a competing virtualizer.
- Scope component overrides with
customIdorcustom-idwhen multiple render surfaces coexist. - Test SSR and incremental client updates separately.
Limitations
- This skill does not choose application-specific visual styling or chat architecture.
- Optional browser-heavy peers can require framework-specific client boundaries and bundler configuration.
- Vue 2.6 and legacy Webpack projects require the compatibility steps documented above.
- Current package and framework requirements must be checked against the host lockfile and Markstream documentation before installation.
Security & Safety Notes
- Package installation changes the dependency manifest and lockfile. Review the proposed package set before running the install command.
- Do not enable trusted HTML or non-strict Mermaid rendering for untrusted model output.
- Keep optional browser runtimes out of server-only execution paths.
- Run installs only inside the intended project directory and use its existing package manager.
Common Pitfalls
- Problem: Styles appear missing or are overwritten.
Solution: Load resets first, then the matching Markstream stylesheet explicitly. - Problem: A completed response still looks incomplete.
Solution: Setfinal=truewhen the stream finishes, not onlysmoothStreaming=false. - Problem: Next.js evaluates browser-only code on the server.
Solution: Select the root,/next, or/serverentry according to the render boundary. - Problem: Lightweight highlighting does not activate after installing
stream-markdown.
Solution: On Vue, Vue 2, or React, configureMarkdownCodeBlockNodeas thecode_blockoverride.
Additional Resources
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.