Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
iamzifei avatar

Wechat Article Publisher

  • 2.5k installs
  • 152 repo stars
  • Updated January 16, 2026
  • iamzifei/wechat-article-publisher-skill

wechat-article-publisher publishes Markdown or HTML articles to WeChat Official Account drafts via the wx.limyai.com OpenAPI.

About

The wechat-article-publisher skill publishes Markdown or HTML content to WeChat Official Account drafts through direct API calls to wx.limyai.com, avoiding browser automation for reliability and speed. It requires WECHAT_API_KEY in the environment, Python 3.9 plus, and an authorized WeChat account on wx.limyai.com. The workflow checks the API key, lists authorized accounts with wechat_api.py, detects file format, and calls the publish endpoint to create a draft. Supported formats include .md files converted by the API and .html files with preserved formatting, plus newspic image-text mode with up to twenty images. Critical rules forbid auto-publishing to live feeds, require listing accounts first, and preserve original content. Error codes cover missing keys, unauthorized accounts, expired tokens, and WeChat API failures. After success the agent reminds users to review and publish manually in the WeChat admin panel.

  • API-first publishing to WeChat drafts via wx.limyai.com with X-API-Key auth.
  • Supports Markdown, HTML, and newspic image-text article types.
  • NEVER auto-publishes live; drafts only for manual WeChat admin review.
  • wechat_api.py scripts for list-accounts and publish from markdown or HTML.
  • Images in markdown or HTML are auto-uploaded to WeChat when referenced.

Wechat Article Publisher by the numbers

  • 2,528 all-time installs (skills.sh)
  • +25 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #232 of 1,879 Marketing & SEO skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

wechat-article-publisher capabilities & compatibility

Capabilities
list authorized wechat accounts via openapi · publish markdown or html to draft endpoint · newspic image text mode with image extraction · api key validation and structured error handling · format detection and title extraction from h1 or
Use cases
copywriting · marketing · email
Pricing
Bring your own API key
From the docs

What wechat-article-publisher says it does

Unlike browser-based publishing, this skill uses direct API calls for reliable, fast publishing.
SKILL.md
npx skills add https://github.com/iamzifei/wechat-article-publisher-skill --skill wechat-article-publisher

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2.5k
repo stars152
Security audit2 / 3 scanners passed
Last updatedJanuary 16, 2026
Repositoryiamzifei/wechat-article-publisher-skill

How do I send a Markdown or HTML article to a WeChat Official Account draft box reliably without browser UI automation?

Publish Markdown or HTML articles to WeChat Official Account drafts via wx.limyai.com API without browser automation.

Who is it for?

Teams with WECHAT_API_KEY and authorized wx.limyai.com accounts publishing articles to WeChat drafts.

Skip if: Skip when the user needs live auto-publish, multi-platform syndication, or has no API key or authorized account.

When should I use this skill?

User asks to publish Markdown or HTML to WeChat Official Account, WeChat drafts, or 微信公众号.

What you get

A draft created in WeChat with publicationId, mediaId, and status returned from the publish API.

  • wechat json payload
  • stripped html article

Files

SKILL.mdMarkdownGitHub ↗

WeChat Article Publisher

Publish Markdown or HTML content to WeChat Official Account drafts via API, with automatic format conversion.

Prerequisites

  • WECHAT_API_KEY environment variable set (from .env file)
  • Python 3.9+
  • Authorized WeChat Official Account on wx.limyai.com

Scripts

Located in ~/.claude/skills/wechat-article-publisher/scripts/:

wechat_api.py

WeChat API client for listing accounts and publishing articles:

# List authorized accounts
python wechat_api.py list-accounts

# Publish from markdown file
python wechat_api.py publish --appid <wechat_appid> --markdown /path/to/article.md

# Publish from HTML file (preserves formatting)
python wechat_api.py publish --appid <wechat_appid> --html /path/to/article.html

# Publish with custom options
python wechat_api.py publish --appid <appid> --markdown /path/to/article.md --type newspic

parse_markdown.py

Parse Markdown and extract structured data (optional, for advanced use):

python parse_markdown.py <markdown_file> [--output json|html]

Workflow

Strategy: "API-First Publishing"

Unlike browser-based publishing, this skill uses direct API calls for reliable, fast publishing.

