Install
openclaw skills install wechat-publisher-md2wechat-draftgetOrchestrate the official WeChat draft publishing path for already-prepared article HTML or Markdown using md2wechat, with mandatory draft/get verification before reporting success.
openclaw skills install wechat-publisher-md2wechat-draftgetUse wechat-publisher-md2wechat-draftget when the user wants to:
upload_image -> create_draft -> draft/getmd2wechat create_draft publishing chainThis skill is the publishing execution layer for WeChat Official Account drafts.
It is responsible for:
draft.json generationmd2wechat create_draftdraft/get backend verificationIt is not responsible for:
Those stay in the main production workflow.
Prepared article HTML or Markdown
→ md2wechat config validate
→ inspect / preview / convert (if Markdown)
→ md2wechat upload_image cover.*
→ generate draft.json
→ md2wechat create_draft draft.json
→ call WeChat draft/get
→ verify title / author / cover / content / visibility
md2wechat create_draft is the formal draft creation action.test-draft is only for chain testing, not formal publishing.convert --mode ai returning CONVERT_AI_REQUEST_READY does not mean a draft was created.scripts/publish.sh, not an ad-hoc hand-built sequence.preview and local convert artifacts are not WeChat backend proof.create_draft succeeds but draft/get fails, the result must be treated as unverified or blocked.media_id alone is only a submission receipt, not a success proof.Preferred prepared package:
wechat_package/
article.html
cover.png
images/
publish-checklist.md
Also supported:
article.md + cover imagearticle.html + cover imageThe following must already be available:
md2wechatpython3Config file:
~/.config/md2wechat/config.yaml
Expected WeChat credentials:
wechat:
appid: "公众号 AppID"
secret: "公众号 AppSecret"
The current public IP must also be in the WeChat Official Account IP allowlist.
md2wechat config validate --json
Primary script:
skills/wechat-publisher/scripts/publish.sh
Usage:
./scripts/publish.sh <article.md|article.html> <cover-image> [title] [author] [digest]
Examples:
./scripts/publish.sh article.html cover.png "现在找工作,最累的不是被拒" "野哥" "找工作最累的不是被拒,而是一直没有回音。"
./scripts/publish.sh article.md cover.png "标题" "野哥" "摘要"
md2wechat config validate --jsonmd2wechat inspect ... --jsonmd2wechat preview ... --jsonmd2wechat convert ... --output ... --jsonmd2wechat upload_image cover.png --json*.md2wechat-create-draft.jsonmd2wechat create_draft *.json --jsondraft/getThe script writes artifacts next to the article:
*.md2wechat-inspect.json
*.md2wechat-preview.json
*.md2wechat-convert.json
*.md2wechat-cover-upload.json
*.md2wechat-create-draft.json
*.md2wechat-create-draft-result.json
*.md2wechat-create-draft-verify.json
The final source of truth is:
*.md2wechat-create-draft-verify.json
Only report draft push success when both are true:
md2wechat create_draft returned successdraft/get verification passed and the backend draft is really presentOtherwise classify as one of:
{
"articles": [
{
"title": "标题",
"author": "野哥",
"digest": "摘要",
"content": "<section style=\"...\">正文 HTML</section>",
"thumb_media_id": "封面素材 media_id",
"show_cover_pic": 0
}
]
}
Constraints:
articles must not be emptytitle required, recommended ≤ 32 charsauthor recommended ≤ 16 charsdigest recommended ≤ 120–128 charscontent required and must be WeChat-compatible HTMLthumb_media_id must come from md2wechat upload_image or equivalent WeChat material uploadAt minimum verify:
title matches expected valueauthor matches expected valuethumb_media_id exists/home/ye/ or content-factory/errcode=40164 invalid ip ... not in whitelist
Action: add the current public IP to the WeChat Official Account backend allowlist.
errcode=40125 invalid appsecret
Action: fix ~/.config/md2wechat/config.yaml.
{
"code": "CONVERT_AI_REQUEST_READY",
"status": "action_required"
}
This is not success. It only means the AI conversion request is ready. Continue by producing HTML, then run the draft chain.
media_id, preview, or convert alone.README.md — quick operator-facing usagereferences/troubleshooting.md — failure handlingreferences/themes.md — related publishing notesscripts/publish.sh — canonical execution wrapperscripts/setup.sh — environment setup helperVerified working path using an older article:
AI-ready HTML
→ md2wechat upload_image
→ draft.json
→ md2wechat create_draft
→ WeChat draft/get verification passed
Verified fields included title, author, digest, cover, content, inline styles, and no local path leakage.
Key lessons added to the standard skill:
scripts/publish.shmedia_id is only a receiptCONVERT_AI_REQUEST_READY is an action-required state, not a success statepreview / convert / test-draft can mislead people into thinking the draft is already in the backend