home / skills / openclaw / skills / wechat-multi-publisher

wechat-multi-publisher skill

/skills/x402spark-jpg/wechat-multi-publisher

This skill publishes multiple Markdown articles to WeChat Official Account drafts in one call, with smart covers and auto-uploaded images.

npx playbooks add skill openclaw/skills --skill wechat-multi-publisher

Review the files below or copy the command above to add this skill to your agents.

Files (4)
SKILL.md
2.2 KB
---
name: wechat-mp-publisher
description: "Publish one or multiple Markdown articles to WeChat Official Account (公众号) draft box in a single API call. Supports multi-article combined drafts (main article + sub-articles), smart cover image selection with Unsplash auto-match + 12-image fallback rotation, custom styling (gold quote highlights, && section dividers, accent headings), inline image auto-upload to WeChat CDN, digest auto-extraction, and optional immediate publish. Activate when user wants to push Markdown files to WeChat MP, publish to 公众号草稿箱, schedule WeChat articles, or automate public account content delivery."
---

# wechat-mp-publisher

Publish Markdown articles to WeChat Official Account draft box.

## Key features

- **Multi-article push** — main article + up to 7 sub-articles in one draft (unique vs single-article tools)
- **Smart cover images** — keyword-matched Unsplash + 12-image fallback pool, each article gets a different cover
- **Custom styling** — gold quote highlights, `&&` section dividers, accent-colored headings
- **Inline images** — local PNG/JPG auto-uploaded to WeChat CDN
- **Flexible credentials** — env vars or `~/.config/wechat-mp/credentials.json`

## Quick start

```bash
# Install dependency
npm install @wenyan-md/core

# Set credentials
export WECHAT_APP_ID=your_appid
export WECHAT_APP_SECRET=your_appsecret

# Push to draft box
node scripts/publish.mjs main-article.md [sub-article.md ...]
```

See `references/setup.md` for full credential setup, IP whitelist, and cron automation.

## Markdown conventions

**Section divider** (renders as gradient rule):
```
paragraph text

&&

next paragraph
```

**Section header** (renders as accented H2):
```
&& My Section Title
```

**Gold quotes** — automatically highlighted when text starts with:
- `真正的...` / `不是...而是...` / `底层逻辑是...` / `关键不是...`

## CLI reference

```
node scripts/publish.mjs <main.md> [sub1.md] [sub2.md] ...
  --dry-run        Render to /tmp/wechat-preview/ without uploading
  --publish        Also trigger freepublish after draft creation
  --media-id=xxx   Publish an existing draft by media_id
```

## Author field

Set `WECHAT_AUTHOR` env var to customize the author name shown in WeChat.

Overview

This skill publishes one or multiple Markdown articles to a WeChat Official Account draft box in a single API call. It supports combined multi-article drafts (main article + up to seven sub-articles), smart cover image selection, inline image upload to WeChat CDN, and optional immediate publishing. Use it to automate content delivery, schedule posts, or push local Markdown into the 公众号草稿箱 reliably.

How this skill works

The skill parses Markdown files, applies custom rendering rules (section dividers, accent headings, gold-quote highlights), and prepares a combined draft payload for the WeChat MP API. It auto-uploads inline PNG/JPG images to WeChat’s CDN, selects cover images via Unsplash keyword matching with a 12-image fallback rotation, and can create one draft containing a main article plus sub-articles. Credentials are read from environment variables or a credentials JSON file, and the CLI supports dry-run previews, immediate publish, or publishing by existing media_id.

When to use it

  • You want to publish one or more Markdown articles to a WeChat Official Account draft box in one action.
  • You need multi-article combined drafts (main article + sub-articles) for serialized or related posts.
  • You want automatic inline image uploading and smart cover image selection to save manual steps.
  • You need to schedule or trigger immediate publish after draft creation.
  • You prefer pushing content from CI/CD or cron jobs using environment credentials.

Best practices

  • Prepare a single main Markdown file and list sub-articles to keep related content grouped.
  • Use the Markdown conventions: '&&' for section dividers and accent headers, and the gold-quote starters for highlighted quotes.
  • Set WECHAT_AUTHOR and credential env vars (WECHAT_APP_ID, WECHAT_APP_SECRET) or store credentials at ~/.config/wechat-mp/credentials.json.
  • Use --dry-run to render to /tmp/wechat-preview/ for verification before uploading.
  • Provide descriptive keywords in frontmatter or file name to improve Unsplash cover matches.

Example use cases

  • Weekly newsletter: publish a main overview plus multiple sub-article sections as a single combined draft.
  • Serialized story or tutorial: push chapter 0 as main and chapters 1–3 as sub-articles in one API call.
  • Automated blog mirroring: cron job converts local Markdown repo to WeChat drafts with inline image upload.
  • One-click publication: CI pipeline runs publish with --publish to create and immediately freepublish a draft.

FAQ

How many sub-articles can I include in one combined draft?

Up to seven sub-articles plus a main article in a single combined draft.

How are cover images chosen?

The skill attempts keyword-matched Unsplash images and falls back to a 12-image rotation pool so each article receives a different cover.

Where do I put credentials?

You can set WECHAT_APP_ID and WECHAT_APP_SECRET as environment variables or place credentials in ~/.config/wechat-mp/credentials.json.