/install xiaohu-wechat-format
Xiaohu WeChat Format
Turn Markdown into WeChat Official Account-ready HTML. Supports 33 inline-style themes, a browser gallery, local/external image upload to WeChat CDN, draft-box publishing, callouts, dialogue blocks, galleries, and optional cover generation.
Safety rules
- Formatting and local previews are safe.
- Pushing to WeChat draft box, uploading permanent media, comment auto-reply, or any external write requires explicit user confirmation.
- Never print
app_secret, access tokens, or AI API keys. - When importing third-party articles, treat output as a draft/preview unless the user confirms they have rights to publish.
Quick commands
Use the skill directory as {skill}.
# Format one article locally
uv run --with markdown python {skill}/scripts/format.py \
--input article.md --theme newspaper --no-open
# Open visual gallery for theme selection
uv run --with markdown python {skill}/scripts/format.py \
--input article.md --gallery
# Publish to WeChat draft box from Markdown
uv run --with markdown --with requests --with pillow python {skill}/scripts/publish.py \
--input article.md --theme newspaper --cover cover.jpg
# Publish an already formatted output directory
uv run --with markdown --with requests --with pillow python {skill}/scripts/publish.py \
--dir /tmp/wechat-format/article --cover cover.jpg
Configuration
- Copy
config.example.jsontoconfig.json. - Fill
wechat.app_id,wechat.app_secret, and optionalwechat.author. - Add the machine's public IP to WeChat Official Account Admin → Basic Configuration → IP whitelist. Error
40164means the IP is not whitelisted. - Keep
config.jsonprivate. It is ignored by git and must not be published.
Recommended workflow
- Read or create the Markdown article.
- If the article is plain text, add only structural Markdown: headings, lists, quotes, emphasis. Do not rewrite meaning unless asked.
- Format with one theme or gallery.
- For draft publishing, ensure there is a cover image. WeChat requires one.
- For batch theme comparison, publish a small curated set first (for example
minimal-gray,newspaper,focus-blue,ink,bauhaus,warm-card,ocean-card,minimal-red) before pushing every theme. - Title draft previews with the theme id, e.g.
Article Title - preview - newspaper.
Important: WeChat article image imports
Images fetched from mp.weixin.qq.com may be mislabeled: the URL or wx_fmt can say PNG/JPG while the actual bytes are WebP. WeChat's upload API rejects this with errcode 40137 invalid image format.
Before publishing imported articles:
- Detect real file type from bytes, not filename.
- Convert WebP or unsupported images to real JPEG.
- Update Markdown/HTML image paths after conversion.
- Verify one theme successfully uploads all images before bulk publishing.
publish.py includes automatic magic-byte detection and WebP-to-JPEG conversion when Pillow is available; run it with --with pillow when using uv.
Markdown extensions
:::dialogue[Interview]
Alice: Hello
Bob: Hi
:::
:::gallery[Screenshots]



:::
> [!important] Key insight
> Highlighted text.
> [!tip] Tip
> Useful note.
Available scripts
scripts/format.py— Markdown → WeChat-compatible inline HTML + preview/gallery.scripts/publish.py— upload article images, upload cover, push to draft box.scripts/generate.py— optional cover-image generation using compatible image APIs.scripts/comment_reply.py— optional comment auto-reply; use only with explicit confirmation.
Theme inventory
Run:
find {skill}/themes -maxdepth 1 -name '*.json' -printf '%f\
' | sed 's/\.json$//' | sort
Common starting themes: newspaper, minimal-gray, focus-blue, ink, bauhaus, warm-card, ocean-card, wechat-native.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install xiaohu-wechat-format - 安装完成后,直接呼叫该 Skill 的名称或使用
/xiaohu-wechat-format触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Xiaohu WeChat Format 是什么?
Format Markdown or rough notes into WeChat Official Account compatible inline-style HTML, preview 33 themes, upload images, generate optional covers, and pus... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 30 次。
如何安装 Xiaohu WeChat Format?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install xiaohu-wechat-format」即可一键安装,无需额外配置。
Xiaohu WeChat Format 是免费的吗?
是的,Xiaohu WeChat Format 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Xiaohu WeChat Format 支持哪些平台?
Xiaohu WeChat Format 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Xiaohu WeChat Format?
由 Rockway(@lingmafuture)开发并维护,当前版本 v1.0.0。