baoyu-post-to-wechat
Install this skill
npx skills add jimliu/baoyu-skillsWorks 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
- Identify the target markdown file and image assets directory
- Execute the appropriate script for article or image-text format
- Verify the browser instance launches and handle the QR code login
- Allow the script to perform content injection into the WeChat editor
- 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
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.
📄 Full skill instructions — original source: jimliu/baoyu-skills
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_DIR2. Script path =
${SKILL_DIR}/scripts/<script-name>.ts3. 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)
- Click "Download" above
- In your project, create the directory:
.agent/skills/baoyu-post-to-wechat/ - Save the file as
SKILL.md - 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