Wechat publish

From vorojar/AgentClaw · View interactive version

Wechat publish is an AI agent skill from the GitHub repository vorojar/AgentClaw. Markdown 转微信公众号排版并发布草稿。Use this whenever the user asks to convert Markdown to WeChat Official Account HTML, inspect publish readiness, preview local WeChat layout, or create a WeChat draft. 不用于:写文章内容、其他平台发布。

How to use this skill

Skill file

wechat-publish

将 Markdown 转成微信公众号兼容 HTML,可预览或创建草稿箱草稿。所有常规操作只走统一入口:

cd D:/mycode/agentclaw && python skills/wechat-publish/scripts/wechat_publish.py capabilities --json
cd D:/mycode/agentclaw && python skills/wechat-publish/scripts/wechat_publish.py inspect {INPUT_MD} --json
cd D:/mycode/agentclaw && python skills/wechat-publish/scripts/wechat_publish.py publish {INPUT_MD} --title "封面标题" --subtitle "封面副标题" --scheme dark --author "爬爬虾" --out-dir {WORKDIR} --json

离线验收或调试时使用 --dry-run,不会创建真实草稿:

cd D:/mycode/agentclaw && python skills/wechat-publish/scripts/wechat_publish.py publish {INPUT_MD} --title "封面标题" --subtitle "封面副标题" --out-dir {WORKDIR} --dry-run --json

执行规则

禁止事项

显式预览

只有用户要求“预览、查看效果、不要发布”时才运行:

cd D:/mycode/agentclaw && python skills/wechat-publish/scripts/wechat_publish.py preview {INPUT_MD} --out-dir {WORKDIR} --json

常用参数

微信限制自动处理

脚本自动处理:

  1. 外链转脚注,避免微信外链限制。
  2. 列表改成 <section> flex 布局,避免原生列表在微信编辑器里失真。
  3. CJK 和 Latin 字符间插入空格。
  4. 代码块使用 white-space: pre-wrap 防止横向溢出。
  5. 输出 100% 内联 CSS,避免微信剥离 <style>。
  6. 正文自动移除 Markdown 第一个 H1,避免和草稿标题重复。
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.