wechat-article-publisher-skill

作者 iamzifei已验证

Claude Skill that publish on Wechat articles (微信公众号发布)

133
Stars
19
Forks
Python
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/iamzifei/wechat-article-publisher-skill

快速入门

使用 wechat-article-publisher-skill 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

WeChat Article Publisher Skill

ko-fi

English | 中文

Publish Markdown or HTML articles to WeChat Official Account drafts with one command. Say goodbye to tedious copy-paste-format workflows.

v1.1.0 — API-based publishing for reliability and speed


The Problem

If you write in Markdown, publishing to WeChat Official Account (公众号) is a painful process:

Pain PointDescription
Format LossCopy from Markdown editor -> Paste to WeChat -> All formatting gone
Manual FormattingRe-apply each H2, bold, link manually — 15-20 min per article
Image Upload HassleUpload images one by one through WeChat's media library
Multiple StepsSwitch between markdown editor, image uploads, and WeChat admin panel

Time Comparison

TaskManualWith This Skill
Format conversion15-20 min0 (automatic)
Image upload5-10 min0 (automatic)
Copy & paste content2-3 min0 (automatic)
Total20-30 min< 1 min

30x efficiency improvement


The Solution

This skill uses WeChat's API for direct, reliable publishing:

Markdown/HTML File
     | Python parsing
     v
Structured Data (title, content, images)
     | WeChat API
     v
Draft in WeChat Official Account (never auto-publishes)

Key Features

  • API-Based: Direct API calls, no browser automation needed
  • Cross-Platform: Works on macOS, Linux, and Windows
  • Dual Format: Supports both Markdown (.md) and HTML (.html) files
  • Format Preserved: HTML formatting preserved, Markdown auto-converted
  • Image Auto-Upload: Images in your content are automatically uploaded
  • Safe by Design: Only saves as draft, never publishes automatically
  • 小绿书 Support: Publish as image-text format (newspic) for visual content

Requirements

RequirementDetails
Claude Codeclaude.ai/code
Python 3.9+Standard library only (no extra dependencies)
WECHAT_API_KEYGet from wx.limyai.com
WeChat AccountAuthorized on wx.limyai.com

怎么装(没用过命令行也能跟着做)

下面每一步都可以直接复制粘贴。不用懂什么是「技能」「仓库」「终端」,照做就行。 哪一步卡住了,把报错原样复制给 AI,让它帮你看——这是最快的解决办法。

方式一:WorkBuddy(推荐,不用敲命令)

  1. 下载安装 WorkBuddy,打开它,登录。
  2. 在电脑上新建一个文件夹,名字随便,比如 我的AI技能,放桌面上就行。记住它在哪。
  3. 把本项目下载下来
    • 在本页面点绿色的 Code 按钮 → Download ZIP
    • 下载完解压,把解压出来的整个文件夹拖进刚才建的 我的AI技能
  4. 打开 WorkBuddy 的设置 → 技能(Skills),点「添加技能目录」,选中 我的AI技能 这个文件夹。
  5. 重启 WorkBuddy
  6. 在对话框里输入 /公众号发布 新手,回车。

看到它开始介绍它能做什么并给你编号选项,就是装好了。

找不到「技能」入口?在设置里搜 skill,或者直接问 WorkBuddy:「我要怎么添加本地技能目录?」 WorkBuddy 的菜单名称可能随版本变化,但「添加技能目录」这一步的意思是一样的。

方式二:Claude Code(会用终端的人)

git clone https://github.com/iamzifei/wechat-article-publisher-skill.git

把 clone 下来的文件夹放进 Claude Code 的技能目录(~/.claude/skills/),重启,输入 /公众号发布 新手

方式三:其他支持技能的 AI 工具(Codex、豆包、Trae 等)

这些工具大多会读一个固定的技能目录,常见的是 ~/.agents/skills~/.codex/skills。 把本项目文件夹复制进去,重启工具,输入 /公众号发布 新手

不知道装没装上?

在对话框里输入 /公众号发布 新手它会自己介绍自己、并带你走一遍—— 不用你想好要问什么,也不用准备任何材料。

Installation

Step 1: Clone the Repository

git clone https://github.com/iamzifei/wechat-article-publisher-skill.git

Step 2: Copy Skill to Claude

cp -r wechat-article-publisher-skill/skills/wechat-article-publisher ~/.claude/skills/

Step 3: Configure API Key

cd wechat-article-publisher-skill
cp .env.example .env
# Edit .env and set your WECHAT_API_KEY

Usage

Natural Language

