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.

referencesarticle-posting.md

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

Article Posting (文章发表)

Post markdown articles to WeChat Official Account with full formatting support.

Usage

# Post markdown article
${BUN_X} ./scripts/wechat-article.ts --markdown article.md

# With theme
${BUN_X} ./scripts/wechat-article.ts --markdown article.md --theme grace

# Disable bottom citations for ordinary external links
${BUN_X} ./scripts/wechat-article.ts --markdown article.md --no-cite

# With explicit options
${BUN_X} ./scripts/wechat-article.ts --markdown article.md --author "作者名" --summary "摘要"

Parameters

Parameter Description
--markdown <path> Markdown file to convert and post
--theme <name> Theme: default, grace, simple, modern
--no-cite Keep ordinary external links inline instead of converting them to bottom citations
--title <text> Override title (auto-extracted from markdown)
--author <name> Author name
--summary <text> Article summary
--html <path> Pre-rendered HTML file (alternative to markdown)
--profile <dir> Chrome profile directory

Markdown Format

---
title: Article Title
author: Author Name
---

# Title (becomes article title)

Regular paragraph with **bold** and *italic*.

## Section Header

![Image description](./image.png)

- List item 1
- List item 2

> Blockquote text

[Link text](https://example.com)

Markdown mode converts ordinary external links into bottom citations by default for WeChat-friendly output. Use --no-cite to disable that behavior.

Image Handling

  1. Parse: Images in markdown are replaced with WECHATIMGPH_N
  2. Render: HTML is generated with placeholders in text
  3. Paste: HTML content is pasted into WeChat editor
  4. Replace: For each placeholder:
    • Find and select the placeholder text
    • Scroll into view
    • Press Backspace to delete the placeholder
    • Paste the image from clipboard

Scripts

Script Purpose
wechat-article.ts Main article publishing script
md-to-wechat.ts Markdown to HTML with placeholders
md/render.ts Markdown rendering with themes

Example Session

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

Claude:
1. Parses markdown, finds 5 images
2. Generates HTML with placeholders
3. Opens Chrome, navigates to WeChat editor
4. Pastes HTML content
5. For each image:
   - Selects WECHATIMGPH_1
   - Scrolls into view
   - Presses Backspace to delete
   - Pastes image
6. Reports: "Article composed with 5 images."

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.