wechat-article-pipeline-skill
WeChat Article Pipeline Skill 是一个兼容 Codex、Claude Code 等支持 Agent Skills 格式的智能体的多平台内容生产 Skill,支持文章优化、配图、排版及微信、头条、小红书草稿。 A multi-platform content skill for Codex, Claude Code, and other Agent Skills-compatible agents, supporting writing, visuals, formatting, and WeChat, Toutiao, and Xiaohongshu drafts.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Badge for your README
Markdown
[](/listings/jhwreal--wechat-article-pipeline-skill)HTML
<a href="/listings/jhwreal--wechat-article-pipeline-skill"><img src="/api/listings/jhwreal--wechat-article-pipeline-skill/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
The skill uses the open Agent Skills format and can be installed into any agent that supports it.
Codex
In Codex App or Codex CLI, paste this prompt and let Codex install the skill:
Please install this Codex skill from GitHub: https://github.com/jhwreal/wechat-article-pipeline-skill . Install the wechat-article-pipeline skill into my local Codex skills directory.
You can also copy the skill directory manually:
mkdir -p ~/.codex/skills rsync -a --exclude=".env" --exclude=".env.lock" --exclude="__pycache__/" --exclude="*.pyc" --exclude=".DS_Store" \ wechat-article-pipeline/ ~/.codex/skills/wechat-article-pipeline/ python3 wechat-article-pipeline/scripts/doctor_wechat_article_skill.py \ --source wechat-article-pipeline \ --installed ~/.codex/skills/wechat-article-pipeline \ --require-installed-sync
Restart or refresh Codex after installing.
Maintain the repository skill as the source of truth: compare the installed copy first, merge valid local changes, then synchronize while preserving local credentials, issue counters, and caches. Record each release in [CHANGELOG.md](CHANGELOG.md), explain problems and validation in commit bodies, and create an annotated tag without moving existing tags. Versioned notes in `docs/releases/<tag>.md` are published to GitHub Releases. See the [v1.9.1 notes](docs/releases/v1.9.1.md) for the fix-to-commit map and rollback guidance.
Claude Code
Copy the skill directory into the personal Claude Code skills directory:
mkdir -p ~/.claude/skills rsync -a --exclude=".env" --exclude=".env.lock" --exclude="__pycache__/" --exclude="*.pyc" --exclude=".DS_Store" \ wechat-article-pipeline/ ~/.claude/skills/wechat-article-pipeline/
You can also place it under a project's `.claude/skills/` directory to scope it to that project. Restart Claude Code, then simply describe the article task to trigger the skill.
Other Agents
Copy `wechat-article-pipeline/` into the agent's skills directory. `agents/openai.yaml` is Codex-specific interface metadata; other agents ignore it.
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
README.md · README · 490 lines
- # WeChat Article Pipeline Skill
- ## 中文
- 这是一个以 Markdown 为唯一内容源的中文长文 Agent Skill,兼容 Codex、Claude Code 以及其他支持 [Agent Skills](https://agentskills.io) 格式的智能体(下文统称 Agent)。它可以从一个选题或方向开始,完成文章正文、配图计划、图片生成和 HTML 工作台打包,并在明确要求时把同一篇终稿同步到微信、今日头条和小红书草稿。
- 可安装的 skill 位于:
- ```text
- wechat-article-pipeline/
- ```
- ## 一、功能特性
- - 面向微信公众号/公众号风格的长文创作流程
- - 支持“秘书模式”:忠实整理用户已经口述出的文章主线,保留原有观点、顺序、例子、语气和节奏,不擅自改写成新的 AI 大纲
- - 支持“检查模式”:用“检查”或“检查一下”检查错别字、核实重要事实、梳理表达结构与主题、判断对象感,并给出按优先级排列的优化建议
- - 支持方法类、分析类、情绪/故事类视觉模式
- - 情绪/故事类内容使用插画逻辑,而不是步骤图或流程图
- - 可根据正文自动规划题图、正文配图和尾图
- - 输出可持续编辑的本地 HTML 工作台,可将修改写回 Markdown、HTML 和发布数据;同一份 Markdown 可切换微信、头条、小红书三种可视化预览,页面只挂载当前预览,并用一个随平台切换的主按钮复制当前格式
- - 复制前显示标题长度、标题层级、图片数量和平台准备状态;头条缺少有效托管回执时回退内嵌原图,原图读取或小红书图片转码失败时会在写入剪贴板前停止
- - 支持无配图排版、只补缺失图片、单张图片重做,以及只修改标题、正文或配图等增量处理路径
- - 可通过微信官方 API 上传正文图片、上传封面素材、创建并验证草稿;中断后可保留进度继续处理,并可在成功创建新草稿后安全递增原创篇号
- - 可通过 Chrome + macOS 系统剪贴板同步今日头条和小红书长文草稿;两者优先复制语义化富文本,头条使用单级大标题,小红书保留两级标题与原始图片位置
- - 支持一次生成文章包后同步三平台草稿:微信使用官方 API,头条和小红书使用已登录 Chrome;统一状态文件支持部分成功后继续,草稿同步不会默认公开发布
- - 只有明确要求时才发送预览;不会自动发布或群发
- ## 二、安装
- 该 skill 使用开放的 Agent Skills 格式,可安装到任何支持该格式的 Agent。
- ### Codex
- 推荐在 Codex App 或 Codex CLI 中直接粘贴下面这段话,让 Codex 帮你安装:
- ```text
- 请从 GitHub 安装这个 Codex skill:https://github.com/jhwreal/wechat-article-pipeline-skill ,安装其中的 wechat-article-pipeline skill 到本机 Codex skills 目录。
- ```
- 也可以手工将 skill 目录复制到 Codex 的 skills 目录:
- ```bash
- mkdir -p ~/.codex/skills
- rsync -a --exclude=".env" --exclude=".env.lock" --exclude="__pycache__/" --exclude="*.pyc" --exclude=".DS_Store" \
- wechat-article-pipeline/ ~/.codex/skills/wechat-article-pipeline/
- python3 wechat-article-pipeline/scripts/doctor_wechat_article_skill.py \
- --source wechat-article-pipeline \
- --installed ~/.codex/skills/wechat-article-pipeline \
- --require-installed-sync
- ```
- 安装后重启或刷新 Codex。
- ### 本地维护与交付约定
- 以仓库中的 `wechat-article-pipeline/` 为唯一源码。更新前比较源码与安装目录,合并安装版独有的有效改动,再运行上述同步与 doctor 检查;不要直接覆盖尚未合并的安装版。同步排除本机 `.env`、账号篇号和缓存,不使用 `--delete` 清理运行目录。
- 每次维护发布都更新 [CHANGELOG.md](CHANGELOG.md),在 commit 正文写明问题、修改及验证结果,并为版本创建带说明的 annotated tag。详细说明保存在 `docs/releases/<tag>.md`,发布工作流会同步到 GitHub Release;已发布 tag 保留不移动。本次记录和回退方法见 [v1.9.7 发布说明](docs/releases/v1.9.7.md)。
- 发布后的说明勘误以新提交记录。当安装包源码与当前版本标签一致时,`main` 的测试通过后会自动同步对应的 Release 说明,不替换标签或安装包;源码变化需要发布新版本。
- 交付规则统一维护在 [delivery.md](wechat-article-pipeline/references/delivery.md):可编辑工作台先给经验证的运行 URL,再给 HTML 文件;静态文件请求直接给文件,不启动服务。服务失败时明确编辑保存未完成。
- ### Claude Code
- 将 skill 目录复制到 Claude Code 的个人 skills 目录:
- ```bash
- mkdir -p ~/.claude/skills
- rsync -a --exclude=".env" --exclude=".env.lock" --exclude="__pycache__/" --exclude="*.pyc" --exclude=".DS_Store" \
- wechat-article-pipeline/ ~/.claude/skills/wechat-article-pipeline/
- ```
- 也可以放进某个项目的 `.claude/skills/` 目录,只在该项目内生效。重启 Claude Code 后,直接描述公众号写作任务即可触发。
- ### 其他 Agent
- 将 `wechat-article-pipeline/` 复制到对应 Agent 的 skills 目录即可。`agents/openai.yaml` 是 Codex 专用的界面元数据,其他 Agent 会自动忽略。
- ## 三、使用方法
- 在 Agent 中说明你要写的公众号文章主题、方向或已有初稿即可。默认流程会生成一套可本地审核和编辑的文章包:
- 1. 先写文章正文
- 2. 根据写好的文章内容生成按角色划分的图片计划
- 3. 直接调用 Agent 可用的图片生成能力(如 Codex 内置图片工具)生成题图、正文配图和尾图
- 4. 将文章打包成可编辑 HTML 工作台,并用相对路径引用独立图片目录;微信和小红书在复制时临时内嵌图片,头条优先使用与当前内容匹配的公众号回执 HTTPS 图片地址,缺失或失效时回退内嵌原图
- 5. 如果你要求导入公众号草稿箱,再使用微信官方 API 创建草稿
- 6. 如果你要求三平台同步,再把同一份已确认终稿分别保存到微信、今日头条和小红书草稿
- ### 文稿来源
- 文稿可以来自两种方式:
- 1. 你先用其他大模型或自己写好初稿,再交给 Agent 使用该 skill 排版、配图和打包。
- 2. 你只给 Agent 一个选题、观点或文章方向,由 Agent 使用该 skill 直接完成初稿。
- 如果已有初稿,可以直接粘贴正文,并说明目标风格、读者、是否需要压缩篇幅。若没有初稿,可以只描述主题,例如“写一篇面向普通读者的公众号文章,解释某个新趋势/方法/产品”。
- ### 秘书模式
- 当你已经通过口述或长段文字给出了文章的核心判断、叙述顺序、例子和表达节奏,可以明确说“打开秘书模式”。该模式只整理你已经说出的文章主线,保留开头、结论、例子顺序、重复锚点、情绪力度和说话习惯,主要修正断句、段落、明显口误、重复口头语和局部衔接。
- 秘书模式不会自行扩大主题,不会补写一套更完整的观点。原素材存在关键缺口时,Agent 会指出缺口或询问,不会替你发明新的主张。
- ### 检查模式
- 在当前文章的对话中说“检查”或“检查一下”,或指定“帮我检查一下这篇文章”,即可进入检查模式。当前稿件明确时直接检查最新稿;用户只要求检查某一项时,按指定范围执行。
- 默认依次完成五项工作:
- 1. **检查错别字**:定位错字、漏字、误用、标点和名称不一致,给出原文与建议改法。
- 2. **核实事实**:优先核对支撑核心结论的重要事实,实际查阅可靠来源、核对时间与数据口径,区分“已核实”“存在错误”“证据不足”“暂时无法核实”,并列出依据和重大风险。
- 3. **梳理表达结构与主题**:判断核心主题是否清楚、段落如何展开、论据能否支撑结论,指出跳跃、重复或偏题的位置。
- 4. **检查对象感**:判断写给谁、回应什么具体问题,以及术语、例子、语气与读者需求是否匹配。
- 5. **给出优化建议**:按“必须修正”“建议优化”“可选润色”排序,提供能落实到原句或段落的修改建议。
- 仅要求检查时,默认输出报告,保留正文。已有文章文件的报告保存为 `files/<slug>.check.md`;重复检查保留旧报告并使用时间戳文件名。只粘贴文字时,也可直接在回复中给完整结果。无法联网或缺少证据时,会明确标注未完成的事实核查。
- 如果同时要求“检查并直接修改”,Agent 会直接落实授权范围内的修改,并同步已有文章包中受影响的资产。完整流程见 [检查模式说明](wechat-article-pipeline/references/article-check.md)。
- ### 配图方式
- 配图也可以来自两种方式:
- 1. 使用其他图片模型先生成图片,再把图片文件交给 Agent 打包进 HTML。
- 2. 由 Agent 根据文章内容自动规划题图、正文配图和尾图,并调用可用的图片生成能力完成配图。
- 默认情况下,该 skill 会先写完文章,再根据正文内容生成图片计划,避免先出图再硬套文章。
- ### 增量处理和快速路径
- 不必每次都重新生成完整文章包。该 skill 会根据你的要求只处理发生变化的部分:
- 1. 如果要求“不配图”“只排版”,只生成正文和工作台,不规划正文图片。
- 2. 如果已有文章只缺少部分图片,只生成缺失的图片,不重做已经完成的素材。
- 3. 如果只对某一张图片不满意,只重新生成并替换对应位置的图片。
- 4. 如果只要求修改标题、正文、排版或配图,只更新对应资产,不重跑无关阶段。
- 5. 如果正文不需要配图但仍要导入公众号草稿箱,可以只准备微信接口必需的封面图,封面不会被插入正文。
- ### 审稿和发布
- 上传或发布时,若用户没有明确跳过检查,且当前稿没有有效的全文或完整语言检查,Agent 会自动检查并在对话里报告结果,不再询问是否开始。无待处理问题或只有可选润色时继续上传;发现已确认错别字、重大事实错误或关键证据缺口时,给出原句、建议及上传状态,按已有修改授权处理,必要时只询问具体取舍。明确跳过仅对本次同篇同版流程有效;改稿后自动重新判断。隐藏计数不影响正文或原创篇号,底层 API 脚本本身不执行编辑检查。
- 除上述检查模式外,还可以通过两种方式人工审稿:
- 1. 输出 HTML 工作台。通过 Agent 启动的本地工作台地址打开后,可以继续修改 Markdown,并将最新内容写回 HTML、源 Markdown、任务数据和已配置的发布清单;输入内容会先保存到浏览器缓存,停止编辑后自动写入,也可以点击“保存”立即写入。顶部平台下拉框默认显示微信格式,也可切换头条和小红书格式;唯一复制按钮、复制前检查和右侧预览会同步切换。三种格式共享同一份 Markdown,只挂载当前预览,语义解析结果复用,图片只在复制时转码。完全相同的保存不会重复写盘。直接打开独立 HTML 时为预览/复制只读模式,工作台会明确提示改用本地服务地址。
- 2. 在已绑定公众号凭据的情况下,让 Agent 调用微信官方 API 直接创建公众号草稿,然后到公众号草稿箱里检查。
- 该 skill 默认只负责创建草稿和可选发送预览,不会自动群发或公开发布。微信只使用官方 API;今日头条和小红书复用已登录 Chrome,并通过各自专用的富文本复制路径同步正文、图片和标题结构。
- ## 四、直接导入公众号草稿箱
- 只有当用户明确要求“导入公众号草稿箱”“创建微信草稿”“推送到草稿箱”等操作时,才执行这一阶段。该阶段只使用微信官方 API,不使用 `mp.weixin.qq.com` 私有后台接口,也不会调用发布/群发 API。
- ### 绑定公众号
- 先进入微信开发者平台:
- ```text
- https://developers.weixin.qq.com/platform
- ```
- 在平台里找到公众号相关设置,完成三件事:
- 1. 获取公众号的 `AppID`
- 2. 生成或查看 `AppSecret`
- 3. 将本机公网 IP 加入接口调用白名单
- 本机公网 IP 可以通过常见的“查询本机 IP”网站查看。白名单里要填写的是公网出口 IP,不一定是局域网里的 `192.168.x.x` 或 `10.x.x.x` 地址。如果网络环境变化,例如切换公司、家里、热点或 VPN,公网 IP 可能也会变化,需要重新加入白名单。
- 拿到 `AppID` 和 `AppSecret` 后,把这两个值告诉 Agent,并说明公众号名称。Agent 会在本机生成本地配置文件;这个文件只保存在本机,不应提交到 GitHub,也不要贴到公开聊天或文档里。
- 如果只绑定一个公众号,后续导入草稿时通常不需要再指定公众号名称。如果绑定了多个公众号,导入草稿前需要告诉 Agent 要导入到哪一个公众号。
- 正文题图下方的“某某的第 N 篇原创”使用独立字段:默认账号为 `WECHAT_SIGNATURE_AUTHOR` / `WECHAT_ORIGINAL_ISSUE`,命名账号为 `WECHAT_ACCOUNT_<ALIAS>_SIGNATURE_AUTHOR` / `WECHAT_ACCOUNT_<ALIAS>_ORIGINAL_ISSUE`。它和草稿箱 API 使用的 `WECHAT_AUTHOR` 不是同一个字段。正常创建一篇全新草稿时,可以在草稿创建成功后安全递增原创篇号;重新创建或修复旧稿时可以不递增,避免错误占用新篇号。
- 命名账号的 `<ALIAS>` 建议只使用大写英文、数字和下划线,并避免以 `_SIGNATURE`、`_ORIGINAL`、`_PREVIEW` 结尾;这些后缀和 `AUTHOR`、`ISSUE`、`ACCOUNT` 等字段组合后会形成保留字段名。公众号展示名请放在 `WECHAT_ACCOUNT_<ALIAS>_NAME`。
- 导出草稿箱的正文 HTML 使用 paragraph-only 结构:标题、署名条、图片、引用、列表和黑色代码块都落成连续 `<p>`,不再用 `section` / `div` / `blockquote` / `pre` / `ul` / `ol` 包裹,避免微信编辑器在这些块前后生成多余空行。黑色代码块只保留代码块内部留白。
- 导入草稿时,Agent 会完成:
- 1. 从 `.env` 读取所选公众号的 AppID/AppSecret
- 2. 获取或复用该公众号专属的 stable access token 缓存
- 3. 查询公众号草稿箱开关
- 4. 上传正文内嵌图片到微信正文图片接口
- 5. 上传封面图到永久素材接口
- 6. 调用草稿箱接口创建草稿
- 7. 可选调用 `draft/get` 验证草稿标题和条目数
- 草稿导入会把关键步骤和远端返回结果写入本地结果文件。如果草稿已经创建,但后续验证、预览或原创篇号更新失败,可以从已保存的结果继续完成剩余步骤,避免重新上传素材或重复创建草稿。对于无法确认微信端是否已经成功执行的中断,流程会停止并明确提示,而不会贸然再创建一份草稿。
- 发送预览需要额外明确要求,并传入 `--send-preview` 及预览账号参数。正式发布/群发不属于默认自动化范围。
- ## 五、仓库结构
- ```text
- .
- ├── README.md
- ├── CHANGELOG.md
- ├── docs/releases/
- ├── evals/
- ├── LICENSE
- ├── examples/
- │ ├── assets/
- │ ├── method-article.md
- │ ├── emotion-article.md
- │ ├── method-article.html
- │ ├── emotion-article.html
- │ ├── method-article.clipboard-assets.js
- │ └── emotion-article.clipboard-assets.js
- └── wechat-article-pipeline/
- ├── .env.example
- ├── SKILL.md
- ├── agents/openai.yaml
- ├── assets/templates/
- ├── references/
- └── scripts/
- ```
- ## 六、说明
- - 使用 Codex 时,内置图片工具通常会把生成图片保存到 `$CODEX_HOME/generated_images`,打包前请将选中的图片复制到项目的图片目录;使用其他 Agent 时,请让图片生成工具直接把结果保存到项目的图片目录。
- - 打包脚本会校验生成的 HTML 没有未解析的 `{{visual:*}}` 占位符,并确认工作台里的图片引用已经落成相对路径;微信和小红书复制时临时内嵌图片,头条优先使用有效回执中的 HTTPS 托管图片,否则内嵌原图;三者都从版本化平台适配器和语义 DOM 生成富文本且不会污染左侧 Markdown。本地 Base64 侧车不会在打开页面时常驻内存。
- - 非 macOS 环境运行图片打包/发布流程前请安装 Pillow;macOS 对部分封面裁剪预览可使用系统 `sips`,但 Pillow 仍建议用于发布前正文图片压缩。
- - CI 会在 Ubuntu 和 macOS 上运行 Python/Node 测试、Skill 结构与版本校验、性能行为检查、完整“图片规划 + 工作台打包 + 发布清单 + API dry-run”冒烟测试,并在测试通过后验证安装包与源码一致。
- - 工作台 HTTP 入口、文章事务模型和 Markdown 解析分别维护在 `serve_wechat_workbench.py`、`workbench_document.py`、`assets/workbench-markdown.js`;解析模块打包时内嵌,仍交付单文件 HTML。检查模式的人工行为验收素材见 [evals](evals/README.md),不计入自动测试通过数。
- - `.env`、token cache、生成的文章包和图片都不应提交到 GitHub。
- ## 七、版本说明
- - `V 1.9.7(当前版本)`:修复仅改配图配置后重新打包仍误报保存冲突的问题,区分版本冲突与服务断开,保留外部改稿保护。详见 [发布说明](docs/releases/v1.9.7.md)。
- - `V 1.9.6`:微信复制从题图开始,排除文章总标题,保留原创篇号和正文小标题;预览与源稿仍保留标题。详见 [发布说明](docs/releases/v1.9.6.md)。
- - `V 1.9.5`:写稿时主动挑选少量核心金句,交付和完整检查时复核质量与密度;缺少合适金句时提供结构和候选句建议,常规打包保留选定标记。详见 [发布说明](docs/releases/v1.9.5.md)。
- - `V 1.9.4`:修复外部改稿被旧工作台覆盖、旧正文回执误指向新版、命名账号缺凭据时误用默认账号三类问题,补齐回归测试;纳入表格换行和头条定时流程的已有维护。详见 [发布说明](docs/releases/v1.9.4.md)。
- - `V 1.9.3`:上传前缺少有效检查时自动检查,直接反馈结果,无待决定问题就继续;保留明确跳过与改稿授权边界。详见 [发布说明](docs/releases/v1.9.3.md)。
- - `V 1.9.2`:修复 Markdown 转义标点的预览与公众号导出,保护行内代码的字面内容。详见 [发布说明](docs/releases/v1.9.2.md)。
- - `V 1.9.1`:修复审核发现的 9 类问题,包括串篇保存、旧缓存覆盖、账号 token 混用、列表内容丢失、旧图片回执与旧发布清单、跨平台状态、篇号复用和特殊标题;拆分工作台模块,补齐检查报告版本信息及可追溯的发布记录。详见 [更新记录](CHANGELOG.md) 和 [本次发布说明](docs/releases/v1.9.1.md)。
- - `V 1.9.0`:新增由“检查”或“检查一下”触发的检查模式,覆盖错别字、事实核查、表达结构与主题、对象感及优化建议;提供带来源和核查边界的独立报告,并支持明确要求后的直接改稿。
- - `V 1.7.2`:优化跨平台图片复制与预览插图,保留 GIF 原图;统一交付与安全同步规则,调整同步三角为 26px。
- - `V 1.7.1`:工作台新增右侧预览与 Markdown 的双向行定位、软换行行高测量和 `▶` 同步标记,避免程序滚动反向抢夺编辑焦点;Skill 文案改为兼容 Codex、Claude Code 等 Agent Skills 运行时,并补充无生图能力时的明确降级路径。
- - `V 1.7.0`:工作台支持在右侧微信预览中点击段落之间直接粘贴图片,自动把图片保存到文章目录并写回 Markdown;Skill 的界面显示名与调用名统一为 `wechat-article-pipeline`,并汇总 1.6.0 之后的草稿修订、发布确认、表格保留和白名单错误处理修复。
- - `V 1.6.1`:同一 Codex 会话重复发送同一文章 slug 时可标记为修改稿,沿用首次草稿的原创篇号,并只在第一次成功创建草稿后递增系统计数。
- - `V 1.6.0`:正式支持小红书长文与微信、头条、小红书三平台一稿同步;新增统一当前平台复制、复制前检查、版本化平台适配器、可恢复三平台结果、构建诊断、相同快照免写盘和本地安全头,并通过单预览挂载、语义缓存、逐帧合并渲染、滚动布局缓存、懒加载 Base64 与按需图片转码降低浏览器开销。
- - `V 1.5.0`:新增今日头条 Chrome 草稿与发布流程;强化工作台事务恢复和路径边界,发布清单改为显式生成,收紧图片任务/草稿校验,并补齐完整 CI 冒烟测试与安装元数据。
- - `V 1.1.0`:增加接入多个公众号的能力。
- - `V 1.0.0`:支持调用微信官方 API,直接导入微信公众号草稿箱。
- - `V 0.5.0`:支持将文稿和配图打包成可编辑 HTML,需手工复制到微信公众号后台。
- ---
- ## English
- This Agent Skill uses Markdown as the sole source for Chinese long-form content. It is compatible with Codex, Claude Code, and any other agent that supports the open [Agent Skills](https://agentskills.io) format (referred to as "the agent" below). Starting from a topic or direction, it can write the article, plan and generate visuals, package an editable HTML workbench, and, when explicitly requested, synchronize the approved article to WeChat, Toutiao, and Xiaohongshu drafts.
- The installable skill lives in:
- ```text
- wechat-article-pipeline/
- ```
- ## 1. Features
- - WeChat/official-account style long-form article workflow
- - Secretary Mode for faithfully organizing an already-spoken article mainline while preserving the user's judgments, order, examples, voice, and cadence instead of replacing them with a new AI outline
- - Check Mode triggered by “检查” or “检查一下” in article context: typo review, fact verification, structure and theme, audience fit, and prioritized improvements
- - Method, analysis, and emotional/story visual modes
- - Emotional/story content uses illustration logic instead of step diagrams
- - Automatic cover/body/closing image planning based on the finished article
- - Persistent local HTML workbench editing that can write changes back to Markdown, HTML, and publishing data, with lazy switchable WeChat, Toutiao, and Xiaohongshu previews plus one context-aware copy action
- - Pre-copy checks for title length, heading structure, image counts, and platform readiness, with hard stops before incomplete rich HTML reaches the clipboard
- - Incremental paths for no-image formatting, missing-image repair, single-image regeneration, and title/body/layout/image-only changes
- - Official API workflow for image upload, draft creation, and verification, with recoverable interrupted runs and safe original-issue increment after a new draft succeeds
- - Chrome + macOS system-clipboard draft delivery for Toutiao and Xiaohongshu long-form content, including platform-specific heading normalization
- - Resumable one-request three-platform draft sync: official API for WeChat, authenticated Chrome UI for Toutiao and Xiaohongshu; draft sync never implies public publishing
- - Preview is sent only when explicitly requested; publishing and mass sending are never automatic
- ## 2. Install
- The skill uses the open Agent Skills format and can be installed into any agent that supports it.
- ### Codex
- In Codex App or Codex CLI, paste this prompt and let Codex install the skill:
- ```text
- Please install this Codex skill from GitHub: https://github.com/jhwreal/wechat-article-pipeline-skill . Install the wechat-article-pipeline skill into my local Codex skills directory.
- ```
- You can also copy the skill directory manually:
- ```bash
- mkdir -p ~/.codex/skills
- rsync -a --exclude=".env" --exclude=".env.lock" --exclude="__pycache__/" --exclude="*.pyc" --exclude=".DS_Store" \
- wechat-article-pipeline/ ~/.codex/skills/wechat-article-pipeline/
- python3 wechat-article-pipeline/scripts/doctor_wechat_article_skill.py \
- --source wechat-article-pipeline \
- --installed ~/.codex/skills/wechat-article-pipeline \
- --require-installed-sync
- ```
- Restart or refresh Codex after installing.
- Maintain the repository skill as the source of truth: compare the installed copy first, merge valid local changes, then synchronize while preserving local credentials, issue counters, and caches. Record each release in [CHANGELOG.md](CHANGELOG.md), explain problems and validation in commit bodies, and create an annotated tag without moving existing tags. Versioned notes in `docs/releases/<tag>.md` are published to GitHub Releases. See the [v1.9.1 notes](docs/releases/v1.9.1.md) for the fix-to-commit map and rollback guidance.
- ### Claude Code
- Copy the skill directory into the personal Claude Code skills directory:
- ```bash
- mkdir -p ~/.claude/skills
- rsync -a --exclude=".env" --exclude=".env.lock" --exclude="__pycache__/" --exclude="*.pyc" --exclude=".DS_Store" \
- wechat-article-pipeline/ ~/.claude/skills/wechat-article-pipeline/
- ```
- You can also place it under a project's `.claude/skills/` directory to scope it to that project. Restart Claude Code, then simply describe the article task to trigger the skill.
- ### Other Agents
- Copy `wechat-article-pipeline/` into the agent's skills directory. `agents/openai.yaml` is Codex-specific interface metadata; other agents ignore it.
- ## 3. Usage
- Describe to the agent the WeChat Official Account article topic, direction, or draft you already have. By default, the skill produces a local package for review and editing:
- 1. Write the article first
- 2. Derive a role-based visual plan from the finished article
- 3. Generate cover/body/closing images directly with the agent's available image generation capability (for example Codex's built-in image tool)
- 4. Package the article into an editable HTML workbench that references the separate image folder; WeChat and Xiaohongshu embed image data only during copy, while Toutiao prefers hosted HTTPS URLs from a receipt matching the current article and falls back to embedded originals when no valid mapping is available
- 5. If you ask to import it into WeChat, create a draft through the official WeChat API
- 6. If you ask for three-platform sync, save the same approved final article as drafts in WeChat, Toutiao, and Xiaohongshu
- ### Article Source
- The article can start in either of two ways:
- 1. Write or draft it elsewhere first, then ask the agent to use this skill for editing, image planning, and packaging.
- 2. Give the agent only a topic, point of view, or direction, and let it draft the article with this skill.
- If you already have a draft, paste the text and describe the target style, audience, and whether it should be shortened. If you do not have a draft, describe the topic directly.
- ### Secretary Mode
- If you have already supplied the article's main judgment, narrative order, examples, and speaking rhythm through dictation or a long rough passage, explicitly say `打开秘书模式` (Open Secretary Mode). The mode organizes what you already said while preserving the opening, conclusion, example order, repeated anchors, emotional pressure, and speaking cadence. It mainly fixes sentence breaks, paragraphs, obvious slips, duplicated filler, and local transitions.
- Secretary Mode does not broaden the thesis, invent a more complete argument, add a balancing framework, or replace your structure with a report-like AI outline. If the source has a material gap, the agent identifies or asks about it instead of inventing a new claim.
- ### Check Mode
- Say “检查” or “检查一下” while working on an article, or identify the article to check. The agent uses the latest available draft when the target is clear and respects requests limited to a single check.
- The default review covers five steps:
- 1. **Typos and wording accuracy:** locate spelling, omission, punctuation, and naming errors, with suggested corrections.
- 2. **Fact verification:** inspect reliable sources for claims supporting the main argument, check dates and data definitions, and distinguish verified facts, errors, insufficient evidence, and claims that cannot currently be verified.
- 3. **Structure and theme:** assess the central claim, progression, supporting evidence, repetition, gaps, and digressions.
- 4. **Audience fit:** identify the intended reader and their needs, then assess explanations, examples, tone, and practical relevance.
- 5. **Prioritized improvements:** give actionable sentence or paragraph changes, ordered as required corrections, recommended improvements, and optional polish.
- A check-only request produces a report and preserves the article. Existing article files receive `files/<slug>.check.md`; repeated checks keep earlier reports and use timestamped filenames. Pasted text can receive a complete review in the response. Fact-checking limitations and evidence links remain explicit in the report.
- When the user also asks to apply changes, the agent edits within that scope and synchronizes affected assets in an existing package. See [Check Mode](wechat-article-pipeline/references/article-check.md) for the full procedure.
- ### Images
- Images can also come from either of two ways:
- 1. Generate images with another image model first, then give the files to the agent for packaging.
- 2. Let the agent plan and generate the cover image, in-body images, and closing image from the article content.
- By default, the skill writes the article first and plans images from the finished content, so the visuals match the article rather than forcing the article around pre-made images.
- ### Incremental And Fast Paths
- You do not need to rebuild the complete article package for every change. The skill can limit work to the affected layer:
- 1. For “no images” or “format only,” produce the article and workbench without planning body images.
- 2. If an existing article is missing only some images, generate only those missing assets.
- 3. If one image is unsatisfactory, regenerate and replace only that slot.
- 4. For a title-, body-, layout-, or image-only request, update the corresponding assets without rerunning unrelated stages.
- 5. For draft delivery without body images, provide only the cover required by the WeChat API and keep it out of the article body.
- ### Review And Publishing
- Unless the user explicitly skips checking for this delivery, an unchecked current draft is reviewed automatically before upload or publishing. Findings appear in the conversation. Delivery continues when no content decision remains; confirmed typos, material factual errors, or critical evidence gaps receive concrete corrections and a clear upload status. Apply changes only within existing authorization, and ask about specific unresolved choices instead of asking whether to start checking. Optional polish does not block delivery.
- In addition to Check Mode, there are two paths for manual review:
- 1. Output an editable HTML workbench. When opened through the local workbench URL started by the agent, Markdown edits can be written back to the HTML, source Markdown, job data, and any configured publishing manifest. Input is cached immediately, saved to project files after editing pauses, and can also be persisted with Save. The platform selector drives the preview, readiness summary, and one current-format copy button. Identical snapshots skip disk writes. Opening the standalone HTML directly is preview/copy-only; it locks editing and points back to the loopback service URL. Only the active platform preview is mounted; semantic parsing is reused and image data is embedded only during the relevant copy action.
- 2. After binding Official Account credentials, ask the agent to create a WeChat draft through the official API, then review it in the WeChat draft box.
- The skill creates drafts and can optionally send previews. It does not automatically publish or mass-send.
- ## 4. Direct WeChat Draft Import
- Run this stage only when the user explicitly asks to import/create/push a WeChat Official Account draft. This workflow uses only official WeChat APIs. It does not use private `mp.weixin.qq.com` backend APIs and never calls publish or mass-send APIs.
- ### Bind An Official Account
- Open the WeChat developer platform:
- ```text
- https://developers.weixin.qq.com/platform
- ```
- Find the Official Account settings and complete three steps:
- 1. Get the Official Account `AppID`
- 2. Generate or view the `AppSecret`
- 3. Add this computer's public IP address to the API whitelist
- You can find the public IP with any common "what is my IP" website. The whitelist needs the public outbound IP, not necessarily a local `192.168.x.x` or `10.x.x.x` address. If you switch networks, such as office, home, mobile hotspot, or VPN, the public IP may change and must be added again.
- After you have the `AppID` and `AppSecret`, give them to the agent and include the Official Account name. The agent will create a local config file on this machine. Keep that file local; do not commit it to GitHub or paste it into public chats or documents.
- If only one Official Account is bound, future draft imports usually do not need an account name. If multiple accounts are bound, tell the agent which Official Account to use before importing a draft.
- The visible "author's Nth original article" label below the cover image uses separate fields: `WECHAT_SIGNATURE_AUTHOR` / `WECHAT_ORIGINAL_ISSUE` for the default account, or `WECHAT_ACCOUNT_<ALIAS>_SIGNATURE_AUTHOR` / `WECHAT_ACCOUNT_<ALIAS>_ORIGINAL_ISSUE` for named accounts. It is separate from `WECHAT_AUTHOR`, which is only for the draft API author field. For a normal new article, the issue number can be advanced safely after draft creation succeeds; recreating or repairing an older draft can leave the counter unchanged so it does not consume a new issue number.
- For named accounts, keep `<ALIAS>` to uppercase ASCII letters, numbers, and underscores, and avoid aliases ending in `_SIGNATURE`, `_ORIGINAL`, or `_PREVIEW`; those suffixes combine with field names such as `AUTHOR`, `ISSUE`, and `ACCOUNT` into reserved keys. Store the public display name in `WECHAT_ACCOUNT_<ALIAS>_NAME`.
- Draft-box HTML uses a paragraph-only structure: headings, the signature badge, images, quotes, lists, and black code blocks are emitted as consecutive `<p>` blocks instead of `section` / `div` / `blockquote` / `pre` / `ul` / `ol`, avoiding extra blank editable lines in the WeChat editor. Black code blocks keep only internal padding.
- When importing a draft, the agent will:
- 1. Read the selected account credentials from `.env`
- 2. Fetch or reuse an account-specific stable access token
- 3. Check the draft-box switch
- 4. Upload embedded body images to the WeChat body-image API
- 5. Upload the cover image as permanent material
- 6. Create the draft through the draft-box API
- 7. Optionally verify the created draft with `draft/get`
- Draft delivery records important steps and remote results in a local result file. If the draft was created but a later verification, preview, or issue-number update fails, the remaining work can continue from the saved result instead of uploading assets again or creating another draft. If an interruption leaves the remote outcome unknowable, the workflow stops and reports the uncertainty rather than risking a duplicate draft.
- Preview sending requires a separate explicit request plus `--send-preview` and preview-account parameters. Final publishing and mass sending are out of scope by default.
- ## 5. Repository Layout
- ```text
- .
- ├── README.md
- ├── LICENSE
- ├── examples/
- │ ├── assets/
- │ ├── method-article.md
- │ ├── emotion-article.md
- │ ├── method-article.html
- │ ├── emotion-article.html
- │ ├── method-article.clipboard-assets.js
- │ └── emotion-article.clipboard-assets.js
- └── wechat-article-pipeline/
- ├── .env.example
- ├── SKILL.md
- ├── agents/openai.yaml
- ├── assets/templates/
- ├── references/
- └── scripts/
- ```
- ## 6. Notes
- - When running under Codex, the built-in image tool normally saves generated files under `$CODEX_HOME/generated_images`; copy accepted images into the project image directory before packaging. Under other agents, have the image generation tool save results directly into the project image directory.
- - The packager validates that generated HTML has no unresolved `{{visual:*}}` placeholders and that workbench image references have been resolved to relative paths. WeChat and Xiaohongshu embed images during copy, while Toutiao prefers valid hosted HTTPS images and otherwise embeds originals; all three derive semantic rich HTML from versioned adapters without changing the editable Markdown. The local Base64 sidecar is lazy and released after copying.
- - Install Pillow before running image packaging/publishing workflows on non-macOS systems. macOS can use the built-in `sips` fallback for some cover-crop previews, but Pillow is still recommended for pre-upload body-image compression.
- - CI runs Python and Node tests on Ubuntu and macOS, validates release metadata and the installable skill, executes the full image-plan + package + manifest + API dry-run smoke path, checks performance behavior, and verifies that the distributable archive matches the source skill.
- - `.env`, token cache files, generated article packages, and generated images should not be committed to GitHub.
- ## 7. Release Notes
- - `V 1.9.7 (current version)`: Fix false save conflicts after image-metadata-only rebuilds, distinguish version conflicts from disconnected services, and preserve external-edit protection. See [release notes](docs/releases/v1.9.7.md).
- - `V 1.9.6`: WeChat copy starts at the cover and excludes the article title while preserving the signature and body headings. Preview and source keep the title. See [release notes](docs/releases/v1.9.6.md).
- - `V 1.9.5`: Select sparse pull quotes while drafting, review their quality and density before delivery, and suggest structural improvements and candidate sentences when none is suitable. Normal packaging preserves editorial choices. See [release notes](docs/releases/v1.9.5.md).
- - `V 1.9.4`: Protect external source edits from stale workbench saves, bind publishing receipts to the submitted revision, and prevent named accounts from inheriting legacy credentials. Includes regression coverage and the existing table-wrapping and Toutiao scheduling maintenance. See [release notes](docs/releases/v1.9.4.md).
- - `V 1.9.3`: Automatically review unchecked drafts before delivery, report findings, and continue when no content decision remains. Explicit skips and editing permissions are preserved. See [release notes](docs/releases/v1.9.3.md).
- - `V 1.9.2`: Fixed escaped Markdown punctuation in previews and WeChat exports; preserved inline code literals. See [release notes](docs/releases/v1.9.2.md).
- - `V 1.9.1`: Fixed nine audited issue groups covering article identity, stale saves, account-bound tokens, list content, image receipts, publishing manifests, delivery state, issue reuse, and literal titles. Split workbench modules and added report version metadata and traceable release records. See the [changelog](CHANGELOG.md) and [release notes](docs/releases/v1.9.1.md).
- - `V 1.9.0`: Added Check Mode triggered by “检查” or “检查一下”, covering typos, fact verification, structure and theme, audience fit, and prioritized improvements; reports preserve evidence and verification limits, with direct editing when requested.
- - `V 1.7.2`: Improved cross-platform image copying and preview insertion, preserved original GIF assets, unified delivery and safe synchronization guidance, and resized the synchronization marker to 26px.
- - `V 1.7.1`: Added bidirectional line navigation between the preview and Markdown editor, wrapped-line height measurement, and a `▶` synchronization marker while preventing programmatic scrolling from stealing editing focus; generalized the skill for Codex, Claude Code, and other Agent Skills runtimes, with an explicit no-image fallback when generation is unavailable.
- - `V 1.7.0`: Added direct image pasting between blocks in the WeChat preview, with automatic asset storage and Markdown insertion; aligned the UI display name with `wechat-article-pipeline`, and rolled up post-1.6.0 fixes for draft revisions, publish confirmation, table preservation, and IP-allowlist failures.
- - `V 1.6.1`: Added same-conversation article revision semantics: repeated drafts for the same article slug reuse the first draft's original-issue number, while the system counter advances only after the first successful draft.
- - `V 1.6.0`: Officially added Xiaohongshu long-form delivery and resumable one-source WeChat/Toutiao/Xiaohongshu draft sync; added one current-platform copy action, pre-copy readiness checks, versioned adapters, build diagnostics, no-op saves, local security headers, and lower browser overhead through a single mounted preview, semantic caching, frame-coalesced rendering, cached scroll layout, lazy Base64, and on-demand image conversion.
- - `V 1.5.0`: Added the Chrome-based Toutiao draft and publishing workflow; hardened workbench recovery and path boundaries, made publish manifests opt-in, tightened image-job/draft validation, and added full CI smoke coverage plus install metadata.
- - `V 1.1.0`: Added support for connecting multiple WeChat Official Accounts.
- - `V 1.0.0`: Added official WeChat API import for creating Official Account drafts directly.
- - `V 0.5.0`: Supported packaging article text and images into editable HTML for manual copy-paste into WeChat.
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.