jianshuo-wechat-mp-publish
Health Pass
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 18 GitHub stars
Code Warn
- network request — Outbound network request in scripts/fetch-comments-by-cookie.sh
- network request — Outbound network request in scripts/fetch-comments-via-gstack.sh
Permissions Pass
- Permissions — No dangerous permissions requested
No AI report is available for this listing yet.
Claude Code skill for writing and publishing 微信公众号 articles — light-polish editorial + AI cover (题图) + AI illustration (解释图) + Tier-1 publish helper
wjs-publishing-wechat
Claude Code skill for writing and publishing 微信公众号 (WeChat Official Account) articles, with AI-generated covers, AI-generated explanation illustrations, and a one-command upload helper.
Built around three principles:
- Light polish, no rewriting. Preserve the author's voice. The skill fixes typos and paragraph spacing; it does not "improve" the prose.
- Two images per article. A 2.35:1 typographic cover (题图) for the WeChat editor's cover field, and an aspect-ratio-flexible cartoon illustration (解释图) for the article body.
- Tier-1 publishing assist. Open browser, reveal cover in Finder, push body HTML to clipboard as rich text — paste into mp.weixin.qq.com in ~2 minutes.
What it does
draft → polish (light)
→ title + summary
→ cover (typographic, 900×383)
→ illustration (cartoon, model-chosen ratio)
→ article folder
→ publish.sh: open browser + clipboard
→ paste into mp.weixin.qq.com
Each article ends up in a dated folder:
articles/2026-05-09-my-slug/
├── original.md # your raw input (backup)
├── article.md # lightly polished markdown
├── article.html # rich-text HTML for pasting
├── cover.png # 题图 900×383 (2.35:1, strict)
├── illustration.png # 解释图 (any ratio, AI picks)
├── meta.json # title / summary / author / slug
└── cover-prompt-used.txt
Install
git clone https://github.com/jianshuo/wjs-publishing-wechat ~/.claude/skills/wjs-publishing-wechat
Then in Claude Code, the skill auto-fires on prompts like "写一篇公众号", "润色", "准备发布", or "/wjs-publishing-wechat".
Dependencies
macOS (uses
sips,pbcopy,osascript,open)Python 3 (for markdown→html conversion and meta parsing)
Node.js (for the AI image generation wrapper)
gpt-image-2-skill — required for AI cover and illustration. Install:
git clone https://github.com/Wangnov/gpt-image-2-skill /tmp/g cp -r /tmp/g/skills/gpt-image-2-skill ~/.claude/skills/Auth: either
OPENAI_API_KEY(needs OpenAI org verification forgpt-image-2) or Codex~/.codex/auth.json(any ChatGPT Plus account works, no verification needed — recommended).Optional:
pandocfor nicer markdown→html. The fallback is a built-in minimal converter.
Usage
The skill does most of the work for you. After it asks 1–2 clarifying questions and produces the article folder, three scripts handle the assets:
DIR=articles/YYYY-MM-DD-slug
# Generate the typographic cover (2.35:1, auto-cropped to 900×383)
~/.claude/skills/wjs-publishing-wechat/scripts/gen-cover-ai.sh "$DIR" "目标字词"
# Generate the cartoon explanation image (any aspect ratio)
~/.claude/skills/wjs-publishing-wechat/scripts/gen-illustration.sh "$DIR"
# Open browser, reveal cover, push HTML to clipboard
~/.claude/skills/wjs-publishing-wechat/scripts/publish.sh "$DIR"
Each script is idempotent — re-run it to get a different result (image generations are stochastic).
Customization
Both image generators read prompt templates that you can edit:
prompts/cover-prompt.md— the cover (题图) design philosophy, with[目标字词]placeholder. Locked to 2.35:1.prompts/illustration-prompt.md— the illustration (解释图) style guide, with[文章内容]placeholder. Aspect ratio chosen by the model based on content.
Environment variables (optional):
WECHAT_PUBLISH_IMAGE_SIZE— default1536x1024WECHAT_PUBLISH_IMAGE_QUALITY—auto/low/medium/high(defaulthigh)
Files
.
├── SKILL.md # how the skill behaves (its prompt)
├── prompts/
│ ├── cover-prompt.md # AI cover prompt template
│ └── illustration-prompt.md # AI illustration prompt template
└── scripts/
├── gen-cover-ai.sh # AI cover via gpt-image-2 → 900×383
├── gen-illustration.sh # AI illustration, no crop
├── upload-draft.sh # build content.html + create/update draft via md2wechat API
├── publish.sh # browser + clipboard publish helper
├── pangu.py # 盘古之白 spacing
└── … # comment-fetch / mass-send helpers
Why two images?
The 题图 is the cover the reader sees in the WeChat feed before clicking. It needs maximum punch in 2.35:1 (900×383, the exact dimensions of the WeChat cover slot). Typography wins here.
The 解释图 lives inside the article. It needs to teach. A cartoon explanation often helps readers grasp the idea before reading the text. Forcing this image into the cover ratio destroys it. Different jobs, different aspect ratios.
What this skill explicitly does NOT do
- It does not rewrite your prose. If you want an LLM to ghostwrite, this is the wrong tool.
- It does not auto-publish via WeChat API (Tier 1 only — opens browser + clipboard). Tier 2 (browser automation) and Tier 3 (official API, requires 服务号 + 企业认证) are not implemented.
- It does not manage 公众号 accounts, follower analytics, or scheduled posts.
License
MIT — see LICENSE.
Author
Wang Jianshuo (王建硕) — built for my own 公众号 workflow, shared for anyone with the same problem.
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found