markstream-migration – skill Bảo mật cho agent AI
Kiểm tra và chuyển đổi renderer Markdown hiện có sang Markstream, giữ nguyên renderer tùy chỉnh, chính sách bảo mật, hành vi streaming và các khoảng cách tính năng đã nêu rõ.
Cài skill markstream-migration 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-migration-5fcdb.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /markstream-migration – 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-migration-5fcdb.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $markstream-migration – 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-migration-5fcdb.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /markstream-migration – 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-migration-5fcdb.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /markstream-migration – 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 Migration
Overview
Replace an existing Markdown renderer without silently dropping transforms, custom components, URL policy, raw-HTML behavior, or streaming semantics. Read [references/adoption-checklist.md](references/adoption-checklist.md) first.
When to Use
Use when replacing react-markdown, markdown-it, marked, or another renderer; migrating node renderers; or choosing between Markstream content, smooth streaming, and nodes.
Workflow
Before changing dependencies or source files, inspect the existing package manager and project conventions, preview the intended edits, and obtain explicit user approval.
1. Inventory renderer imports, call sites, plugins, HTML policy, URL transforms, allowlists, custom renderers, CSS, and tests.
2. Classify the migration as direct, renderer-custom, plugin-heavy, or security-heavy.
3. Install the framework package and explicit CSS. Preserve visible behavior before optional features.
4. Map built-ins to scoped overrides; in React prefer renderer-local component maps.
5. Use trusted custom tags only for trusted content and reserve parse transforms for irreducible token/AST requirements.
6. Keep content with smooth streaming for ordinary token streams. Use nodes only for worker parsing, shared AST ownership, or structural transforms.
7. Preserve safe HTML and strict Mermaid defaults; scope and document any trusted legacy exception.
8. Run relevant builds and behavior tests. Report mappings, intentional differences, and unresolved review.
Example
// Before:
// import ReactMarkdown from 'react-markdown'
// return <ReactMarkdown>{markdown}</ReactMarkdown>
import MarkdownRender from 'markstream-react'
import 'markstream-react/index.css'
export function AssistantAnswer({
markdown,
isDone,
}: {
markdown: string
isDone: boolean
}) {
return (
<MarkdownRender
content={markdown}
final={isDone}
fade={isDone}
typewriter={!isDone}
smoothStreaming={isDone ? false : 'auto'}
htmlPolicy="safe"
/>
)
}Limitations
- Markstream cannot reproduce every remark, rehype, or markdown-it plugin automatically.
- Visual parity does not prove security or URL-policy parity.
- Large migrations may require staged conversion.
Security & Safety Notes
Do not weaken sanitization for screenshot parity. Review dependencies, raw HTML, URL transforms, and trust boundaries explicitly.
Skill liên quan
- meme-coin-audit – Kiểm toán bảo mật meme coin và token
- memory-forensics – Kỹ thuật toàn diện để thu thập, phân tích và trích xuất artifact từ bản dump bộ nhớ phục…
- metasploit-framework – ⚠️ CHỈ DÙNG CHO MỤC ĐÍCH ĐƯỢC ỦY QUYỀN > Skill này chỉ dành cho mục đích giáo dục hoặc…
- mid-engagement-ir-detection – Phương pháp phát hiện bản vá SOC của khách hàng, hoạt động của kẻ tấn công và thay đổi…
- mobile-reverse – Dịch ngược và kiểm thử bảo mật ứng dụng Android/iOS được ủy quyền: phân tích APK/IPA…
- mobile-security-coder – Chuyên gia lập trình di động an toàn, chuyên kiểm tra đầu vào, bảo mật WebView và các…
- model-supply-chain-security – Bảo mật chuỗi cung ứng mô hình AI với ký artifact, chứng thực nguồn gốc (provenance…
- network-engineer – Kỹ sư mạng chuyên gia, chuyên về mạng đám mây hiện đại, kiến trúc bảo mật và tối ưu hiệu…