chenyd002025

微信公众号文章发布技能

Contentv1.0.6
By chenyd002025Updated 2026-05-187 versions · latest released 2026-03-15jvs-wechat-article-publisher@clawhub_chenyd002025/jvs-wechat-article-publisher
Article WritingSocial Media#WeChat#工作流#微信

According to AlphaMoat, as of 2026-10, 微信公众号文章发布技能 has 14,093 downloads and 6 stars — ranked by downloads #1,991 among 10,914 AI skills in this ranking, and #208 of 927 in Content.

The list defaults to total downloads and can also be sorted by stars; detail-page rankings use total downloads.

Downloads
14.1K
Stars
6
Overall download rank
#1,991
Top 19% overall · Top 23% in Content
PlatformDownloadsStarsComments
ClawHub ↗1.5K--
SkillHub ↗14.1K6—

Platforms count differently and update at different times.

What this skill does

It provides layout templates and a publishing flow: produce the article, upload images to the media library, and push the draft to the WeChat backend. A registered official account with its AppID and AppSecret is required, the server IP whitelist must be configured, and some interfaces are limited for unverified accounts.

Profile published 2026-10-27

What you can do with it

  • Lay out an illustrated article and push it to the drafts box
  • Upload a batch of images to the media library

When to use it

  • When a finished article should go to the WeChat backend
  • When layout style must stay consistent with a template

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Format this case study article and push it to drafts
Upload these images to the media library first, then publish the article

Monthly Trend

Downloads14.1K
1.2K8.1K15.0K2026-03 · Downloads 2.2K2026-05 · Downloads 3.5K2026-06 · Downloads 3.9K2026-07 · Downloads 4.5K2026-08 · Downloads 5.0K2026-09 · Downloads 6.4K2026-10 · Downloads 14.1K26-0326-0926-10
Stars6
0362026-03 · Stars -2026-05 · Stars 52026-06 · Stars 62026-07 · Stars 62026-08 · Stars 62026-09 · Stars 62026-10 · Stars 626-0326-0926-10

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.

MonthDownloadsMoMStars
2026-1014.1K—6
2026-096.4K—6
2026-085.0K+11.3%6
2026-074.5K+14.0%6
2026-063.9K+11.0%6
2026-053.5K—5
2026-032.2K—-

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

9.6 KB · ClawHub v1.0.6
---
name: wechat-article-publisher
description: 微信公众号文章排版和发布技能。提供专业排版模板、图片上传、草稿发布等完整工作流。使用场景:(1) 创建公众号文章,(2) 上传图片到素材库,(3) 发布草稿到微信后台,(4) 装修案例/干货分享/客户故事等类型文章。
---

# WeChat Article Publisher

微信公众号文章排版和发布技能。

---
Show all (368 lines)

## 📋 使用前准备(首次使用必读!)

### 1. 微信公众号要求

- ✅ 需要已注册的**微信公众号**(服务号或订阅号均可)
- ✅ 需要公众号的 **AppID** 和 **AppSecret**
- ⚠️ 公众号需要通过微信认证(未认证账号部分 API 受限)

### 2. 获取 AppID 和 AppSecret