1. Load WECHAT_API_KEY from environment 2. List available WeChat accounts (if user hasn't specified) 3. Detect file format (Markdown or HTML) and parse accordingly 4. Call publish API to create draft in WeChat 5. Report success with draft details

Supported File Formats:

  • .md files → Parsed as Markdown, converted by WeChat API
  • .html files → Sent as HTML, formatting preserved

Step-by-Step Guide

Step 1: Check API Key

Before any operation, verify the API key is available:

# Check if .env file exists and contains WECHAT_API_KEY
cat .env | grep WECHAT_API_KEY

If not set, remind user to: 1. Copy .env.example to .env 2. Set their WECHAT_API_KEY value

Step 2: List Available Accounts

Get the list of authorized WeChat accounts:

python ~/.claude/skills/wechat-article-publisher/scripts/wechat_api.py list-accounts

Output example:

{
  "success": true,
  "data": {
    "accounts": [
      {
        "name": "我的公众号",
        "wechatAppid": "wx1234567890",
        "username": "gh_abc123",
        "type": "subscription",
        "verified": true,
        "status": "active"
      }
    ],
    "total": 1
  }
}

Important:

  • If only one account, use it automatically
  • If multiple accounts, ask user to choose
  • Note the wechatAppid for publishing

Step 3: Publish Article

For Markdown files:

python ~/.claude/skills/wechat-article-publisher/scripts/wechat_api.py publish \
  --appid <wechatAppid> \
  --markdown /path/to/article.md

For HTML files (preserves formatting):

python ~/.claude/skills/wechat-article-publisher/scripts/wechat_api.py publish \
  --appid <wechatAppid> \
  --html /path/to/article.html

For 小绿书 (image-text mode):

python ~/.claude/skills/wechat-article-publisher/scripts/wechat_api.py publish \
  --appid <wechatAppid> \
  --markdown /path/to/article.md \
  --type newspic

Success response:

{
  "success": true,
  "data": {
    "publicationId": "uuid-here",
    "materialId": "uuid-here",
    "mediaId": "wechat-media-id",
    "status": "published",
    "message": "文章已成功发布到公众号草稿箱"
  }
}

Step 4: Report Result

After successful publishing:

  • Confirm the draft was created
  • Remind user to review and publish manually in WeChat admin panel
  • Provide any relevant IDs for reference

API Reference

Authentication

All API requests require the X-API-Key header:

X-API-Key: WECHAT_API_KEY

Get Accounts List

POST https://wx.limyai.com/api/openapi/wechat-accounts

Publish Article

POST https://wx.limyai.com/api/openapi/wechat-publish

Parameters:

ParameterTypeRequiredDescription
wechatAppidstringYesWeChat AppID
titlestringYesArticle title (max 64 chars)
contentstringYesArticle content (Markdown/HTML)
summarystringNoArticle summary (max 120 chars)
coverImagestringNoCover image URL
authorstringNoAuthor name
contentFormatstringNo'markdown' (default) or 'html'
articleTypestringNo'news' (default) or 'newspic'

Error Codes

CodeDescription
API_KEY_MISSINGAPI key not provided
API_KEY_INVALIDAPI key invalid
ACCOUNT_NOT_FOUNDAccount not found or unauthorized
ACCOUNT_TOKEN_EXPIREDAccount authorization expired
INVALID_PARAMETERInvalid parameter
WECHAT_API_ERRORWeChat API call failed
INTERNAL_ERRORServer error

Critical Rules

1. NEVER auto-publish - Only save to drafts, user publishes manually 2. Check API key first - Fail fast if not configured 3. List accounts first - User may have multiple accounts 4. Handle errors gracefully - Show clear error messages 5. Preserve original content - Don't modify user's markdown unnecessarily

Supported Formats

Markdown Files (.md)

  • H1 header (# ) → Article title
  • H2/H3 headers (##, ###) → Section headers
  • Bold (text)
  • Italic (text)
  • Links text
  • Blockquotes (> )
  • Code blocks (`` ... ``)
  • Lists (- or 1.)
  • Images !alt → Auto-uploaded to WeChat

HTML Files (.html)

  • <title> or <h1> → Article title
  • All HTML formatting preserved (styles, tables, etc.)
  • <img> tags → Images auto-uploaded to WeChat
  • First <p> → Auto-extracted as summary
  • Supports inline styles and rich formatting

HTML Title Extraction Priority: 1. <title> tag content 2. First <h1> tag content 3. "Untitled" as fallback

HTML Content Extraction:

  • If <body> exists, uses body content
  • Otherwise, strips <html>, <head>, <!DOCTYPE> and uses remaining content

Article Types

news (普通文章)

  • Standard WeChat article format
  • Full Markdown/HTML support
  • Rich text with images

newspic (小绿书/图文消息)

  • Image-focused format (like Instagram posts)
  • Maximum 20 images extracted from content
  • Text content limited to 1000 characters
  • Images auto-uploaded to WeChat

Example Flow

Markdown File

User: "把 ~/articles/ai-tools.md 发布到微信公众号"

# Step 1: Verify API key
cat .env | grep WECHAT_API_KEY

# Step 2: List accounts
python ~/.claude/skills/wechat-article-publisher/scripts/wechat_api.py list-accounts

# Step 3: Publish (assuming single account with appid wx1234567890)
python ~/.claude/skills/wechat-article-publisher/scripts/wechat_api.py publish \
  --appid wx1234567890 \
  --markdown ~/articles/ai-tools.md

# Step 4: Report
# "文章已成功发布到公众号草稿箱!请登录微信公众平台预览并发布。"

HTML File

User: "把这个HTML文章发布到公众号:~/articles/newsletter.html"

# Step 1: Verify API key
cat .env | grep WECHAT_API_KEY

# Step 2: List accounts
python ~/.claude/skills/wechat-article-publisher/scripts/wechat_api.py list-accounts

# Step 3: Publish HTML (auto-detects format)
python ~/.claude/skills/wechat-article-publisher/scripts/wechat_api.py publish \
  --appid wx1234567890 \
  --html ~/articles/newsletter.html

# Step 4: Report
# "文章已成功发布到公众号草稿箱!HTML格式已保留。请登录微信公众平台预览并发布。"

Error Handling

API Key Not Found

Error: WECHAT_API_KEY environment variable not set.

Solution: Ask user to set up .env file with their API key.

Account Not Found

Error: ACCOUNT_NOT_FOUND - 公众号不存在或未授权

Solution: Ask user to authorize their account on wx.limyai.com.

Token Expired

Error: ACCOUNT_TOKEN_EXPIRED - 公众号授权已过期

Solution: Ask user to re-authorize on wx.limyai.com.

WeChat API Error

Error: WECHAT_API_ERROR - 微信接口调用失败

Solution: May be temporary issue, retry or check WeChat service status.

Best Practices

Why use API instead of browser automation?

1. Reliability: Direct API calls are more stable than browser automation 2. Speed: No browser startup, page loading, or UI interactions 3. Simplicity: Single command to publish 4. Portability: Works on any system with Python (no macOS-only dependencies)

Content Guidelines

1. Images: Use public URLs when possible; local images will be uploaded 2. Title: Keep under 64 characters 3. Summary: Auto-extracted from first paragraph if not provided 4. Cover: First image in markdown becomes cover if not specified

Workflow Efficiency

Minimal workflow (1 command):
- list-accounts → get appid → publish → done

Full workflow (with verification):
1. Check .env → list accounts → confirm with user
2. Publish with options → report result

Troubleshooting

Q: How do I get a WECHAT_API_KEY?

A: Register and authorize your WeChat account at wx.limyai.com to get your API key.

Q: Can I publish to multiple accounts?

A: Yes, use list-accounts to see all authorized accounts, then specify the target --appid.

Q: Images not showing in WeChat?

A: Ensure images are accessible URLs. Local images are auto-uploaded but may fail if path is incorrect.

Q: Title is too long?

A: WeChat limits titles to 64 characters. The script will use the first 64 chars of H1.

Q: What's the difference between news and newspic?

A: news is standard article format; newspic (小绿书) is image-focused with limited text.

Related skills

How it compares

Use wechat-article-publisher for WeChat-specific Markdown-to-structured-data conversion; use generic static-site or RSS skills for non-WeChat content distribution.

FAQ

Does this skill publish articles live automatically?

No. It only saves to drafts; the user must review and publish manually in the WeChat admin panel.

What API key is required?

WECHAT_API_KEY must be set in the environment and sent as X-API-Key to wx.limyai.com endpoints.

What is the difference between news and newspic?

news is standard article format; newspic is image-focused with up to 20 images and 1000 character text limit.

Is Wechat Article Publisher safe to install?

skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Marketing & SEOcontentdistribution

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.