Formats Telegram bot messages with MarkdownV2, Rich HTML, and tg-rich-messages TypeScript builder. Covers GFM tables, task lists, advanced HTML, media captions, buttons, and gateway delivery contracts.
Ships in Telegram Rich Markdown and HTML. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Prepare Telegram content in the format supported by the sender. For a Hermes
gateway reply, write plain GitHub-Flavored Markdown and let the gateway choose
MarkdownV2 or Rich Messages. For an explicitly requested bot integration, use
Rich HTML or the tg-rich-messages TypeScript builder. These are different
delivery contracts: Rich HTML is not sendMessage(parse_mode="HTML").
MEDIA: file.InputRichMessage payload from tg-rich-messages.Don't use for gateway administration, bot credentials or callback-handler
implementation. Do not call the Bot API just to deliver an ordinary agent
reply. Local-file delivery via MEDIA: is a gateway convention, not Telegram
markup. See Rich HTML and builder reference for
explicit bot integrations and the runnable example.
InputRichMessage requires exactly one of markdown, html or blocks.
Send it as rich_message to sendRichMessage, not as text with a parse mode.
Optional is_rtl selects right-to-left display; skip_entity_detection
disables automatic entity detection. Uploaded media references require the
separate media field. The builder emits html; it does not parse Markdown,
upload files or send requests.
The routing rules below describe the locally installed Hermes v0.22.0 adapter
tree (install stamp commit e06df9c2eae6901f4c88f464e0ae6e753c0428b8,
dirty: true). The commit is only its baseline; local modifications may affect
behavior. This is not a claim about every Hermes release. Rich delivery is
opt-in and can still be declined by capability, content-shape, size or other
eligibility guards.
One agent text — two delivery paths; the gateway chooses:
| MarkdownV2 (default) | Rich Messages | |
|---|---|---|
| When | ordinary prose | recognized rich constructs, if eligible |
| Limit | 4,096 characters | 32,768 characters |
| Syntax | gateway converts Markdown | Rich Markdown |
# headings, tables | may be flattened | rendered structurally |
In the local v0.22.0 adapter, rich triggers include:
- or *, checkbox state space, x or X;<details> / <summary> tags or block math $$;PRLENS: line, standalone HTTPS Markdown image, or <tg-emoji emoji-id=…>.These constructs request rich rendering; they do not guarantee it. The adapter also requires opt-in and API support, and applies safety/size guards. Ordinary prose, bold, lists, code and headings alone do not trigger this path. Never add meaningless markup just to force transport.
Text rules:
**bold** and
*italic* are safe on both paths. The gateway normalizes single line breaks
into hard line breaks.Common syntax of the markdown field in InputRichMessage
(official specification):
**bold** __bold__ *italic* _italic_ ~~strike~~ ==marked== ||spoiler||
`inline code` [text](https://…) [email](mailto:[email protected]) [phone](tel:+7…)
[mention](tg://user?id=123) $inline math$ ```lang …``` (code block)


$$E=mc^2$$ or ```math …``` --- (divider)
# H1 … ###### H6
- / * / + bulleted list; 1. 2. numbered
- [ ] open task; - [x] done task
> quote (an empty `>` line between paragraphs separates them)
 media block;  with caption
| Col1 | Col2 | GFM table with alignment `|:---|---:|`
Footnote[^id] … [^id]: explanation
Entity autodetection (no markup): URLs, e-mails, phone numbers, card numbers,
#hashtag, $cashtag, /command, @username.
Rich HTML extensions (usable in Rich Markdown where supported):
<u>, <ins> — underline; <sub>, <sup> — sub/superscript<a name="anchor"></a> — anchor for internal links<a href="#anchor">Jump</a>; <tg-reference name="note">Text</tg-reference>
with <a href="#note">Note</a> — anchors and referenced text<aside>quote<cite>Author</cite></aside> — pull quote<blockquote expandable>Quote<cite>Author</cite></blockquote> — expandable quote<footer>Source note</footer>, <br>, <tg-math> / <tg-math-block><ol start="3" type="a" reversed> and per-item value / type;
<input type="checkbox" checked> inside <li><table bordered striped compact> with <caption>, cell colspan /
rowspan, align and valign — beyond GFM tables<figure> + <figcaption> + <cite> — media captions and credit;
tg-spoiler on visual media; <tg-document src="https://…"> for documents<details open><summary>Title</summary>…</details> — collapsible block<tg-map lat="41.9" long="12.5" zoom="14"/> — map<tg-collage> / <tg-slideshow> — galleries from ![]() or <img><tg-button type="url" url="…" style="success">Text</tg-button> and
<tg-button-row align="center"> — inline buttons (types: url,
callback_data, web_app, login_url, switch_inline_query*,
copy_text, disabled; styles: primary, success, danger, link)<tg-emoji emoji-id="…">👍</tg-emoji>, <tg-time unix="…" format="t"><tg-thinking>…</tg-thinking> — only in streaming drafts (see below)See the full HTML/builder reference for supported
attributes, button prerequisites and examples. tg://emoji and tg://time
are inline entities, not HTTP media. Time formats match r|w?[dD]?[tT]?:
r is relative and cannot be combined; wDT is weekday, long date, long time.
Use real custom emoji IDs with emoji fallback text; never invent IDs.
Parser limits: Markdown inside block HTML tags is not parsed, except
<details>, <tg-collage>, <tg-slideshow>; use HTML children in other block
tags. Inline tags can contain Markdown. Table cells allow only inline
formatting. Media are separate blocks with HTTP(S) URLs, or explicit
tg://photo|video|document|audio?id=… references backed by media.
In the documented Hermes profile, streaming.enabled + rich_drafts: true
allows rich draft streaming in private chats when the SDK/API supports it.
<tg-thinking> is draft-only: never put it in the final payload. Drafts are
temporary previews, not persisted messages; the sender must deliver a final
message. Group fallback and draft refresh timing depend on the adapter.
Do not claim a draft is the final delivered reply. The HTML builder's
thinking() only emits markup; it neither starts streaming nor finalizes it.
| Limit | Value |
|---|---|
| Rich message text | 32,768 UTF-8 characters |
| Blocks (incl. nested, table rows, list items) | 500 |
| Formatting and block nesting | 16 levels |
| Media attachments | 50 |
| Table columns | 20 |
| Regular message (MarkdownV2) | 4,096 characters |
Text includes custom emoji fallback text and raw formula source; the limit is
characters, not UTF-8 bytes. For the builder, explicitly call validate()
before toInputRichMessage(): neither serialization method validates for you.
Its text count is approximate and its depth walk is not a complete check of
inline formatting. Passing validation is not proof of server acceptance or
identical rendering across clients.
MEDIA:/absolute/path in the reply; give a short summary in the message. A
detailed report may be duplicated as an .md/.pdf attachment. (photo/video/audio/ogg-voice/animation/
document is detected by MIME and extension), "caption" after the URL.
Galleries — <tg-collage>/<tg-slideshow>; re-uploaded files — links like
tg://photo?id=… (paired with the media field of InputRichMessage).| Need | Use |
|---|---|
| Digest / section header banner | placehold.co |
| Diagram, comparison, illustration of meaning | generation → public HTTPS → ![]() |
placehold.co banner — a header only, not a "picture":

1200x300 (top of a digest) or 1200x500 (section).text=: ASCII [A-Za-z0-9 ._|-], 1–80 characters; no email, PII, secrets.450a0a / f87171).Generation (OCX POST /v1/images/generations):
google-antigravity/gemini-3.1-flash-imagexai/grok-4.6 (if primary is unavailable / out of quota)gpt-image-*, dall-e-*) — only if the ID is present in
/v1/models; otherwise don't callNot a generator: gemini-3.8-flash (text/vision). After generation:
MEDIA:, never
jpg.wtf/pixhost.curl -s --max-time 30 -F file=@file https://jpg.wtf/api/upload.php | jq -r 'select(.status=="ok") | .url // empty' → url from the JSON
{"status":"ok","url":"https://www.jpg.wtf/<hash>.png","delete_url":…}.
Extract only .url, never print the whole JSON: delete_url must not
reach logs, output or the chat. Use url as is (the www. host serves
image/* without a redirect, while bare jpg.wtf/<hash> returns 302).curl -s --max-time 30 -H 'Accept: application/json' -F img=@file -F content_type=0 -F max_th_size=150 https://api.pixhost.to/images →
th_url
https://tN.pixhost.to/thumbs/…; direct URL =
https://imgN.pixhost.to/images/… (replace tN→imgN, thumbs→images)."status":"err".
No status == ok together with url (empty jq output), or curl
failed / timed out → pixhost. pixhost failed too → MEDIA:.curl -sI --max-time 30 → 200, Content-Type: image/jpeg|png|webp without a redirect, Content-Length ≤ 5 MB (Telegram
limit for photos by URL). No Content-Length or more than 5 MB (up to
10 MB) — MEDIA: only. or
 as a separate block.MEDIA:/abs/path on its own line
(emergency path without hosting). Filesystem paths and file:// inside
![]() are forbidden. Never put file/botTOKEN/… URLs into text (token leak).For well-known brands in digests:
<tg-emoji emoji-id="…">fallback</tg-emoji> BrandName
<tg-emoji>.Practical cron examples (software-update, GLM): skill
telegram-cron-image-conventions.
- lists instead of walls of text,
key: value for small structured data. Completion: paragraphs ≤ 4 lines.MEDIA: file. Completion: the text won't exceed the limit after adding
captions and tables.. Screenshot with PII/secrets/internal systems →
MEDIA: only.
Local file → MEDIA:/abs, not inside ![](). Completion: the reply has
no FS paths inside a markdown image and no file/bot URLs.unsafeRawInline() is only for trusted HTML, never user data.disable_link_previews to rich sends. CJK normally falls back
to MarkdownV2; allow_cjk_rich_messages opts in. Details/math crash guards
apply to matching shapes; the Rich spec itself supports math inside details.<pre><code class="language-python">…</code></pre> in HTML. Standalone
<code> cannot declare a language; fallback conversion may lose it.sendMessage(parse_mode="HTML"). Callback buttons also require
a functioning bot handler; markup alone does not implement an action.hermes send is separate: the local standalone CLI sender uses regular
Telegram send, not the gateway's rich-send path. Do not transfer one path's
limits or formatting behavior to the other.html, with no token, request or automatic send. The builder's
validate() is not a complete server/client validation.MEDIA:/abs is a separate
attachment. Payload generation alone does not verify client rendering.references/adapter-internals.md — archived Hermes v0.18.2 adapter snapshot, not current truth for v0.22.0.Russian version: references/README.ru.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
/telegram-formatting:telegram-formattingfrom Telegram Rich Markdown and HTML
npx claudepluginhub nordz0r/skills --plugin telegram-formatting2 plugins in one repository ship this exact skill · first indexed Nov 15, 2026