Install
openclaw skills install zhy-wechat-writingUse when generating a complete WeChat article from a topic, with optional source research, evidence tracking, illustration, HTML conversion, and draft-box pu...
openclaw skills install zhy-wechat-writing根据用户提供的主题(可选参考URL),自动完成公众号文章写作全流程:多来源检索与证据池整理、初稿生成、自审润色、参考资料整理,并可选自动配图与保存到公众号草稿箱(不提交发布)。
执行前需要确认:
topic)urls)topic 为纯中文且未提供 slug,建议补充英文/拼音 kebab-case 目录名;否则会使用 ASCII 降级方案按照以下步骤顺序执行(产物默认落盘到 articles/<slug>/...,便于复跑与追溯):
目标:确定可稳定复用的目录与路径规范
操作:
slug
slug:直接使用(推荐:英文/拼音kebab-case)topic 含拉丁字母/数字:对其做kebab-casewechat-article-YYYYMMDDarticles/<slug>/articles/<slug>/sources// 分隔符目标:搜集与主题相关的素材,并整理为可追溯的证据池
操作:
urls:并行使用 webfetch 获取内容,提取要点,并记录URL与可获得的发布日期urls:并行使用 WebSearch 做多来源检索(建议覆盖:官方文档 / X(Twitter) / Reddit / 技术论坛 / 微信公众号 / 工程实践)
{topic} official documentation / {topic} release notes 2025 2026{topic} site:x.com / {topic} site:twitter.com{topic} site:reddit.com / {topic} site:reddit.com/r/<subreddit>{topic} site:github.com issues / {topic} site:github.com discussions{topic} site:stackoverflow.com / {topic} site:news.ycombinator.com{topic} site:mp.weixin.qq.com (公众号){topic} 实战 复盘 踩坑 2025 2026 (中文工程实践)articles/<slug>/sources/evidence.md工具映射:
WebSearchwebfetch关于 WebSearch(实现说明):
WebSearch 工具。WebSearch:用 webfetch 抓取公开搜索结果页(SERP),从结果中提取 URL 列表后再并行 webfetch 正文内容。证据池条目格式(每条必须包含):
停止条件(建议):
常见失败处理(新增):
confidence=low/medium),或改抓同一观点的博客/论坛转载;webfetch 抓官方站点的搜索/博客索引页或 GitHub 搜索页;high;社区讨论若无落地细节或无交叉验证标 low。输出:sources_path(证据池路径)
目标:基于素材生成公众号文章初稿
写作要求:
标题:吸引眼球,可使用以下技巧
5个方法让你...为什么...?A与B的区别...你不知道的...开头(前3-5行):
正文结构:
结尾:
字数要求:1500-2500字
可追溯性要求(新增硬约束):
## 参考资料/来源(5-10条链接,尽量带日期)输出:Markdown 格式初稿,保存到:articles/<slug>/article.md
目标:从四个维度审稿,发现问题
审稿维度:
| 维度 | 检查要点 | 权重 |
|---|---|---|
| 逻辑 | 论点清晰、论据充分、推理合理 | 30% |
| 表达 | 语言流畅、无AI痕迹、口语化适度 | 25% |
| 数据 | 数据准确、案例恰当、引用规范 | 25% |
| 结构 | 标题吸引、段落分明、首尾呼应 | 20% |
新增硬检查:
审稿操作:
评分标准:
输出:审稿报告(包含问题和修改建议),建议保存到:articles/<slug>/sources/review.md
目标:修复问题,提升文章质量
润色操作:
去除AI痕迹
综上所述 → 总的来说总而言之 → 说到底由此可见 → 所以说不难看出 → 我们能发现众所周知 → 大家都知道增强口语化
其实、说实话、不得不说优化节奏
修复审稿问题
输出:最终文章
强制要求(新增):
## 参考资料/来源official / community / practice 分组更佳操作:
articles/<slug>/articles/<slug>/article.mdarticle_pathsources_path触发条件:with_illustrations=true
目标:为文章生成统一风格的高完成度配图,并产出插图版文章
默认策略:
article_path:使用 articles/<slug>/article.mdslug:复用当前文章 slugdensity:illustration_density(默认 balanced)upload:illustration_upload(默认 false)aspect_ratio:illustration_aspect_ratio(默认 16:9)prompt_profile:illustration_prompt_profile(默认 nano-banana)text_language:illustration_text_language(默认 zh-CN)english_terms_whitelist:illustration_english_terms_whitelist(默认空)image_provider:illustration_image_provider(默认 xiaomi)image_model:illustration_image_model(默认 gemini-3.1-flash-image-preview)image_size:illustration_image_size(默认 1K)image_base_url:illustration_image_base_url(默认 Xiaomi 接口地址,也支持 Gemini 原生代理)执行方式:
zhy-article-illustrator 的一键流程脚本:
node <zhy-article-illustrator>/scripts/illustrate-article.ts \
--article articles/<slug>/article.md \
--slug <slug> \
--density <illustration_density> \
--aspect-ratio <illustration_aspect_ratio> \
--prompt-profile <illustration_prompt_profile> \
--text-language <illustration_text_language> \
--image-provider <illustration_image_provider> \
--image-model <illustration_image_model> \
[--image-size <illustration_image_size>] \
[--image-base-url <illustration_image_base_url>] \
[--upload]
illustration_english_terms_whitelist 非空,则为每个术语追加 --term <value>,例如:
--term Playwright --term Chromium --term Firefox --term WebKit
visual-bible.mdoutline.md 与 prompts/article_path -> --articleslug -> --slugillustration_density -> --densityillustration_aspect_ratio -> --aspect-ratioillustration_prompt_profile -> --prompt-profileillustration_text_language -> --text-languageillustration_image_provider -> --image-providerillustration_image_model -> --image-modelillustration_image_size -> --image-sizeillustration_image_base_url -> --image-base-urlillustration_upload=true -> --upload输出:
illustrated_article_path: articles/<slug>/article.illustrated.mdillustrations_dir: articles/<slug>/illustrations/<slug>/articles/<slug>/illustrations/<slug>/visual-bible.mdarticles/<slug>/illustrations/<slug>/outline.mdarticles/<slug>/illustrations/<slug>/prompts/失败处理:单张失败可重试一次;仍失败则记录并继续,最终输出失败清单。若部分图片失败,也应保留 article.illustrated.md,并插入图片占位注释。
触发条件:with_html_theme=true
目标:使用 zhy-markdown2wechat 技能将 Markdown 转换为带微信内联样式的 HTML
操作:
with_illustrations=true 且 articles/<slug>/article.illustrated.md 存在,则使用该文件articles/<slug>/article.md<input_markdown>zhy-markdown2wechat 技能,执行转换脚本:
node <zhy-markdown2wechat>/scripts/convert.js \
<input_markdown> \
<zhy-markdown2wechat>/resources/themes/default.css \
articles/<slug>/article.zhy.html
npm install,自动在临时目录处理后清理<section id="MdWechat"> 容器与完整内联 CSS 样式resources/themes/ 下的其他主题文件(apple.css / blue.css / dark.css / green.css / notion.css / vibrant.css)<zhy-markdown2wechat> 表示当前环境中该技能的安装目录,运行时应以实际路径为准<input_markdown>=articles/<slug>/article.illustrated.md<input_markdown>=articles/<slug>/article.md输出:html_article_path(articles/<slug>/article.zhy.html)
失败处理:记录错误并在执行摘要中注明原因,跳过该步骤并继续后续流程
触发条件:post_to_wechat=true
默认行为:通过微信官方 API 保存到草稿箱,不做最终发布提交
前置条件:
zhy-wechat-publish 技能目录下的 .env 已配置 WECHAT_APP_ID 与 WECHAT_APP_SECRETzhy-article-illustrator 提供)调用方式:
article.zhy.html;若不存在则跳过本步骤(或先补执行 Step 7)wechat_draft.js:
node <zhy-wechat-publish>/scripts/wechat_draft.js \
--title "文章标题" \
--file "articles/<slug>/article.zhy.html" \
[--author "作者"] \
[--digest "摘要"] \
[--thumb "封面media_id"] \
[--source-url "原文链接"] \
[--need-open-comment "1"] \
[--only-fans-can-comment "1"]
node <zhy-wechat-publish>/scripts/publish_with_cover.js \
--article "articles/<slug>/article.md" \
--html "articles/<slug>/article.zhy.html" \
[--title "文章标题"] \
[--author "作者"] \
[--source-url "原文链接"] \
[--need-open-comment "1"] \
[--only-fans-can-comment "1"]
<zhy-wechat-publish> 表示当前环境中该技能的安装目录,运行时应以实际路径为准wechat_draft.js 未提供 --thumb 时会自动读取 .env 中的 WECHAT_DEFAULT_THUMB_MEDIA_IDpublish_with_cover.js 会自动从文章中提取标题/摘要、生成单张 16:9 封面、上传封面,并将返回的 media_id 作为 thumb_media_idvar(--xxx) 样式变量,避免微信草稿箱丢失颜色与边框样式<img src> 替换为微信返回的图片 URL注意:
npm installpublish_with_cover.js 时,需要本机可用 bun,因为封面生成会复用现有生图脚本wechat_draft.js 直接上传 HTML,避免自动封面步骤失败成功标准:输出 上传草稿成功! 草稿 MEDIA_ID: xxx
失败排障清单:
| 错误信息 | 原因与处理 |
|---|---|
[40013] invalid appid | AppID 错误,检查发布技能目录下的 .env |
[40164] invalid ip | 当前 IP 未加白名单,将报错中的 IP 加入公众号后台 |
[40007] invalid media_id | 封面图 ID 无效,使用 upload_image.js 重新上传获取 |
缺少 Xiaomi/Gemini/OpenAI API Key | 自动封面生成依赖的生图环境未配置,检查 zhy-article-illustrator 相关 .env |
article.zhy.html 不存在 | Step 7 未执行或失败,检查 with_html_theme=true |
| 标题过长 | 控制标题 <= 64 字符 |
用户输入(topic, urls?, slug?, search_count?, time_range_days?, ...)
↓
Preflight(确定slug与目录)
↓
素材搜集(WebSearch + webfetch → evidence.md)
↓
初稿生成(article.md)
↓
智能审稿(含可追溯性/标题一致性)
↓
润色打磨(强制References)
↓
自动配图(article.illustrated.md + illustrations/)
↓
HTML 主题样式输出(zhy-markdown2wechat → article.zhy.html)
↓
保存到草稿箱(不提交发布)
| 异常情况 | 处理方式 |
|---|---|
| 搜索无结果 | 提示用户提供更多信息或参考URL |
| 参考文章无法访问 | 跳过该URL,继续处理其他素材 |
| 初稿质量过低 | 重新生成或提示用户提供更多素材 |
| 审稿评分<70 | 建议用户检查主题是否合适 |
| 配图失败 | 输出失败清单;可选择补图后再发布 |
| HTML 转换失败 | 记录错误并跳过该步骤(Step 7),继续后续流程 |
| 发布到草稿箱失败 | 输出排障清单(AppID/IP白名单/封面media_id/标题长度) |
输入:
topic: "如何提高工作效率"
urls: ["https://mp.weixin.qq.com/xxx"]
search_count: 5
with_illustrations: true
with_html_theme: true
post_to_wechat: true
执行流程:
输出:
article_path: articles/how-to-improve-work-efficiency/article.md
sources_path: articles/how-to-improve-work-efficiency/sources/evidence.md
illustrated_article_path: articles/how-to-improve-work-efficiency/article.illustrated.md
illustrations_dir: articles/how-to-improve-work-efficiency/illustrations/how-to-improve-work-efficiency/
html_article_path: articles/how-to-improve-work-efficiency/article.zhy.html
word_count: 2150
review_score: 92
wechat_draft_status: success