/install wechat-publisher-md2wechat-draftget
wechat-publisher-md2wechat-draftget
Use wechat-publisher-md2wechat-draftget when the user wants to:
- push a prepared WeChat article into the Official Account draft box
- turn Markdown into WeChat-compatible HTML and then create a draft
- use a stable publishing wrapper instead of manually chaining
upload_image -> create_draft -> draft/get - verify that a draft really exists in the WeChat backend before reporting success
- troubleshoot the current
md2wechat create_draftpublishing chain
What This Skill Is For
This skill is the publishing execution layer for WeChat Official Account drafts.
It is responsible for:
- config validation
- Markdown → HTML conversion when needed
- cover upload
draft.jsongenerationmd2wechat create_draft- WeChat
draft/getbackend verification - outputting machine-readable verification artifacts
It is not responsible for:
- topic selection
- long-form writing
- AI-trace review
- editorial approval
- layout strategy decisions before HTML exists
- archive / final content governance
Those stay in the main production workflow.
Canonical Publish Path
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
Hard Rules
md2wechat create_draftis the formal draft creation action.test-draftis only for chain testing, not formal publishing.convert --mode aireturningCONVERT_AI_REQUEST_READYdoes not mean a draft was created.- AI-mode output must be materialized into real WeChat-compatible HTML before entering this skill.
- Command success is not task success.
- Final success requires backend verification.
- Preferred execution path is
scripts/publish.sh, not an ad-hoc hand-built sequence. - Local
previewand localconvertartifacts are not WeChat backend proof. - If
create_draftsucceeds butdraft/getfails, the result must be treated as unverified or blocked. media_idalone is only a submission receipt, not a success proof.
Inputs
Preferred prepared package:
wechat_package/
article.html
cover.png
images/
publish-checklist.md
Also supported:
article.md+ cover imagearticle.html+ cover image
Requirements
The following must already be available:
md2wechatpython3
Config 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.
Validate Before Publish
md2wechat config validate --json
Standard Execution
Primary script:
skills/wechat-publisher/scripts/publish.sh
Usage:
./scripts/publish.sh \x3Carticle.md|article.html> \x3Ccover-image> [title] [author] [digest]
Examples:
./scripts/publish.sh article.html cover.png "现在找工作,最累的不是被拒" "野哥" "找工作最累的不是被拒,而是一直没有回音。"
./scripts/publish.sh article.md cover.png "标题" "野哥" "摘要"
What The Script Does
md2wechat config validate --json- If input is Markdown:
md2wechat inspect ... --jsonmd2wechat preview ... --jsonmd2wechat convert ... --output ... --json
md2wechat upload_image cover.png --json- Generate
*.md2wechat-create-draft.json md2wechat create_draft *.json --json- Call official WeChat
draft/get - Save verification output
Output Artifacts
The 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
Success Criteria
Only report draft push success when both are true:
md2wechat create_draftreturned successdraft/getverification passed and the backend draft is really present
Otherwise classify as one of:
- submitted but unverified
- verification failed
- blocked by config / credential / IP / content issue
Draft JSON Shape
{
"articles": [
{
"title": "标题",
"author": "野哥",
"digest": "摘要",
"content": "\x3Csection style=\"...\">正文 HTML\x3C/section>",
"thumb_media_id": "封面素材 media_id",
"show_cover_pic": 0
}
]
}
Constraints:
articlesmust not be emptytitlerequired, recommended ≤ 32 charsauthorrecommended ≤ 16 charsdigestrecommended ≤ 120–128 charscontentrequired and must be WeChat-compatible HTMLthumb_media_idmust come frommd2wechat upload_imageor equivalent WeChat material upload
Verification Checklist
At minimum verify:
- draft really exists
titlematches expected valueauthormatches expected valuethumb_media_idexists- content exists
- no leaked local paths such as
/home/ye/orcontent-factory/ - content has inline styles or otherwise clearly matches publish-ready WeChat HTML
- article images are actually present when the article uses body images
- for Markdown input, the process did not stop at local preview/convert only
- for AI mode upstream flows, the published content is real generated HTML, not the request-ready payload
Common Failure Modes
Invalid IP
errcode=40164 invalid ip ... not in whitelist
Action: add the current public IP to the WeChat Official Account backend allowlist.
Invalid AppSecret
errcode=40125 invalid appsecret
Action: fix ~/.config/md2wechat/config.yaml.
AI mode only returned a request
{
"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.
Operational Guidance For Agents
- Use this skill only when draft creation is actually requested.
- Prefer this skill over improvising raw shell steps.
- Never claim success from
media_id,preview, orconvertalone. - Treat verification as mandatory, not optional polish.
- If verification fails, report the exact blocker instead of vague success language.
Related Files
README.md— quick operator-facing usagereferences/troubleshooting.md— failure handlingreferences/themes.md— related publishing notesscripts/publish.sh— canonical execution wrapperscripts/setup.sh— environment setup helper
Experience Captured
2026-05-14
Verified 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.
2026-05-15
Key lessons added to the standard skill:
- formal publishing should default to
scripts/publish.sh media_idis only a receiptCONVERT_AI_REQUEST_READYis an action-required state, not a success statepreview/convert/test-draftcan mislead people into thinking the draft is already in the backend- if backend draft verification fails, treat the run as unverified or blocked instead of assuming eventual consistency
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install wechat-publisher-md2wechat-draftget - 安装完成后,直接呼叫该 Skill 的名称或使用
/wechat-publisher-md2wechat-draftget触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Wechat Publisher DraftGet 是什么?
Orchestrate the official WeChat draft publishing path for already-prepared article HTML or Markdown using md2wechat, with mandatory draft/get verification be... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 115 次。
如何安装 Wechat Publisher DraftGet?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install wechat-publisher-md2wechat-draftget」即可一键安装,无需额外配置。
Wechat Publisher DraftGet 是免费的吗?
是的,Wechat Publisher DraftGet 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Wechat Publisher DraftGet 支持哪些平台?
Wechat Publisher DraftGet 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Wechat Publisher DraftGet?
由 JerryXn(@jerryxn)开发并维护,当前版本 v0.1.1。