AI Agent Hub
Back to skills
WeChat Article Auto-Publisher icon

WeChat Article Auto-Publisher

Content Creation Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

To install this skill into your AI assistant, follow the instructions at https://skillhub.cn/install/skillhub.md for @user_57af6244/wechat-ai-publisher.

About this skill

Problem Addressed

Publishing articles on WeChat Official Accounts often involves a disjointed series of manual steps: from gathering materials and writing content, processing images, converting Markdown to WeChat-compatible HTML, uploading assets, creating drafts, to final archiving. This manual process is time-consuming and prone to errors such as broken image links, missing cover images, or credential security issues, leading to failed posts or data leaks. This skill automates these mechanical steps, allowing creators to focus more on the content itself.

How It Works

The skill features a modular design, with core capabilities divided into six clear steps, and the publishing side (steps 3-6) is chained together via the run_pipeline.py script. The writing step is pluggable and designed to integrate with other writing skills.

Key Steps in Detail:

  1. Material Collection & Organization: Supports link scraping, text distillation, and document parsing. It uses web_fetch to get webpage content, processes text to extract 3-5 key points, and filters images for later use.
  2. Article Writing: This step is handled by external, pluggable writing skills. Options in the skill library include wechat-article-writer (multiple styles) or laoluo-article-writer (strong persona), or self-writing based on quality standards in references/writing-quality.md (including anti-translation-sounding final checks), producing an article.md file.
  3. Image Processing: A cover image is mandatory for WeChat drafts. The skill compresses the cover (recommended ≤800KB) and uploads it to the WeChat material library to obtain a thumb_media_id. Body images (recommended 1 per 500 words) are also uploaded to get WeChat internal URLs, as drafts do not support external image links.
  4. Markdown to WeChat HTML Conversion: Uses the markdown_to_wechat_doocs.py script, supporting 5 preset themes (e.g., cyan for tech, orange for warm). Post-processing replaces image placeholders in the HTML with the WeChat material URLs and can append a brand signature block.
  5. Draft Creation: Creates a draft in the Official Account backend via create_draft.py. This is the default operation and does not auto-publish; manual confirmation in the WeChat backend is required, ensuring security.
  6. Archiving: Files the final Markdown article and a metadata JSON file containing media_id, thumb_media_id, etc., into the articles/published/ directory.

The entire publishing side (steps 3-6) can be executed in one go with run_pipeline.py. Configuration is provided via a .env file or command-line arguments for app_id and app_secret, with clear priority.

Important Considerations

  • Image Specifications: WeChat material images have a size limit of 2MB; exceeding this causes API errors (e.g., 40006). Cover images are recommended to be compressed to ≤800KB.
  • Image Links: WeChat draft bodies do not support direct external image links. You must use URLs obtained from material uploads. The run_pipeline.py script's --body-images parameter handles uploading and replacement automatically.
  • Security & Credentials: AppSecret is a high-risk credential and should never be written to logs, articles, or conversation prompts. Use .env files or environment variables for management.
  • Publishing Control: The skill defaults to creating drafts only; publishing requires manual confirmation in the WeChat Official Account backend, a key safety design.
  • Network & Quotas: Scripts include automatic network retries (3 times with exponential backoff), but ensure stable access to api.weixin.qq.com. WeChat APIs have daily call quotas; exceeding them requires waiting until the next day.

Use Cases

  • An editor responsible for scheduled Official Account posts needs to batch-convert ready Markdown articles into WeChat-compliant HTML and auto-create drafts.
  • An operator managing multiple Official Accounts requires a unified workflow to organize materials from different sources, process images, and securely publish to the respective accounts.
  • A tech team needs to automatically convert internal Markdown technical docs or blog posts into Official Account article format for publishing, ensuring appropriate layout themes are applied.
  • An individual or team needing to securely handle Official Account API credentials and avoid exposing secrets in logs or code.

Best For

  • An editor responsible for scheduled Official Account posts who needs to automate the mechanical steps from manuscript to draft for accuracy.
  • An operator managing multiple Official Accounts who requires a unified workflow to avoid format or link errors caused by manual operations.
  • A developer or technical author who publishes internal technical documentation as Official Account articles and needs reliable Markdown conversion and formatting.
  • An individual developer or small team that prioritizes API key security and needs to manage credentials via configuration files or environment variables.