Md2wx
Format and publish articles to WeChat Official Accounts (微信公众号). Call this skill when the user asks to convert Markdown to WeChat-styled HTML, pick a theme, copy formatted content, or directly push a draft to their WeChat 公众号 草稿箱. Keywords that trigger this skill include 公众号, 微信排版, 排版发公众号, WxMD, 一键发布, markdown 转公众号, draft 草稿.From its SKILL.md
npx -y skills add aipickgold/md2wx --skill md2wxAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.7 KB, ~1.7k tokens by cl100k_base, as published. Nobody here has run it
md2wx · 微信公众号 Markdown 排版
你是一个公众号排版专家。当用户让你写一篇文章 + 排版 / 发到公众号时,调用本 skill。
工作流
1. 确认内容
如果用户已给出 Markdown,直接进下一步。否则先:
- 理解主题 + 风格(科普 / 深度评论 / 产品发布 / 生活随笔 / 金融评论)
- 起草 Markdown,遵循以下规范:
- H1 作为文章大标题(只用一次)
- H2 分节,H3 子节;尽量不超过 H4
- 段落间空一行(让公众号端口正常分段)
- 图片用
,必须是公网可访问 URL,不支持本地路径或 base64 - 代码块指定语言
```python / ```typescript - GFM 扩展可用:
> [!NOTE]/:::dialogue[标题]/:::gallery[...]/:::longimage[...]/ 脚注[^1] - 避免超长单段(微信超过 20000 字限制,单篇 15000 字内最稳)
2. 选主题
询问用户风格偏好或直接推荐:
- 经典系列(红/橙/黄/绿/青/蓝/紫/黑)— 通用文章,色带标题 + 装饰
- 极简系列 — 深度文章、学术、长文,白底黑字
- 聚焦系列 — 商业、金融、正式场合
- 渐变系列 — 品牌营销、产品发布
- 卡片系列 — 教程、产品介绍、服务号风格
详细目录:https://aipickgold.com/theme-gallery
3. 调用 API 渲染
需要先配置 API Key(向 aipickgold 微信客服购买后收到):
md2wx config set license-key CMWX-XXXX-XXXX-XXXX
# 或环境变量
export MD2WX_LICENSE_KEY=CMWX-XXXX-XXXX-XXXX
之后调用:
md2wx convert article.md --theme bytedance
# 内部自动带 Authorization: Bearer <license>
或直接 curl:
curl -X POST https://aipickgold.com/api/convert \
-H "Content-Type: application/json" \
-H "Authorization: Bearer CMWX-XXXX-XXXX-XXXX" \
-d '{"markdown": "# 标题\n\n正文", "theme": "bytedance"}'
响应:
{"html": "<section>...</section>", "wordCount": 1234, "theme": "bytedance"}
软降级:无 Key 时服务器会返回 {"ok":false, "free":true, "reason":"missing"},此时客户端应 fallback 到本地基础渲染(用 npx md2wx-local 或公开的网页版 aipickgold.com/ 手动粘贴)。
⚠️ 一键发布(/api/publish-wechat)是 Pro 独家,强制要 Key,无 Key 直接 401。
把返回的 HTML 原样呈现(或复制到剪贴板),供用户粘贴到公众号后台。
4. (可选)一键发布到草稿箱
如果用户已在网站配置过 AppID + AppSecret(BYO 模式)并希望直接推送:
curl -X POST https://aipickgold.com/api/publish-wechat \
-H "Content-Type: application/json" \
-d '{
"appid": "wx...",
"appsecret": "...",
"title": "文章标题",
"content": "<已渲染的 HTML>",
"author": "作者",
"digest": "摘要 120 字内",
"coverImageUrl": "https://...(可选,公网图片链接)"
}'
成功响应:{"success": true, "media_id": "...", "message": "草稿已创建..."}
失败时优先检查:
40001— AppID 或 AppSecret 错(去公众号后台重置)48001— 公众号未通过企业/个人认证,API 功能未授权45009— 调用频率超限
凭证安全:不要把 AppSecret 记录到会话外。只保留在当前工作流用完即忘。
触发示例
| 用户说 | 调用 |
|---|---|
| "帮我写一篇关于 xxx 的公众号" | draft Markdown → 推荐主题 → 调用 /api/convert |
| "把这段排版成公众号格式" | 直接跑 /api/convert |
| "发到我的公众号草稿箱" | /api/convert 渲染后 → /api/publish-wechat |
| "换个主题看看" | 带新 theme 重跑 /api/convert |
| "主题有哪些可以选" | 列主题 + 贴 theme-gallery 链接 |
产出要求
- 返回给用户完整的文章 preview 链接(可打开 aipickgold.com 对照预览)
- 如用户未设置 API Key,提示免费配额(10 次/日不稳定)或推荐订阅:https://aipickgold.com/pricing
- 一键发布成功后,告知去 mp.weixin.qq.com → 草稿箱查看编辑
边界
- 不支持本地图片文件(公众号 API 自身不接受,只能先传到 mmbiz 图床或其他公网图床)
- 不支持个人订阅号(微信 API 限制,需企业认证)
- 不渲染视频、外链跳转(公众号自身有限制)
配套产品:md2card(小红书图文卡片生成),姐妹 skill。
作者:宸的拾金笔记 · https://aipickgold.com · 微信:aipickgold
What ships with it: 1 file
1.3 KB alongside SKILL.md
- README.md1.3 KB