ClaudeMods
☰
JA
● — 人がオンライン ・閲覧 — 回
スポンサー作品を投稿
GitHub リポジトリ · 投稿者 NateCC0902

reply-media

返信の mermaid フェンス、数式、ローカル画像をターミナルに画像として描画し、そのローカル動画を再生する(kitty グラフィックス:Ghostty、kitty)

NateCC0902@NateCC0902

NateCC0902/NeonCoat/tree/main/mods/reply-media

元の投稿の画像1
翻訳済み

この mod について

NeonCoat

Claude Code 用の MOD とステータスライン。返信の図、数式、画像、動画はターミナルに画像として描画され、その markdown は色付きで描画され、ステータスラインはそのセッションのコストを示す。

ターミナルに描画された Claude Code の返信:フローチャート、数式、表、タスクリスト、コールアウト、コードカード、そしてその場で再生される動画

ここに入っているもの

| パス | 何をするか | | --- | --- | | mods/reply-media/ | mermaid フェンス、数式(math フェンスと $$ ブロック)、ローカル画像(単独行の ![alt](path))を画像として描画する。画像として書かれたローカル動画は、再生ボタン付きの最初のフレームとして描画され、その場で再生される。各画像の下には、そのソースをコピーするボタンと、ペインでより大きく開くボタンがある。 | | mods/reply-markdown/ | 見出し、リスト、タスクリスト、引用、コールアウト(> [!WARNING])、罫線、表を色付きで描画し、各コードフェンスをコピーボタン付きのカードに入れる。 | | mods/skill-router/ | /skill-router <question> は、小さなモデルに、あなたのユーザー専用スキルのうちどれがその質問に適するかを尋ねる。質問がない場合はそれらを一覧表示する。 | | statusline.mjs | ステータスライン。1 行目:使用コンテキスト、コスト、モデル、毎秒トークン数、フォルダ、キャッシュヒット率、git の状態。2 行目:サブスクリプションのウィンドウとその補充時刻、Remote Control、そしてマシン上で動作している他のセッション。 |

要件

  • MOD API(ファンクションフックプラグイン)を備えた Claude Code。この API は早期アクセスであり、これらの MOD の下で変更される可能性がある。最後に Claude Code 2.1.296 で実行。
  • macOS。画像スクリプトは sips と open を呼び出す。
  • reply-media には、kitty グラフィックスプロトコルを話すターミナル:Ghostty または kitty。
  • Node.js、そして reply-media には:
brew install librsvg ffmpeg

インストール

git clone https://github.com/NateCC0902/NeonCoat.git
cd NeonCoat/mods/reply-media/render && npm install

次に ~/.claude/settings.json をクローン先に向けます。CLAUDE_CODE_PLUGIN_DIRS はコロン区切りで mod ごとに 1 エントリです(親フォルダは走査されません)。したがって不要な mod は省いてください:

{
  "env": {
    "CLAUDE_CODE_PLUGIN_DIRS": "/path/to/NeonCoat/mods/reply-media:/path/to/NeonCoat/mods/reply-markdown:/path/to/NeonCoat/mods/skill-router"
  },
  "statusLine": {
    "type": "command",
    "command": "node /path/to/NeonCoat/statusline.mjs",
    "padding": 0,
    "refreshInterval": 5
  }
}

その後開始されたセッションでこれらの mod が読み込まれます。これらのファイルはクローン先からライブで読み込まれます。保存された mod ファイルは実行中のセッションでホットリロードされるため、壊れた編集はそれらすべてのターミナル UI を壊します。

オプション

各 mod のオプションは /config の行で、変更は即座に反映されます。

| Mod | オプション | デフォルト | 変更される内容 | | --- | --- | --- | --- | | 三つすべて | enabled | true | mod を削除せずにオフにします。 | | reply-media | pxPerColumn | 8 | ターミナル 1 列あたりの画像のピクセル数。低いほど画像は大きく描画されます。 | | reply-media | cellAspect | 2.17 | 1 つのターミナル セルが幅の何倍の高さか。画像がつぶれたり引き伸ばされたりして見えるときに変更します。 | | reply-media | resumedReplies | 3 | 再開されたセッションの最後の返信のうち、画像が再描画される数。 | | reply-markdown | tableBorder | bold | round、single、bold。 | | reply-markdown | cardBorder | round | コード カードとコールアウト ボックスの境界線:round、single、bold。 |

チェック

変更後にリポジトリのルートからこれらを実行します:

claude plugin validate mods/<name> && claude plugin test mods/<name>
npx -p typescript tsc -p mods/<name>
(cd mods/reply-media/render && npm test)
echo '{}' | node statusline.mjs && node --test statusline.test.mjs

インストール

まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。

claude plugin marketplace add NateCC0902/NeonCoat
claude plugin install reply-media
原文 / README

NeonCoat

Mods and a status line for Claude Code. A reply's diagrams, formulas, images and videos are drawn as pictures in the terminal, its markdown is drawn in color, and the status line says what the session is costing.

A Claude Code reply drawn in the terminal: a flowchart, a formula, a table, a task list, a callout, a code card, then a video playing in place

What is in here

| Path | What it does | | --- | --- | | mods/reply-media/ | Draws mermaid fences, formulas (math fences and $$ blocks) and local images (![alt](path) on a line of its own) as pictures. A local video written as an image is drawn as its first frame with a play button, and plays in place. Under each picture, one button copies its source and one opens it larger in a pane. | | mods/reply-markdown/ | Draws headings, lists, task lists, quotes, callouts (> [!WARNING]), rules and tables in color, and puts each code fence in a card with a copy button. | | mods/skill-router/ | /skill-router <question> asks a small model which of your user-only skills fits the question. With no question it lists them. | | statusline.mjs | The status line. First row: context used, cost, model, tokens per second, folder, cache hit rate, git state. Second row: subscription windows and when they refill, Remote Control, and the other sessions running on the machine. |

