← 返回 Skills 市场
lingmafuture

Xiaohu WeChat Format

作者 Rockway · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
30
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install 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...
使用说明 (SKILL.md)

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

  1. Copy config.example.json to config.json.
  2. Fill wechat.app_id, wechat.app_secret, and optional wechat.author.
  3. Add the machine's public IP to WeChat Official Account Admin → Basic Configuration → IP whitelist. Error 40164 means the IP is not whitelisted.
  4. Keep config.json private. It is ignored by git and must not be published.

Recommended workflow

  1. Read or create the Markdown article.
  2. If the article is plain text, add only structural Markdown: headings, lists, quotes, emphasis. Do not rewrite meaning unless asked.
  3. Format with one theme or gallery.
  4. For draft publishing, ensure there is a cover image. WeChat requires one.
  5. 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.
  6. 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]
![](img1.jpg)
![](img2.jpg)
![](img3.jpg)
:::

> [!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.

安全使用建议
Use local formatting and previews freely, but before enabling publishing or comment replies, protect config.json, run dry-runs, inspect all image sources in imported articles, avoid untrusted HTML, require explicit confirmation for WeChat writes, and back up articles before cover insertion.
功能分析
Type: OpenClaw Skill Name: xiaohu-wechat-format Version: 1.0.0 The skill bundle provides a comprehensive and legitimate workflow for formatting Markdown into WeChat-compatible HTML and publishing it to the WeChat Official Account platform. It includes scripts for theme-based formatting (format.py), image generation via Gemini-compatible APIs (generate.py), and draft publishing (publish.py). The SKILL.md and README files include explicit safety rules, such as requiring user confirmation for external writes and prohibiting the printing of secrets. No evidence of data exfiltration, malicious execution, or prompt injection was found; the code logic is transparent and aligns with the stated purpose.
能力标签
requires-sensitive-credentials
能力评估
Purpose & Capability
The core purpose is coherent: Markdown formatting, theme previews, WeChat image upload/draft publishing, cover generation, and optional comment replies are all disclosed.
Instruction Scope
Some instructions reduce user control: the comment helper defaults to sending replies after a run, the cover subskill says to insert a cover into an article without asking, and the cover prompt includes a refusal-suppression instruction.
Install Mechanism
There is no install spec, but documented commands use uv to fetch unpinned runtime packages such as markdown, requests, and pillow; this is purpose-aligned but worth noticing.
Credentials
Publishing uploads local and external images to WeChat, but the shown code does not clearly restrict image paths, parent-directory traversal, absolute paths, or remote hosts before upload.
Persistence & Privilege
The skill uses WeChat app credentials for draft/media/comment APIs and the comment helper persists local state/logs; the public comment workflow has limited granular approval controls.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install xiaohu-wechat-format
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /xiaohu-wechat-format 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial ClawHub release: OpenClaw-ready WeChat Official Account formatter/publisher, sanitized config handling, public SKILL.md, WebP image normalization for WeChat draft uploads, and safer comment-reply prompt.
元数据
Slug xiaohu-wechat-format
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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。

💬 留言讨论