All skills
jimliu avatar

/baoyu-post-to-wechat

@441ca30 official
by Jim Liu 宝玉jimliu/baoyu-skills26k stars
2,896

Posts content to WeChat Official Account (微信公众号) via API or Chrome CDP. Supports article posting (文章) with HTML, markdown, or plain text input, and image-text posting (贴图, formerly 图文) with multiple images. Markdown article workflows default to converting ordinary external links into bottom citations for WeChat-friendly output. Use when user mentions "发布公众号", "post to wechat", "微信公众号", or "贴图/图文/文章".

Use this Skill: https://skilld.dev/gh/jimliu/baoyu-skills/baoyu-post-to-wechat

This session only. Nothing lands on disk.

referencesimage-text-posting.md

≈709 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Image-Text Posting (贴图发表, formerly 图文)

Post image-text messages with multiple images to WeChat Official Account.

Note: WeChat has renamed "图文" to "贴图" in the Official Account menu (as of 2026).

Usage

# Post with images and markdown file (title/content extracted automatically)
${BUN_X} ./scripts/wechat-browser.ts --markdown source.md --images ./images/

# Post with explicit title and content
${BUN_X} ./scripts/wechat-browser.ts --title "标题" --content "内容" --image img1.png --image img2.png

# Save as draft
${BUN_X} ./scripts/wechat-browser.ts --markdown source.md --images ./images/ --submit

Parameters

Parameter Description
--markdown <path> Markdown file for title/content extraction
--images <dir> Directory containing images (sorted by name)
--title <text> Article title (max 20 chars, auto-compressed if too long)
--content <text> Article content (max 1000 chars, auto-compressed if too long)
--image <path> Single image file (can be repeated)
--submit Save as draft (default: preview only)
--profile <dir> Chrome profile directory

Auto Title/Content from Markdown

When using --markdown, the script:

  1. Parses frontmatter for title and author:

    ---
    title: 文章标题
    author: 作者名
    ---
  2. Falls back to H1 if no frontmatter title:

    # 这将成为标题
  3. Compresses title to 20 characters if too long:

    • Original: "如何在一天内彻底重塑你的人生"
    • Compressed: "一天彻底重塑你的人生"
  4. Extracts first paragraphs as content (max 1000 chars)

Image Directory Mode

When using --images <dir>:

  • All PNG/JPG files in directory are uploaded
  • Files are sorted alphabetically by name
  • Naming convention: 01-cover.png, 02-content.png, etc.

Constraints

Field Max Length Notes
Title 20 chars Auto-compressed if longer
Content 1000 chars Auto-compressed if longer
Images 9 max WeChat limit

Example Session

User: /post-to-wechat --markdown ./article.md --images ./xhs-images/

Claude:
1. Parses markdown meta:
   - Title: "如何在一天内彻底重塑你的人生" → "一天内重塑你的人生"
   - Author: from frontmatter or default
2. Extracts content from first paragraphs
3. Finds 7 images in xhs-images/
4. Opens Chrome, navigates to WeChat "图文" editor
5. Uploads all images
6. Fills title and content
7. Reports: "Image-text posted with 7 images."

Scripts

Script Purpose
wechat-browser.ts Main image-text posting script
cdp.ts Chrome DevTools Protocol utilities
copy-to-clipboard.ts Clipboard operations

Source: SKILL.md on GitHub

2 warnings16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill provides workflows for automated content publishing to WeChat Official Accounts via API methods or Chrome CDP. The technical capabilities (spawning processes, controlling Chrome, clipboard interactions, managing local configuration files and environment secrets) align with its designated function. There are no malicious elements, exfiltration patterns, or obfuscation flags identified during analysis.

  • Socket16d

    3 alerts: gptSecurity, gptAnomaly

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    77/126 files flagged

  • ZeroLeaks5mo

    1 finding · Score: 86/100

Signed by skilld at 441ca30. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 4 months ago
version
1.118.2
Other metadata
metadata
{
  "openclaw": {
    "homepage": "https://github.com/JimLiu/baoyu-skills#baoyu-post-to-wechat",
    "requires": {
      "anyBins": [
        "bun",
        "npx"
      ]
    }
  }
}
  • API
  • wechat
  • markdown
  • html
  • browser
  • automation
  • chrome-cdp
  • image-upload
  • cms
  • china

README badge

README badge for jimliu/baoyu-skills/baoyu-post-to-wechat

Publishes articles and image-text posts to WeChat Official Accounts via API or Chrome automation, with support for HTML, markdown, or plain text input. Converts markdown links to bottom citations by default and handles cover images, themes, colors, and multi-account management through local configuration.

Generated from the current SKILL.md.

Does this skill work with plain text, markdown, and HTML input?
Yes. Plain text is saved to a timestamped markdown file, markdown files are processed with optional citation conversion, and HTML files are posted as-is. The publishing method (API or browser) determines how images are handled internally.
What are the differences between API, browser, and remote-api publishing methods?
API is fastest and requires local IP allowlisting or remote-api tunneling; browser is slower but needs only a logged-in Chrome session; remote-api uses SSH to tunnel API calls through an allowlisted server IP without writing files or exposing credentials remotely.
Can I manage multiple WeChat Official Accounts with this skill?
Yes. Define an `accounts:` block in EXTEND.md with multiple entries. The skill prompts for account selection or auto-selects based on `default: true` or the `--account` CLI flag.
What are the cover image requirements?
For API publishing with article type `news`, a cover image is required. The skill looks for it via CLI `--cover`, frontmatter fields (`coverImage`, `featureImage`, `cover`, `image`), a file at `imgs/cover.png`, or the first inline image in the content.
How do I set up API credentials for the first time?
If credentials are missing when API or remote-api is selected, the skill runs a guided setup that writes them to `.baoyu-skills/.env`. You can also configure them manually before first use per `references/api-setup.md`.

Generated from the current SKILL.md. These answers refresh after source changes.