Install
openclaw skills install wechat-auto-publishingAutomate a full local WeChat Official Account publishing workflow: environment setup, content drafting, image prep, publishing, archiving, and optional sched...
openclaw skills install wechat-auto-publishingUse this skill to reproduce, document, and operate a complete local WeChat Official Account auto-publishing workflow without embedding any secrets, private account details, or personal identifiers in the skill package.
This skill is intentionally broader than a minimal workflow note. It includes the operational context needed to reproduce the workflow on a fresh machine, while still keeping all sensitive values external.
The desired end state is a reusable local workflow that can do the following:
cover.png, image1.jpg, and image2.jpgNever store real private values in this skill package.
Do not include:
WECHAT_APP_IDWECHAT_APP_SECRETGOOGLE_API_KEYWhen documenting configuration, only include:
Read the bundled references depending on what the user is trying to accomplish:
references/environment-and-config.md — use when preparing a new machine or validating prerequisitesreferences/source-gathering.md — use when collecting the day’s source pool and market anglereferences/writing-style.md — use when drafting and formatting the articlereferences/image-strategy.md — use when preparing cover and body images, including gallery modereferences/publishing.md — use when publishing to draft/final and archiving outputsreferences/scheduling-and-alerting.md — use when attaching cron, wrappers, logs, and alertsreferences/security-boundary.md — use when checking what the skill must and must not containtemplates/article-template.md — use as the default publishable article skeletontemplates/env.example.txt — use as the safe non-secret environment placeholder filetemplates/run.sh — use as a starting point for a local orchestrator scripttemplates/run.production-example.sh — use as a more production-ready orchestrator template with gallery, publish mode, and time-slot supporttemplates/cron.example.txt — use as a starting point for schedulingtemplates/publish-result.example.json — use as a result artifact templatetemplates/gallery-config.example.txt — use as a local gallery config exampletemplates/cover-image-extend.example.md — use as a safe cover-image preference exampletemplates/image-gen-extend.example.md — use as a safe image-gen preference exampletemplates/workspace-tree.txt — use as a recommended directory layoutrunbook.md — use as the operator-facing execution checklistBefore doing any content work, verify that the environment is reproducible on the target machine.
Confirm:
Read references/environment-and-config.md.
Collect raw source material, filter it down, and compress the market angle.
Read references/source-gathering.md.
Draft an article in the target style using the publishable Markdown conventions from this skill.
Read references/writing-style.md and start from templates/article-template.md when useful.
Prepare:
cover.pngimage1.jpgimage2.jpgChoose image sources explicitly:
Read references/image-strategy.md.
Make sure the article package is self-contained and publishable:
article.mdcover.pngimage1.jpgimage2.jpgUse relative paths and UTF-8 encoding.
Use the local publishing pathway to send the article to WeChat draft.
Do not treat publishing as successful unless the draft step returns a meaningful success result, such as a valid media_id.
If baoyu-post-to-wechat 因依赖问题(如 simple-xml-to-json 兼容性错误)无法运行,使用备用脚本:
node templates/publish.mjs
备用脚本 publish.mjs 支持完整流程:获取 token -> 上传封面 -> 上传内图 -> Markdown 转 HTML -> 创建草稿 -> 正式发布 -> 归档结果。
Read references/publishing.md.
If the workflow includes final publication, submit, poll, and capture the final URL.
备用脚本 templates/publish.mjs 已内置正式发布功能(freepublish),如果使用备用脚本完成 Step 6,正式发布会自动执行,无需额外操作。
Save result artifacts, logs, identifiers, and remaining gallery state where relevant.
If the user wants timed operation, attach a wrapper script and scheduler entry.
Read references/scheduling-and-alerting.md.
freepublish is not always operationally equivalent to manual publishing in the MP backendIn practice, a workflow may successfully:
publish_idarticle_idarticle_urlbut still not behave the same way as manually publishing the draft inside the WeChat Official Account admin console, especially for homepage visibility expectations.
Therefore, the skill must distinguish between:
draft_only (recommended production default)auto content generation
→ auto image preparation
→ auto draft submission
→ human publishes in MP backend
Use this mode when homepage visibility and platform-consistent display matter more than full automation.
full_publish (testing / exploratory mode)auto content generation
→ auto draft submission
→ auto freepublish submit
→ poll result
→ archive article_url
Use this mode only when the operator explicitly accepts that API publication may not be equivalent to backend manual publication.
When operating multiple public accounts, prefer:
one account = one working directory = one .env = one title history = one cron entry
This avoids credential confusion, title-history pollution, log mixing, and accidental cross-account publishing.
Do not trust file extension alone.
Before publish, validate that images are:
If a file is named cover.png but is actually HEIF/HEVC, the WeChat API may reject it.
Do not directly inject scraped source titles into the body as-is.
Avoid:
...报道: in final body textPrefer:
Prefer explicit files and paths over hidden assumptions.
Configuration structure belongs inside the skill. Real credentials do not.
If a step fails, preserve enough output and log context for a human operator to understand what happened.
Do not hard-code a single image source assumption. The workflow should make it clear whether the body images come from a local gallery, generated assets, or user-supplied files.
A fresh-machine reproduction should be able to answer yes to all of these:
This skill is allowed to be operationally complete, but it must remain secret-free. Every reusable process detail can go into the skill; every real credential and personal account detail must stay outside it.