1. 登录 [微信公众平台](https://mp.weixin.qq.com)
2. 进入 **开发 → 基本配置**
3. 复制 **开发者 ID** 中的:
   - `AppID(应用 ID)` - 类似 `你的 APPID`
   - `AppSecret(应用密钥)` - 类似 `你的 APPSECRET`

### 3. 配置 IP 白名单(重要!)

微信 API 要求配置服务器 IP 白名单:

1. 在 **开发 → 基本配置** 页面
2. 找到 **IP 白名单** 设置
3. 添加你的服务器公网 IP:
   - 本地测试:查询本机公网 IP(访问 https://ip.sb)
   - 服务器:填写服务器的公网 IP 地址
   - 可添加多个 IP,用逗号分隔

**常见 IP 白名单配置:**
```json
{
  "ipWhitelist": ["你的公网 IP", "你的服务器 IP 2", "你的服务器 IP 1"]
}
```

### 4. 创建配置文件

在技能目录创建 `config.json`:

```json
{
  "appId": "你的 AppID",
  "appSecret": "你的 AppSecret",
  "ipWhitelist": ["你的公网 IP"]
}
```

⚠️ **安全提醒**:
- `config.json` 包含敏感信息,**不要上传到 ClawHub**
- 只保留 `config.example.json` 作为示例
- 真实配置文件应加入 `.gitignore`

### 5. 验证配置

运行测试命令验证配置是否正确:

```bash
# 获取 token(成功会返回一串字符)
curl -s "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=你的 APPID&secret=你的 APPSECRET"
```

**成功响应:**
```json
{"access_token":"ACCESS_TOKEN","expires_in":7200}
```

**失败响应:**
```json
{"errcode":40013,"errmsg":"invalid appid"}
```

---
## 🔴 严重警告:中文乱码问题(必读!)

**问题现象**:发布后文章内容显示为 `<p>这是文字</p>` 标签,而不是正常中文。

**根本原因**:
1. ❌ Python requests 库默认编码不是 UTF-8
2. ❌ Content-Type 头未指定 `charset=utf-8`
3. ❌ Token 过期导致 API 异常处理

**✅ 正确解决方案(必须遵守!)**:

```bash
# ========== 第 1 步:获取最新 token(每次发布前都要重新获取!) ==========
TOKEN=$(curl -s "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=SECRET" | python3 -c "import sys,json; print(json.load(sys.stdin).get('access_token',''))")

# ========== 第 2 步:上传封面图 ==========
COVER=$(curl -s -X POST "https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=$TOKEN&type=image" -F "media=@/path/to/cover.jpg" | python3 -c "import sys,json; print(json.load(sys.stdin).get('media_id',''))")

# ========== 第 3 步:发布草稿(关键:-H "Content-Type: application/json; charset=utf-8") ==========
curl -s -X POST "https://api.weixin.qq.com/cgi-bin/draft/add?access_token=$TOKEN" \
  -H "Content-Type: application/json; charset=utf-8" \
  -d "{\"articles\":[{\"title\":\"标题\",\"content\":\"<p>中文内容</p>\",\"thumb_media_id\":\"$COVER\"}]}"
```

**⚠️ 四个必须(缺一不可!)**:
1. ✅ **每次发布前都重新获取 token** - token 有效期只有 2 小时
2. ✅ **必须指定 `charset=utf-8`** - `-H "Content-Type: application/json; charset=utf-8"`
3. ✅ **必须用 curl 命令** - 不要用 Python requests(编码不可靠)
4. ✅ **必须手机扫码预览** - PC 预览可能显示 Unicode(未验证账号)

**🧪 测试命令**(发布前先用这个验证编码):
```bash
curl -s -X POST "https://api.weixin.qq.com/cgi-bin/draft/add?access_token=$TOKEN" \
  -H "Content-Type: application/json; charset=utf-8" \
  -d "{\"articles\":[{\"title\":\"测试文字\",\"content\":\"<p>这是中文测试</p><p>能看到吗</p>\",\"thumb_media_id\":\"$COVER\"}]}"
```

**❌ 错误做法(不要再犯!)**:
- 使用 Python `requests.post(url, json=data)` 直接发布
- 复用旧 token(超过 2 小时)
- 不指定 `charset=utf-8`
- 只在 PC 端预览,不用手机扫码

---

## 快速开始

### 发布文章(推荐方式)

```bash
# 使用 curl 命令发布(见上方「严重警告」章节的完整命令)
```

### 上传图片

```bash
python3 scripts/upload_images.py /path/to/images/
```

---

## 排版模板

### 专业版模板(推荐)

适用于装修案例、实景展示等专业内容。

**特点:**
- 英文 + 中文双语标题(如 LIVING ROOM · 客厅)
- 奶油色配色方案(#f5e6d3、#8b7355)
- 标题底部装饰线
- 表格相间背景色
- 预约框圆角背景

**模板文件:** `assets/templates/professional.md`

### 简洁版模板

适用于快讯、通知等简单内容。

**模板文件:** `assets/templates/simple.md`

---

## 文章结构

### 标准结构

1. **封面大图** - 标题后第一张就是图片
2. **项目信息** - 小区/面积/风格/造价表格
3. **空间展示** - 客厅/餐厅/卧室/厨房等
4. **费用明细** - 分类费用表格
5. **改造亮点** - 项目亮点列表
6. **预约量房** - CTA 行动号召
7. **联系我们** - 公司信息

### 图片规则

- 每个空间 1-2 张图
- 图片宽度 100%,最大 600px
- 图片间留白 20px
- 封面图单独指定

---

## 发布流程

### 步骤 1:准备文章

```markdown
# 文章标题

<img src="封面图 URL">

---

## 空间 1

<img src="图片 URL">

说明文字

---

## 空间 2

...
```

### 步骤 2:上传图片

```bash
python3 scripts/upload_images.py /path/to/images/
# 输出图片 URL 列表
```

### 步骤 3:插入 URL

将上传的图片 URL 替换文章中的占位符。

### 步骤 4:发布草稿

**唯一推荐方式(curl 命令):**

```bash
# 1. 获取 token
TOKEN=$(curl -s "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=你的 APPID&secret=你的 APPSECRET" | python3 -c "import sys,json; print(json.load(sys.stdin).get('access_token',''))")

# 2. 上传封面
COVER=$(curl -s -X POST "https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=$TOKEN&type=image" -F "media=@/path/to/cover.jpg" | python3 -c "import sys,json; print(json.load(sys.stdin).get('media_id',''))")

# 3. 发布(注意:-H "Content-Type: application/json; charset=utf-8")
curl -s -X POST "https://api.weixin.qq.com/cgi-bin/draft/add?access_token=$TOKEN" \
  -H "Content-Type: application/json; charset=utf-8" \
  -d "{\"articles\":[{\"title\":\"标题\",\"content\":\"<p>中文内容</p>\",\"thumb_media_id\":\"$COVER\"}]}"
```

**❌ 禁止使用 Python 脚本直接发布**(会导致乱码)

### 步骤 5:手动发表

登录微信后台 → 草稿箱 → 检查 → 点发表

---

## 配置

配置文件:`config.json`

```json
{
  "appId": "你的 AppID",
  "appSecret": "你的 AppSecret",
  "ipWhitelist": ["你的服务器 IP 1", "你的服务器 IP 2"]
}
```

---

## 常见问题

### 🔴 中文乱码(最重要!)

**现象**:文章显示为 `<p>这是文字</p>` 标签

**原因**:编码格式不正确

**解决方案**:
1. 使用 curl 命令发布
2. 必须指定 `-H "Content-Type: application/json; charset=utf-8"`
3. 每次发布前重新获取 token

### API 48001 错误

微信 API 未授权,无法直接发布。

**解决方案:** 使用草稿 API + 手动发表工作流。

### 图片不显示

图片未上传到微信素材库。

**解决方案:** 先用 `upload_images.py` 上传图片获取 URL。

### 排版错乱

Markdown 格式不正确。

**解决方案:** 使用提供的模板文件。

---

## 脚本说明

### publish_wechat.py

发布文章到微信草稿箱。

```bash
python3 scripts/publish_wechat.py <article.md> [options]

选项:
  --template <name>     模板名称 (viral/professional/simple)
  --cover-image <path>  封面图路径
  --output <path>       输出 HTML 路径
```

**⚠️ 注意**:此脚本可能导致中文乱码,建议使用 curl 命令替代。

### upload_images.py

批量上传图片到微信素材库。

```bash
python3 scripts/upload_images.py <image_folder>

输出:
  图片 URL JSON 文件
```

---

## 内容栏目

### 7 栏目规划

1. **实景案例** - 完工项目实景拍摄
2. **干货分享** - 装修知识/避坑指南
3. **客户故事** - 业主访谈/入住反馈
4. **工地实况** - 施工进度/工艺展示
5. **材料科普** - 主材/辅材知识
6. **问答互动** - 常见问题解答
7. **活动促销** - 优惠活动/套餐

---

## 参考链接

- 微信公众平台:https://mp.weixin.qq.com
- 微信 API 文档:https://developers.weixin.qq.com/doc/offiaccount/
- 排版参考:见 `references/` 目录

---

## 公司信息模板

```
公司:[你的公司名称]
网站:[你的网站]
电话:[你的联系电话] / [你的联系电话]
地址:[你的地址]
时间:9:00-18:00(周一至周日)
```

---

## 发布检查清单(每次发布前必看!)

- [ ] 已重新获取最新 token(不超过 2 小时)
- [ ] 已使用 curl 命令(不是 Python)
- [ ] 已指定 `-H "Content-Type: application/json; charset=utf-8"`
- [ ] 已用手机扫码预览(不是 PC 预览)
- [ ] 已确认文字正常显示(不是 `<p>...</p>` 标签)

**以上 5 项全部打勾后才能正式发布!**

Popular in Content

李白.SkillContent

李白.Skill:润色专家 检测并消除中文文本中的AI生成痕迹,将生硬的机器输出转化为自然流畅的人类文笔。融合规则检测、分层改写和质控流水线,确保最终文本通过人工审查。

↓ 1.3M★ 121user_741dc82b
libai-skillContent

李白.Skill:润色专家 检测并消除中文文本中的AI生成痕迹,将生硬的机器输出转化为自然流畅的人类文笔。融合规则检测、分层改写和质控流水线,确保最终文本通过人工审查。

↓ 1.0M★ 11user_814dbe54
文章去AI味工具Content

Detects and removes AI writing traces so text reads more like a person wrote it.

↓ 951.0K★ 767user_ab5ae6ee
视频号爆款短视频拆解(付费版:全能)【零一数科·出品】Content

【零一数科·出品】视频号爆款短视频拆解(全能版)(付费版)。视频号爆款短视频拆解(付费版:全能)。一键拆解爆款,把一条视频号视频拆成结构分段、爆款归因、六维评分和可借鉴策略,照着学照着抄。支持视频号分享链接和本地视频,付费全能版远端分析,1–5 分钟出可视化 HTML 报告。

↓ 918.5K★ 116u_c19e970c
视频号挂车爆单短视频脚本生成【零一数科·出品】Content

【零一数科·出品】视频号挂车爆单短视频脚本生成(付费版)。一条链接二创脚本,丢进爆款视频号链接即以此骨架改写成你的挂车脚本,或按方向/目的/商品原创多条口播脚本(含分段表、口播全文、六维质检评分)。

↓ 554.4K★ 39u_c19e970c
HumanizerContent

A writing-editor skill that finds the usual marks of AI-generated text and rewrites them into more natural prose without losing the meaning.

↓ 508.8K★ 1.1KB*T
中文公文写作Content

用于中文公文、事务性材料和新闻稿件的起草、改写、压缩、润色、审校、文种核对、去口语化、降 AI 味及 Word 格式处理,适用于机关、企事业单位、学校和新闻机构。涵盖申请、请示、报告、通知、通告、意见、决定、决议、议案、公报、命令、函、复函、批复、说明、方案、纪要、公告、公示、通报、制度、规定、办法、细则、操作规程、工作要点、总结、调研、讲话、致辞、主持词、述职、可研、审查材料、技术需求、新闻消息、编者按、新闻评论,以及采购、整改、反馈和 AI 算力等场景。

↓ 413.4K★ 84gongyu0918
视频号爆款文案生成(体验版)【零一数科·出品】Content

【零一数科·出品】视频号爆款文案生成(体验版)。免费免登录出脚本,给创作目的、行业、受众、选题就按爆款结构(Hook-中段-CTA、节奏标签)产出口播脚本,信息不全也能按爆款潜质兜底。本地运行、无需 Key,零成本上手。

↓ 339.1K★ 94u_c19e970c

More from chenyd002025

Data as of 2026-10. Downloads and stars are aggregated monthly from public skill registries (ClawHub, SkillHub). See data methodology.