Home / All Skills / Docs & Knowledge / wjs-publishing-wechat
Docs & Knowledge · jianshuo/jianshuo-wechat-mp-publish

wjs-publishing-wechat

Formats, optimizes, and publishes long-form articles to WeChat Official Accounts (Weixin/WJS) with elegant mobile typography, branded CSS cards, callouts, and clean cross-platform image hosting.

L4 High-Privilege · Graded auth & full auditV1 Commit-PinnedDual-pass Audit
💬 Chat Trial
Author jianshuoGitHub jianshuo/jianshuo-wechat-mp-publish ↗Stars 30License MITCommit d7a94266f8
Control levels describe skill capabilities and suggested control measures; they do not represent quality or safety certifications, nor do they dictate usability. Usage decisions rest entirely with users and administrators. Different agent hosts apply varying constraints; do not assume hosts provide automatic protection. Third-party skill copyrights belong to their original authors. Use at your own risk.

1How It Works & Mechanism

WeChat-compliant inline HTML/CSS formatting optimized for mobile screens.

SKILL.md
**保留作者的语气和节奏。** 你只做四件事: 1. 修明显错字和重复字 2. 调整段落(每段 1–3 句) 3. 抚平特别拗口的句子(保守,能不动就不动) 4. 准备配套素材(题图、标题候选、摘要) **不要做**:改用词偏好;加 AI 味连接词("首先 / 其次 / 综上所述 / 值得注意的是");把口语改书面;加 emoji;重组段落顺序;"提升"作者表达。 **改动尺度**:改的字数超过原文 5% 就是改太多了,退回去。
Bypasses rich text paste quirks.

Curated typography palettes with branded headers, callout boxes, and blockquotes.

SKILL.md
### Step 4: 配图(每篇两张,自动生成不问用户) - **题图 cover.png** — **严格 2.35:1**(900×383),强字体、强构图、文字主导 - **解释图 illustration.png** — **比例由内容决定**(模型自选),扁平卡通、有标签和流程 ```bash ~/.claude/skills/wjs-publishing-wechat/scripts/gen-cover-ai.sh <article-folder> ["目标字词"] ~/.claude/skills/wjs-publishing-wechat/scripts/gen-illustration.sh <article-folder> ```
Editorial polish.

Automated headline score auditing for viral click-through and curiosity appeal.

SKILL.md
中英之间留空格——「用 AI 写 skill」。`upload-draft.sh` 自动跑 `scripts/pangu.py`,Claude 不用手动。
Readership optimization.

QR code, author signature, and interactive footer card layouts.

SKILL.md
`upload-draft.sh` 把 `**...**` 渲染成**红色粗体**——作者刻意要的视觉重点。**每篇正文都必须有合理加粗,一处都没有 = 没写完。**
Engagement conversion.

解释图引用安全网:当本地目录生成了 illustration.png 但 Markdown 正文未显式引用时,发布脚本会在正文收束或后注前自动插入图片引用语法,保证图片必上微信 CDN 并展示。

SKILL.md
> 安全网:`illustration.png` 存在但 `article.md` 没引用时,`upload-draft.sh` 自动插入并改写,幂等。
这里在做什么:在 upload-draft.sh 脚本内设立防御性兜底机制,自动解析 AST/正文位置回写 markdown,防止生成图片在推送到草稿箱后静默丢失。

一键草稿发布与原地更新闭环:通过 md2wechat 工具链上传素材、构建草稿数据体,并支持读取现有 draft_media_id 通过微信 API 进行草稿原地覆盖更新,最终自动唤起系统浏览器打开草稿箱。

SKILL.md
1. 跑 `pangu.py` 加盘古之白 2. `md2wechat upload_image cover.png` → 拿 `thumb_media_id` 3. `illustration.png` 存在但没引用时自动插入并 upload 拿 CDN URL(幂等安全网) 4. 从 `article.md` 生成 `content.html`(转换规则见下) 5. 装 `draft.json`,调 `create_draft` 或(`publish.json` 有 `draft_media_id` 时)`draft/update` 原地更新 6. macOS / Linux 自动打开 `mp.weixin.qq.com` 草稿箱 7. 自动 `git add / commit / push` 文章目录到 origin
这里在做什么:将图片素材 CDN 化、HTML 转换、公众号草稿接口交互(创建或版本更新)以及本地 Git 备份归档整合成全自动流水线。

多渠道读者留言拉取与管理:提供官方 API、抓包 Cookie 和持久化浏览器三种途径获取已发布文章的读者评论,支持将留言格式化导出为 Markdown 或 JSON。