把 /path/to/article.md 发布到微信公众号
Publish ~/Documents/my-post.md to WeChat
帮我把这篇文章发到公众号:~/articles/ai-tools.md
把这个HTML文章发布到公众号:~/newsletter/issue-01.html
Publish the HTML article ~/export/formatted-post.html to WeChat

Skill Command

/wechat-article-publisher /path/to/article.md
/wechat-article-publisher /path/to/article.html

With Options

# Publish as 小绿书 (image-text mode)
/wechat-article-publisher /path/to/article.md --type newspic

Workflow Steps

[1/4] Check API Key...
      -> Load WECHAT_API_KEY from .env

[2/4] List WeChat Accounts...
      -> Find authorized accounts
      -> Auto-select if only one, ask if multiple

[3/4] Publish Article...
      -> Detect file format (Markdown or HTML)
      -> Parse content (title, body, images)
      -> Call WeChat API
      -> Upload images automatically

[4/4] Report Result...
      -> Show success message
      -> Remind to review and publish manually

Supported Formats

Markdown (.md)

SyntaxResult
# H1Article title (extracted, not in body)
## H2Section headers
### H3Sub-section headers
**bold**Bold text
*italic*Italic text
[text](https://github.com/iamzifei/wechat-article-publisher-skill/blob/main/url)Hyperlinks
> quoteBlockquotes
- itemUnordered lists
1. itemOrdered lists
codeCode blocks
![](https://raw.githubusercontent.com/iamzifei/wechat-article-publisher-skill/main/img.jpg)Images (auto-uploaded)

HTML (.html)

ElementResult
<title> or <h1>Article title
<h2>, <h3>Section headers
<strong>, <b>Bold text
<em>, <i>Italic text
<a href="">Hyperlinks
<blockquote>Blockquotes
<ul>, <ol>Lists
<table>Tables (preserved)
<img src="">Images (auto-uploaded)
Inline stylesPreserved

Article Types

news (Default)

Standard WeChat article format with full rich text support.

newspic (小绿书)

Image-focused format for visual content:

  • Up to 20 images extracted from content
  • Text limited to 1000 characters
  • Perfect for photo-heavy posts

Example

Input: article.md

# 5 AI Tools Worth Watching in 2024

![cover](https://raw.githubusercontent.com/iamzifei/wechat-article-publisher-skill/main/./images/cover.jpg)

AI tools exploded in 2024. Here are 5 worth your attention.

## 1. Claude: Best Conversational AI

**Claude** by Anthropic excels at long-context understanding.

> Claude's context window reaches 200K tokens.

![claude-demo](https://raw.githubusercontent.com/iamzifei/wechat-article-publisher-skill/main/./images/claude-demo.png)

Command

把 ~/Documents/article.md 发布到微信公众号

Result

✓ 文章已成功发布到公众号草稿箱!

标题: 5 AI Tools Worth Watching in 2024
状态: 已保存到草稿箱

请登录微信公众平台预览并发布。

Project Structure

wechat-article-publisher-skill/
├── .claude-plugin/
│   └── plugin.json              # Plugin config
├── skills/
│   └── wechat-article-publisher/
│       ├── SKILL.md             # Skill instructions
│       └── scripts/
│           ├── wechat_api.py    # WeChat API client
│           └── parse_markdown.py # Markdown parser
├── docs/
│   └── GUIDE.md                 # Detailed guide
├── .env.example                 # Environment template
├── README.md                    # This file (bilingual)
└── LICENSE

FAQ

Q: How do I get a WECHAT_API_KEY? A: Register at wx.limyai.com, authorize your WeChat Official Account, and get your API key from the dashboard.

Q: Can I publish to multiple accounts? A: Yes! If you have multiple authorized accounts, the skill will ask you to choose which one to publish to.

Q: What happens to my images? A: Images are automatically uploaded to WeChat's servers. Both local paths and URLs are supported.

Q: Will this auto-publish my article? A: No, never. Articles are always saved as drafts. You must manually publish from the WeChat admin panel.

Q: What's the difference between news and newspic? A: news is standard article format; newspic (小绿书) is image-focused with limited text, similar to Instagram posts.

Q: Does this work on Windows? A: Yes! Unlike browser-based tools, this API-based approach works on all platforms.


API Reference

List Accounts

python wechat_api.py list-accounts

Publish Markdown Article

python wechat_api.py publish --appid <appid> --markdown /path/to/article.md

Publish HTML Article

python wechat_api.py publish --appid <appid> --html /path/to/article.html

Publish as 小绿书

python wechat_api.py publish --appid <appid> --markdown /path/to/article.md --type newspic

Documentation


Changelog

v1.1.0 (2025-01)

  • Add HTML file support with formatting preserved
  • Auto-detect file format (Markdown or HTML)
  • Extract title from HTML <title> or <h1> tags
  • Support inline styles and rich HTML formatting

v1.0.0 (2025-01)

  • Initial release for WeChat Official Account
  • API-based publishing (no browser automation)
  • Cross-platform support (macOS, Linux, Windows)
  • Markdown to WeChat format conversion
  • Auto image upload
  • 小绿书 (newspic) support
  • Draft-only publishing (safe by design)

License

MIT License - see LICENSE

Author

iamzifei


Contributing

  • Issues: Report bugs or request features
  • PRs: Welcome!




微信公众号文章发布 Skill

English | 中文

一键将 Markdown 或 HTML 文章发布到微信公众号草稿箱,告别繁琐的复制粘贴排版流程。

v1.1.0 — 基于 API 的发布方式,稳定高效,支持 Markdown 和 HTML


痛点分析

如果你习惯用 Markdown 写作,将内容发布到微信公众号是一个极其痛苦的过程:

痛点描述
格式丢失从 Markdown 编辑器复制 -> 粘贴到公众号后台 -> 格式全部丢失
手动排版逐个设置 H2、粗体、链接 — 每篇文章 15-20 分钟
图片上传繁琐需要通过素材库逐张上传图片
步骤繁多在 Markdown 编辑器、图片上传、公众号后台之间反复切换

时间对比

操作手动方式使用本 Skill
格式转换15-20 分钟0(自动)
图片上传5-10 分钟0(自动)
复制粘贴内容2-3 分钟0(自动)
总计20-30 分钟< 1 分钟

效率提升 30 倍以上


解决方案

本 Skill 使用微信 API 直接发布,稳定可靠:

Markdown/HTML 文件
     | Python 解析
     v
结构化数据(标题、内容、图片)
     | WeChat API
     v
保存到公众号草稿箱(绝不自动发布)

核心特性

  • 基于 API:直接调用 API,无需浏览器自动化
  • 跨平台:支持 macOS、Linux、Windows
  • 双格式支持:同时支持 Markdown (.md) 和 HTML (.html) 文件
  • 格式保留:HTML 格式完整保留,Markdown 自动转换
  • 图片自动上传:文章中的图片自动上传到微信服务器
  • 安全设计:仅保存草稿,绝不自动发布
  • 小绿书支持:支持发布为图文消息格式

环境要求

要求说明
Claude Codeclaude.ai/code
Python 3.9+仅使用标准库,无需额外依赖
WECHAT_API_KEYwx.limyai.com 获取
微信公众号在 wx.limyai.com 完成授权

安装方式

步骤一:克隆仓库

git clone https://github.com/iamzifei/wechat-article-publisher-skill.git

步骤二:复制 Skill 到 Claude

cp -r wechat-article-publisher-skill/skills/wechat-article-publisher ~/.claude/skills/

步骤三:配置 API Key

cd wechat-article-publisher-skill
cp .env.example .env
# 编辑 .env 文件,设置你的 WECHAT_API_KEY

使用方法

自然语言

把 /path/to/article.md 发布到微信公众号
帮我把这篇文章发到公众号:~/articles/ai-tools.md
把这个HTML文章发布到公众号:~/newsletter/issue-01.html
Publish ~/Documents/my-post.md to WeChat
发布这个带排版的HTML文件到微信:~/export/formatted-post.html

Skill 命令

/wechat-article-publisher /path/to/article.md
/wechat-article-publisher /path/to/article.html

带选项使用

# 发布为小绿书(图文消息)
/wechat-article-publisher /path/to/article.md --type newspic

工作流程

[1/4] 检查 API Key...
      -> 从 .env 加载 WECHAT_API_KEY

[2/4] 获取公众号列表...
      -> 查找已授权的公众号
      -> 如果只有一个则自动选择,多个则询问用户

[3/4] 发布文章...
      -> 检测文件格式(Markdown 或 HTML)
      -> 解析内容(标题、正文、图片)
      -> 调用微信 API
      -> 自动上传图片

[4/4] 报告结果...
      -> 显示成功信息
      -> 提醒用户手动预览并发布

支持的格式

Markdown (.md)

语法效果
# H1文章标题(提取后不含在正文中)
## H2二级标题
### H3三级标题
**粗体**粗体文字
*斜体*斜体文字
[文字](https://github.com/iamzifei/wechat-article-publisher-skill/blob/main/url)超链接
> 引用引用块
- 列表无序列表
1. 列表有序列表
代码代码块
![](https://raw.githubusercontent.com/iamzifei/wechat-article-publisher-skill/main/img.jpg)图片(自动上传)

HTML (.html)

元素效果
<title><h1>文章标题
<h2>, <h3>章节标题
<strong>, <b>粗体文字
<em>, <i>斜体文字
<a href="">超链接
<blockquote>引用块
<ul>, <ol>列表
<table>表格(保留)
<img src="">图片(自动上传)
内联样式保留

文章类型

news(默认)

标准的公众号文章格式,支持完整的富文本。

newspic(小绿书)

以图片为主的内容格式:

  • 最多支持 20 张图片
  • 文字内容限制 1000 字
  • 适合图片为主的内容发布

完整示例

输入:article.md

# 2024 年最值得关注的 5 个 AI 工具

![封面](https://raw.githubusercontent.com/iamzifei/wechat-article-publisher-skill/main/./images/cover.jpg)

人工智能工具在 2024 年迎来了爆发式增长。本文将介绍 5 个最值得关注的工具。

## 1. Claude:最强对话 AI

**Claude** 由 Anthropic 开发,在长文本理解方面表现出色。

> Claude 的上下文窗口高达 200K tokens。

![claude-demo](https://raw.githubusercontent.com/iamzifei/wechat-article-publisher-skill/main/./images/claude-demo.png)

执行命令

把 ~/Documents/article.md 发布到微信公众号

执行结果

✓ 文章已成功发布到公众号草稿箱!

标题: 2024 年最值得关注的 5 个 AI 工具
状态: 已保存到草稿箱

请登录微信公众平台预览并发布。

项目结构

wechat-article-publisher-skill/
├── .claude-plugin/
│   └── plugin.json              # 插件配置
├── skills/
│   └── wechat-article-publisher/
│       ├── SKILL.md             # Skill 核心指令
│       └── scripts/
│           ├── wechat_api.py    # 微信 API 客户端
│           └── parse_markdown.py # Markdown 解析器
├── docs/
│   └── GUIDE.md                 # 详细使用指南
├── .env.example                 # 环境变量模板
├── README.md                    # 本文件(双语)
└── LICENSE

常见问题

Q: 如何获取 WECHAT_API_KEY? A: 访问 wx.limyai.com,注册并授权你的微信公众号,在控制台获取 API Key。

Q: 可以发布到多个公众号吗? A: 可以!如果你授权了多个公众号,Skill 会询问你要发布到哪个。

Q: 图片会怎么处理? A: 图片会自动上传到微信服务器。支持本地路径和网络 URL。

Q: 会自动发布文章吗? A: 不会。文章始终保存为草稿,你需要在公众号后台手动发布。

Q: news 和 newspic 有什么区别? A: news 是标准文章格式;newspic(小绿书)是图文消息格式,以图片为主,文字有限制。

Q: 支持 Windows 吗? A: 支持!与浏览器自动化工具不同,本 Skill 基于 API,支持所有平台。


API 参考

获取公众号列表

python wechat_api.py list-accounts

发布 Markdown 文章

python wechat_api.py publish --appid <appid> --markdown /path/to/article.md

发布 HTML 文章

python wechat_api.py publish --appid <appid> --html /path/to/article.html

发布为小绿书

python wechat_api.py publish --appid <appid> --markdown /path/to/article.md --type newspic

详细文档


更新日志

v1.1.0 (2025-01)

  • 新增 HTML 文件支持,保留原有格式
  • 自动检测文件格式(Markdown 或 HTML)
  • 从 HTML <title><h1> 标签提取标题
  • 支持内联样式和丰富的 HTML 格式

v1.0.0 (2025-01)

  • 首次发布,支持微信公众号
  • 基于 API 发布(无需浏览器自动化)
  • 跨平台支持(macOS、Linux、Windows)
  • Markdown 自动转换为公众号格式
  • 图片自动上传
  • 小绿书(newspic)支持
  • 仅保存草稿(安全设计)

许可证

MIT License - 见 LICENSE

作者

iamzifei


贡献

  • Issues:报告 Bug 或提出功能建议
  • PR:欢迎贡献代码

常见问题

What is wechat-article-publisher-skill?

wechat-article-publisher-skill is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by iamzifei. Claude Skill that publish on Wechat articles (微信公众号发布). It has 133 GitHub stars.

Is wechat-article-publisher-skill safe to use?

Yes. wechat-article-publisher-skill passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install wechat-article-publisher-skill?

Clone the repository with "git clone https://github.com/iamzifei/wechat-article-publisher-skill" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is wechat-article-publisher-skill written in?

wechat-article-publisher-skill is primarily written in Python. It is open-source under iamzifei on GitHub, so you can review or fork the full source.

Are there alternatives to wechat-article-publisher-skill?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh wechat-article-publisher-skill against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情