markstream-react – skill Lập trình cho agent AI
Tích hợp renderer markstream-react (beta) vào React 18+ hoặc Next.js với entrypoint client/server đúng, CSS, trạng thái streaming và ghi đè component.
Cài skill markstream-react bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/markstream-react-cf3d6.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /markstream-react – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/markstream-react-cf3d6.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $markstream-react – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/markstream-react-cf3d6.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /markstream-react – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/markstream-react-cf3d6.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /markstream-react – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
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.
Skill liên quan
- markstream-vue – Tích hợp markstream-vue vào Vue 3 thuần với các chế độ renderer, lựa chọn code và DOM…
- markstream-vue2-cli – Tích hợp markstream-vue2 vào Vue CLI hoặc Webpack 4 với CSS tương thích export-map, dự…
- mason – Tạo mã sạch, hoạt động đúng, khớp với kiến trúc và danh sách kiểm tra.
- matematico-tao – Phân tích độ phức tạp của mã, đồ thị phụ thuộc, đồng thời và bất biến dựa trên các giả…
- matplotlib – Matplotlib là thư viện trực quan hóa nền tảng của Python, dùng để tạo biểu đồ tĩnh, động…
- mcp-tool-developer – Xây dựng máy chủ và công cụ Model Context Protocol (MCP) từ đầu. Phát triển MCP toàn…
- mmx-cli – Dùng mmx để tạo văn bản, ảnh, video, giọng nói và nhạc qua nền tảng AI MiniMax. Dùng khi…
- mobile-developer – Phát triển ứng dụng React Native, Flutter hoặc native với kiến trúc hiện đại. Thành thạo…