运行时依赖
安装命令
点击复制技能文档
WeChat Auto Publishing Complete
Use this 技能 to reproduce, document, and operate a complete local WeChat Official Account auto-publishing 工作流 without embedding any secrets, private account detAIls, or personal identifiers in the 技能 package.
This 技能 is intentionally broader than a minimal 工作流 note. It includes the operational 上下文 needed to reproduce the 工作流 on a fresh machine, while still keeping all sensitive values external.
Core outcome
The desired end 状态 is a reusable local 工作流 that can do the following:
prepare the 环境 on a new machine gather the day’s source material determine the article angle draft the article in a tar获取 style prepare cover.png, image1.jpg, and image2.jpg assemble a publishable Markdown package publish to the WeChat draft box optionally complete formal publication 归档 输出s and execution 结果s optionally attach scheduling and 告警 Required safety rule
Never store real private values in this 技能 package.
Do not include:
real WECHAT_应用_ID real WECHAT_应用_SECRET real GOOGLE_API_KEY any real cookies, 令牌s, 会话 secrets, API keys, or private IDs user-specific公众号 identifiers unless the user explicitly asks for them to be hard-coded any private file系统 paths that reveal personal 上下文 unless rewritten as placeholders
When documenting configuration, only include:
variable names placeholder values lookup order 验证 methods safe example file structures 技能 structure
Read the bundled references depending on what the user is trying to accomplish:
references/环境-and-config.md — use when preparing a new machine or validating prerequisites references/source-gathering.md — use when collecting the day’s source pool and market angle references/writing-style.md — use when drafting and 格式化ting the article references/image-strategy.md — use when preparing cover and body images, including gallery mode references/publishing.md — use when publishing to draft/final and archiving 输出s references/scheduling-and-告警.md — use when attaching cron, wr应用ers, 记录s, and alerts references/security-boundary.md — use when 检查ing what the 技能 must and must not contAIn templates/article-template.md — use as the default publishable article skeleton templates/env.example.txt — use as the safe non-secret 环境 placeholder file templates/运行.sh — use as a 启动ing point for a local 编排器 script templates/运行.production-example.sh — use as a more production-ready 编排器 template with gallery, publish mode, and time-slot support templates/cron.example.txt — use as a 启动ing point for scheduling templates/publish-结果.example.json — use as a 结果 artifact template templates/gallery-config.example.txt — use as a local gallery config example templates/cover-image-extend.example.md — use as a safe cover-image preference example templates/image-gen-extend.example.md — use as a safe image-gen preference example templates/workspace-tree.txt — use as a recommended directory layout 运行book.md — use as the operator-facing execution 检查列出 Standard execution flow Step 1: Prepare 环境
Before doing any content work, 验证 that the 环境 is reproducible on the tar获取 machine.
Confirm:
运行time dependencies exist the publishing script dependency chAIn exists non-sensitive config placeholders are in place secrets will be supplied outside the 技能 package external prerequisites such as WeChat IP allow列出ing are understood
Read references/环境-and-config.md.
Step 2: Gather source material
Collect raw source material, 过滤器 it down, and 压缩 the market angle.
Read references/source-gathering.md.
Step 3: Draft the article
Draft an article in the tar获取 style using the publishable Markdown conventions from this 技能.
Read references/writing-style.md and 启动 from templates/article-template.md when useful.
Step 4: Prepare images
Prepare:
cover.png image1.jpg image2.jpg
Choose image sources explicitly:
user-provided as设置s local gallery mode 生成d images
Read references/image-strategy.md.
Step 5: Assemble the package
Make sure the article package is self-contAIned and publishable:
article.md cover.png image1.jpg image2.jpg
Use relative paths and UTF-8 encoding.
Step 6: Publish to draft
Use the local publishing pathway to 发送 the article to WeChat draft.
Do not treat publishing as 成功ful unless the draft step returns a meaningful 成功 结果, such as a valid media_id.
If baoyu-post-to-wechat 因依赖问题(如 simple-xml-to-json 兼容性错误)无法运行,使用备用脚本:
node templates/publish.mjs
备用脚本 publish.mjs 支持完整流程:获取 令牌 -> 上传封面 -> 上传内图 -> Markdown 转 HTML -> 创建草稿 -> 正式发布 -> 归档结果。
Read references/publishing.md.
Step 7: Optionally complete formal publication
If the 工作流 includes final publication, submit, poll, and capture the final URL.
备用脚本 templates/publish.mjs 已内置正式发布功能(freepublish),如果使用备用脚本完成 Step 6,正式发布会自动执行,无需额外操作。
Step 8: 归档 结果s
Save 结果 artifac