← Back to Skills Marketplace
lingmafuture

Xiaohu WeChat Format

by Rockway · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
30
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install xiaohu-wechat-format
Description
Format Markdown or rough notes into WeChat Official Account compatible inline-style HTML, preview 33 themes, upload images, generate optional covers, and pus...
README (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.

Usage Guidance
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.
Capability Analysis
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.
Capability Tags
requires-sensitive-credentials
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install xiaohu-wechat-format
  3. After installation, invoke the skill by name or use /xiaohu-wechat-format
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug xiaohu-wechat-format
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 30 downloads so far.

How do I install Xiaohu WeChat Format?

Run "/install xiaohu-wechat-format" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Xiaohu WeChat Format free?

Yes, Xiaohu WeChat Format is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Xiaohu WeChat Format support?

Xiaohu WeChat Format is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Xiaohu WeChat Format?

It is built and maintained by Rockway (@lingmafuture); the current version is v1.0.0.

💬 Comments