Help the user write a WeChat Official Account article.Light polish, not a rewrite. Automatically generate the cover image and explanatory images, and push the draft with one command.
Core principles
Preserve the author's tone and rhythm. You only do four things:
- Fix obvious typos and repeated characters
- Adjust paragraphs (1–3 sentences each)
- Smooth out especially awkward sentences (conservatively—if you can leave it alone, leave it alone)
- Prepare accompanying assets (cover image, title candidates, summary)
Do not do: change word preferences; add AI-flavored connectives ("first / second / in summary / it is worth noting"); turn colloquial language into written language; add emoji; reorganize paragraph order; "improve" the author's expression.
Scale of changes: if the number of characters changed exceeds 5% of the original text, that is too much—go back.
Length and examples (hard constraints)
Default 800–1000 characters. Write the first draft to budget; do not cut after finishing—cut text leaves a lingering sense of stitching. If it exceeds 1200, go back and cut another round.
When writing example paragraphs, run them through this ruler:Is this example truly specific (real event / real person / real numbers), or is it fabricated to demonstrate a framework? If the latter, delete it directly and let illustration.png carry the "demonstrate the structure" role.
- Prioritize keeping: opening hook + core framework + 1 punchline + soft-landing ending
- Prioritize cutting: demonstrative examples, repeated explanations, and instructional paragraphs like "how to use / where to find the entry point"
By default, do not write ## 后注, unless there is a genuinely necessary acknowledgment or source attribution; otherwise just let the main text come to a close at the end.
Count characters:
python3 -c "import re; t=open('article.md').read(); t=re.sub(r'\!\[.*?\]\(.*?\)','',t); print(len(re.findall(r'[一-鿿]',t)) + len(re.findall(r'[A-Za-z]+',t)))"
Bold and red (required in every article)
upload-draft.sh Make **...** render asred bold—the visual emphasis the author deliberately wants.Every article body must have reasonable bolding; none at all = not finished.
- 2–4 places, placed on punchlines, key conclusions, and core concept words
- Prioritize adding: each section's one-sentence conclusion, the emotional landing point of the whole article, the sentence readers most need to remember
- Do not add: whole paragraphs, transition sentences, list items (commands use
`code`); headings (H2/H3) already have font weight, no more**wrapping
Pangu spacing
Leave a space between Chinese and English—「用 AI 写 skill」.upload-draft.sh Automatically run scripts/pangu.py; Claude does not need to do it manually.
Commands / code: standalone paragraphs, using code style
When installation / run commands appear in the bodyby default pull them out into standalone paragraphs, do not mix them into narrative sentences as inline. Two ways to write them:
- Preferred—light-background code block (raw HTML block, the whole paragraph on one line, no blank lines inside):
<section style="background:#f6f8fa;border-radius:6px;padding:14px 16px;overflow-x:auto;font-family:Menlo,Consolas,monospace;font-size:14px;line-height:1.8;color:#24292e;">npm install -g xxx<br>xxx run</section> - Or fenced
```bashblock, the script converts it into standalone<p><code>…</code></p>
If only the command name is mentioned in a sentence → inline `code` is enough.
Articles introducing a skill: the installation method must be appended at the end
Trigger condition: this article is introducing / recommending a specific Claude Code skill.
Prerequisite — confirm the skill has been published: Wang Jianshuo's own wjs-* skills are automatically pushed by ~/.claude/skills-publish-hook.sh to github.com/jianshuo/claude-skills, confirm with gh api repos/jianshuo/claude-skills/contents/<skill-name> . For other people's skills, first confirm they are in a public git repo.
Append the following passage at the end(<SKILL_NAME> replace with the actual name):
## 安装方法
不用复制命令。打开你用的 AI agent——Claude Code、Codex、Kimi Code、OpenClaw 都可以,对它说一句:
> 安装 https://github.com/jianshuo/claude-skills/blob/main/<SKILL_NAME>/SKILL.md
它会自己 fetch、放到 skill 目录里、提示你重启对话。
用 Hermes 的话直接命令行:
\`\`\`bash
hermes skills install https://github.com/jianshuo/claude-skills/blob/main/<SKILL_NAME>/SKILL.md
\`\`\`
装完之后,对 agent 说一句「<一句最自然的触发语,紧扣这个 skill 的入口>」,就能用。
Rules:
- This passagedoes not count toward the 800–1000 word budget
- Use
github.com/<owner>/<repo>/blob/main/<path>for the URL — browsers can view it directly, and LLM agents can also extract markdown from the blob URL - List Hermes separately as acommand line, because it is a registry CLI rather than a chat agent
- Write the final trigger phrase according to the current skill's actual entry point,do not omit it
- Usually placed last; if there is
## 后注then place it before the postscript
Workflow
Step 0: Receive input
Input forms: complete draft / scattered ideas / long unsegmented passage / voice transcription (may contain typos). If too scattered,ask one question: "Do you want to write one article, or several independent ideas?" — ask only this once.
Step 1: Light polishing
- Fix typos ("的得地", homophones, repeated characters like "我我")
- One paragraph every 1–3 sentences
- Make minimal changes to awkward phrasing; if the tone changes after editing, rather not change it
- Punctuation: full-width for Chinese, spaces between English / numbers
- Keep the original opening and ending
Step 2: Title candidates
Give 3 candidates: A) straightforward type; B) story type; C) the most flavorful sentence from the original text. No clickbait, exaggeration, "shocking", "must-read".
Step 3: Summary (50–80 words)
Not a copy of the first paragraph; state clearly in one sentence what the reader will gain; use the author's tone, not a marketing tone.
Step 4: Illustrations (two per article, generated automatically without asking the user)
- Cover image cover.png — strictly 2.35:1(900×383), strong typography, strong composition, text-led
- Explanation image illustration.png — aspect ratio determined by content(model's choice), flat cartoon style, with labels and flow
~/.claude/skills/wjs-publishing-wechat/scripts/gen-cover-ai.sh <article-folder> ["目标字词"]
~/.claude/skills/wjs-publishing-wechat/scripts/gen-illustration.sh <article-folder>
- When no second parameter is passed, take from
meta.jsonthetitle; it is recommended to pick core concept words (1–4 characters) - Internally goes through
gpt-image-2-skillthe--provider codex, requires~/.codex/auth.json - The cover image is automatically cropped to 900×383; the explanation image is not cropped
The explanation image must be referenced in the markdown——article.md must have  one line, otherwise it will not be visible in the draft.
⚠️ In the body text, except for cover.png / illustration.png images will not be automatically uploaded to the CDN. For each local screenshot provided by the user (such as img-xxx.png), first md2wechat upload_image img-xxx.png --json get data.wechat_url, then replace article.md the local path ingrep -c mmbiz content.html = number of body images,grep -c 'img-' content.html = 0。
Default insertion position:after the final landing point of the body text(if there is ## 后注 place before the postscript; if there is ## 安装方法 place before the installation method).
Never write a lead-in for illustration images—do not write things like "here's how the whole thing looks" or "as shown in the figure"; let the figure speak for itself. See [[no-illustration-caption]] for details.
Safety net:
illustration.pngwhen present butarticle.mdnot referenced,upload-draft.shit is automatically inserted and rewritten, idempotent.
Step 5: Output file package
Create in the working directory (default ~/wechat-publish/articles/):
articles/2026-05-09-{slug}/
├── article.md # 润色后的 markdown
├── cover.png # 题图 900×383
├── illustration.png # 解释图
├── meta.json # { title, summary, author, date, slug }
└── original.md # 用户原始输入
{slug}:pinyin initials + keywords, within 30 characters.
Step 6: Publish (upload-draft.sh)
~/.claude/skills/wjs-publishing-wechat/scripts/upload-draft.sh <workspace>/articles/YYYY-MM-DD-{slug}
What the script does:
- Run
pangu.pyto apply Pangu spacing md2wechat upload_image cover.png→ getthumb_media_idillustration.pngWhen present but unreferenced, automatically insert and upload to get the CDN URL (idempotent safety net)- From
article.mdgeneratecontent.html(conversion rules below) - Install
draft.json, callcreate_draftor (publish.jsonhasdraft_media_idwhen)draft/updateupdate in place - macOS / Linux automatically opens
mp.weixin.qq.comdrafts box - Automatically
git add / commit / pusharticle directory to origin
article.md writing constraints(affects how Claude writes; other HTML details are handled by the script):
- Supports
<p>/<h2>/<h3>/<img>/<strong>/<em>/<code>/<ul>/<ol>/<li>/ pipe table - Raw HTML block passthrough: blocks starting with
<are output as-is; the whole paragraph must be one block,no blank lines inside - Multiple lines within a paragraph →
<br>line breaks(for parallelism / juxtaposed short sentences):Hard rule: a line must never end with the comma ",", line-break boundaries can only fall after sentence-ending punctuation (。?!)
Environment variables:
WECHAT_PUBLISH_FORCE_NEW=1— force creating a new draft (do not reusedraft_media_id)WECHAT_PUBLISH_NO_OPEN=1— do not automatically open the browserWECHAT_PUBLISH_NO_PUSH=1— do not automatically push
Prerequisites:
md2wechatCLI installed andWECHAT_APPID+WECHAT_SECRETconfigured (md2wechat config show)- Current public IP is in the WeChat Official Account backend whitelist: mp.weixin.qq.com → Settings and Development → Basic Configuration → IP Whitelist. Missing it will
errcode=40164
Common errcodes:40164 IP not in whitelist | 45004 summary is empty / too short | 40007 old draft_media_id deleted (the script automatically falls back to creating a new one).
After success, go to the drafts box → mobile preview → publish.
Polishing inspiration
Typo mode:
- Misuse of "的得地" (according to grammar)
- Repeated characters: "我我", "是是", "了了" → delete one
- Homophones ("在" vs "再", "做" vs "作")
Paragraph break timing:
- One sentence finishes one idea, the next sentence changes subject → paragraph break
- "但是 / 不过 / 所以 / 后来" appears at the start of a sentence → consider a paragraph break
- A paragraph exceeds 80 characters → find the nearest period and split
No paragraph break: parallel sentences, lists, dialogue (follow dialogue format).
Do not do this
| Do not | Reason |
|---|---|
| "我觉得" → "笔者认为" | Change the author's identity |
| Add subheadings that interrupt the flow | WeChat readers don't need navigation |
| Delete "吧/呢/啊" at the end of sentences | Once deleted, it's no longer written by this person |
| Add "Welcome to follow / Like and Wow" | The author decides for themselves |
| "Today" → specific date | The author used "Today" intentionally |
| Add your own examples / citations / data | This is writing, not completion |
| After editing, output the full text directly without providing a diff | The user can't see what you changed |
| The article exceeds 1500 characters | Most likely some paragraph is padding with empty examples—cut it |
| Fabricate a complete example to demonstrate the framework | Let illustration.png handle it |
Provide a list of changes first
After polishingFirst tell the user what was changed, then ask whether to continue:
我改了 7 处:
1. L3: "我我觉得" → "我觉得"(重复字)
2. L8: 长段落 (120字) 拆成两段
...
要看完整结果吗?
If there are ≤ 3 changes, you can directly provide the complete result.
Depends on external skill:gpt-image-2-skill(cover/illustration generation) + /md2wechat(upload + draft)。
Completion criteria
-
articles/YYYY-MM-DD-{slug}/The folder exists - Contains article.md, cover.png, illustration.png, meta.json, original.md
- meta.json fields are complete
- The draft is visible in the mp.weixin.qq.com backend
- The user did not say "revise it again"