baoyu-post-to-wechat
About baoyu-post-to-wechat
baoyu-post-to-wechat is a skill for publishing image-text posts and articles to WeChat Official Account. It provides separate scripts for each format, Markdown conversion, and configurable preferences.
Key features
- 01Publish image-text posts
- 02Publish articles
- 03Convert Markdown to WeChat HTML
- 04Support multiple images and themes
- 05Set preferences through EXTEND.md
Use cases
- 01Publish image-based posts
- 02Format Markdown as themed articles
- 03Configure default themes and Chrome profiles
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ jst-well-dan/ skill-box --skill baoyu-post-to-wechatAfter installing, type/baoyu-post-to-wechatin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/article-posting.mdimage-text-posting.mdscripts/cdp.tscopy-to-clipboard.tsmd-to-wechat.tspaste-from-clipboard.tswechat-agent-browser.tswechat-article.tswechat-browser.tsscripts/md/LICENSErender.tsscripts/md/extensions/alert.tsfootnotes.tsindex.tsinfographic.tskatex.tsmarkup.tsplantuml.tsruby.tsslider.tstoc.tsscripts/md/themes/base.cssdefault.cssgrace.csssimple.cssscripts/md/utils/languages.tsDetails
From the project READMEPost to WeChat Official Account
Script Directory
Agent Execution: Determine this SKILL.md directory as SKILL_DIR, then use ${SKILL_DIR}/scripts/<name>.ts.
| Script | Purpose |
|---|---|
scripts/wechat-browser.ts | Image-text posts (图文) |
scripts/wechat-article.ts | Article posting (文章) |
scripts/md-to-wechat.ts | Markdown → WeChat HTML |
Preferences (EXTEND.md)
Use Bash to check EXTEND.md existence (priority order):
# Check project-level first
test -f .baoyu-skills/baoyu-post-to-wechat/EXTEND.md && echo "project"
# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.baoyu-skills/baoyu-post-to-wechat/EXTEND.md" && echo "user"
┌────────────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├────────────────────────────────────────────────────────┼───────────────────┤ │ .baoyu-skills/baoyu-post-to-wechat/EXTEND.md │ Project directory │ ├────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.baoyu-skills/baoyu-post-to-wechat/EXTEND.md │ User home │ └────────────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ Result │ Action │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Found │ Read, parse, apply settings │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Not found │ Use defaults │ └───────────┴───────────────────────────────────────────────────────────────────────────┘
EXTEND.md Supports: Default theme | Auto-submit preference | Chrome profile path
Usage
Image-Text (图文)
npx -y bun ${SKILL_DIR}/scripts/wechat-browser.ts --markdown article.md --images ./images/
npx -y bun ${SKILL_DIR}/scripts/wechat-browser.ts --title "标题" --content "内容" --image img.png --submit
Article (文章)
npx -y bun ${SKILL_DIR}/scripts/wechat-article.ts --markdown article.md --theme grace
Detailed References
| Topic | Reference |
|---|---|
| Image-text parameters, auto-compression | references/image-text-posting.md |
| Article themes, image handling | references/article-posting.md |
Feature Comparison
| Feature | Image-Text | Article |
|---|---|---|
| Multiple images | ✓ (up to 9) | ✓ (inline) |
| Markdown support | Title/content extraction | Full formatting |
| Auto compression | ✓ (title: 20, content: 1000 chars) | ✗ |
| Themes | ✗ | ✓ (default, grace, simple) |
Prerequisites
- Google Chrome
- First run: log in to WeChat Official Account (session preserved)
Troubleshooting
| Issue | Solution |
|---|---|
| Not logged in | First run opens browser - scan QR to log in |
| Chrome not found | Set WECHAT_BROWSER_CHROME_PATH env var |
| Paste fails | Check system clipboard permissions |
Extension Support
Custom configurations via EXTEND.md. See Preferences section for paths and supported options.