markstream-react – Coding skill for AI agents
Integrate the beta markstream-react renderer into React 18+ or Next.js with correct client/server entrypoints, CSS, streaming state, and component overrides.
Install the markstream-react skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/markstream-react-cf3d6.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /markstream-react – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/markstream-react-cf3d6.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $markstream-react – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/markstream-react-cf3d6.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /markstream-react – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/markstream-react-cf3d6.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /markstream-react – then describe the task you want done.
SKILL.md content
Markstream React
Overview
Wire the beta React renderer into React 18+ or Next.js without crossing client/server boundaries or reaching for AST control unnecessarily.
When to Use
Use for React/Next setup, root/next/server entrypoints, streaming, component overrides, or migration support. Pair with markstream-migration for renderer replacement.
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.
1. Confirm React 18+ and acceptance of a beta package.
2. Install only requested peers and import markstream-react/index.css.
3. Use the root entry for client rendering, /next for Next-specific components, and /server for server rendering without client hooks.
4. Start with content and smoothStreaming="auto"; use nodes plus final only when another layer owns parsing.
5. For live chat disable fade and opt into the cursor. On completion set final, disable pacing/cursor, and enable fade only if desired.
6. Keep browser-only peers inside 'use client', dynamic ssr: false, or another minimal boundary.
7. Prefer streamingComponents for parser-backed tags and htmlComponents for sanitized props. Use scoped registry overrides for built-in nodes.
8. Keep htmlPolicy="safe" and Mermaid strict; validate client, server, and incremental paths.
Example
'use client' // Required when this example is used in a Next.js App Router client boundary
import MarkdownRender from 'markstream-react'
import 'markstream-react/index.css'
export function StreamingAnswer({
content,
isDone,
}: {
content: string
isDone: boolean
}) {
return (
<MarkdownRender
content={content}
final={isDone}
fade={isDone}
typewriter={!isDone}
smoothStreaming={isDone ? false : 'auto'}
htmlPolicy="safe"
/>
)
}Limitations
- The package is beta and requires React 18+.
- Browser-only peers require client boundaries under SSR.
- Complex parser parity requires separate migration review.
Security & Safety Notes
Review dependencies and never opt untrusted model output into trusted HTML or loose diagram rendering.
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.
Related skills
- markstream-vue – Integrate markstream-vue into plain Vue 3 with renderer modes, code and DOM choices…
- markstream-vue2-cli – Integrate markstream-vue2 into Vue CLI or Webpack 4 with export-map-safe CSS, CDN worker…
- mason – Produces clean, functional code that matches the architecture and checklists.
- matematico-tao – Analyze code complexity, dependency graphs, concurrency and invariants using explicit…
- matplotlib – Matplotlib is Python's foundational visualization library for creating static, animated…
- mcp-tool-developer – Build Model Context Protocol (MCP) servers and tools from scratch. Full-stack MCP…
- mmx-cli – Use mmx to generate text, images, video, speech, and music via the MiniMax AI platform…
- mobile-developer – Develop React Native, Flutter, or native mobile apps with modern architecture patterns…