wechat-to-docx-sqsmile
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-to-docx-sqsmile" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-159129fd9fd4f20b91fe91538242fef8a1e7c346154717eeee989eda8ce4304e. Verify the upstream source and version against https://skillhub.cn/skills/user_fa252aa5/wechat-to-docx-sqsmile 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
Export WeChat public account articles into well-formatted DOCX documents. Automatically fetch the body text, download images, and produce professional Word files with auto-numbered headings, headers and page numbers, and a unified style. Supports single or multiple links.
Introduction source: third_party · user_fa252aa5 · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Inputs and outputs
- Translation pending; see source documentation.
- Software, accounts and paid services
- Translation pending; see source documentation.
- Limits and differences
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: wechat-to-docx-sqsmile
description: "将微信公众号文章导出为精美排版 DOCX 文档。自动抓取正文、下载图片、生成带自动编号标题、页眉页码和统一样式的专业 Word 文件。支持单个或多个链接。"
agent_created: true微信公众号 → 精美 DOCX 导出技能 (sqsmile 定制版)
触发条件
当用户提及以下请求时触发此技能:
- "把这篇公众号文章导出为 Word / DOCX"
- "保存微信文章,要带图片"
- "帮我导出这几篇公众号文章"
- 提供
mp.weixin.qq.com链接并要求下载/导出/保存 - 任何包含微信公众号文章链接且要求转为文档的请求
触发示例:
- "导出这篇文章 https://mp.weixin.qq.com/s/xxx"
- "把这几篇公众号文章保存为带图片的 Word 文档"
- "帮我下载这篇微信文章,做成 DOCX"
能力概述
此技能将整个工作流封装为一个脚本,一步到位:
微信公众号 URL
│
▼
抓取 HTML → 解析正文 + 提取元数据
│
▼
下载文章中所有图片(本地缓存)
│
▼
解析正文结构(标题 / 段落 / 图片 / 代码块 / 引用 / 列表)
│
▼
生成 DOCX(图片内嵌 + 代码块格式化 + 自动标题编号 + 统一样式)
│
▼
含页眉(文章标题)+ 页脚(页码)
统一字体微软雅黑 / 1.5 倍行距 / 首行缩进
Consolas 代码块 / 浅灰背景 / 左边框
自动标题编号
| 层级 | 格式 | 示例 |
|---|---|---|
| 一级标题 (H1) | 一、二、三、 | 一、 引言 |
| 二级标题 (H2) | {chap}.{sec}、 | 2.1、 研究背景 |
| 三级标题 (H3) | {chap}.{sec}.{sub}、 | 2.1.1、 相关工作 |
- 原文已带中国数字编号(一、二、三)→ 保留原文,仅更新内部计数器
- 原文已带阿拉伯编号(1. 2.)→ 保留原文,不重复添加
- 无编号原文 → 自动按层级添加编号
脚本位置
- 基础目录:
~/.workbuddy/skills/wechat-to-docx-sqsmile/ - 主脚本:
scripts/wechat_to_docx.py
依赖项
| 包名 | 用途 |
|---|---|
| requests | HTTP 请求获取文章 |
| beautifulsoup4 + lxml | HTML 解析 |
| python-docx | 生成格式化 DOCX |
安装命令:
pip install requests beautifulsoup4 lxml python-docx
执行步骤
步骤 1:提取 URL
从用户请求中提取所有 mp.weixin.qq.com 链接。有效格式:
https://mp.weixin.qq.com/s/xxxhttp://mp.weixin.qq.com/s/xxx
步骤 2:确定输出目录
- 默认:当前工作目录
- 规则:用户指定的任意目录(优先使用工作空间内文件夹)
步骤 3:运行导出脚本
# 单个链接
python3 ~/.workbuddy/skills/wechat-to-docx-sqsmile/scripts/wechat_to_docx.py \
"https://mp.weixin.qq.com/s/xxx" \
--output "/path/to/output"
# 多个链接
python3 ~/.workbuddy/skills/wechat-to-docx-sqsmile/scripts/wechat_to_docx.py \
"https://mp.weixin.qq.com/s/xxx" \
"https://mp.weixin.qq.com/s/yyy" \
--output "/path/to/output"
步骤 4:报告结果
向用户报告:
- 成功导出的文章标题与文件路径
- 每篇文章包含的图片数量
- 任何失败的链接及原因
- 最终文件列表
DOCX 输出规格
| 项目 | 规格 |
|---|---|
| 页面 | A4,2.54cm 等距页边距 |
| 正文字体 | 微软雅黑 11pt,#333 |
| 标题 1 | 微软雅黑 18pt 粗体,#1A1A1A,编号 一、二、三 |
| 标题 2 | 微软雅黑 14pt 粗体,#2C2C2C,编号 2.1、2.2 |
| 标题 3 | 微软雅黑 13pt 粗体,#444444,编号 2.1.1、2.1.2 |
| 行距 | 正文 1.5 倍,标题 1.25 倍 |
| 首行缩进 | 正文 0.74cm |
| 图片 | 嵌入正文,居中,宽度 5.2 英寸 |
| 代码块 | Consolas 9pt,#333333,浅灰背景 #F5F5F5,左边框 |
| 页眉 | 文章标题(居中,灰色小字) |
| 页脚 | 自动页码("第 X 页") |
| 引用 | 微软雅黑 10pt,#666,左缩进 |
文件命名
格式:{文章标题}.docx
特殊字符 \ / : * ? " < > | 会自动替换为下划线,标题过长时会截断。
图片处理
- 图片下载到输出目录下的
.images/缓存目录 - 按
a1_0.jpg,a1_1.png命名,按文章内顺序排列 - 已缓存的图片不会重复下载
常见问题与限制
| 问题 | 原因 | 解决方案 |
|---|---|---|
| "未找到文章正文" | 文章需登录或已删除 | 先在浏览器中验证链接 |
| 连接超时 | 网络问题或微信限流 | 等待后重试 |
| 图片下载失败 | 链接过期或防盗链 | 不影响文档生成,图片位置留空 |
| 图片在 Word 中显示过大/过小 | 原图分辨率差异 | 默认统一宽度 5.2 英寸,可调整 |
输出格式(供 AI 解析)
使用 --list 参数时,脚本输出 JSON 格式结果:
[
{
"url": "https://mp.weixin.qq.com/s/xxx",
"title": "文章标题",
"docx": "/path/to/文章标题.docx",
"images": 5,
"status": "ok"
}
]Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Areas to improve
-
缺少 When to Use 显式章节 Reported severity: Minor
文档中未显式设置 When to Use 章节,但触发条件部分已覆盖相关内容。
Recommendation: 建议增加显式的 When to Use 章节以提升文档规范性。
Highlights
- 提供微信公众号文章导出为 DOCX 的实用功能,解决用户将网页内容转为结构化文档的需求
- 支持单个或多个链接,具备图片下载与内嵌、自动标题编号、页眉页码等专业排版功能
- 受众较广,属于通用工具范畴,实用价值明确
Highlights
- 触发词覆盖多种变体(导出为 Word/DOCX、保存微信文章、带图片、多个链接等)
- 边界清晰,示例充分,包含具体触发示例
- 有效识别 mp.weixin.qq.com 链接并要求下载/导出/保存的请求
Highlights
- Phase/步骤清晰(提取 URL → 确定输出目录 → 运行脚本 → 报告结果)
- 有详细执行命令和端到端示例,frontmatter 完整
- 单文件未超 500 行,结构规范,易于理解执行流程
Highlights
- 依赖项明确(requests, beautifulsoup4, lxml, python-docx),安装命令清晰
- 脚本路径明确,参数说明完整,覆盖主要异常(未找到正文、连接超时、图片下载失败等)
- 输出格式规范,提供 JSON 格式结果供 AI 解析
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.
-
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 77
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- mp.weixin.qq.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Translation pending; see source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.