根据用户提供的主题(可选参考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 (中文工程实践)合并去重,按可信度分级(high/medium/low),形成证据池,落盘:
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
目标:修复问题,提升文章质量
润色操作:
综上所述 → 总的来说总而言之 → 说到底由此可见 → 所以说不难看出 → 我们能发现众所周知 → 大家都知道其实、 说实话、 不得不说输出:最终文章
强制要求(新增):
## 参考资料/来源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 的一键流程脚本:
bash
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>,例如:
bash
--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将选中的 Markdown 文件记为 <input_markdown>
调用 zhy-markdown2wechat 技能,执行转换脚本:
bash
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 提供)调用方式:
正文必须是带内联样式的 HTML 文件
优先使用 Step 7 生成的 article.zhy.html;若不存在则跳过本步骤(或先补执行 Step 7)
默认推荐的稳定入口是直接调用 wechat_draft.js:
bash
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"]
若希望自动生成封面并发布,也可调用: bash
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_ID
publish_with_cover.js 会自动从文章中提取标题/摘要、生成单张 16:9 封面、上传封面,并将返回的 media_id 作为 thumb_media_id
发布脚本会在上传前自动展开 HTML 中的 var(--xxx) 样式变量,避免微信草稿箱丢失颜色与边框样式
发布脚本会在上传前自动将正文中的图片上传到微信正文图片接口,并将 <img src> 替换为微信返回的图片 URL
发布脚本会在上传前将原生列表结构降级为“普通段落 + 圆点/编号”,以兼容微信草稿箱再次进入编辑模式时的列表解析问题
注意:
npm installpublish_with_cover.js 时,需要本机可用 bun,因为封面生成会复用现有生图脚本wechat_draft.js 直接上传 HTML,避免自动封面步骤失败成功标准:输出 上传草稿成功! 草稿 MEDIA_ID: xxx
失败排障清单:
错误信息原因与处理[40013] invalid appidAppID 错误,检查发布技能目录下的 .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 字符
text
用户输入(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/标题长度)
输入:
text
topic: "如何提高工作效率"
urls: ["https://mp.weixin.qq.com/xxx"]
search_count: 5
with_illustrations: true
with_html_theme: true
post_to_wechat: true
执行流程:
输出:
text
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