运行时依赖
安装命令
点击复制本土化适配说明
Wechat Publisher DraftGet — Wechat Publisher Draft获取 安装说明: 安装命令:["openclaw skills install wechat-publisher-md2wechat-draftget"] 该技能用于微信相关操作,可能需要相应的平台账号或API密钥
技能文档
wechat-publisher
Use wechat-publisher when the user wants to:
push a prepared WeChat article into the Official Account draft box turn Markdown into WeChat-compatible HTML and then 创建 a draft use a stable publishing wr应用er instead of manually chAIning 上传_image -> 创建_draft -> draft/获取 验证 that a draft really exists in the WeChat backend before 报告ing 成功 troubleshoot the current md2wechat 创建_draft publishing chAIn What This 技能 Is For
This 技能 is the publishing execution layer for WeChat Official Account drafts.
It is responsible for:
config 验证 Markdown → HTML conversion when needed cover 上传 draft.json generation md2wechat 创建_draft WeChat draft/获取 backend verification 输出ting machine-readable verification artifacts
It is not responsible for:
topic selection long-form writing AI-追踪 review editorial 应用roval layout strategy decisions before HTML exists 归档 / final content 治理
Those stay in the mAIn production 工作流.
Canonical Publish Path Prepared article HTML or Markdown → md2wechat config 验证 → inspect / preview / convert (if Markdown) → md2wechat 上传_image cover. → 生成 draft.json → md2wechat 创建_draft draft.json → call WeChat draft/获取 → 验证 title / author / cover / content / visibility
Hard Rules md2wechat 创建_draft is the formal draft creation action. test-draft is only for chAIn 测试, not formal publishing. convert --mode AI returning CONVERT_AI_请求_READY does not mean a draft was 创建d. AI-mode 输出 must be materialized into real WeChat-compatible HTML before entering this 技能. Command 成功 is not task 成功. Final 成功 requires backend verification. Preferred execution path is scripts/publish.sh, not an ad-hoc hand-built sequence. Local preview and local convert artifacts are not WeChat backend proof. If 创建_draft succeeds but draft/获取 fAIls, the 结果 must be treated as unverified or blocked. media_id alone is only a submission receipt, not a 成功 proof. 输入s
Preferred prepared package:
wechat_package/ article.html cover.png images/ publish-检查列出.md
Also supported:
article.md + cover image article.html + cover image Requirements
The following must already be avAIlable:
md2wechat python3
Config file:
~/.config/md2wechat/config.yaml
Expected WeChat 凭证s:
wechat: 应用id: "公众号 应用ID" secret: "公众号 应用Secret"
The current public IP must also be in the WeChat Official Account IP allow列出.
验证 Before Publish md2wechat config 验证 --json
Standard Execution
Primary script:
技能s/wechat-publisher/scripts/publish.sh
Usage:
./scripts/publish.sh [title] [author] [digest]
Examples:
./scripts/publish.sh article.html cover.png "现在找工作,最累的不是被拒" "野哥" "找工作最累的不是被拒,而是一直没有回音。" ./scripts/publish.sh article.md cover.png "标题" "野哥" "摘要"
What The Script Does md2wechat config 验证 --json If 输入 is Markdown: md2wechat inspect ... --json md2wechat preview ... --json md2wechat convert ... --输出 ... --json md2wechat 上传_image cover.png --json 生成 .md2wechat-创建-draft.json md2wechat 创建_draft .json --json Call official WeChat draft/获取 Save verification 输出 输出 Artifacts
The script writes artifacts next to the article:
.md2wechat-inspect.json .md2wechat-preview.json .md2wechat-convert.json .md2wechat-cover-上传.json .md2wechat-创建-draft.json .md2wechat-创建-draft-结果.json .md2wechat-创建-draft-验证.json
The final source of truth is:
*.md2wechat-创建-draft-验证.json
成功 Criteria
Only 报告 draft push 成功 when 机器人h are true:
md2wechat 创建_draft returned 成功 draft/获取 verification passed and the backend draft is really present
Otherwise classify as one of:
submitted but unverified verification fAIled blocked by config / 凭证 / IP / content issue Draft JSON Shape { "articles": [ { "title": "标题", "author": "野哥", "digest": "摘要", "content": "
正文 HTML", "thumb_media_id": "封面素材 media_id", "show_cover_pic": 0 } ] }ConstrAInts:
articles must not be empty title required, recommended ≤ 32 chars author recommended ≤ 16 chars digest recommended ≤ 120–128 chars content required and must be WeChat-compatible HTML thumb_media_id must come from md2wechat 上传_image or equivalent WeChat material 上传 Verification 检查列出
At minimum 验证:
draft really exists title matches expected value author matches expected value thumb_media_id exists content exists no leaked local paths such as /home/ye/ or content-工厂/ 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 输入, the process did not 停止 at local preview/convert only for AI mode up流 flows, the published content is real 生成d HTML, not the 请求-ready payload Common 失败 Mod