README.md
├── update-draft-via-api.py # 草稿原地更新 └── … # 留言抓取 / 群发等辅助脚本
这里在做什么:自带留言抓取脚本群,应对公众号个人订阅号 API 权限调整,提供 Cookie 模拟与 Chromium 浏览器无头注入抓取方案。

2Core Capabilities

01WeChat Official Accounts mobile typography formatting
02Curated CSS cards, headers, and callout components
03Viral headline evaluation and hook enhancement
04Branded footer and subscriber engagement layouts
05排版自动化处理:盘古之白与重点标红
06本地图片全量上云与正文引用安全校验
07微信公众号草稿一键直推与原地版本更新

3External Dependencies

KindDependency / Endpoint
climd2wechat
packagegpt-image-2-skill
clisips

4Recommended Governance & Evidence

Suggested Controls for Safe Operation
For Agent Runtime
Can be auto-loaded
For Administrators
Register source and version
Audit Notes: HTML formatting guidelines and templates; zero host privileges required.

5Second-Pass Verification

  • [ok] 题图与解释图自动生成脚本的执行链路与尺寸规范复核 — 复核 scripts/gen-cover-ai.sh 与 scripts/gen-illustration.sh:前者通过 Python 替换模板目标字词后传给 codex 并在产出后用 sips 强制裁切至 900x383(2.35:1);后者将文章内容灌入 instructions,保留模型自适应比例,仅等比例重采样至 1024 宽,无强制裁切,代码与文档说明严格吻合。
  • [ok] 草稿原地更新功能(draft/update)与鉴权依赖复核 — 复核 scripts/update-draft-via-api.py 与 scripts/upload-draft.sh:当 publish.json 中已存在 draft_media_id 时,脚本优先走 update-draft-via-api.py 读环境变量 WECHAT_APPID 与 WECHAT_SECRET 换取 access_token 并向官方接口发 POST 请求进行原地更新;若接口返回 40007 等失效码时平滑回退至 md2wechat create_draft,逻辑完备闭环。
  • [ok] 盘古之白(中英文间距处理)实现与保护规则复核 — 复核 scripts/pangu.py:采用正则识别汉字与含字母英文块边界,内建 _protect 与 _restore 闭包函数对 ``` 代码块、`行内代码`、Markdown 链接/图片 URL 及裸 HTTP(S) 地址实施空字节占位保护,确保空格处理幂等且绝不破坏语法标记。
  • [ok] 正文红字与段落空行转微信 HTML 机制复核 — 复核 scripts/upload-draft.sh 中的 Python 嵌入块:识别 **text** 转换为带内联样式的 <strong style="color:#ff0000;">;同时为解决微信编辑器段间距塌陷问题,顶层块之间以 <p><br></p> 作为 spacer 隔开,与规范描述完全相符。
  • [ok] 文章轻润色 5% 改动阈值及字数统计方法复核 — 复核 SKILL.md 中的字数与改动控制:给出剔除图片链接后的汉字与英文字符正则匹配命令行脚本,并明确声明只做错字纠正、切段与微调拗口,将禁止 AI 连接词和超 5% 退回写为硬规则。
  • [ok] 留言拉取脚本对个人主体公众号权限受限的适配方案复核 — 复核 scripts/fetch-comments-by-cookie.sh 与 fetch-comments-via-gstack.sh:针对官方 API 对个人订阅号关闭评论接口的现状,提供抓取 Cookie 和复用 Chromium Profile 的网页抓取回退方案,并在脚本头部明确提醒 Cookie 时效与隔离安全事项。

6Verdict & Scenarios

  • Solves the notorious frustration of broken typography when pasting into WeChat editor
  • Produces beautiful, publication-ready article layouts with zero CSS manual tinkering
  • Optimized specifically for mobile reading ergonomics and follower conversion
  • Best for: Ideal for WeChat Official Account creators, content marketing teams, and corporate communications leads publishing on WeChat.
    Not for: Not designed for general web blogs or Markdown wikis (specifically tuned for WeChat HTML constraints).
    💬 Online Trial Chat Sandbox

    Preview this skill in an interactive chat playground. Generic LLM evaluation trial.

    💬 Open Chat Trial (Preview)
    Under construction · Generic sandbox trial
    Install Agent-Ready
    ① Accelerated Distribution dl.bestaiskill.com
    Option A · Direct Zip Download⚡ Download wjs-publishing-wechat (Zip)
    Edge-accelerated mirror via dl.bestaiskill.com
    Option B · Copy Guide for Agent
    install.json
    Agents automatically download and verify mirrors from this JSON guide.
    ② Upstream GitHub
    GitHub Repo ↗
    Pinned to commit d7a94266f8.