wechat-draft-push

Push any HTML article to a WeChat Official Account draft with one click. Automatically upload local images to WeChat material library, strip CSS unsupported by WeChat (e.g. gradients, shadows, positioning, animations), and create or overwrite drafts. Intended for automating the flow “WorkBuddy-written articles → directly to draft box.” Requires a verified service or subscription account and configured WECHAT_APPID/WECHAT_SECRET environment variables plus an IP whitelist.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "wechat-draft-push" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-c7750a798e05dffd5b8958de6c35d8b32fa4cf74e73b3225262c6d0d3f107039. Verify the upstream source and version against https://skillhub.cn/skills/user_6bee27e2/wechat-draft-push before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Push any HTML article to a WeChat Official Account draft with one click. Automatically upload local images to WeChat material library, strip CSS unsupported by WeChat (e.g. gradients, shadows, positioning, animations), and create or overwrite drafts. Intended for automating the flow “WorkBuddy-written articles → directly to draft box.” Requires a verified service or subscription account and configured WECHAT_APPID/WECHAT_SECRET environment variables plus an IP whitelist.

0 Downloads

Introduction source: third_party · user_6bee27e2 · 1.0.2 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Not specified in the source documentation.
Inputs and outputs
Not specified in the source documentation.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: "wechat-draft-push"
description: 将任意 HTML 文章一键推送到微信公众号草稿箱。自动上传本地图片到微信素材库、清洗微信不支持的 CSS(渐变/阴影/定位/动画等)、创建或覆盖更新草稿。适用于「WorkBuddy 撰写的公众号文章 → 直接进草稿箱」的自动化发布流程。需要公众号为认证服务号/订阅号,并配置 WECHAT_APPID/WECHAT_SECRET 环境变量与 IP 白名单。

CHANGELOG · wechat-draft-push

技能更新跟踪记录。每次修改脚本 / 说明后在此追加一条,便于回溯与双人复核。

约定格式:## [版本] YYYY-MM-DD — 概要(版本号自定,如 v1.0 / v1.1)。


[v1.1] 2026-07-29 — 安全与健壮性全面优化(🔴🟡🟢 全做)

相对 v1.0(「全做」任务之前那版)的逐项变更:

🔴 必修(安全 / 可用性)

  • 技能开关:SKILL.md disable: true → disable: false,技能正式生效、可被自动加载。
  • SSL 安全:删除全局 ssl.CERT_NONE;默认 ssl.create_default_context() 启用证书校验,仅 --insecure 作为本地沙箱兜底。
  • 正文图接口:所有图原走 material/add_material(永久素材,反复推稿占额度)→ 正文图改走 media/uploadimg(临时素材,不占永久额度),仅封面走永久素材。

🟡 健壮性 / 体验

  • Token 缓存:原每次重新取 token → 缓存 ~/.cache/wechat_token.json(带过期,7200s 内复用),--force-token 强刷。
  • 图片缓存:原改 N 次传 N 次 → ~/.cache/wechat_img_cache.json 按路径缓存 url/media_id,重推跳过已传图。
  • 摘要提取:原取首个 <p>(可能抓到图注/空段)→ extract_digest() 抽纯文本、跳过 <img>/<style>,取首段有意义文字。
  • 友好报错:新增 ERRCODES 字典,覆盖 40001/40164/45009/48001/47001/45064/42001 等常见码,给中文提示+处置建议。
  • 留言开关:原 need_open_comment 写死 1 → 新增 --no-comment 由用户决定。
  • 封面指定:新增 --thumb 显式指定封面(SKILL 提醒用方图)。
  • CSS 清洗:sanitize_css() 增强,新增剔除 backdrop-filter/filter/z-index/@media,linear/radial-gradient 转末位色。

🟢 进阶(新增能力)

  • --list:列出草稿箱(draft/batchget,显示标题/时间/media_id)。
  • --publish <media_id>:一键群发(freepublish/submit 异步);SKILL 补订阅号日 1 条 / 服务号月 4 条频率限制。
  • 文档修正:SKILL 中"用 pandoc 提取"改为"本环境 pandoc 不可用,用解包脚本/Python 提取"。

保持不变

  • draft/update 兜底(更新失败→新建+删旧,保证后台只一份)。
  • 微信 CSS 铁律(sanitize_css 核心思路)。
  • 前置条件:认证号 + WECHAT_APPID/SECRET 环境变量 + IP 白名单。

验证

  • py_compile 语法通过;默认 SSL 探测微信回 invalid appid(证书校验通过、链路通)。
  • 真实 --list 调用被 40164 拦截:沙箱出口 IP 漂移为 117.136.38.121(7/27 为 223.104.38.82),需把新 IP 加进白名单。

[v1.0] 2026-07-27 — 初始沉淀(通用版,含 WAIC 文章实战)

  • 从写死的 push_to_wechat.py 重写为通用 wechat_push.py:吃任意 HTML + 图片目录,自动上传图、清洗 CSS、推草稿。
  • 支持 新建 / --update 覆盖更新(失败自动新建+删旧兜底)/ --delete 删草稿。
  • 修复渐变徽章白字隐形隐患(纯色块替代)。
  • 微信安全版文章 waic_wechat.html 推入草稿箱成功(正文图走永久素材,占额度 —— v1.1 修正)。
  • IP 白名单初配 223.104.38.82。

Current listing version

1.0.2

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value75/100

Areas to improve

  • 缺少When to Use章节 Reported severity: Minor

    文档中缺少明确的使用场景说明章节

    Recommendation: 建议添加When to Use章节,明确说明适用场景和使用时机

Highlights

  • 解决微信公众号内容创作者高频痛点
  • 支持HTML文章一键推送和自动化图片上传
  • 适用于WorkBuddy撰写文章的自动化发布流程
Trigger Precision85/100

Areas to improve

  • 缺少具体使用示例 Reported severity: Minor

    description中缺少具体的命令使用示例

    Recommendation: 建议添加具体的使用命令示例,如wechat-draft-push --help等

Highlights

  • 触发词精准完整,覆盖多种功能变体
  • 边界清晰,明确前置条件要求
  • description内容完整,无截断或错位
Structure and Standards88/100

Areas to improve

  • 文档中提及pandoc但说明不可用 Reported severity: Minor

    文档中提到'用pandoc提取'但后续说明本环境pandoc不可用

    Recommendation: 建议统一表述,避免给用户造成困惑

Highlights

  • CHANGELOG结构清晰,版本迭代记录完整
  • frontmatter完整包含必要信息
  • 单文件长度适中,符合规范要求
Execution Reliability90/100

Highlights

  • 使用微信官方API,工具来源明确
  • 实现Token缓存机制,减少重复请求
  • 新增ERRCODES字典覆盖常见错误码,提升用户体验
  • 支持多种操作模式(新建/更新/删除/发布)
Evidence Verifiability (mean of the first four)85/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.