本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)48k · #5168

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がスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/markstream-custom-components/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

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.

  1. Classify the change as a built-in override, trusted tag, or parser transform.
  2. Prefer scoped mappings. Vue, Vue 2, Svelte, and Angular can use setCustomComponents(customId, mapping); Svelte and Angular can also pass renderer-local maps.
  3. In React, prefer streamingComponents for parser-backed nodes and htmlComponents for sanitized attributes plus children.
  4. Start with leaf nodes before containers that must preserve children.
  5. For trusted tag bodies containing Markdown, use a nested renderer with the same allowlist. Do not add a second smooth-streaming loop.
  6. Preserve node/loading props, identity keys, scope IDs, theme state, and preview-height estimates for async diagrams.
  7. 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.

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#5168
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル