Back to Marketing & Growth

baoyu-post-to-wechat

WeChatsocial media automationcontent publishingmarketingChrome CDPAI agentofficial accountnodejs
21.7k🕒 2026-06-13Source ↗

Install this skill

npx skills add jimliu/baoyu-skills

Works across Claude Code, Cursor, Codex, Copilot & Antigravity

The baoyu-post-to-wechat skill automates the process of publishing content to WeChat Official Accounts by leveraging Chrome DevTools Protocol. It bypasses the tedious manual editor interface by programmatically injecting markdown-formatted articles or image-text updates directly into the browser session. The skill handles essential browser interactions, such as logging in and triggering paste commands, to ensure content renders correctly within the WeChat platform. It supports distinct publishing modes: one for full-length articles with specific visual themes and another for quick, multi-image content updates. This tool is intended for content creators and marketers who manage WeChat accounts and wish to integrate their publishing workflow directly into their terminal or AI-assisted development environment, reducing the time spent navigating the browser-based backend.

When to Use This Skill

  • Automating daily newsletter publishing from local markdown drafts
  • Deploying content updates directly from a technical documentation pipeline
  • Batch-uploading marketing assets and captions to a WeChat official account
  • Syncing blog posts from a project repository to a social media feed

How to Invoke This Skill

Example prompts that trigger this skill in Claude Code, Cursor, or Antigravity:

  • Post this markdown file to my WeChat Official Account
  • Publish the latest draft from the articles folder to WeChat
  • Use the grace theme to send my markdown post to WeChat
  • Send these images as a new image-text post on WeChat
  • Automate the WeChat article upload process for this file

Pro Tips

  • 💡Utilize the `md-to-wechat.ts` script for seamless Markdown content conversion, ensuring proper formatting and styling within WeChat.
  • 💡Integrate this skill into CI/CD pipelines for automated, scheduled content releases, leveraging its Chrome CDP foundation for robust execution.
  • 💡Always test content formatting and image display in a draft post before final submission, especially when dealing with complex layouts.

What this skill does

  • Converts Markdown files into WeChat-ready HTML formatting
  • Automates browser navigation via Chrome CDP for authenticated posting
  • Supports multiple visual themes for long-form article rendering
  • Manages batch uploads of up to nine images for image-text posts
  • Handles programmatic clipboard injection to mimic user paste actions

When not to use it

  • When you need to perform complex manual media editing within the WeChat backend editor
  • If your organization requires manual content approval workflows that cannot be bypassed

Example workflow

  1. Identify the target markdown file and image assets directory
  2. Execute the appropriate script for article or image-text format
  3. Verify the browser instance launches and handle the QR code login
  4. Allow the script to perform content injection into the WeChat editor
  5. Review the injected content inside the browser window before final submission

Prerequisites

  • Google Chrome browser installed
  • Bun runtime installed for command execution
  • Active WeChat Official Account with login credentials available for QR scan

Pitfalls & limitations

  • !Requires an initial manual QR scan to establish a persistent session
  • !Content formatting may vary slightly if WeChat updates their internal web editor CSS
  • !Clipboard permissions must be enabled on the host system to allow successful pasting

FAQ

Do I need to log in every time I run this?
No. Once you scan the QR code to log in during your first session, the browser preserves your login state for subsequent operations.
Can I customize how my articles look?
Yes. The article script supports themes such as 'grace' and 'simple' to adjust the visual output of your markdown files.
What happens if the script cannot find my Chrome installation?
You must set the WECHAT_BROWSER_CHROME_PATH environment variable to point to the specific location of your Chrome executable.

How it compares

Unlike manual copy-pasting, this skill preserves markdown formatting structures and automates the repetitive browser-click sequence, while generic prompts lack the deep-linked automation required to control an active browser session.

Source & trust

22k stars🕒 Updated 2026-06-13
📄 Full skill instructions — original source: jimliu/baoyu-skills
# Post to WeChat Official Account (微信公众号)

Post content to WeChat Official Account using Chrome CDP automation.

## Script Directory

**Important**: All scripts are located in the scripts/ subdirectory of this skill.

**Agent Execution Instructions**:
1. Determine this SKILL.md file's directory path as SKILL_DIR
2. Script path = ${SKILL_DIR}/scripts/<script-name>.ts
3. Replace all ${SKILL_DIR} in this document with the actual path

**Script Reference**:
| Script | Purpose |
|--------|---------|
| scripts/wechat-browser.ts | Image-text posts (图文) |
| scripts/wechat-article.ts | Full article posting (文章) |
| scripts/md-to-wechat.ts | Markdown → WeChat HTML conversion |
| scripts/copy-to-clipboard.ts | Copy content to clipboard |
| scripts/paste-from-clipboard.ts | Send real paste keystroke |

## Quick Usage

### Image-Text (图文) - Multiple images with title/content

# From markdown file and image directory
npx -y bun ${SKILL_DIR}/scripts/wechat-browser.ts --markdown article.md --images ./images/

# With explicit parameters
npx -y bun ${SKILL_DIR}/scripts/wechat-browser.ts --title "标题" --content "内容" --image img1.png --image img2.png --submit


### Article (文章) - Full markdown with formatting

# Post markdown article
npx -y bun ${SKILL_DIR}/scripts/wechat-article.ts --markdown article.md --theme grace


> **Note**: ${SKILL_DIR} represents this skill's installation directory. Agent replaces with actual path at runtime.

## References

- **Image-Text Posting**: See references/image-text-posting.md for detailed image-text posting guide
- **Article Posting**: See references/article-posting.md for detailed article posting guide

## Prerequisites

- Google Chrome installed
- bun runtime (via npx -y bun)
- First run: log in to WeChat Official Account in the opened browser window

## Features

| Feature | Image-Text | Article |
|---------|------------|---------|
| Multiple images | ✓ (up to 9) | ✓ (inline) |
| Markdown support | Title/content extraction | Full formatting |
| Auto title compression | ✓ (to 20 chars) | ✗ |
| Content compression | ✓ (to 1000 chars) | ✗ |
| Themes | ✗ | ✓ (default, grace, simple) |

## Troubleshooting

- **Not logged in**: First run opens browser - scan QR code to log in, session is preserved
- **Chrome not found**: Set WECHAT_BROWSER_CHROME_PATH environment variable
- **Paste fails**: Check system clipboard permissions

## Extension Support

Custom configurations via EXTEND.md.

**Check paths** (priority order):
1. .baoyu-skills/baoyu-post-to-wechat/EXTEND.md (project)
2. ~/.baoyu-skills/baoyu-post-to-wechat/EXTEND.md (user)

If found, load before workflow. Extension content overrides defaults.

How to Use This Skill Unit

Option A: Project-Specific (Recommended)

  1. Click "Download" above
  2. In your project, create the directory: .agent/skills/baoyu-post-to-wechat/
  3. Save the file as SKILL.md
  4. The agent will automatically discover the skill based on its description.

Option B: Global Installation (All Agents)

Save the file to these locations to make it available across all projects:

  • Claude Code: ~/.claude/skills/jimliu/baoyu-skills/baoyu-post-to-wechat/SKILL.md
  • Cursor: ~/.cursor/skills/jimliu/baoyu-skills/baoyu-post-to-wechat/SKILL.md
  • Antigravity: ~/.gemini/antigravity/skills/jimliu/baoyu-skills/baoyu-post-to-wechat/SKILL.md

🚀 Install with CLI:
npx skills add jimliu/baoyu-skills

Read the Master Guide: Mastering Agent Skills

Recommended Rules

View more rules

Recommended Workflows

View more workflows

Recommended MCP Servers

View more MCP servers

Take It Further

Maximize your productivity with these powerful resources

📋

Define Your Standards

Set up coding standards to ensure this workflow produces consistent, high-quality results.

Browse Rules Library
📖

Master Workflows

Learn how to create custom workflows, use Turbo Mode, and build your automation library.

Complete Guide

How to use this Skill in Claude Code & Cursor

For Claude Code (CLI)

To use this skill in Claude Code, copy the rule content into your project's custom instructions or follow our Add-Skill CLI guide. This ensures Claude follows your standards during every code generation.

For Cursor & Windsurf

For Cursor or Windsurf, individual skills are best used in the "Rules for AI" section. This specific unit helps the agent avoid marketing & growth issues, leading to cleaner, more efficient code.

Why the skill format matters: the standardized Agent Skills format lets your AI agent load detailed instructions only when they are relevant, keeping your prompt clean while improving results.

Source & attribution

This skill is categorized under Marketing & Growth and is published by Jim Liu, maintained in jimliu/baoyu-skills.

← Browse All Agent Skills
Sponsored AI assistant. Recommendations may be paid.