Claude Code 公众号一键排版+发布技能 | Markdown → 微信兼容 HTML → 推送草稿箱 | 30 套主题 + 可视化画廊
npx skills add https://github.com/xiaohuailabs/xiaohu-wechat-format --skill xiaohu-wechat-coverCLI を使用してこのスキルをインストールし、ワークスペースで SKILL.md ワークフローの使用を開始します。
A Claude Code skill for the full WeChat Official Account (公众号) publishing pipeline: Format → Cover (optional) → Publish — with 30 themes, a visual gallery picker, AI content enhancement, and one-click publishing to drafts.

<style> tags, no classes — everything inline)
# Install
cd ~/.claude/skills/
git clone https://github.com/xiaohuailabs/xiaohu-wechat-format.git
cp xiaohu-wechat-format/config.example.json xiaohu-wechat-format/config.json
pip3 install markdown requests
# Format an article (opens gallery in browser)
python3 scripts/format.py --input article.md --gallery
# Format with a specific theme
python3 scripts/format.py --input article.md --theme newspaper
# Publish to WeChat drafts
python3 scripts/publish.py --dir /tmp/wechat-format/article-name/ --cover cover.jpg
Just say:
排版这篇文章 /path/to/article.md
Claude will:
| Theme | ID | Style |
|---|---|---|
| Terracotta | terracotta |
Warm orange, rounded headers |
| ByteDance | bytedance |
Blue-teal gradient, modern tech |
| Chinese | chinese |
Vermillion red, classical |
| Newspaper | newspaper |
NYT-style serif, serious |
| GitHub | github |
Developer-friendly, light code blocks |
| SSPAI | sspai |
Chinese tech media red |
| Bauhaus | bauhaus |
Primary colors, geometric |
| Ink | ink |
Pure black, minimal whitespace |
| Midnight | midnight |
Dark background, neon accents |
| Theme | ID | Style |
|---|---|---|
| Sports | sports |
Gradient stripes, energetic |
| Mint | mint-fresh |
Mint green, fresh |
| Sunset | sunset-amber |
Warm amber tones |
| Lavender | lavender-dream |
Purple dreamy |
| Coffee | coffee-house |
Brown warm tones |
| WeChat Native | wechat-native |
WeChat green |
| Magazine | magazine |
Extra whitespace, editorial |
4 layouts (Minimal / Focus / Elegant / Bold) × multiple color variants (Gold / Blue / Red / Green / Navy / Gray)
Enhance your Markdown with these containers before formatting:
:::dialogue[Interview Title]
Alice: Hello there
Bob: Hi, how are you?
:::
:::gallery[Screenshots]



:::
> [!important] Key Insight
> This is the important takeaway
> [!tip] Pro Tip
> A useful tip for readers
Edit config.json:
{
"output_dir": "/tmp/wechat-format",
"vault_root": "/path/to/your/obsidian/vault",
"settings": {
"default_theme": "newspaper",
"auto_open_browser": true
},
"wechat": {
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET",
"author": "Author Name"
},
"cover": {
"output_dir": "~/Documents/covers",
"image_generation_script": ""
}
}
wechat section is only needed for publishing; formatting works without itcover section is only needed for cover image generationThis repo includes a complete cover image generator in cover/. It calls the Gemini Image API (or compatible third-party gateways) to produce WeChat cover images (2.35:1 ratio, Notion illustration style).
cover/config.example.json → cover/config.json{
"output_dir": "~/Documents/covers",
"settings": {
"base_url": "https://YOUR_PROVIDER/v1",
"model": "gemini-3-pro-image-preview"
},
"secrets": {
"api_key": "YOUR_API_KEY"
}
}
python3 scripts/generate.py \
--config cover/config.json \
--prompt-file prompt.md \
--out cover.jpg
Or with Claude Code, just say: 给这篇文章配个封面
See cover/SKILL.md for the full prompt template and workflow details.
WeChat's editor strips <style> tags and CSS classes. This tool:
**text,** → **text**,)style="..." attributes on every element<ul>/<ol> to <section> + flexbox (WeChat mangles native lists)[text](url) into footnotes (WeChat blocks external links)![[image.jpg]] Obsidian wiki-links and standard  references[!tip], [!important], [!warning]) with distinct colorsmarkdown libraryrequests library (for publishing)MIT