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.

referencesconfigfirst-time-setup.md

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

First-Time Setup

Overview

When no EXTEND.md is found, guide user through preference setup.

BLOCKING OPERATION: This setup MUST complete before ANY other workflow steps. Do NOT:

  • Ask about content or files to publish
  • Ask about themes or publishing methods
  • Proceed to content conversion or publishing

ONLY ask the questions in this setup flow, save EXTEND.md, then continue.

Setup Flow

No EXTEND.md found
        |
        v
+---------------------+
| AskUserQuestion     |
| (all questions)     |
+---------------------+
        |
        v
+---------------------+
| Create EXTEND.md    |
+---------------------+
        |
        v
    Continue to Step 1

Questions

Language: Use user's input language or saved language preference.

Use AskUserQuestion with ALL questions in ONE call:

Question 1: Default Theme

header: "Theme"
question: "Default theme for article conversion?"
options:
  - label: "default (Recommended)"
    description: "Classic layout - centered title with border, white-on-color H2 (default: blue)"
  - label: "grace"
    description: "Elegant - text shadows, rounded cards, refined blockquotes (default: purple)"
  - label: "simple"
    description: "Minimal modern - asymmetric rounded corners, clean whitespace (default: green)"
  - label: "modern"
    description: "Large rounded corners, pill headings, spacious (default: orange)"

Question 2: Default Color

header: "Color"
question: "Default color preset? (theme default if not set)"
options:
  - label: "Theme default (Recommended)"
    description: "Use the theme's built-in default color"
  - label: "blue"
    description: "#0F4C81 经典蓝"
  - label: "red"
    description: "#A93226 中国红"
  - label: "green"
    description: "#009874 翡翠绿"

Note: User can choose "Other" to type any preset name (vermilion, yellow, purple, sky, rose, olive, black, gray, pink, orange) or hex value.

Question 3: Default Publishing Method

header: "Method"
question: "Default publishing method?"
options:
  - label: "api (Recommended)"
    description: "Fast, requires API credentials (AppID + AppSecret)"
  - label: "browser"
    description: "Slow, requires Chrome and login session"
  - label: "remote-api"
    description: "Fast, tunnels WeChat API calls through SSH to a server whose IP is on the WeChat allowlist"

If the user selects remote-api, prompt for remote_publish_host and (optionally) remote_publish_user, remote_publish_identity_file. These can also be filled in later by editing EXTEND.md.

Question 4: Default Author

header: "Author"
question: "Default author name for articles?"
options:
  - label: "No default"
    description: "Leave empty, specify per article"

Note: User will likely choose "Other" to type their author name.

Question 5: Open Comments

header: "Comments"
question: "Enable comments on articles by default?"
options:
  - label: "Yes (Recommended)"
    description: "Allow readers to comment on articles"
  - label: "No"
    description: "Disable comments by default"

Question 6: Fans-Only Comments

header: "Fans only"
question: "Restrict comments to followers only?"
options:
  - label: "No (Recommended)"
    description: "All readers can comment"
  - label: "Yes"
    description: "Only followers can comment"

Question 7: Save Location

header: "Save"
question: "Where to save preferences?"
options:
  - label: "Project (Recommended)"
    description: ".baoyu-skills/ (this project only)"
  - label: "User"
    description: "~/.baoyu-skills/ (all projects)"

Save Locations

Choice Path Scope
Project .baoyu-skills/baoyu-post-to-wechat/EXTEND.md Current project
User ~/.baoyu-skills/baoyu-post-to-wechat/EXTEND.md All projects

After Setup

  1. Create directory if needed
  2. Write EXTEND.md
  3. Confirm: "Preferences saved to [path]"
  4. Continue to Step 0 (load the saved preferences)

EXTEND.md Template

Single Account (Default)

default_theme: [default/grace/simple/modern]
default_color: [preset name, hex, or empty for theme default]
default_publish_method: [api/browser/remote-api]
default_author: [author name or empty]
need_open_comment: [1/0]
only_fans_can_comment: [1/0]
chrome_profile_path:

# Remote API publishing — only fill in if default_publish_method is remote-api
# or you plan to pass --remote on the CLI.
remote_publish_host:
remote_publish_user:
remote_publish_port:
remote_publish_identity_file:
remote_publish_known_hosts_file:
remote_publish_strict_host_key_checking:
remote_publish_connect_timeout:
remote_publish_proxy_jump:

Raw ssh / scp options are intentionally not supported; only the typed keys above are honored. Authentication is SSH key only.

Multi-Account

default_theme: [default/grace/simple/modern]
default_color: [preset name, hex, or empty for theme default]

accounts:
  - name: [display name]
    alias: [short key, e.g. "baoyu"]
    default: true
    default_publish_method: [api/browser/remote-api]
    default_author: [author name]
    need_open_comment: [1/0]
    only_fans_can_comment: [1/0]
    app_id: [WeChat App ID, optional]
    app_secret: [WeChat App Secret, optional]
    # Remote API publishing (optional, per-account override of globals)
    remote_publish_host:
    remote_publish_user:
    remote_publish_identity_file:
  - name: [second account name]
    alias: [short key, e.g. "ai-tools"]
    default_publish_method: [api/browser/remote-api]
    default_author: [author name]
    need_open_comment: [1/0]
    only_fans_can_comment: [1/0]

Adding More Accounts Later

After initial setup, users can add accounts by editing EXTEND.md:

  1. Add an accounts: block with list items
  2. Move per-account settings (author, publish method, comments) into each account entry
  3. Keep global settings (theme, color) at the top level
  4. Each account needs a unique alias (used for CLI --account arg and Chrome profile naming)
  5. Set default: true on the primary account

Modifying Preferences Later

Users can edit EXTEND.md directly or delete it to trigger setup again.

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.