当前位置: 首页 > Skill >

ZM 公众号草稿发布与核验

ZM 公众号草稿发布与核验

0.1.0 2026.11.24 浏览:500
获取Skill文件查看使用说明
作者:许景许可证:
本文目录展开

zm-wechat-draft-publish-verify

Use zm-wechat-draft-publish-verify 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 zm-md2wechat-conversion-tool create_draft publishing 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.json generation
  • zm-md2wechat-conversion-tool create_draft
  • WeChat draft/get backend 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
→ zm-md2wechat-conversion-tool config validate
→ inspect / preview / convert (if Markdown)
→ zm-md2wechat-conversion-tool upload_image cover.*
→ generate draft.json
→ zm-md2wechat-conversion-tool create_draft draft.json
→ call WeChat draft/get
→ verify title / author / cover / content / visibility

Hard Rules

  1. zm-md2wechat-conversion-tool create_draft is the formal draft creation action.
  2. test-draft is only for chain testing, not formal publishing.
  3. convert --mode ai returning CONVERT_AI_REQUEST_READY does not mean a draft was created.
  4. AI-mode output must be materialized into real WeChat-compatible HTML before entering this skill.
  5. Command success is not task success.
  6. Final success requires backend verification.
  7. Preferred execution path is scripts/publish.sh, not an ad-hoc hand-built sequence.
  8. Local preview and local convert artifacts are not WeChat backend proof.
  9. If create_draft succeeds but draft/get fails, the result must be treated as unverified or blocked.
  10. media_id alone 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 image
  • article.html + cover image

Requirements

The following must already be available:

  • zm-md2wechat-conversion-tool
  • python3

Config file:

~/.config/zm-md2wechat-conversion-tool/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

zm-md2wechat-conversion-tool config validate --json

Standard Execution

Primary script:

skills/zm-wechat-draft-publish-verify/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 "标题" "野哥" "摘要"

What The Script Does

  1. zm-md2wechat-conversion-tool config validate --json
  2. If input is Markdown:
    • zm-md2wechat-conversion-tool inspect ... --json
    • zm-md2wechat-conversion-tool preview ... --json
    • zm-md2wechat-conversion-tool convert ... --output ... --json
  3. zm-md2wechat-conversion-tool upload_image cover.png --json
  4. Generate *.zm-md2wechat-conversion-tool-create-draft.json
  5. zm-md2wechat-conversion-tool create_draft *.json --json
  6. Call official WeChat draft/get
  7. Save verification output

Output Artifacts

The script writes artifacts next to the article:

*.zm-md2wechat-conversion-tool-inspect.json
*.zm-md2wechat-conversion-tool-preview.json
*.zm-md2wechat-conversion-tool-convert.json
*.zm-md2wechat-conversion-tool-cover-upload.json
*.zm-md2wechat-conversion-tool-create-draft.json
*.zm-md2wechat-conversion-tool-create-draft-result.json
*.zm-md2wechat-conversion-tool-create-draft-verify.json

The final source of truth is:

*.zm-md2wechat-conversion-tool-create-draft-verify.json

Success Criteria

Only report draft push success when both are true:

  1. zm-md2wechat-conversion-tool create_draft returned success
  2. draft/get verification 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": "<section style="...">正文 HTML</section>",
      "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 zm-md2wechat-conversion-tool upload_image or equivalent WeChat material upload

Verification Checklist

At minimum verify:

  • draft really exists
  • title matches expected value
  • author matches expected value
  • thumb_media_id exists
  • content exists
  • no leaked local paths such as <local-home>/ or content-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/zm-md2wechat-conversion-tool/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, or convert alone.
  • 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 usage
  • references/troubleshooting.md — failure handling
  • references/themes.md — related publishing notes
  • scripts/publish.sh — canonical execution wrapper
  • scripts/setup.sh — environment setup helper

Experience Captured

2026-05-14

Verified working path using an older article:

AI-ready HTML
→ zm-md2wechat-conversion-tool upload_image
→ draft.json
→ zm-md2wechat-conversion-tool 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_id is only a receipt
  • CONVERT_AI_REQUEST_READY is an action-required state, not a success state
  • preview / convert / test-draft can 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

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,013
Skill 文件
  • SKILL.md
    • zm-wechat-draft-publish-verify
    • What This Skill Is For
    • Canonical Publish Path
    • Hard Rules
    • Inputs
    • Requirements
    • Validate Before Publish
    • Standard Execution
    • What The Script Does
    • Output Artifacts
    • Success Criteria
    • Draft JSON Shape
    • Verification Checklist
    • Common Failure Modes
      • Invalid IP
      • Invalid AppSecret
      • AI mode only returned a request
    • Operational Guidance For Agents
    • Related Files
    • Experience Captured
      • 2026-05-14
      • 2026-05-15
  • 项目或源文件

相关 Skill

更多
ZM Markdown 转公众号格式工具 ZM Markdown 转公众号格式工具 ZM Markdown 转公众号工具:Markdown → 微信公众号 HTML,支持主题、图片、样式、AI痕迹处理并生成草稿;正式发布需配合 ZM 公众号草稿发布与核验 Skill
公众号一键发文流水线·Markdown转排版推送 公众号一键发文流水线·Markdown转排版推送 把"每篇复制改路径"的发文流程收敛成一个可复用流水线。写好的 Markdown,三步变一篇带样式、带封面的群发草稿。
阿淼发公众号 阿淼发公众号 Editor-first WeChat Official Account publishing skill. Posts content to WeChat Official Account (微信公众号) via API or browser, while prioritizing humanized writ...
公众号文章采集 公众号文章采集 智能体自动滚动微信搜一搜结果页,OCR 识别文章信息,生成分类报告。
公众号爆文写作助手(蹭热点·双AI核实) 公众号爆文写作助手(蹭热点·双AI核实) 自媒体爆款文章智能生成工具,支持蹭热点写文、双AI事实核查、自动配图、全平台发布。适配知乎、头条、公众号等平台,自动生成1000字以上深度文章,标题含热点关键词,正文自然融入,适合流量变现。