What reply-markdown draws

Headings, lists, a quote, a rule, and bold, italic and inline code:

<img src="docs/markdown-text.png" width="830" alt="A reply with three levels of heading, a nested bullet list, a numbered list, a quote and a rule, each in its own color">

The five callouts:

<img src="docs/markdown-callouts.png" width="830" alt="Note, Tip, Important, Warning and Caution, each a box in its own color">

A table, a task list, and a code fence as a card with its copy button:

<img src="docs/markdown-blocks.png" width="830" alt="A framed table, a task list with two items ticked, and a TypeScript snippet in a card with a copy button">

Requirements

  • Claude Code with the mod API (function-hook plugins). The API is early access and may change under these mods. Last run on Claude Code 2.1.296.
  • macOS. The picture scripts call sips and open.
  • For reply-media, a terminal that speaks the kitty graphics protocol: Ghostty or kitty.
  • Node.js, and for reply-media:
brew install librsvg ffmpeg

Install

git clone https://github.com/NateCC0902/NeonCoat.git
cd NeonCoat/mods/reply-media/render && npm install

Then point ~/.claude/settings.json at the clone. CLAUDE_CODE_PLUGIN_DIRS is colon-separated with one entry per mod (a parent folder is not scanned), so leave out the mods you do not want:

{
  "env": {
    "CLAUDE_CODE_PLUGIN_DIRS": "/path/to/NeonCoat/mods/reply-media:/path/to/NeonCoat/mods/reply-markdown:/path/to/NeonCoat/mods/skill-router"
  },
  "statusLine": {
    "type": "command",
    "command": "node /path/to/NeonCoat/statusline.mjs",
    "padding": 0,
    "refreshInterval": 5
  }
}

The mods load in sessions started after that. These files are loaded live from the clone: a saved mod file hot-reloads in running sessions, so a broken edit breaks the terminal UI of all of them.

Tell Claude what to write

reply-media draws only what Claude writes in the forms it knows: a mermaid fence, a math fence, an image on a line of its own. Claude does not write them unprompted, so add these notes to ~/.claude/CLAUDE.md. The Formatting note does the same for the forms reply-markdown draws only when Claude chooses to write them.

Diagrams:

Draw diagrams in replies as ```mermaid code fences, never as ASCII art. The reply-media mod turns each fence into a picture in the terminal.
Use only these types, the rest do not render: flowchart, stateDiagram-v2, sequenceDiagram, classDiagram, erDiagram, xychart-beta.
Start the fence at column 0: an indented fence (inside a list item or a quote) is not picked up.
Prefer flowchart LR: a TD chart with more than a few nodes fills the terminal's height.
For a flowchart with a cycle, declare the node the back-edge leaves from on a line of its own before any edge (e.g. `T{test}`), or the layout draws that node above the one before it.
Directory trees and tables are not diagrams: keep them as text.

Math:

Write a formula that stands on a line of its own as LaTeX in a ```math code fence, one formula per fence, starting at column 0. The same mod turns it into a picture. Leave out `\tag`: a tagged formula is not drawn.
Write math inside a sentence in Unicode (a⃗ · b⃗ = |a||b|cos θ), never as `$x$`: a picture cannot sit inside a line of text.

Images:

To show an image file from this machine, write `![alt](path)` on a line of its own, starting at column 0. The same mod draws it. The path is absolute, under `~/`, or relative to the session's working directory. An image at a URL is not fetched, so give its link as text.
A video file (mp4, mov, webm, mkv, gif) written the same way is shown as its first frame with a play button.

Formatting:

For a warning or a note I must not miss, write a GitHub alert: a quote whose first line is `[!NOTE]`, `[!TIP]`, `[!IMPORTANT]`, `[!WARNING]` or `[!CAUTION]`. It becomes a colored box.
For steps or checks to tick off, write a task list: `- [ ]` and `- [x]`.
Put a command or snippet I will copy in a code fence of its own, with its language, not in inline code: the fence gets a copy button.

Options

Each mod's options are rows in /config, and a change takes effect at once.

| Mod | Option | Default | What it changes | | --- | --- | --- | --- | | all three | enabled | true | Turns the mod off without removing it. | | reply-media | pxPerColumn | 8 | Pixels of a picture per terminal column. Lower draws pictures larger. | | reply-media | cellAspect | 2.17 | How many times taller than wide one terminal cell is. Change it when pictures look squashed or stretched. | | reply-media | resumedReplies | 3 | How many of a resumed session's last replies get their pictures drawn again. | | reply-markdown | tableBorder | bold | round, single or bold. | | reply-markdown | cardBorder | round | The border of a code card and of a callout box: round, single or bold. |

Colors

The colors are written into the code to match one dark theme, which is not in this repo. For another theme, edit the constants at the top of each file: COLORS in statusline.mjs, COLOR and CALLOUT in mods/reply-markdown/hooks/register.tsx, and THEME in mods/reply-media/render/render.mjs.

Checks

Run these after a change, from the repo's root:

claude plugin validate mods/<name> && claude plugin test mods/<name>
npx -p typescript tsc -p mods/<name>
(cd mods/reply-media/render && npm test)
echo '{}' | node statusline.mjs && node --test statusline.test.mjs

The types check works once Claude Code has loaded the mod and written its types to mods/<name>/.claude-plugin/types/. CLAUDE.md has the notes for changing or adding a mod.

関連作品