markstream-custom-components
できること
このツールは、記事や投稿などの整形されたテキスト文書において、特定の要素の表示方法をカスタマイズできるものです。画像、リンク、コードブロックなどの見た目を変更したり、独自の特別な要素を追加したりできます。
使う場面
- ✓画像やリンクの初期の見た目を変えたいとき。
- ✓「思考」ブロックのような、新しい種類のブロックを作りたいとき。
- ✓サイトやアプリの特定の部分だけで、これらのカスタム要素を動かしたいとき。
スキルのリンク
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/markstream-custom-components/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“コードブロックの背景色を変えて表示するにはどうすればよいですか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
変更したい要素と、その表示方法をツールに指示します。ツールはその指示を使ってテキストを描画し、初期のルールではなく、指定したカスタマイズを適用します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Markstream Custom Components
Overview
Customize specific Markstream nodes or trusted custom tags without replacing the parser or leaking global renderer state. Read references/patterns.md first.
When to Use
Use to replace built-ins such as image, link, code_block, mermaid, or inline_code; render trusted tags such as thinking; or scope overrides to one renderer or app. Use parser transforms only when token or AST reshaping is required.
Workflow
Before changing dependencies or source files, inspect the existing package manager and project conventions, preview the intended edits, and obtain explicit user approval.
- Classify the change as a built-in override, trusted tag, or parser transform.
- Prefer scoped mappings. Vue, Vue 2, Svelte, and Angular can use
setCustomComponents(customId, mapping); Svelte and Angular can also pass renderer-local maps. - In React, prefer
streamingComponentsfor parser-backed nodes andhtmlComponentsfor sanitized attributes plus children. - Start with leaf nodes before containers that must preserve children.
- For trusted tag bodies containing Markdown, use a nested renderer with the same allowlist. Do not add a second smooth-streaming loop.
- Preserve node/loading props, identity keys, scope IDs, theme state, and preview-height estimates for async diagrams.
- Remove temporary scoped registrations on cleanup and validate repeated and nested tags.
Example
import MarkdownRender, {
type NodeComponentProps,
setCustomComponents,
} from 'markstream-react'
import 'markstream-react/index.css'
function ThinkingNode({ node }: NodeComponentProps<any>) {
return <details><summary>Thinking</summary>{node.content}</details>
}
setCustomComponents('assistant-panel', { thinking: ThinkingNode })
export function Answer({ markdown }: { markdown: string }) {
return (
<MarkdownRender
content={markdown}
customId="assistant-panel"
customHtmlTags={['thinking']}
htmlPolicy="safe"
/>
)
}
Limitations
- Component overrides cannot reproduce arbitrary remark/rehype transforms.
- Container overrides require careful child rendering and accessibility review.
- Framework registration APIs are not interchangeable.
Security & Safety Notes
Treat custom HTML-like tags as trusted input only. Keep safe HTML enabled and do not pass unsanitized attributes into host components.
よくある質問
何でも変更できますか?
画像やリンクなどの標準的な要素を変更したり、信頼できる新しい要素を追加したりできます。ただし、複雑な書式変換のすべてを作り直すことはできません。
カスタム要素を使うのは安全ですか?
はい、ただしこれらの要素を信頼できるものとして扱い、検証されていない情報を入れないようにすれば安全です。セキュリティ設定は有効にしておくことが大切です。
Vue、Reactなどの各種技術とはどのように連携しますか?
このツールは、それぞれの技術に合わせてカスタマイズを設定する方法を用意しており、各環境で正しく動作するようにします。
詳細
作者による元の説明
Override Markstream node renderers and add trusted custom tags across Vue, React, Svelte, and Angular using scoped or renderer-local mappings.
人気
- GitHubのスター
- 48k
- ランキング
- #5168
- ライセンス
- MIT
- 更新日
- 2026/10/15
コメント
- …
このリポジトリの他のスキル
00-andruia-consultant
48kエージェントがAIプロジェクトの立ち上げや改善を支援します。コードを分析し、ツールを提案し、スペイン語で行動計画を作成します。
007
48kエージェントがセキュリティ監査と脅威モデリングを行えるようにします。攻撃や脆弱性からプロジェクトを守るのに役立ちます。
10-andruia-skill-smith
48kエージェントがAIツールの作成や改善を支援します。ツールの動作を定義し、ドキュメントを書き、構造を検証します。
20-andruia-niche-intelligence
48kエージェントが特定の業界に関する要約を作成できるようにします。信頼できる情報源を使って、プロジェクトの背景、ルール、利用パターン、リスクを把握するのに役立ちます。
似ているスキル
angular-developer
280kエージェントがAngularのコードを作成し、プロジェクト構成についてアドバイスできるようにします。新しいプロジェクトの開始、コード部品の作成、パフォーマンスやアクセシビリティの改善に役立ちます。
frontend-a11y
280kエージェントが Web インターフェースを誰にとっても使いやすくするよう支援します。スクリーンリーダーやキーボード操作に対応し、サイトやアプリが適切に動作するようにします。
frontend-patterns
280kエージェントがフロントエンド開発の最新パターンを適用できるようにします。React と Next.js において、パフォーマンスの最適化、状態管理、ベストプラクティスの遵守を行います。